diff --git a/assets/index-85eed898.js b/assets/index-d7863aa0.js similarity index 80% rename from assets/index-85eed898.js rename to assets/index-d7863aa0.js index 837ef85..0082799 100644 --- a/assets/index-85eed898.js +++ b/assets/index-d7863aa0.js @@ -1,4 +1,4 @@ -function vv(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function al(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ih={exports:{}},ul={},oh={exports:{}},ne={};/** +function gv(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function al(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ih={exports:{}},ul={},oh={exports:{}},ne={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function vv(e,t){for(var n=0;n>>1,_e=F[X];if(0>>1;Xi(ct,K))ft<_e&&0>i(Gt,ct)?(F[X]=Gt,F[ft]=K,X=ft):(F[X]=ct,F[oe]=K,X=oe);else if(ft<_e&&0>i(Gt,K))F[X]=Gt,F[ft]=K,X=ft;else break e}}return b}function i(F,b){var K=F.sortIndex-b.sortIndex;return K!==0?K:F.id-b.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],f=1,h=null,d=3,g=!1,y=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(F){for(var b=n(u);b!==null;){if(b.callback===null)r(u);else if(b.startTime<=F)r(u),b.sortIndex=b.expirationTime,t(a,b);else break;b=n(u)}}function v(F){if(S=!1,_(F),!y)if(n(a)!==null)y=!0,at(R);else{var b=n(u);b!==null&&ut(v,b.startTime-F)}}function R(F,b){y=!1,S&&(S=!1,m(O),O=-1),g=!0;var K=d;try{for(_(b),h=n(a);h!==null&&(!(h.expirationTime>b)||F&&!Z());){var X=h.callback;if(typeof X=="function"){h.callback=null,d=h.priorityLevel;var _e=X(h.expirationTime<=b);b=e.unstable_now(),typeof _e=="function"?h.callback=_e:h===n(a)&&r(a),_(b)}else r(a);h=n(a)}if(h!==null)var ae=!0;else{var oe=n(u);oe!==null&&ut(v,oe.startTime-b),ae=!1}return ae}finally{h=null,d=K,g=!1}}var D=!1,T=null,O=-1,A=5,U=-1;function Z(){return!(e.unstable_now()-UF||125X?(F.sortIndex=K,t(u,F),n(a)===null&&F===n(u)&&(S?(m(O),O=-1):S=!0,ut(v,K-X))):(F.sortIndex=_e,t(a,F),y||g||(y=!0,at(R))),F},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(F){var b=d;return function(){var K=d;d=b;try{return F.apply(this,arguments)}finally{d=K}}}})(gh);vh.exports=gh;var bv=vh.exports;/** + */(function(e){function t(F,b){var K=F.length;F.push(b);e:for(;0>>1,_e=F[X];if(0>>1;Xi(ct,K))ft<_e&&0>i(Gt,ct)?(F[X]=Gt,F[ft]=K,X=ft):(F[X]=ct,F[oe]=K,X=oe);else if(ft<_e&&0>i(Gt,K))F[X]=Gt,F[ft]=K,X=ft;else break e}}return b}function i(F,b){var K=F.sortIndex-b.sortIndex;return K!==0?K:F.id-b.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],f=1,h=null,d=3,g=!1,y=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(F){for(var b=n(u);b!==null;){if(b.callback===null)r(u);else if(b.startTime<=F)r(u),b.sortIndex=b.expirationTime,t(a,b);else break;b=n(u)}}function v(F){if(S=!1,_(F),!y)if(n(a)!==null)y=!0,at(R);else{var b=n(u);b!==null&&ut(v,b.startTime-F)}}function R(F,b){y=!1,S&&(S=!1,m(O),O=-1),g=!0;var K=d;try{for(_(b),h=n(a);h!==null&&(!(h.expirationTime>b)||F&&!Z());){var X=h.callback;if(typeof X=="function"){h.callback=null,d=h.priorityLevel;var _e=X(h.expirationTime<=b);b=e.unstable_now(),typeof _e=="function"?h.callback=_e:h===n(a)&&r(a),_(b)}else r(a);h=n(a)}if(h!==null)var ae=!0;else{var oe=n(u);oe!==null&&ut(v,oe.startTime-b),ae=!1}return ae}finally{h=null,d=K,g=!1}}var D=!1,T=null,O=-1,A=5,U=-1;function Z(){return!(e.unstable_now()-UF||125X?(F.sortIndex=K,t(u,F),n(a)===null&&F===n(u)&&(S?(m(O),O=-1):S=!0,ut(v,K-X))):(F.sortIndex=_e,t(a,F),y||g||(y=!0,at(R))),F},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(F){var b=d;return function(){var K=d;d=b;try{return F.apply(this,arguments)}finally{d=K}}}})(gh);vh.exports=gh;var zv=vh.exports;/** * @license React * react-dom.production.min.js * @@ -30,18 +30,18 @@ function vv(e,t){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ca=Object.prototype.hasOwnProperty,zv=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,nf={},rf={};function Bv(e){return Ca.call(rf,e)?!0:Ca.call(nf,e)?!1:zv.test(e)?rf[e]=!0:(nf[e]=!0,!1)}function $v(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function qv(e,t,n,r){if(t===null||typeof t>"u"||$v(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function tt(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new tt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new tt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new tt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new tt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$e[e]=new tt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new tt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new tt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new tt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new tt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Uu=/[\-:]([a-z])/g;function Fu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Uu,Fu);$e[t]=new tt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Uu,Fu);$e[t]=new tt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Uu,Fu);$e[t]=new tt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new tt(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new tt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ju(e,t,n,r){var i=$e.hasOwnProperty(t)?$e[t]:null;(i!==null?i.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ca=Object.prototype.hasOwnProperty,Bv=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,nf={},rf={};function $v(e){return Ca.call(rf,e)?!0:Ca.call(nf,e)?!1:Bv.test(e)?rf[e]=!0:(nf[e]=!0,!1)}function qv(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Hv(e,t,n,r){if(t===null||typeof t>"u"||qv(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function tt(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new tt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new tt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new tt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new tt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$e[e]=new tt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new tt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new tt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new tt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new tt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Uu=/[\-:]([a-z])/g;function Fu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Uu,Fu);$e[t]=new tt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Uu,Fu);$e[t]=new tt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Uu,Fu);$e[t]=new tt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new tt(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new tt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ju(e,t,n,r){var i=$e.hasOwnProperty(t)?$e[t]:null;(i!==null?i.type!==0:r||!(2l||i[s]!==o[l]){var a=` -`+i[s].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{$l=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wi(e):""}function Hv(e){switch(e.tag){case 5:return Wi(e.type);case 16:return Wi("Lazy");case 13:return Wi("Suspense");case 19:return Wi("SuspenseList");case 0:case 2:case 15:return e=ql(e.type,!1),e;case 11:return e=ql(e.type.render,!1),e;case 1:return e=ql(e.type,!0),e;default:return""}}function Oa(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case zr:return"Fragment";case br:return"Portal";case Ta:return"Profiler";case bu:return"StrictMode";case Ra:return"Suspense";case Pa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case wh:return(e.displayName||"Context")+".Consumer";case Sh:return(e._context.displayName||"Context")+".Provider";case zu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Bu:return t=e.displayName||null,t!==null?t:Oa(e.type)||"Memo";case An:t=e._payload,e=e._init;try{return Oa(e(t))}catch{}}return null}function Qv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Oa(t);case 8:return t===bu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Jn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Wv(e){var t=xh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vo(e){e._valueTracker||(e._valueTracker=Wv(e))}function kh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Rs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Da(e,t){var n=t.checked;return ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function sf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Jn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ch(e,t){t=t.checked,t!=null&&ju(e,"checked",t,!1)}function Na(e,t){Ch(e,t);var n=Jn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Aa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Aa(e,t.type,Jn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function lf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Aa(e,t,n){(t!=="number"||Rs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vi=Array.isArray;function ti(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ko.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ho(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Vv=["Webkit","ms","Moz","O"];Object.keys(Xi).forEach(function(e){Vv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xi[t]=Xi[e]})});function Oh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xi.hasOwnProperty(e)&&Xi[e]?(""+t).trim():t+"px"}function Dh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Oh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Kv=ke({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function La(e,t){if(t){if(Kv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function Ua(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fa=null;function $u(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ja=null,ni=null,ri=null;function cf(e){if(e=Fo(e)){if(typeof ja!="function")throw Error(M(280));var t=e.stateNode;t&&(t=pl(t),ja(e.stateNode,e.type,t))}}function Nh(e){ni?ri?ri.push(e):ri=[e]:ni=e}function Ah(){if(ni){var e=ni,t=ri;if(ri=ni=null,cf(e),t)for(e=0;e>>=0,e===0?32:31-(og(e)/sg|0)|0}var Go=64,Yo=4194304;function Ki(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ns(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Ki(l):(o&=s,o!==0&&(r=Ki(o)))}else s=n&~i,s!==0?r=Ki(s):o!==0&&(r=Ki(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Lo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qt(t),e[t]=n}function cg(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Zi),_f=String.fromCharCode(32),Sf=!1;function Jh(e,t){switch(e){case"keyup":return jg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Br=!1;function zg(e,t){switch(e){case"compositionend":return Zh(t);case"keypress":return t.which!==32?null:(Sf=!0,_f);case"textInput":return e=t.data,e===_f&&Sf?null:e;default:return null}}function Bg(e,t){if(Br)return e==="compositionend"||!Yu&&Jh(e,t)?(e=Yh(),ms=Vu=Fn=null,Br=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=kf(n)}}function rp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ip(){for(var e=window,t=Rs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rs(e.document)}return t}function Xu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Yg(e){var t=ip(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&rp(n.ownerDocument.documentElement,n)){if(r!==null&&Xu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Cf(n,o);var s=Cf(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,$r=null,Ha=null,to=null,Qa=!1;function Tf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qa||$r==null||$r!==Rs(r)||(r=$r,"selectionStart"in r&&Xu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),to&&_o(to,r)||(to=r,r=Ms(Ha,"onSelect"),0Qr||(e.current=Xa[Qr],Xa[Qr]=null,Qr--)}function he(e,t){Qr++,Xa[Qr]=e.current,e.current=t}var Zn={},Ge=rr(Zn),ot=rr(!1),xr=Zn;function fi(e,t){var n=e.type.contextTypes;if(!n)return Zn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function st(e){return e=e.childContextTypes,e!=null}function Us(){me(ot),me(Ge)}function If(e,t,n){if(Ge.current!==Zn)throw Error(M(168));he(Ge,t),he(ot,n)}function hp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(M(108,Qv(e)||"Unknown",i));return ke({},n,r)}function Fs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zn,xr=Ge.current,he(Ge,e),he(ot,ot.current),!0}function Mf(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=hp(e,t,xr),r.__reactInternalMemoizedMergedChildContext=e,me(ot),me(Ge),he(Ge,e)):me(ot),he(ot,n)}var hn=null,ml=!1,ra=!1;function pp(e){hn===null?hn=[e]:hn.push(e)}function ay(e){ml=!0,pp(e)}function ir(){if(!ra&&hn!==null){ra=!0;var e=0,t=le;try{var n=hn;for(le=1;e>=s,i-=s,pn=1<<32-qt(t)+i|n<O?(A=T,T=null):A=T.sibling;var U=d(m,T,_[O],v);if(U===null){T===null&&(T=A);break}e&&T&&U.alternate===null&&t(m,T),p=o(U,p,O),D===null?R=U:D.sibling=U,D=U,T=A}if(O===_.length)return n(m,T),ye&&pr(m,O),R;if(T===null){for(;O<_.length;O++)T=h(m,_[O],v),T!==null&&(p=o(T,p,O),D===null?R=T:D.sibling=T,D=T);return ye&&pr(m,O),R}for(T=r(m,T);O<_.length;O++)A=g(T,m,O,_[O],v),A!==null&&(e&&A.alternate!==null&&T.delete(A.key===null?O:A.key),p=o(A,p,O),D===null?R=A:D.sibling=A,D=A);return e&&T.forEach(function(Z){return t(m,Z)}),ye&&pr(m,O),R}function S(m,p,_,v){var R=Ai(_);if(typeof R!="function")throw Error(M(150));if(_=R.call(_),_==null)throw Error(M(151));for(var D=R=null,T=p,O=p=0,A=null,U=_.next();T!==null&&!U.done;O++,U=_.next()){T.index>O?(A=T,T=null):A=T.sibling;var Z=d(m,T,U.value,v);if(Z===null){T===null&&(T=A);break}e&&T&&Z.alternate===null&&t(m,T),p=o(Z,p,O),D===null?R=Z:D.sibling=Z,D=Z,T=A}if(U.done)return n(m,T),ye&&pr(m,O),R;if(T===null){for(;!U.done;O++,U=_.next())U=h(m,U.value,v),U!==null&&(p=o(U,p,O),D===null?R=U:D.sibling=U,D=U);return ye&&pr(m,O),R}for(T=r(m,T);!U.done;O++,U=_.next())U=g(T,m,O,U.value,v),U!==null&&(e&&U.alternate!==null&&T.delete(U.key===null?O:U.key),p=o(U,p,O),D===null?R=U:D.sibling=U,D=U);return e&&T.forEach(function(V){return t(m,V)}),ye&&pr(m,O),R}function E(m,p,_,v){if(typeof _=="object"&&_!==null&&_.type===zr&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Wo:e:{for(var R=_.key,D=p;D!==null;){if(D.key===R){if(R=_.type,R===zr){if(D.tag===7){n(m,D.sibling),p=i(D,_.props.children),p.return=m,m=p;break e}}else if(D.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===An&&Bf(R)===D.type){n(m,D.sibling),p=i(D,_.props),p.ref=Fi(m,D,_),p.return=m,m=p;break e}n(m,D);break}else t(m,D);D=D.sibling}_.type===zr?(p=Er(_.props.children,m.mode,v,_.key),p.return=m,m=p):(v=xs(_.type,_.key,_.props,null,m.mode,v),v.ref=Fi(m,p,_),v.return=m,m=v)}return s(m);case br:e:{for(D=_.key;p!==null;){if(p.key===D)if(p.tag===4&&p.stateNode.containerInfo===_.containerInfo&&p.stateNode.implementation===_.implementation){n(m,p.sibling),p=i(p,_.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=fa(_,m.mode,v),p.return=m,m=p}return s(m);case An:return D=_._init,E(m,p,D(_._payload),v)}if(Vi(_))return y(m,p,_,v);if(Ai(_))return S(m,p,_,v);rs(m,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,p!==null&&p.tag===6?(n(m,p.sibling),p=i(p,_),p.return=m,m=p):(n(m,p),p=ca(_,m.mode,v),p.return=m,m=p),s(m)):n(m,p)}return E}var hi=Ep(!0),xp=Ep(!1),jo={},on=rr(jo),xo=rr(jo),ko=rr(jo);function yr(e){if(e===jo)throw Error(M(174));return e}function sc(e,t){switch(he(ko,t),he(xo,e),he(on,jo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ma(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ma(t,e)}me(on),he(on,t)}function pi(){me(on),me(xo),me(ko)}function kp(e){yr(ko.current);var t=yr(on.current),n=Ma(t,e.type);t!==n&&(he(xo,e),he(on,n))}function lc(e){xo.current===e&&(me(on),me(xo))}var we=rr(0);function qs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ia=[];function ac(){for(var e=0;en?n:4,e(!0);var r=oa.transition;oa.transition={};try{e(!1),t()}finally{le=n,oa.transition=r}}function zp(){return Nt().memoizedState}function dy(e,t,n){var r=Kn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Bp(e))$p(t,n);else if(n=yp(e,t,n,r),n!==null){var i=Je();Ht(n,e,r,i),qp(n,t,r)}}function hy(e,t,n){var r=Kn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bp(e))$p(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,Qt(l,s)){var a=t.interleaved;a===null?(i.next=i,ic(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=yp(e,t,i,r),n!==null&&(i=Je(),Ht(n,e,r,i),qp(n,t,r))}}function Bp(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function $p(e,t){no=Hs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Hu(e,n)}}var Qs={readContext:Dt,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},py={readContext:Dt,useCallback:function(e,t){return en().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:qf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_s(4194308,4,Lp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _s(4194308,4,e,t)},useInsertionEffect:function(e,t){return _s(4,2,e,t)},useMemo:function(e,t){var n=en();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=en();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=dy.bind(null,xe,e),[r.memoizedState,e]},useRef:function(e){var t=en();return e={current:e},t.memoizedState=e},useState:$f,useDebugValue:hc,useDeferredValue:function(e){return en().memoizedState=e},useTransition:function(){var e=$f(!1),t=e[0];return e=fy.bind(null,e[1]),en().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xe,i=en();if(ye){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),be===null)throw Error(M(349));Cr&30||Rp(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,qf(Op.bind(null,r,o,e),[e]),r.flags|=2048,Ro(9,Pp.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=en(),t=be.identifierPrefix;if(ye){var n=mn,r=pn;n=(r&~(1<<32-qt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Co++,0")&&(a=a.replace("",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{$l=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wi(e):""}function Qv(e){switch(e.tag){case 5:return Wi(e.type);case 16:return Wi("Lazy");case 13:return Wi("Suspense");case 19:return Wi("SuspenseList");case 0:case 2:case 15:return e=ql(e.type,!1),e;case 11:return e=ql(e.type.render,!1),e;case 1:return e=ql(e.type,!0),e;default:return""}}function Oa(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case zr:return"Fragment";case br:return"Portal";case Ta:return"Profiler";case bu:return"StrictMode";case Ra:return"Suspense";case Pa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case wh:return(e.displayName||"Context")+".Consumer";case Sh:return(e._context.displayName||"Context")+".Provider";case zu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Bu:return t=e.displayName||null,t!==null?t:Oa(e.type)||"Memo";case An:t=e._payload,e=e._init;try{return Oa(e(t))}catch{}}return null}function Wv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Oa(t);case 8:return t===bu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Jn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Vv(e){var t=xh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vo(e){e._valueTracker||(e._valueTracker=Vv(e))}function kh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Rs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Da(e,t){var n=t.checked;return ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function sf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Jn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ch(e,t){t=t.checked,t!=null&&ju(e,"checked",t,!1)}function Na(e,t){Ch(e,t);var n=Jn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Aa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Aa(e,t.type,Jn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function lf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Aa(e,t,n){(t!=="number"||Rs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vi=Array.isArray;function ti(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ko.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ho(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Kv=["Webkit","ms","Moz","O"];Object.keys(Xi).forEach(function(e){Kv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xi[t]=Xi[e]})});function Oh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xi.hasOwnProperty(e)&&Xi[e]?(""+t).trim():t+"px"}function Dh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Oh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Gv=ke({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function La(e,t){if(t){if(Gv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function Ua(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fa=null;function $u(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ja=null,ni=null,ri=null;function cf(e){if(e=Fo(e)){if(typeof ja!="function")throw Error(M(280));var t=e.stateNode;t&&(t=pl(t),ja(e.stateNode,e.type,t))}}function Nh(e){ni?ri?ri.push(e):ri=[e]:ni=e}function Ah(){if(ni){var e=ni,t=ri;if(ri=ni=null,cf(e),t)for(e=0;e>>=0,e===0?32:31-(sg(e)/lg|0)|0}var Go=64,Yo=4194304;function Ki(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ns(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Ki(l):(o&=s,o!==0&&(r=Ki(o)))}else s=n&~i,s!==0?r=Ki(s):o!==0&&(r=Ki(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Lo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qt(t),e[t]=n}function fg(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Zi),_f=String.fromCharCode(32),Sf=!1;function Jh(e,t){switch(e){case"keyup":return bg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Br=!1;function Bg(e,t){switch(e){case"compositionend":return Zh(t);case"keypress":return t.which!==32?null:(Sf=!0,_f);case"textInput":return e=t.data,e===_f&&Sf?null:e;default:return null}}function $g(e,t){if(Br)return e==="compositionend"||!Yu&&Jh(e,t)?(e=Yh(),ms=Vu=Fn=null,Br=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=kf(n)}}function rp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ip(){for(var e=window,t=Rs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rs(e.document)}return t}function Xu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Xg(e){var t=ip(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&rp(n.ownerDocument.documentElement,n)){if(r!==null&&Xu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Cf(n,o);var s=Cf(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,$r=null,Ha=null,to=null,Qa=!1;function Tf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qa||$r==null||$r!==Rs(r)||(r=$r,"selectionStart"in r&&Xu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),to&&_o(to,r)||(to=r,r=Ms(Ha,"onSelect"),0Qr||(e.current=Xa[Qr],Xa[Qr]=null,Qr--)}function he(e,t){Qr++,Xa[Qr]=e.current,e.current=t}var Zn={},Ge=rr(Zn),ot=rr(!1),xr=Zn;function fi(e,t){var n=e.type.contextTypes;if(!n)return Zn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function st(e){return e=e.childContextTypes,e!=null}function Us(){me(ot),me(Ge)}function If(e,t,n){if(Ge.current!==Zn)throw Error(M(168));he(Ge,t),he(ot,n)}function hp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(M(108,Wv(e)||"Unknown",i));return ke({},n,r)}function Fs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zn,xr=Ge.current,he(Ge,e),he(ot,ot.current),!0}function Mf(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=hp(e,t,xr),r.__reactInternalMemoizedMergedChildContext=e,me(ot),me(Ge),he(Ge,e)):me(ot),he(ot,n)}var hn=null,ml=!1,ra=!1;function pp(e){hn===null?hn=[e]:hn.push(e)}function uy(e){ml=!0,pp(e)}function ir(){if(!ra&&hn!==null){ra=!0;var e=0,t=le;try{var n=hn;for(le=1;e>=s,i-=s,pn=1<<32-qt(t)+i|n<O?(A=T,T=null):A=T.sibling;var U=d(m,T,_[O],v);if(U===null){T===null&&(T=A);break}e&&T&&U.alternate===null&&t(m,T),p=o(U,p,O),D===null?R=U:D.sibling=U,D=U,T=A}if(O===_.length)return n(m,T),ye&&pr(m,O),R;if(T===null){for(;O<_.length;O++)T=h(m,_[O],v),T!==null&&(p=o(T,p,O),D===null?R=T:D.sibling=T,D=T);return ye&&pr(m,O),R}for(T=r(m,T);O<_.length;O++)A=g(T,m,O,_[O],v),A!==null&&(e&&A.alternate!==null&&T.delete(A.key===null?O:A.key),p=o(A,p,O),D===null?R=A:D.sibling=A,D=A);return e&&T.forEach(function(Z){return t(m,Z)}),ye&&pr(m,O),R}function S(m,p,_,v){var R=Ai(_);if(typeof R!="function")throw Error(M(150));if(_=R.call(_),_==null)throw Error(M(151));for(var D=R=null,T=p,O=p=0,A=null,U=_.next();T!==null&&!U.done;O++,U=_.next()){T.index>O?(A=T,T=null):A=T.sibling;var Z=d(m,T,U.value,v);if(Z===null){T===null&&(T=A);break}e&&T&&Z.alternate===null&&t(m,T),p=o(Z,p,O),D===null?R=Z:D.sibling=Z,D=Z,T=A}if(U.done)return n(m,T),ye&&pr(m,O),R;if(T===null){for(;!U.done;O++,U=_.next())U=h(m,U.value,v),U!==null&&(p=o(U,p,O),D===null?R=U:D.sibling=U,D=U);return ye&&pr(m,O),R}for(T=r(m,T);!U.done;O++,U=_.next())U=g(T,m,O,U.value,v),U!==null&&(e&&U.alternate!==null&&T.delete(U.key===null?O:U.key),p=o(U,p,O),D===null?R=U:D.sibling=U,D=U);return e&&T.forEach(function(V){return t(m,V)}),ye&&pr(m,O),R}function E(m,p,_,v){if(typeof _=="object"&&_!==null&&_.type===zr&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Wo:e:{for(var R=_.key,D=p;D!==null;){if(D.key===R){if(R=_.type,R===zr){if(D.tag===7){n(m,D.sibling),p=i(D,_.props.children),p.return=m,m=p;break e}}else if(D.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===An&&Bf(R)===D.type){n(m,D.sibling),p=i(D,_.props),p.ref=Fi(m,D,_),p.return=m,m=p;break e}n(m,D);break}else t(m,D);D=D.sibling}_.type===zr?(p=Er(_.props.children,m.mode,v,_.key),p.return=m,m=p):(v=xs(_.type,_.key,_.props,null,m.mode,v),v.ref=Fi(m,p,_),v.return=m,m=v)}return s(m);case br:e:{for(D=_.key;p!==null;){if(p.key===D)if(p.tag===4&&p.stateNode.containerInfo===_.containerInfo&&p.stateNode.implementation===_.implementation){n(m,p.sibling),p=i(p,_.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=fa(_,m.mode,v),p.return=m,m=p}return s(m);case An:return D=_._init,E(m,p,D(_._payload),v)}if(Vi(_))return y(m,p,_,v);if(Ai(_))return S(m,p,_,v);rs(m,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,p!==null&&p.tag===6?(n(m,p.sibling),p=i(p,_),p.return=m,m=p):(n(m,p),p=ca(_,m.mode,v),p.return=m,m=p),s(m)):n(m,p)}return E}var hi=Ep(!0),xp=Ep(!1),jo={},on=rr(jo),xo=rr(jo),ko=rr(jo);function yr(e){if(e===jo)throw Error(M(174));return e}function sc(e,t){switch(he(ko,t),he(xo,e),he(on,jo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ma(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ma(t,e)}me(on),he(on,t)}function pi(){me(on),me(xo),me(ko)}function kp(e){yr(ko.current);var t=yr(on.current),n=Ma(t,e.type);t!==n&&(he(xo,e),he(on,n))}function lc(e){xo.current===e&&(me(on),me(xo))}var we=rr(0);function qs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ia=[];function ac(){for(var e=0;en?n:4,e(!0);var r=oa.transition;oa.transition={};try{e(!1),t()}finally{le=n,oa.transition=r}}function zp(){return Nt().memoizedState}function hy(e,t,n){var r=Kn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Bp(e))$p(t,n);else if(n=yp(e,t,n,r),n!==null){var i=Je();Ht(n,e,r,i),qp(n,t,r)}}function py(e,t,n){var r=Kn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bp(e))$p(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,Qt(l,s)){var a=t.interleaved;a===null?(i.next=i,ic(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=yp(e,t,i,r),n!==null&&(i=Je(),Ht(n,e,r,i),qp(n,t,r))}}function Bp(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function $p(e,t){no=Hs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Hu(e,n)}}var Qs={readContext:Dt,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},my={readContext:Dt,useCallback:function(e,t){return en().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:qf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_s(4194308,4,Lp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _s(4194308,4,e,t)},useInsertionEffect:function(e,t){return _s(4,2,e,t)},useMemo:function(e,t){var n=en();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=en();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=hy.bind(null,xe,e),[r.memoizedState,e]},useRef:function(e){var t=en();return e={current:e},t.memoizedState=e},useState:$f,useDebugValue:hc,useDeferredValue:function(e){return en().memoizedState=e},useTransition:function(){var e=$f(!1),t=e[0];return e=dy.bind(null,e[1]),en().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xe,i=en();if(ye){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),be===null)throw Error(M(349));Cr&30||Rp(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,qf(Op.bind(null,r,o,e),[e]),r.flags|=2048,Ro(9,Pp.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=en(),t=be.identifierPrefix;if(ye){var n=mn,r=pn;n=(r&~(1<<32-qt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Co++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[nn]=t,e[Eo]=r,Jp(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ua(n,r),n){case"dialog":pe("cancel",e),pe("close",e),i=r;break;case"iframe":case"object":case"embed":pe("load",e),i=r;break;case"video":case"audio":for(i=0;ivi&&(t.flags|=128,r=!0,ji(o,!1),t.lanes=4194304)}else{if(!r)if(e=qs(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ji(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ye)return We(t),null}else 2*Te()-o.renderingStartTime>vi&&n!==1073741824&&(t.flags|=128,r=!0,ji(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Te(),t.sibling=null,n=we.current,he(we,r?n&1|2:n&1),t):(We(t),null);case 22:case 23:return _c(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pt&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function Ey(e,t){switch(Zu(t),t.tag){case 1:return st(t.type)&&Us(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pi(),me(ot),me(Ge),ac(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return lc(t),null;case 13:if(me(we),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(we),null;case 4:return pi(),null;case 10:return rc(t.type._context),null;case 22:case 23:return _c(),null;case 24:return null;default:return null}}var os=!1,Ke=!1,xy=typeof WeakSet=="function"?WeakSet:Set,z=null;function Gr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ce(e,t,r)}else n.current=null}function uu(e,t,n){try{n()}catch(r){Ce(e,t,r)}}var Jf=!1;function ky(e,t){if(Wa=As,e=ip(),Xu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,f=0,h=e,d=null;t:for(;;){for(var g;h!==n||i!==0&&h.nodeType!==3||(l=s+i),h!==o||r!==0&&h.nodeType!==3||(a=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(g=h.firstChild)!==null;)d=h,h=g;for(;;){if(h===e)break t;if(d===n&&++u===i&&(l=s),d===o&&++f===r&&(a=s),(g=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=g}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Va={focusedElem:e,selectionRange:n},As=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var S=y.memoizedProps,E=y.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?S:jt(t.type,S),E);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(v){Ce(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return y=Jf,Jf=!1,y}function ro(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&uu(t,n,o)}i=i.next}while(i!==r)}}function yl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function cu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function tm(e){var t=e.alternate;t!==null&&(e.alternate=null,tm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nn],delete t[Eo],delete t[Ya],delete t[sy],delete t[ly])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nm(e){return e.tag===5||e.tag===3||e.tag===4}function Zf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ls));else if(r!==4&&(e=e.child,e!==null))for(fu(e,t,n),e=e.sibling;e!==null;)fu(e,t,n),e=e.sibling}function du(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(du(e,t,n),e=e.sibling;e!==null;)du(e,t,n),e=e.sibling}var ze=null,bt=!1;function Nn(e,t,n){for(n=n.child;n!==null;)rm(e,t,n),n=n.sibling}function rm(e,t,n){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(cl,n)}catch{}switch(n.tag){case 5:Ke||Gr(n,t);case 6:var r=ze,i=bt;ze=null,Nn(e,t,n),ze=r,bt=i,ze!==null&&(bt?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(bt?(e=ze,n=n.stateNode,e.nodeType===8?na(e.parentNode,n):e.nodeType===1&&na(e,n),go(e)):na(ze,n.stateNode));break;case 4:r=ze,i=bt,ze=n.stateNode.containerInfo,bt=!0,Nn(e,t,n),ze=r,bt=i;break;case 0:case 11:case 14:case 15:if(!Ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&uu(n,t,s),i=i.next}while(i!==r)}Nn(e,t,n);break;case 1:if(!Ke&&(Gr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ce(n,t,l)}Nn(e,t,n);break;case 21:Nn(e,t,n);break;case 22:n.mode&1?(Ke=(r=Ke)||n.memoizedState!==null,Nn(e,t,n),Ke=r):Nn(e,t,n);break;default:Nn(e,t,n)}}function ed(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new xy),t.forEach(function(r){var i=Iy.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ut(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ty(r/1960))-r,10e?16:e,jn===null)var r=!1;else{if(e=jn,jn=null,Ks=0,ie&6)throw Error(M(331));var i=ie;for(ie|=4,z=e.current;z!==null;){var o=z,s=o.child;if(z.flags&16){var l=o.deletions;if(l!==null){for(var a=0;aTe()-gc?wr(e,0):vc|=n),lt(e,t)}function fm(e,t){t===0&&(e.mode&1?(t=Yo,Yo<<=1,!(Yo&130023424)&&(Yo=4194304)):t=1);var n=Je();e=Sn(e,t),e!==null&&(Lo(e,t,n),lt(e,n))}function Ay(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fm(e,n)}function Iy(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),fm(e,n)}var dm;dm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)it=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return it=!1,Sy(e,t,n);it=!!(e.flags&131072)}else it=!1,ye&&t.flags&1048576&&mp(t,bs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ss(e,t),e=t.pendingProps;var i=fi(t,Ge.current);oi(t,n),i=cc(null,t,r,e,i,n);var o=fc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,st(r)?(o=!0,Fs(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,oc(t),i.updater=vl,t.stateNode=i,i._reactInternals=t,nu(t,r,e,n),t=ou(null,t,r,!0,o,n)):(t.tag=0,ye&&o&&Ju(t),Xe(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ss(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Ly(r),e=jt(r,e),i){case 0:t=iu(null,t,r,e,n);break e;case 1:t=Gf(null,t,r,e,n);break e;case 11:t=Vf(null,t,r,e,n);break e;case 14:t=Kf(null,t,r,jt(r.type,e),n);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),iu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),Gf(e,t,r,i,n);case 3:e:{if(Gp(t),e===null)throw Error(M(387));r=t.pendingProps,o=t.memoizedState,i=o.element,_p(e,t),$s(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=mi(Error(M(423)),t),t=Yf(e,t,r,n,i);break e}else if(r!==i){i=mi(Error(M(424)),t),t=Yf(e,t,r,n,i);break e}else for(mt=Qn(t.stateNode.containerInfo.firstChild),vt=t,ye=!0,Bt=null,n=xp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(di(),r===i){t=wn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return kp(t),e===null&&Za(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Ka(r,i)?s=null:o!==null&&Ka(r,o)&&(t.flags|=32),Kp(e,t),Xe(e,t,s,n),t.child;case 6:return e===null&&Za(t),null;case 13:return Yp(e,t,n);case 4:return sc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hi(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),Vf(e,t,r,i,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,he(zs,r._currentValue),r._currentValue=s,o!==null)if(Qt(o.value,s)){if(o.children===i.children&&!ot.current){t=wn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=vn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?a.next=a:(a.next=f.next,f.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),eu(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(M(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),eu(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Xe(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,oi(t,n),i=Dt(i),r=r(i),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,i=jt(r,t.pendingProps),i=jt(r.type,i),Kf(e,t,r,i,n);case 15:return Wp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),Ss(e,t),t.tag=1,st(r)?(e=!0,Fs(t)):e=!1,oi(t,n),wp(t,r,i),nu(t,r,i,n),ou(null,t,r,!0,e,n);case 19:return Xp(e,t,n);case 22:return Vp(e,t,n)}throw Error(M(156,t.tag))};function hm(e,t){return bh(e,t)}function My(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pt(e,t,n,r){return new My(e,t,n,r)}function wc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ly(e){if(typeof e=="function")return wc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===zu)return 11;if(e===Bu)return 14}return 2}function Gn(e,t){var n=e.alternate;return n===null?(n=Pt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function xs(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")wc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case zr:return Er(n.children,i,o,t);case bu:s=8,i|=8;break;case Ta:return e=Pt(12,n,t,i|2),e.elementType=Ta,e.lanes=o,e;case Ra:return e=Pt(13,n,t,i),e.elementType=Ra,e.lanes=o,e;case Pa:return e=Pt(19,n,t,i),e.elementType=Pa,e.lanes=o,e;case Eh:return Sl(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Sh:s=10;break e;case wh:s=9;break e;case zu:s=11;break e;case Bu:s=14;break e;case An:s=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=Pt(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Er(e,t,n,r){return e=Pt(7,e,r,t),e.lanes=n,e}function Sl(e,t,n,r){return e=Pt(22,e,r,t),e.elementType=Eh,e.lanes=n,e.stateNode={isHidden:!1},e}function ca(e,t,n){return e=Pt(6,e,null,t),e.lanes=n,e}function fa(e,t,n){return t=Pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Uy(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ql(0),this.expirationTimes=Ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ql(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ec(e,t,n,r,i,o,s,l,a){return e=new Uy(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Pt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},oc(o),e}function Fy(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gm)}catch(e){console.error(e)}}gm(),mh.exports=yt;var $y=mh.exports,ad=$y;ka.createRoot=ad.createRoot,ka.hydrateRoot=ad.hydrateRoot;var ym={exports:{}};/*! +`+o.stack}return{value:e,source:t,stack:i,digest:null}}function aa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ru(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var yy=typeof WeakMap=="function"?WeakMap:Map;function Hp(e,t,n){n=vn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Vs||(Vs=!0,hu=r),ru(e,t)},n}function Qp(e,t,n){n=vn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ru(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ru(e,t),typeof r!="function"&&(Vn===null?Vn=new Set([this]):Vn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Hf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new yy;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Ay.bind(null,e,t,n),t.then(e,e))}function Qf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Wf(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=vn(-1,1),t.tag=2,Wn(n,t,1))),n.lanes|=1),e)}var _y=xn.ReactCurrentOwner,it=!1;function Xe(e,t,n,r){t.child=e===null?xp(t,null,n,r):hi(t,e.child,n,r)}function Vf(e,t,n,r,i){n=n.render;var o=t.ref;return oi(t,i),r=cc(e,t,n,r,o,i),n=fc(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wn(e,t,i)):(ye&&n&&Ju(t),t.flags|=1,Xe(e,t,r,i),t.child)}function Kf(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!wc(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Wp(e,t,o,r,i)):(e=xs(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:_o,n(s,r)&&e.ref===t.ref)return wn(e,t,i)}return t.flags|=1,e=Gn(o,r),e.ref=t.ref,e.return=t,t.child=e}function Wp(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(_o(o,r)&&e.ref===t.ref)if(it=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(it=!0);else return t.lanes=e.lanes,wn(e,t,i)}return iu(e,t,n,r,i)}function Vp(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},he(Yr,pt),pt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,he(Yr,pt),pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,he(Yr,pt),pt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,he(Yr,pt),pt|=r;return Xe(e,t,i,n),t.child}function Kp(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function iu(e,t,n,r,i){var o=st(n)?xr:Ge.current;return o=fi(t,o),oi(t,i),n=cc(e,t,n,r,o,i),r=fc(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,wn(e,t,i)):(ye&&r&&Ju(t),t.flags|=1,Xe(e,t,n,i),t.child)}function Gf(e,t,n,r,i){if(st(n)){var o=!0;Fs(t)}else o=!1;if(oi(t,i),t.stateNode===null)Ss(e,t),wp(t,n,r),nu(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Dt(u):(u=st(n)?xr:Ge.current,u=fi(t,u));var f=n.getDerivedStateFromProps,h=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";h||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&zf(t,s,r,u),In=!1;var d=t.memoizedState;s.state=d,$s(t,r,s,i),a=t.memoizedState,l!==r||d!==a||ot.current||In?(typeof f=="function"&&(tu(t,n,f,r),a=t.memoizedState),(l=In||bf(t,n,l,r,d,a,u))?(h||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,_p(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:jt(t.type,l),s.props=u,h=t.pendingProps,d=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=Dt(a):(a=st(n)?xr:Ge.current,a=fi(t,a));var g=n.getDerivedStateFromProps;(f=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==h||d!==a)&&zf(t,s,r,a),In=!1,d=t.memoizedState,s.state=d,$s(t,r,s,i);var y=t.memoizedState;l!==h||d!==y||ot.current||In?(typeof g=="function"&&(tu(t,n,g,r),y=t.memoizedState),(u=In||bf(t,n,u,r,d,y,a)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=a,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return ou(e,t,n,r,o,i)}function ou(e,t,n,r,i,o){Kp(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&Mf(t,n,!1),wn(e,t,o);r=t.stateNode,_y.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=hi(t,e.child,null,o),t.child=hi(t,null,l,o)):Xe(e,t,l,o),t.memoizedState=r.state,i&&Mf(t,n,!0),t.child}function Gp(e){var t=e.stateNode;t.pendingContext?If(e,t.pendingContext,t.pendingContext!==t.context):t.context&&If(e,t.context,!1),sc(e,t.containerInfo)}function Yf(e,t,n,r,i){return di(),ec(i),t.flags|=256,Xe(e,t,n,r),t.child}var su={dehydrated:null,treeContext:null,retryLane:0};function lu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Yp(e,t,n){var r=t.pendingProps,i=we.current,o=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),he(we,i&1),e===null)return Za(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,o?(r=t.mode,o=t.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Sl(s,r,0,null),e=Er(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=lu(n),t.memoizedState=su,e):pc(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return Sy(e,t,s,r,l,i,n);if(o){o=r.fallback,s=t.mode,i=e.child,l=i.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Gn(i,a),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?o=Gn(l,o):(o=Er(o,s,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,s=e.child.memoizedState,s=s===null?lu(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=e.childLanes&~n,t.memoizedState=su,r}return o=e.child,e=o.sibling,r=Gn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function pc(e,t){return t=Sl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function is(e,t,n,r){return r!==null&&ec(r),hi(t,e.child,null,n),e=pc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sy(e,t,n,r,i,o,s){if(n)return t.flags&256?(t.flags&=-257,r=aa(Error(M(422))),is(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=Sl({mode:"visible",children:r.children},i,0,null),o=Er(o,i,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&hi(t,e.child,null,s),t.child.memoizedState=lu(s),t.memoizedState=su,o);if(!(t.mode&1))return is(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(M(419)),r=aa(o,r,void 0),is(e,t,s,r)}if(l=(s&e.childLanes)!==0,it||l){if(r=be,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Sn(e,i),Ht(r,e,i,-1))}return Sc(),r=aa(Error(M(421))),is(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=Iy.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,mt=Qn(i.nextSibling),vt=t,ye=!0,Bt=null,e!==null&&(Ct[Tt++]=pn,Ct[Tt++]=mn,Ct[Tt++]=kr,pn=e.id,mn=e.overflow,kr=t),t=pc(t,r.children),t.flags|=4096,t)}function Xf(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),eu(e.return,t,n)}function ua(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function Xp(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Xe(e,t,r.children,n),r=we.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xf(e,n,t);else if(e.tag===19)Xf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(he(we,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&qs(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ua(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&qs(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ua(t,!0,n,null,o);break;case"together":ua(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ss(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function wn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Tr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,n=Gn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function wy(e,t,n){switch(t.tag){case 3:Gp(t),di();break;case 5:kp(t);break;case 1:st(t.type)&&Fs(t);break;case 4:sc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;he(zs,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(he(we,we.current&1),t.flags|=128,null):n&t.child.childLanes?Yp(e,t,n):(he(we,we.current&1),e=wn(e,t,n),e!==null?e.sibling:null);he(we,we.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Xp(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),he(we,we.current),r)break;return null;case 22:case 23:return t.lanes=0,Vp(e,t,n)}return wn(e,t,n)}var Jp,au,Zp,em;Jp=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};au=function(){};Zp=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,yr(on.current);var o=null;switch(n){case"input":i=Da(e,i),r=Da(e,r),o=[];break;case"select":i=ke({},i,{value:void 0}),r=ke({},r,{value:void 0}),o=[];break;case"textarea":i=Ia(e,i),r=Ia(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ls)}La(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(fo.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var a=r[u];if(l=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(o||(o=[]),o.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(o=o||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(fo.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&pe("scroll",e),o||l===a||(o=[])):(o=o||[]).push(u,a))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};em=function(e,t,n,r){n!==r&&(t.flags|=4)};function ji(e,t){if(!ye)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function We(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ey(e,t,n){var r=t.pendingProps;switch(Zu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return st(t.type)&&Us(),We(t),null;case 3:return r=t.stateNode,pi(),me(ot),me(Ge),ac(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ns(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Bt!==null&&(vu(Bt),Bt=null))),au(e,t),We(t),null;case 5:lc(t);var i=yr(ko.current);if(n=t.type,e!==null&&t.stateNode!=null)Zp(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(M(166));return We(t),null}if(e=yr(on.current),ns(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[nn]=t,r[Eo]=o,e=(t.mode&1)!==0,n){case"dialog":pe("cancel",r),pe("close",r);break;case"iframe":case"object":case"embed":pe("load",r);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[nn]=t,e[Eo]=r,Jp(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ua(n,r),n){case"dialog":pe("cancel",e),pe("close",e),i=r;break;case"iframe":case"object":case"embed":pe("load",e),i=r;break;case"video":case"audio":for(i=0;ivi&&(t.flags|=128,r=!0,ji(o,!1),t.lanes=4194304)}else{if(!r)if(e=qs(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ji(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ye)return We(t),null}else 2*Te()-o.renderingStartTime>vi&&n!==1073741824&&(t.flags|=128,r=!0,ji(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Te(),t.sibling=null,n=we.current,he(we,r?n&1|2:n&1),t):(We(t),null);case 22:case 23:return _c(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pt&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function xy(e,t){switch(Zu(t),t.tag){case 1:return st(t.type)&&Us(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pi(),me(ot),me(Ge),ac(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return lc(t),null;case 13:if(me(we),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(we),null;case 4:return pi(),null;case 10:return rc(t.type._context),null;case 22:case 23:return _c(),null;case 24:return null;default:return null}}var os=!1,Ke=!1,ky=typeof WeakSet=="function"?WeakSet:Set,z=null;function Gr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ce(e,t,r)}else n.current=null}function uu(e,t,n){try{n()}catch(r){Ce(e,t,r)}}var Jf=!1;function Cy(e,t){if(Wa=As,e=ip(),Xu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,f=0,h=e,d=null;t:for(;;){for(var g;h!==n||i!==0&&h.nodeType!==3||(l=s+i),h!==o||r!==0&&h.nodeType!==3||(a=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(g=h.firstChild)!==null;)d=h,h=g;for(;;){if(h===e)break t;if(d===n&&++u===i&&(l=s),d===o&&++f===r&&(a=s),(g=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=g}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Va={focusedElem:e,selectionRange:n},As=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var S=y.memoizedProps,E=y.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?S:jt(t.type,S),E);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(v){Ce(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return y=Jf,Jf=!1,y}function ro(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&uu(t,n,o)}i=i.next}while(i!==r)}}function yl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function cu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function tm(e){var t=e.alternate;t!==null&&(e.alternate=null,tm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nn],delete t[Eo],delete t[Ya],delete t[ly],delete t[ay])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nm(e){return e.tag===5||e.tag===3||e.tag===4}function Zf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ls));else if(r!==4&&(e=e.child,e!==null))for(fu(e,t,n),e=e.sibling;e!==null;)fu(e,t,n),e=e.sibling}function du(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(du(e,t,n),e=e.sibling;e!==null;)du(e,t,n),e=e.sibling}var ze=null,bt=!1;function Nn(e,t,n){for(n=n.child;n!==null;)rm(e,t,n),n=n.sibling}function rm(e,t,n){if(rn&&typeof rn.onCommitFiberUnmount=="function")try{rn.onCommitFiberUnmount(cl,n)}catch{}switch(n.tag){case 5:Ke||Gr(n,t);case 6:var r=ze,i=bt;ze=null,Nn(e,t,n),ze=r,bt=i,ze!==null&&(bt?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(bt?(e=ze,n=n.stateNode,e.nodeType===8?na(e.parentNode,n):e.nodeType===1&&na(e,n),go(e)):na(ze,n.stateNode));break;case 4:r=ze,i=bt,ze=n.stateNode.containerInfo,bt=!0,Nn(e,t,n),ze=r,bt=i;break;case 0:case 11:case 14:case 15:if(!Ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&uu(n,t,s),i=i.next}while(i!==r)}Nn(e,t,n);break;case 1:if(!Ke&&(Gr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ce(n,t,l)}Nn(e,t,n);break;case 21:Nn(e,t,n);break;case 22:n.mode&1?(Ke=(r=Ke)||n.memoizedState!==null,Nn(e,t,n),Ke=r):Nn(e,t,n);break;default:Nn(e,t,n)}}function ed(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ky),t.forEach(function(r){var i=My.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ut(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ry(r/1960))-r,10e?16:e,jn===null)var r=!1;else{if(e=jn,jn=null,Ks=0,ie&6)throw Error(M(331));var i=ie;for(ie|=4,z=e.current;z!==null;){var o=z,s=o.child;if(z.flags&16){var l=o.deletions;if(l!==null){for(var a=0;aTe()-gc?wr(e,0):vc|=n),lt(e,t)}function fm(e,t){t===0&&(e.mode&1?(t=Yo,Yo<<=1,!(Yo&130023424)&&(Yo=4194304)):t=1);var n=Je();e=Sn(e,t),e!==null&&(Lo(e,t,n),lt(e,n))}function Iy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fm(e,n)}function My(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),fm(e,n)}var dm;dm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)it=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return it=!1,wy(e,t,n);it=!!(e.flags&131072)}else it=!1,ye&&t.flags&1048576&&mp(t,bs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ss(e,t),e=t.pendingProps;var i=fi(t,Ge.current);oi(t,n),i=cc(null,t,r,e,i,n);var o=fc();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,st(r)?(o=!0,Fs(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,oc(t),i.updater=vl,t.stateNode=i,i._reactInternals=t,nu(t,r,e,n),t=ou(null,t,r,!0,o,n)):(t.tag=0,ye&&o&&Ju(t),Xe(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ss(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Uy(r),e=jt(r,e),i){case 0:t=iu(null,t,r,e,n);break e;case 1:t=Gf(null,t,r,e,n);break e;case 11:t=Vf(null,t,r,e,n);break e;case 14:t=Kf(null,t,r,jt(r.type,e),n);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),iu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),Gf(e,t,r,i,n);case 3:e:{if(Gp(t),e===null)throw Error(M(387));r=t.pendingProps,o=t.memoizedState,i=o.element,_p(e,t),$s(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=mi(Error(M(423)),t),t=Yf(e,t,r,n,i);break e}else if(r!==i){i=mi(Error(M(424)),t),t=Yf(e,t,r,n,i);break e}else for(mt=Qn(t.stateNode.containerInfo.firstChild),vt=t,ye=!0,Bt=null,n=xp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(di(),r===i){t=wn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return kp(t),e===null&&Za(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Ka(r,i)?s=null:o!==null&&Ka(r,o)&&(t.flags|=32),Kp(e,t),Xe(e,t,s,n),t.child;case 6:return e===null&&Za(t),null;case 13:return Yp(e,t,n);case 4:return sc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hi(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),Vf(e,t,r,i,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,he(zs,r._currentValue),r._currentValue=s,o!==null)if(Qt(o.value,s)){if(o.children===i.children&&!ot.current){t=wn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=vn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?a.next=a:(a.next=f.next,f.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),eu(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(M(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),eu(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Xe(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,oi(t,n),i=Dt(i),r=r(i),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,i=jt(r,t.pendingProps),i=jt(r.type,i),Kf(e,t,r,i,n);case 15:return Wp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),Ss(e,t),t.tag=1,st(r)?(e=!0,Fs(t)):e=!1,oi(t,n),wp(t,r,i),nu(t,r,i,n),ou(null,t,r,!0,e,n);case 19:return Xp(e,t,n);case 22:return Vp(e,t,n)}throw Error(M(156,t.tag))};function hm(e,t){return bh(e,t)}function Ly(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pt(e,t,n,r){return new Ly(e,t,n,r)}function wc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Uy(e){if(typeof e=="function")return wc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===zu)return 11;if(e===Bu)return 14}return 2}function Gn(e,t){var n=e.alternate;return n===null?(n=Pt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function xs(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")wc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case zr:return Er(n.children,i,o,t);case bu:s=8,i|=8;break;case Ta:return e=Pt(12,n,t,i|2),e.elementType=Ta,e.lanes=o,e;case Ra:return e=Pt(13,n,t,i),e.elementType=Ra,e.lanes=o,e;case Pa:return e=Pt(19,n,t,i),e.elementType=Pa,e.lanes=o,e;case Eh:return Sl(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Sh:s=10;break e;case wh:s=9;break e;case zu:s=11;break e;case Bu:s=14;break e;case An:s=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=Pt(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Er(e,t,n,r){return e=Pt(7,e,r,t),e.lanes=n,e}function Sl(e,t,n,r){return e=Pt(22,e,r,t),e.elementType=Eh,e.lanes=n,e.stateNode={isHidden:!1},e}function ca(e,t,n){return e=Pt(6,e,null,t),e.lanes=n,e}function fa(e,t,n){return t=Pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fy(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ql(0),this.expirationTimes=Ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ql(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ec(e,t,n,r,i,o,s,l,a){return e=new Fy(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Pt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},oc(o),e}function jy(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(gm)}catch(e){console.error(e)}}gm(),mh.exports=yt;var qy=mh.exports,ad=qy;ka.createRoot=ad.createRoot,ka.hydrateRoot=ad.hydrateRoot;var ym={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i"u")throw new Error(t)}function Pr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Qy(){return Math.random().toString(36).substr(2,8)}function cd(e,t){return{usr:e.state,key:e.key,idx:t}}function Oo(e,t,n,r){return n===void 0&&(n=null),ge({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?sn(t):t,{state:n,key:t&&t.key||r||Qy()})}function bo(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function sn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Wy(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,l=Oe.Pop,a=null,u=f();u==null&&(u=0,s.replaceState(ge({},s.state,{idx:u}),""));function f(){return(s.state||{idx:null}).idx}function h(){l=Oe.Pop;let E=f(),m=E==null?null:E-u;u=E,a&&a({action:l,location:S.location,delta:m})}function d(E,m){l=Oe.Push;let p=Oo(S.location,E,m);n&&n(p,E),u=f()+1;let _=cd(p,u),v=S.createHref(p);try{s.pushState(_,"",v)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;i.location.assign(v)}o&&a&&a({action:l,location:S.location,delta:1})}function g(E,m){l=Oe.Replace;let p=Oo(S.location,E,m);n&&n(p,E),u=f();let _=cd(p,u),v=S.createHref(p);s.replaceState(_,"",v),o&&a&&a({action:l,location:S.location,delta:0})}function y(E){let m=i.location.origin!=="null"?i.location.origin:i.location.href,p=typeof E=="string"?E:bo(E);return te(m,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,m)}let S={get action(){return l},get location(){return e(i,s)},listen(E){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(ud,h),a=E,()=>{i.removeEventListener(ud,h),a=null}},createHref(E){return t(i,E)},createURL:y,encodeLocation(E){let m=y(E);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:d,replace:g,go(E){return s.go(E)}};return S}var Me;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Me||(Me={}));const Vy=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ky(e){return e.index===!0}function gu(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let s=[...n,o],l=typeof i.id=="string"?i.id:s.join("-");if(te(i.index!==!0||!i.children,"Cannot specify children on an index route"),te(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),Ky(i)){let a=ge({},i,t(i),{id:l});return r[l]=a,a}else{let a=ge({},i,t(i),{id:l,children:void 0});return r[l]=a,i.children&&(a.children=gu(i.children,t,s,r)),a}})}function Xr(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?sn(t):t,i=zo(r.pathname||"/",n);if(i==null)return null;let o=_m(e);Gy(o);let s=null;for(let l=0;s==null&&l{let a={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};a.relativePath.startsWith("/")&&(te(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Xn([r,a.relativePath]),f=n.concat(a);o.children&&o.children.length>0&&(te(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),_m(o.children,t,f,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:n_(u,o.index),routesMeta:f})};return e.forEach((o,s)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,s);else for(let a of Sm(o.path))i(o,s,a)}),t}function Sm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=Sm(r.join("/")),l=[];return l.push(...s.map(a=>a===""?o:[o,a].join("/"))),i&&l.push(...s),l.map(a=>e.startsWith("/")&&a===""?"/":a)}function Gy(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:r_(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Yy=/^:\w+$/,Xy=3,Jy=2,Zy=1,e_=10,t_=-2,fd=e=>e==="*";function n_(e,t){let n=e.split("/"),r=n.length;return n.some(fd)&&(r+=t_),t&&(r+=Jy),n.filter(i=>!fd(i)).reduce((i,o)=>i+(Yy.test(o)?Xy:o===""?Zy:e_),r)}function r_(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function i_(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let s=0;s{if(f==="*"){let d=l[h]||"";s=o.slice(0,o.length-d.length).replace(/(.)\/+$/,"$1")}return u[f]=a_(l[h]||"",f),u},{}),pathname:o,pathnameBase:s,pattern:e}}function s_(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Pr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,l)=>(r.push(l),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function l_(e){try{return decodeURI(e)}catch(t){return Pr(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function a_(e,t){try{return decodeURIComponent(e)}catch(n){return Pr(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function zo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function u_(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?sn(e):e;return{pathname:n?n.startsWith("/")?n:c_(n,t):t,search:d_(r),hash:h_(i)}}function c_(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function da(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Tc(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wm(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=sn(e):(i=ge({},e),te(!i.pathname||!i.pathname.includes("?"),da("?","pathname","search",i)),te(!i.pathname||!i.pathname.includes("#"),da("#","pathname","hash",i)),te(!i.search||!i.search.includes("#"),da("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,l;if(r||s==null)l=n;else{let h=t.length-1;if(s.startsWith("..")){let d=s.split("/");for(;d[0]==="..";)d.shift(),h-=1;i.pathname=d.join("/")}l=h>=0?t[h]:"/"}let a=u_(i,l),u=s&&s!=="/"&&s.endsWith("/"),f=(o||s===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||f)&&(a.pathname+="/"),a}const Xn=e=>e.join("/").replace(/\/\/+/g,"/"),f_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),d_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,h_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Rc{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Em(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const xm=["post","put","patch","delete"],p_=new Set(xm),m_=["get",...xm],v_=new Set(m_),g_=new Set([301,302,303,307,308]),y_=new Set([307,308]),ha={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},__={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zi={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},km=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,S_=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function w_(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;te(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let k=e.detectErrorBoundary;i=C=>({hasErrorBoundary:k(C)})}else i=S_;let o={},s=gu(e.routes,i,void 0,o),l,a=e.basename||"/",u=ge({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),f=null,h=new Set,d=null,g=null,y=null,S=e.hydrationData!=null,E=Xr(s,e.history.location,a),m=null;if(E==null){let k=xt(404,{pathname:e.history.location.pathname}),{matches:C,route:N}=_d(s);E=C,m={[N.id]:k}}let p=!E.some(k=>k.route.lazy)&&(!E.some(k=>k.route.loader)||e.hydrationData!=null),_,v={historyAction:e.history.action,location:e.history.location,matches:E,initialized:p,navigation:ha,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||m,fetchers:new Map,blockers:new Map},R=Oe.Pop,D=!1,T,O=!1,A=!1,U=[],Z=[],V=new Map,qe=0,Cn=-1,Kt=new Map,at=new Set,ut=new Map,F=new Map,b=new Map,K=!1;function X(){return f=e.history.listen(k=>{let{action:C,location:N,delta:B}=k;if(K){K=!1;return}Pr(b.size===0||B!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let G=Mr({currentLocation:v.location,nextLocation:N,historyAction:C});if(G&&B!=null){K=!0,e.history.go(B*-1),ur(G,{state:"blocked",location:N,proceed(){ur(G,{state:"proceeding",proceed:void 0,reset:void 0,location:N}),e.history.go(B)},reset(){let $=new Map(v.blockers);$.set(G,zi),oe({blockers:$})}});return}return It(C,N)}),v.initialized||It(Oe.Pop,v.location),_}function _e(){f&&f(),h.clear(),T&&T.abort(),v.fetchers.forEach((k,C)=>Pi(C)),v.blockers.forEach((k,C)=>Oi(C))}function ae(k){return h.add(k),()=>h.delete(k)}function oe(k){v=ge({},v,k),h.forEach(C=>C(v))}function ct(k,C){var N,B;let G=v.actionData!=null&&v.navigation.formMethod!=null&&zt(v.navigation.formMethod)&&v.navigation.state==="loading"&&((N=k.state)==null?void 0:N._isRedirect)!==!0,$;C.actionData?Object.keys(C.actionData).length>0?$=C.actionData:$=null:G?$=v.actionData:$=null;let W=C.loaderData?yd(v.loaderData,C.loaderData,C.matches||[],C.errors):v.loaderData,Q=v.blockers;Q.size>0&&(Q=new Map(Q),Q.forEach((se,re)=>Q.set(re,zi)));let H=D===!0||v.navigation.formMethod!=null&&zt(v.navigation.formMethod)&&((B=k.state)==null?void 0:B._isRedirect)!==!0;l&&(s=l,l=void 0),O||R===Oe.Pop||(R===Oe.Push?e.history.push(k,k.state):R===Oe.Replace&&e.history.replace(k,k.state)),oe(ge({},C,{actionData:$,loaderData:W,historyAction:R,location:k,initialized:!0,navigation:ha,revalidation:"idle",restoreScrollPosition:cn(k,C.matches||v.matches),preventScrollReset:H,blockers:Q})),R=Oe.Pop,D=!1,O=!1,A=!1,U=[],Z=[]}async function ft(k,C){if(typeof k=="number"){e.history.go(k);return}let N=yu(v.location,v.matches,a,u.v7_prependBasename,k,C==null?void 0:C.fromRouteId,C==null?void 0:C.relative),{path:B,submission:G,error:$}=dd(u.v7_normalizeFormMethod,!1,N,C),W=v.location,Q=Oo(v.location,B,C&&C.state);Q=ge({},Q,e.history.encodeLocation(Q));let H=C&&C.replace!=null?C.replace:void 0,se=Oe.Push;H===!0?se=Oe.Replace:H===!1||G!=null&&zt(G.formMethod)&&G.formAction===v.location.pathname+v.location.search&&(se=Oe.Replace);let re=C&&"preventScrollReset"in C?C.preventScrollReset===!0:void 0,He=Mr({currentLocation:W,nextLocation:Q,historyAction:se});if(He){ur(He,{state:"blocked",location:Q,proceed(){ur(He,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),ft(k,C)},reset(){let Re=new Map(v.blockers);Re.set(He,zi),oe({blockers:Re})}});return}return await It(se,Q,{submission:G,pendingError:$,preventScrollReset:re,replace:C&&C.replace})}function Gt(){if(Ir(),oe({revalidation:"loading"}),v.navigation.state!=="submitting"){if(v.navigation.state==="idle"){It(v.historyAction,v.location,{startUninterruptedRevalidation:!0});return}It(R||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation})}}async function It(k,C,N){T&&T.abort(),T=null,R=k,O=(N&&N.startUninterruptedRevalidation)===!0,Mt(v.location,v.matches),D=(N&&N.preventScrollReset)===!0;let B=l||s,G=N&&N.overrideNavigation,$=Xr(B,C,a);if(!$){let Re=xt(404,{pathname:C.pathname}),{matches:Ae,route:nt}=_d(B);Lr(),ct(C,{matches:Ae,loaderData:{},errors:{[nt.id]:Re}});return}if(v.initialized&&!A&&T_(v.location,C)&&!(N&&N.submission&&zt(N.submission.formMethod))){ct(C,{matches:$});return}T=new AbortController;let W=$i(e.history,C,T.signal,N&&N.submission),Q,H;if(N&&N.pendingError)H={[Jr($).route.id]:N.pendingError};else if(N&&N.submission&&zt(N.submission.formMethod)){let Re=await qo(W,C,N.submission,$,{replace:N.replace});if(Re.shortCircuited)return;Q=Re.pendingActionData,H=Re.pendingActionError,G=as(C,N.submission),W=new Request(W.url,{signal:W.signal})}let{shortCircuited:se,loaderData:re,errors:He}=await Tn(W,C,$,G,N&&N.submission,N&&N.fetcherSubmission,N&&N.replace,Q,H);se||(T=null,ct(C,ge({matches:$},Q?{actionData:Q}:{},{loaderData:re,errors:He})))}async function qo(k,C,N,B,G){G===void 0&&(G={}),Ir();let $=N_(C,N);oe({navigation:$});let W,Q=Su(B,C);if(!Q.route.action&&!Q.route.lazy)W={type:Me.error,error:xt(405,{method:k.method,pathname:C.pathname,routeId:Q.route.id})};else if(W=await Bi("action",k,Q,B,o,i,a),k.signal.aborted)return{shortCircuited:!0};if(li(W)){let H;return G&&G.replace!=null?H=G.replace:H=W.location===v.location.pathname+v.location.search,await Xt(v,W,{submission:N,replace:H}),{shortCircuited:!0}}if(so(W)){let H=Jr(B,Q.route.id);return(G&&G.replace)!==!0&&(R=Oe.Push),{pendingActionData:{},pendingActionError:{[H.route.id]:W.error}}}if(_r(W))throw xt(400,{type:"defer-action"});return{pendingActionData:{[Q.route.id]:W.data}}}async function Tn(k,C,N,B,G,$,W,Q,H){let se=B||as(C,G),re=G||$||Ed(se),He=l||s,[Re,Ae]=hd(e.history,v,N,re,C,A,U,Z,ut,at,He,a,Q,H);if(Lr(fe=>!(N&&N.some(Ye=>Ye.route.id===fe))||Re&&Re.some(Ye=>Ye.route.id===fe)),Re.length===0&&Ae.length===0){let fe=an();return ct(C,ge({matches:N,loaderData:{},errors:H||null},Q?{actionData:Q}:{},fe?{fetchers:new Map(v.fetchers)}:{})),{shortCircuited:!0}}if(!O){Ae.forEach(Ye=>{let fn=v.fetchers.get(Ye.key),Ie=qi(void 0,fn?fn.data:void 0);v.fetchers.set(Ye.key,Ie)});let fe=Q||v.actionData;oe(ge({navigation:se},fe?Object.keys(fe).length===0?{actionData:null}:{actionData:fe}:{},Ae.length>0?{fetchers:new Map(v.fetchers)}:{}))}Cn=++qe,Ae.forEach(fe=>{V.has(fe.key)&&St(fe.key),fe.controller&&V.set(fe.key,fe.controller)});let nt=()=>Ae.forEach(fe=>St(fe.key));T&&T.signal.addEventListener("abort",nt);let{results:fr,loaderResults:Lt,fetcherResults:On}=await lr(v.matches,N,Re,Ae,k);if(k.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",nt),Ae.forEach(fe=>V.delete(fe.key));let wt=Sd(fr);if(wt)return await Xt(v,wt,{replace:W}),{shortCircuited:!0};let{loaderData:dr,errors:Ni}=gd(v,N,Re,Lt,H,Ae,On,F);F.forEach((fe,Ye)=>{fe.subscribe(fn=>{(fn||fe.done)&&F.delete(Ye)})});let Dn=an(),dt=un(Cn),hr=Dn||dt||Ae.length>0;return ge({loaderData:dr,errors:Ni},hr?{fetchers:new Map(v.fetchers)}:{})}function Yt(k){return v.fetchers.get(k)||__}function Ti(k,C,N,B){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");V.has(k)&&St(k);let G=l||s,$=yu(v.location,v.matches,a,u.v7_prependBasename,N,C,B==null?void 0:B.relative),W=Xr(G,$,a);if(!W){ar(k,C,xt(404,{pathname:$}));return}let{path:Q,submission:H,error:se}=dd(u.v7_normalizeFormMethod,!0,$,B);if(se){ar(k,C,se);return}let re=Su(W,Q);if(D=(B&&B.preventScrollReset)===!0,H&&zt(H.formMethod)){Ri(k,C,Q,re,W,H);return}ut.set(k,{routeId:C,path:Q}),Rn(k,C,Q,re,W,H)}async function Ri(k,C,N,B,G,$){if(Ir(),ut.delete(k),!B.route.action&&!B.route.lazy){let Ie=xt(405,{method:$.formMethod,pathname:N,routeId:C});ar(k,C,Ie);return}let W=v.fetchers.get(k),Q=A_($,W);v.fetchers.set(k,Q),oe({fetchers:new Map(v.fetchers)});let H=new AbortController,se=$i(e.history,N,H.signal,$);V.set(k,H);let re=await Bi("action",se,B,G,o,i,a);if(se.signal.aborted){V.get(k)===H&&V.delete(k);return}if(li(re)){V.delete(k),at.add(k);let Ie=qi($);return v.fetchers.set(k,Ie),oe({fetchers:new Map(v.fetchers)}),Xt(v,re,{submission:$,isFetchActionRedirect:!0})}if(so(re)){ar(k,C,re.error);return}if(_r(re))throw xt(400,{type:"defer-action"});let He=v.navigation.location||v.location,Re=$i(e.history,He,H.signal),Ae=l||s,nt=v.navigation.state!=="idle"?Xr(Ae,v.navigation.location,a):v.matches;te(nt,"Didn't find any matches after fetcher action");let fr=++qe;Kt.set(k,fr);let Lt=qi($,re.data);v.fetchers.set(k,Lt);let[On,wt]=hd(e.history,v,nt,$,He,A,U,Z,ut,at,Ae,a,{[B.route.id]:re.data},void 0);wt.filter(Ie=>Ie.key!==k).forEach(Ie=>{let q=Ie.key,w=v.fetchers.get(q),I=qi(void 0,w?w.data:void 0);v.fetchers.set(q,I),V.has(q)&&St(q),Ie.controller&&V.set(q,Ie.controller)}),oe({fetchers:new Map(v.fetchers)});let dr=()=>wt.forEach(Ie=>St(Ie.key));H.signal.addEventListener("abort",dr);let{results:Ni,loaderResults:Dn,fetcherResults:dt}=await lr(v.matches,nt,On,wt,Re);if(H.signal.aborted)return;H.signal.removeEventListener("abort",dr),Kt.delete(k),V.delete(k),wt.forEach(Ie=>V.delete(Ie.key));let hr=Sd(Ni);if(hr)return Xt(v,hr);let{loaderData:fe,errors:Ye}=gd(v,v.matches,On,Dn,void 0,wt,dt,F);if(v.fetchers.has(k)){let Ie=ks(re.data);v.fetchers.set(k,Ie)}let fn=un(fr);v.navigation.state==="loading"&&fr>Cn?(te(R,"Expected pending action"),T&&T.abort(),ct(v.navigation.location,{matches:nt,loaderData:fe,errors:Ye,fetchers:new Map(v.fetchers)})):(oe(ge({errors:Ye,loaderData:yd(v.loaderData,fe,nt,Ye)},fn||wt.length>0?{fetchers:new Map(v.fetchers)}:{})),A=!1)}async function Rn(k,C,N,B,G,$){let W=v.fetchers.get(k),Q=qi($,W?W.data:void 0);v.fetchers.set(k,Q),oe({fetchers:new Map(v.fetchers)});let H=new AbortController,se=$i(e.history,N,H.signal);V.set(k,H);let re=await Bi("loader",se,B,G,o,i,a);if(_r(re)&&(re=await Rm(re,se.signal,!0)||re),V.get(k)===H&&V.delete(k),se.signal.aborted)return;if(li(re)){at.add(k),await Xt(v,re);return}if(so(re)){let Re=Jr(v.matches,C);v.fetchers.delete(k),oe({fetchers:new Map(v.fetchers),errors:{[Re.route.id]:re.error}});return}te(!_r(re),"Unhandled fetcher deferred data");let He=ks(re.data);v.fetchers.set(k,He),oe({fetchers:new Map(v.fetchers)})}async function Xt(k,C,N){let{submission:B,replace:G,isFetchActionRedirect:$}=N===void 0?{}:N;C.revalidate&&(A=!0);let W=Oo(k.location,C.location,ge({_isRedirect:!0},$?{_isFetchActionRedirect:!0}:{}));if(te(W,"Expected a location on the redirect navigation"),km.test(C.location)&&n){let se=e.history.createURL(C.location),re=zo(se.pathname,a)==null;if(t.location.origin!==se.origin||re){G?t.location.replace(C.location):t.location.assign(C.location);return}}T=null;let Q=G===!0?Oe.Replace:Oe.Push,H=B||Ed(k.navigation);if(y_.has(C.status)&&H&&zt(H.formMethod))await It(Q,W,{submission:ge({},H,{formAction:C.location}),preventScrollReset:D});else if($)await It(Q,W,{overrideNavigation:as(W),fetcherSubmission:H,preventScrollReset:D});else{let se=as(W,H);await It(Q,W,{overrideNavigation:se,preventScrollReset:D})}}async function lr(k,C,N,B,G){let $=await Promise.all([...N.map(H=>Bi("loader",G,H,C,o,i,a)),...B.map(H=>H.matches&&H.match&&H.controller?Bi("loader",$i(e.history,H.path,H.controller.signal),H.match,H.matches,o,i,a):{type:Me.error,error:xt(404,{pathname:H.path})})]),W=$.slice(0,N.length),Q=$.slice(N.length);return await Promise.all([wd(k,N,W,W.map(()=>G.signal),!1,v.loaderData),wd(k,B.map(H=>H.match),Q,B.map(H=>H.controller?H.controller.signal:null),!0)]),{results:$,loaderResults:W,fetcherResults:Q}}function Ir(){A=!0,U.push(...Lr()),ut.forEach((k,C)=>{V.has(C)&&(Z.push(C),St(C))})}function ar(k,C,N){let B=Jr(v.matches,C);Pi(k),oe({errors:{[B.route.id]:N},fetchers:new Map(v.fetchers)})}function Pi(k){let C=v.fetchers.get(k);V.has(k)&&!(C&&C.state==="loading"&&Kt.has(k))&&St(k),ut.delete(k),Kt.delete(k),at.delete(k),v.fetchers.delete(k)}function St(k){let C=V.get(k);te(C,"Expected fetch controller: "+k),C.abort(),V.delete(k)}function Pn(k){for(let C of k){let N=Yt(C),B=ks(N.data);v.fetchers.set(C,B)}}function an(){let k=[],C=!1;for(let N of at){let B=v.fetchers.get(N);te(B,"Expected fetcher: "+N),B.state==="loading"&&(at.delete(N),k.push(N),C=!0)}return Pn(k),C}function un(k){let C=[];for(let[N,B]of Kt)if(B0}function Ho(k,C){let N=v.blockers.get(k)||zi;return b.get(k)!==C&&b.set(k,C),N}function Oi(k){v.blockers.delete(k),b.delete(k)}function ur(k,C){let N=v.blockers.get(k)||zi;te(N.state==="unblocked"&&C.state==="blocked"||N.state==="blocked"&&C.state==="blocked"||N.state==="blocked"&&C.state==="proceeding"||N.state==="blocked"&&C.state==="unblocked"||N.state==="proceeding"&&C.state==="unblocked","Invalid blocker state transition: "+N.state+" -> "+C.state);let B=new Map(v.blockers);B.set(k,C),oe({blockers:B})}function Mr(k){let{currentLocation:C,nextLocation:N,historyAction:B}=k;if(b.size===0)return;b.size>1&&Pr(!1,"A router only supports one blocker at a time");let G=Array.from(b.entries()),[$,W]=G[G.length-1],Q=v.blockers.get($);if(!(Q&&Q.state==="proceeding")&&W({currentLocation:C,nextLocation:N,historyAction:B}))return $}function Lr(k){let C=[];return F.forEach((N,B)=>{(!k||k(B))&&(N.cancel(),C.push(B),F.delete(B))}),C}function Ur(k,C,N){if(d=k,y=C,g=N||null,!S&&v.navigation===ha){S=!0;let B=cn(v.location,v.matches);B!=null&&oe({restoreScrollPosition:B})}return()=>{d=null,y=null,g=null}}function cr(k,C){return g&&g(k,C.map(B=>D_(B,v.loaderData)))||k.key}function Mt(k,C){if(d&&y){let N=cr(k,C);d[N]=y()}}function cn(k,C){if(d){let N=cr(k,C),B=d[N];if(typeof B=="number")return B}return null}function Di(k){o={},l=gu(k,i,void 0,o)}return _={get basename(){return a},get state(){return v},get routes(){return s},initialize:X,subscribe:ae,enableScrollRestoration:Ur,navigate:ft,fetch:Ti,revalidate:Gt,createHref:k=>e.history.createHref(k),encodeLocation:k=>e.history.encodeLocation(k),getFetcher:Yt,deleteFetcher:Pi,dispose:_e,getBlocker:Ho,deleteBlocker:Oi,_internalFetchControllers:V,_internalActiveDeferreds:F,_internalSetRoutes:Di},_}function E_(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function yu(e,t,n,r,i,o,s){let l,a;if(o!=null&&s!=="path"){l=[];for(let f of t)if(l.push(f),f.route.id===o){a=f;break}}else l=t,a=t[t.length-1];let u=wm(i||".",Tc(l).map(f=>f.pathnameBase),zo(e.pathname,n)||e.pathname,s==="path");return i==null&&(u.search=e.search,u.hash=e.hash),(i==null||i===""||i===".")&&a&&a.route.index&&!Pc(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Xn([n,u.pathname])),bo(u)}function dd(e,t,n,r){if(!r||!E_(r))return{path:n};if(r.formMethod&&!O_(r.formMethod))return{path:n,error:xt(405,{method:r.formMethod})};let i=()=>({path:n,error:xt(400,{type:"invalid-body"})}),o=r.formMethod||"get",s=e?o.toUpperCase():o.toLowerCase(),l=Tm(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!zt(s))return i();let d=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,y)=>{let[S,E]=y;return""+g+S+"="+E+` -`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:d}}}else if(r.formEncType==="application/json"){if(!zt(s))return i();try{let d=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:d,text:void 0}}}catch{return i()}}}te(typeof FormData=="function","FormData is not available in this environment");let a,u;if(r.formData)a=_u(r.formData),u=r.formData;else if(r.body instanceof FormData)a=_u(r.body),u=r.body;else if(r.body instanceof URLSearchParams)a=r.body,u=vd(a);else if(r.body==null)a=new URLSearchParams,u=new FormData;else try{a=new URLSearchParams(r.body),u=vd(a)}catch{return i()}let f={formMethod:s,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(zt(f.formMethod))return{path:n,submission:f};let h=sn(n);return t&&h.search&&Pc(h.search)&&a.append("index",""),h.search="?"+a,{path:bo(h),submission:f}}function x_(e,t){let n=e;if(t){let r=e.findIndex(i=>i.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function hd(e,t,n,r,i,o,s,l,a,u,f,h,d,g){let y=g?Object.values(g)[0]:d?Object.values(d)[0]:void 0,S=e.createURL(t.location),E=e.createURL(i),m=g?Object.keys(g)[0]:void 0,_=x_(n,m).filter((R,D)=>{if(R.route.lazy)return!0;if(R.route.loader==null)return!1;if(k_(t.loaderData,t.matches[D],R)||s.some(A=>A===R.route.id))return!0;let T=t.matches[D],O=R;return pd(R,ge({currentUrl:S,currentParams:T.params,nextUrl:E,nextParams:O.params},r,{actionResult:y,defaultShouldRevalidate:o||S.pathname+S.search===E.pathname+E.search||S.search!==E.search||Cm(T,O)}))}),v=[];return a.forEach((R,D)=>{if(!n.some(V=>V.route.id===R.routeId))return;let T=Xr(f,R.path,h);if(!T){v.push({key:D,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let O=t.fetchers.get(D),A=O&&O.state!=="idle"&&O.data===void 0&&!u.has(D),U=Su(T,R.path);(l.includes(D)||A||pd(U,ge({currentUrl:S,currentParams:t.matches[t.matches.length-1].params,nextUrl:E,nextParams:n[n.length-1].params},r,{actionResult:y,defaultShouldRevalidate:o})))&&v.push({key:D,routeId:R.routeId,path:R.path,matches:T,match:U,controller:new AbortController})}),[_,v]}function k_(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Cm(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function pd(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function md(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];te(i,"No route found in manifest");let o={};for(let s in r){let a=i[s]!==void 0&&s!=="hasErrorBoundary";Pr(!a,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!a&&!Vy.has(s)&&(o[s]=r[s])}Object.assign(i,o),Object.assign(i,ge({},t(i),{lazy:void 0}))}async function Bi(e,t,n,r,i,o,s,l){l===void 0&&(l={});let a,u,f,h=y=>{let S,E=new Promise((m,p)=>S=p);return f=()=>S(),t.signal.addEventListener("abort",f),Promise.race([y({request:t,params:n.params,context:l.requestContext}),E])};try{let y=n.route[e];if(n.route.lazy)if(y)u=(await Promise.all([h(y),md(n.route,o,i)]))[0];else if(await md(n.route,o,i),y=n.route[e],y)u=await h(y);else if(e==="action"){let S=new URL(t.url),E=S.pathname+S.search;throw xt(405,{method:t.method,pathname:E,routeId:n.route.id})}else return{type:Me.data,data:void 0};else if(y)u=await h(y);else{let S=new URL(t.url),E=S.pathname+S.search;throw xt(404,{pathname:E})}te(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(y){a=Me.error,u=y}finally{f&&t.signal.removeEventListener("abort",f)}if(P_(u)){let y=u.status;if(g_.has(y)){let m=u.headers.get("Location");if(te(m,"Redirects returned/thrown from loaders/actions must have a Location header"),!km.test(m))m=yu(new URL(t.url),r.slice(0,r.indexOf(n)+1),s,!0,m);else if(!l.isStaticRequest){let p=new URL(t.url),_=m.startsWith("//")?new URL(p.protocol+m):new URL(m),v=zo(_.pathname,s)!=null;_.origin===p.origin&&v&&(m=_.pathname+_.search+_.hash)}if(l.isStaticRequest)throw u.headers.set("Location",m),u;return{type:Me.redirect,status:y,location:m,revalidate:u.headers.get("X-Remix-Revalidate")!==null}}if(l.isRouteRequest)throw{type:a||Me.data,response:u};let S,E=u.headers.get("Content-Type");return E&&/\bapplication\/json\b/.test(E)?S=await u.json():S=await u.text(),a===Me.error?{type:a,error:new Rc(y,u.statusText,S),headers:u.headers}:{type:Me.data,data:S,statusCode:u.status,headers:u.headers}}if(a===Me.error)return{type:a,error:u};if(R_(u)){var d,g;return{type:Me.deferred,deferredData:u,statusCode:(d=u.init)==null?void 0:d.status,headers:((g=u.init)==null?void 0:g.headers)&&new Headers(u.init.headers)}}return{type:Me.data,data:u}}function $i(e,t,n,r){let i=e.createURL(Tm(t)).toString(),o={signal:n};if(r&&zt(r.formMethod)){let{formMethod:s,formEncType:l}=r;o.method=s.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(r.json)):l==="text/plain"?o.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?o.body=_u(r.formData):o.body=r.formData}return new Request(i,o)}function _u(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function vd(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function C_(e,t,n,r,i){let o={},s=null,l,a=!1,u={};return n.forEach((f,h)=>{let d=t[h].route.id;if(te(!li(f),"Cannot handle redirect results in processLoaderData"),so(f)){let g=Jr(e,d),y=f.error;r&&(y=Object.values(r)[0],r=void 0),s=s||{},s[g.route.id]==null&&(s[g.route.id]=y),o[d]=void 0,a||(a=!0,l=Em(f.error)?f.error.status:500),f.headers&&(u[d]=f.headers)}else _r(f)?(i.set(d,f.deferredData),o[d]=f.deferredData.data):o[d]=f.data,f.statusCode!=null&&f.statusCode!==200&&!a&&(l=f.statusCode),f.headers&&(u[d]=f.headers)}),r&&(s=r,o[Object.keys(r)[0]]=void 0),{loaderData:o,errors:s,statusCode:l||200,loaderHeaders:u}}function gd(e,t,n,r,i,o,s,l){let{loaderData:a,errors:u}=C_(t,n,r,i,l);for(let f=0;fr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function _d(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function xt(e,t){let{pathname:n,routeId:r,method:i,type:o}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new Rc(e||500,s,new Error(l),!0)}function Sd(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(li(n))return n}}function Tm(e){let t=typeof e=="string"?sn(e):e;return bo(ge({},t,{hash:""}))}function T_(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function _r(e){return e.type===Me.deferred}function so(e){return e.type===Me.error}function li(e){return(e&&e.type)===Me.redirect}function R_(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function P_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function O_(e){return v_.has(e.toLowerCase())}function zt(e){return p_.has(e.toLowerCase())}async function wd(e,t,n,r,i,o){for(let s=0;sh.route.id===a.route.id),f=u!=null&&!Cm(u,a)&&(o&&o[a.route.id])!==void 0;if(_r(l)&&(i||f)){let h=r[s];te(h,"Expected an AbortSignal for revalidating fetcher deferred result"),await Rm(l,h,i).then(d=>{d&&(n[s]=d||n[s])})}}}async function Rm(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Me.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Me.error,error:i}}return{type:Me.data,data:e.deferredData.data}}}function Pc(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function D_(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Su(e,t){let n=typeof t=="string"?sn(t).search:t.search;if(e[e.length-1].route.index&&Pc(n||""))return e[e.length-1];let r=Tc(e);return r[r.length-1]}function Ed(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:s}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function as(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function N_(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function qi(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t," _hasFetcherDoneAnything ":!0}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function A_(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0," _hasFetcherDoneAnything ":!0}}function ks(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}/** + */function ge(){return ge=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Pr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Wy(){return Math.random().toString(36).substr(2,8)}function cd(e,t){return{usr:e.state,key:e.key,idx:t}}function Oo(e,t,n,r){return n===void 0&&(n=null),ge({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?sn(t):t,{state:n,key:t&&t.key||r||Wy()})}function bo(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function sn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Vy(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,l=Oe.Pop,a=null,u=f();u==null&&(u=0,s.replaceState(ge({},s.state,{idx:u}),""));function f(){return(s.state||{idx:null}).idx}function h(){l=Oe.Pop;let E=f(),m=E==null?null:E-u;u=E,a&&a({action:l,location:S.location,delta:m})}function d(E,m){l=Oe.Push;let p=Oo(S.location,E,m);n&&n(p,E),u=f()+1;let _=cd(p,u),v=S.createHref(p);try{s.pushState(_,"",v)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;i.location.assign(v)}o&&a&&a({action:l,location:S.location,delta:1})}function g(E,m){l=Oe.Replace;let p=Oo(S.location,E,m);n&&n(p,E),u=f();let _=cd(p,u),v=S.createHref(p);s.replaceState(_,"",v),o&&a&&a({action:l,location:S.location,delta:0})}function y(E){let m=i.location.origin!=="null"?i.location.origin:i.location.href,p=typeof E=="string"?E:bo(E);return te(m,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,m)}let S={get action(){return l},get location(){return e(i,s)},listen(E){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(ud,h),a=E,()=>{i.removeEventListener(ud,h),a=null}},createHref(E){return t(i,E)},createURL:y,encodeLocation(E){let m=y(E);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:d,replace:g,go(E){return s.go(E)}};return S}var Me;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Me||(Me={}));const Ky=new Set(["lazy","caseSensitive","path","id","index","children"]);function Gy(e){return e.index===!0}function gu(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let s=[...n,o],l=typeof i.id=="string"?i.id:s.join("-");if(te(i.index!==!0||!i.children,"Cannot specify children on an index route"),te(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),Gy(i)){let a=ge({},i,t(i),{id:l});return r[l]=a,a}else{let a=ge({},i,t(i),{id:l,children:void 0});return r[l]=a,i.children&&(a.children=gu(i.children,t,s,r)),a}})}function Xr(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?sn(t):t,i=zo(r.pathname||"/",n);if(i==null)return null;let o=_m(e);Yy(o);let s=null;for(let l=0;s==null&&l{let a={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};a.relativePath.startsWith("/")&&(te(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Xn([r,a.relativePath]),f=n.concat(a);o.children&&o.children.length>0&&(te(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),_m(o.children,t,f,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:r_(u,o.index),routesMeta:f})};return e.forEach((o,s)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,s);else for(let a of Sm(o.path))i(o,s,a)}),t}function Sm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=Sm(r.join("/")),l=[];return l.push(...s.map(a=>a===""?o:[o,a].join("/"))),i&&l.push(...s),l.map(a=>e.startsWith("/")&&a===""?"/":a)}function Yy(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:i_(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Xy=/^:\w+$/,Jy=3,Zy=2,e_=1,t_=10,n_=-2,fd=e=>e==="*";function r_(e,t){let n=e.split("/"),r=n.length;return n.some(fd)&&(r+=n_),t&&(r+=Zy),n.filter(i=>!fd(i)).reduce((i,o)=>i+(Xy.test(o)?Jy:o===""?e_:t_),r)}function i_(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function o_(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let s=0;s{if(f==="*"){let d=l[h]||"";s=o.slice(0,o.length-d.length).replace(/(.)\/+$/,"$1")}return u[f]=u_(l[h]||"",f),u},{}),pathname:o,pathnameBase:s,pattern:e}}function l_(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Pr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,l)=>(r.push(l),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function a_(e){try{return decodeURI(e)}catch(t){return Pr(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function u_(e,t){try{return decodeURIComponent(e)}catch(n){return Pr(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function zo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function c_(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?sn(e):e;return{pathname:n?n.startsWith("/")?n:f_(n,t):t,search:h_(r),hash:p_(i)}}function f_(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function da(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Tc(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wm(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=sn(e):(i=ge({},e),te(!i.pathname||!i.pathname.includes("?"),da("?","pathname","search",i)),te(!i.pathname||!i.pathname.includes("#"),da("#","pathname","hash",i)),te(!i.search||!i.search.includes("#"),da("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,l;if(r||s==null)l=n;else{let h=t.length-1;if(s.startsWith("..")){let d=s.split("/");for(;d[0]==="..";)d.shift(),h-=1;i.pathname=d.join("/")}l=h>=0?t[h]:"/"}let a=c_(i,l),u=s&&s!=="/"&&s.endsWith("/"),f=(o||s===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||f)&&(a.pathname+="/"),a}const Xn=e=>e.join("/").replace(/\/\/+/g,"/"),d_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),h_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,p_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Rc{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Em(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const xm=["post","put","patch","delete"],m_=new Set(xm),v_=["get",...xm],g_=new Set(v_),y_=new Set([301,302,303,307,308]),__=new Set([307,308]),ha={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},S_={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zi={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},km=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,w_=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function E_(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;te(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let k=e.detectErrorBoundary;i=C=>({hasErrorBoundary:k(C)})}else i=w_;let o={},s=gu(e.routes,i,void 0,o),l,a=e.basename||"/",u=ge({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),f=null,h=new Set,d=null,g=null,y=null,S=e.hydrationData!=null,E=Xr(s,e.history.location,a),m=null;if(E==null){let k=xt(404,{pathname:e.history.location.pathname}),{matches:C,route:N}=_d(s);E=C,m={[N.id]:k}}let p=!E.some(k=>k.route.lazy)&&(!E.some(k=>k.route.loader)||e.hydrationData!=null),_,v={historyAction:e.history.action,location:e.history.location,matches:E,initialized:p,navigation:ha,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||m,fetchers:new Map,blockers:new Map},R=Oe.Pop,D=!1,T,O=!1,A=!1,U=[],Z=[],V=new Map,qe=0,Cn=-1,Kt=new Map,at=new Set,ut=new Map,F=new Map,b=new Map,K=!1;function X(){return f=e.history.listen(k=>{let{action:C,location:N,delta:B}=k;if(K){K=!1;return}Pr(b.size===0||B!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let G=Mr({currentLocation:v.location,nextLocation:N,historyAction:C});if(G&&B!=null){K=!0,e.history.go(B*-1),ur(G,{state:"blocked",location:N,proceed(){ur(G,{state:"proceeding",proceed:void 0,reset:void 0,location:N}),e.history.go(B)},reset(){let $=new Map(v.blockers);$.set(G,zi),oe({blockers:$})}});return}return It(C,N)}),v.initialized||It(Oe.Pop,v.location),_}function _e(){f&&f(),h.clear(),T&&T.abort(),v.fetchers.forEach((k,C)=>Pi(C)),v.blockers.forEach((k,C)=>Oi(C))}function ae(k){return h.add(k),()=>h.delete(k)}function oe(k){v=ge({},v,k),h.forEach(C=>C(v))}function ct(k,C){var N,B;let G=v.actionData!=null&&v.navigation.formMethod!=null&&zt(v.navigation.formMethod)&&v.navigation.state==="loading"&&((N=k.state)==null?void 0:N._isRedirect)!==!0,$;C.actionData?Object.keys(C.actionData).length>0?$=C.actionData:$=null:G?$=v.actionData:$=null;let W=C.loaderData?yd(v.loaderData,C.loaderData,C.matches||[],C.errors):v.loaderData,Q=v.blockers;Q.size>0&&(Q=new Map(Q),Q.forEach((se,re)=>Q.set(re,zi)));let H=D===!0||v.navigation.formMethod!=null&&zt(v.navigation.formMethod)&&((B=k.state)==null?void 0:B._isRedirect)!==!0;l&&(s=l,l=void 0),O||R===Oe.Pop||(R===Oe.Push?e.history.push(k,k.state):R===Oe.Replace&&e.history.replace(k,k.state)),oe(ge({},C,{actionData:$,loaderData:W,historyAction:R,location:k,initialized:!0,navigation:ha,revalidation:"idle",restoreScrollPosition:cn(k,C.matches||v.matches),preventScrollReset:H,blockers:Q})),R=Oe.Pop,D=!1,O=!1,A=!1,U=[],Z=[]}async function ft(k,C){if(typeof k=="number"){e.history.go(k);return}let N=yu(v.location,v.matches,a,u.v7_prependBasename,k,C==null?void 0:C.fromRouteId,C==null?void 0:C.relative),{path:B,submission:G,error:$}=dd(u.v7_normalizeFormMethod,!1,N,C),W=v.location,Q=Oo(v.location,B,C&&C.state);Q=ge({},Q,e.history.encodeLocation(Q));let H=C&&C.replace!=null?C.replace:void 0,se=Oe.Push;H===!0?se=Oe.Replace:H===!1||G!=null&&zt(G.formMethod)&&G.formAction===v.location.pathname+v.location.search&&(se=Oe.Replace);let re=C&&"preventScrollReset"in C?C.preventScrollReset===!0:void 0,He=Mr({currentLocation:W,nextLocation:Q,historyAction:se});if(He){ur(He,{state:"blocked",location:Q,proceed(){ur(He,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),ft(k,C)},reset(){let Re=new Map(v.blockers);Re.set(He,zi),oe({blockers:Re})}});return}return await It(se,Q,{submission:G,pendingError:$,preventScrollReset:re,replace:C&&C.replace})}function Gt(){if(Ir(),oe({revalidation:"loading"}),v.navigation.state!=="submitting"){if(v.navigation.state==="idle"){It(v.historyAction,v.location,{startUninterruptedRevalidation:!0});return}It(R||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation})}}async function It(k,C,N){T&&T.abort(),T=null,R=k,O=(N&&N.startUninterruptedRevalidation)===!0,Mt(v.location,v.matches),D=(N&&N.preventScrollReset)===!0;let B=l||s,G=N&&N.overrideNavigation,$=Xr(B,C,a);if(!$){let Re=xt(404,{pathname:C.pathname}),{matches:Ae,route:nt}=_d(B);Lr(),ct(C,{matches:Ae,loaderData:{},errors:{[nt.id]:Re}});return}if(v.initialized&&!A&&R_(v.location,C)&&!(N&&N.submission&&zt(N.submission.formMethod))){ct(C,{matches:$});return}T=new AbortController;let W=$i(e.history,C,T.signal,N&&N.submission),Q,H;if(N&&N.pendingError)H={[Jr($).route.id]:N.pendingError};else if(N&&N.submission&&zt(N.submission.formMethod)){let Re=await qo(W,C,N.submission,$,{replace:N.replace});if(Re.shortCircuited)return;Q=Re.pendingActionData,H=Re.pendingActionError,G=as(C,N.submission),W=new Request(W.url,{signal:W.signal})}let{shortCircuited:se,loaderData:re,errors:He}=await Tn(W,C,$,G,N&&N.submission,N&&N.fetcherSubmission,N&&N.replace,Q,H);se||(T=null,ct(C,ge({matches:$},Q?{actionData:Q}:{},{loaderData:re,errors:He})))}async function qo(k,C,N,B,G){G===void 0&&(G={}),Ir();let $=A_(C,N);oe({navigation:$});let W,Q=Su(B,C);if(!Q.route.action&&!Q.route.lazy)W={type:Me.error,error:xt(405,{method:k.method,pathname:C.pathname,routeId:Q.route.id})};else if(W=await Bi("action",k,Q,B,o,i,a),k.signal.aborted)return{shortCircuited:!0};if(li(W)){let H;return G&&G.replace!=null?H=G.replace:H=W.location===v.location.pathname+v.location.search,await Xt(v,W,{submission:N,replace:H}),{shortCircuited:!0}}if(so(W)){let H=Jr(B,Q.route.id);return(G&&G.replace)!==!0&&(R=Oe.Push),{pendingActionData:{},pendingActionError:{[H.route.id]:W.error}}}if(_r(W))throw xt(400,{type:"defer-action"});return{pendingActionData:{[Q.route.id]:W.data}}}async function Tn(k,C,N,B,G,$,W,Q,H){let se=B||as(C,G),re=G||$||Ed(se),He=l||s,[Re,Ae]=hd(e.history,v,N,re,C,A,U,Z,ut,at,He,a,Q,H);if(Lr(fe=>!(N&&N.some(Ye=>Ye.route.id===fe))||Re&&Re.some(Ye=>Ye.route.id===fe)),Re.length===0&&Ae.length===0){let fe=an();return ct(C,ge({matches:N,loaderData:{},errors:H||null},Q?{actionData:Q}:{},fe?{fetchers:new Map(v.fetchers)}:{})),{shortCircuited:!0}}if(!O){Ae.forEach(Ye=>{let fn=v.fetchers.get(Ye.key),Ie=qi(void 0,fn?fn.data:void 0);v.fetchers.set(Ye.key,Ie)});let fe=Q||v.actionData;oe(ge({navigation:se},fe?Object.keys(fe).length===0?{actionData:null}:{actionData:fe}:{},Ae.length>0?{fetchers:new Map(v.fetchers)}:{}))}Cn=++qe,Ae.forEach(fe=>{V.has(fe.key)&&St(fe.key),fe.controller&&V.set(fe.key,fe.controller)});let nt=()=>Ae.forEach(fe=>St(fe.key));T&&T.signal.addEventListener("abort",nt);let{results:fr,loaderResults:Lt,fetcherResults:On}=await lr(v.matches,N,Re,Ae,k);if(k.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",nt),Ae.forEach(fe=>V.delete(fe.key));let wt=Sd(fr);if(wt)return await Xt(v,wt,{replace:W}),{shortCircuited:!0};let{loaderData:dr,errors:Ni}=gd(v,N,Re,Lt,H,Ae,On,F);F.forEach((fe,Ye)=>{fe.subscribe(fn=>{(fn||fe.done)&&F.delete(Ye)})});let Dn=an(),dt=un(Cn),hr=Dn||dt||Ae.length>0;return ge({loaderData:dr,errors:Ni},hr?{fetchers:new Map(v.fetchers)}:{})}function Yt(k){return v.fetchers.get(k)||S_}function Ti(k,C,N,B){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");V.has(k)&&St(k);let G=l||s,$=yu(v.location,v.matches,a,u.v7_prependBasename,N,C,B==null?void 0:B.relative),W=Xr(G,$,a);if(!W){ar(k,C,xt(404,{pathname:$}));return}let{path:Q,submission:H,error:se}=dd(u.v7_normalizeFormMethod,!0,$,B);if(se){ar(k,C,se);return}let re=Su(W,Q);if(D=(B&&B.preventScrollReset)===!0,H&&zt(H.formMethod)){Ri(k,C,Q,re,W,H);return}ut.set(k,{routeId:C,path:Q}),Rn(k,C,Q,re,W,H)}async function Ri(k,C,N,B,G,$){if(Ir(),ut.delete(k),!B.route.action&&!B.route.lazy){let Ie=xt(405,{method:$.formMethod,pathname:N,routeId:C});ar(k,C,Ie);return}let W=v.fetchers.get(k),Q=I_($,W);v.fetchers.set(k,Q),oe({fetchers:new Map(v.fetchers)});let H=new AbortController,se=$i(e.history,N,H.signal,$);V.set(k,H);let re=await Bi("action",se,B,G,o,i,a);if(se.signal.aborted){V.get(k)===H&&V.delete(k);return}if(li(re)){V.delete(k),at.add(k);let Ie=qi($);return v.fetchers.set(k,Ie),oe({fetchers:new Map(v.fetchers)}),Xt(v,re,{submission:$,isFetchActionRedirect:!0})}if(so(re)){ar(k,C,re.error);return}if(_r(re))throw xt(400,{type:"defer-action"});let He=v.navigation.location||v.location,Re=$i(e.history,He,H.signal),Ae=l||s,nt=v.navigation.state!=="idle"?Xr(Ae,v.navigation.location,a):v.matches;te(nt,"Didn't find any matches after fetcher action");let fr=++qe;Kt.set(k,fr);let Lt=qi($,re.data);v.fetchers.set(k,Lt);let[On,wt]=hd(e.history,v,nt,$,He,A,U,Z,ut,at,Ae,a,{[B.route.id]:re.data},void 0);wt.filter(Ie=>Ie.key!==k).forEach(Ie=>{let q=Ie.key,w=v.fetchers.get(q),I=qi(void 0,w?w.data:void 0);v.fetchers.set(q,I),V.has(q)&&St(q),Ie.controller&&V.set(q,Ie.controller)}),oe({fetchers:new Map(v.fetchers)});let dr=()=>wt.forEach(Ie=>St(Ie.key));H.signal.addEventListener("abort",dr);let{results:Ni,loaderResults:Dn,fetcherResults:dt}=await lr(v.matches,nt,On,wt,Re);if(H.signal.aborted)return;H.signal.removeEventListener("abort",dr),Kt.delete(k),V.delete(k),wt.forEach(Ie=>V.delete(Ie.key));let hr=Sd(Ni);if(hr)return Xt(v,hr);let{loaderData:fe,errors:Ye}=gd(v,v.matches,On,Dn,void 0,wt,dt,F);if(v.fetchers.has(k)){let Ie=ks(re.data);v.fetchers.set(k,Ie)}let fn=un(fr);v.navigation.state==="loading"&&fr>Cn?(te(R,"Expected pending action"),T&&T.abort(),ct(v.navigation.location,{matches:nt,loaderData:fe,errors:Ye,fetchers:new Map(v.fetchers)})):(oe(ge({errors:Ye,loaderData:yd(v.loaderData,fe,nt,Ye)},fn||wt.length>0?{fetchers:new Map(v.fetchers)}:{})),A=!1)}async function Rn(k,C,N,B,G,$){let W=v.fetchers.get(k),Q=qi($,W?W.data:void 0);v.fetchers.set(k,Q),oe({fetchers:new Map(v.fetchers)});let H=new AbortController,se=$i(e.history,N,H.signal);V.set(k,H);let re=await Bi("loader",se,B,G,o,i,a);if(_r(re)&&(re=await Rm(re,se.signal,!0)||re),V.get(k)===H&&V.delete(k),se.signal.aborted)return;if(li(re)){at.add(k),await Xt(v,re);return}if(so(re)){let Re=Jr(v.matches,C);v.fetchers.delete(k),oe({fetchers:new Map(v.fetchers),errors:{[Re.route.id]:re.error}});return}te(!_r(re),"Unhandled fetcher deferred data");let He=ks(re.data);v.fetchers.set(k,He),oe({fetchers:new Map(v.fetchers)})}async function Xt(k,C,N){let{submission:B,replace:G,isFetchActionRedirect:$}=N===void 0?{}:N;C.revalidate&&(A=!0);let W=Oo(k.location,C.location,ge({_isRedirect:!0},$?{_isFetchActionRedirect:!0}:{}));if(te(W,"Expected a location on the redirect navigation"),km.test(C.location)&&n){let se=e.history.createURL(C.location),re=zo(se.pathname,a)==null;if(t.location.origin!==se.origin||re){G?t.location.replace(C.location):t.location.assign(C.location);return}}T=null;let Q=G===!0?Oe.Replace:Oe.Push,H=B||Ed(k.navigation);if(__.has(C.status)&&H&&zt(H.formMethod))await It(Q,W,{submission:ge({},H,{formAction:C.location}),preventScrollReset:D});else if($)await It(Q,W,{overrideNavigation:as(W),fetcherSubmission:H,preventScrollReset:D});else{let se=as(W,H);await It(Q,W,{overrideNavigation:se,preventScrollReset:D})}}async function lr(k,C,N,B,G){let $=await Promise.all([...N.map(H=>Bi("loader",G,H,C,o,i,a)),...B.map(H=>H.matches&&H.match&&H.controller?Bi("loader",$i(e.history,H.path,H.controller.signal),H.match,H.matches,o,i,a):{type:Me.error,error:xt(404,{pathname:H.path})})]),W=$.slice(0,N.length),Q=$.slice(N.length);return await Promise.all([wd(k,N,W,W.map(()=>G.signal),!1,v.loaderData),wd(k,B.map(H=>H.match),Q,B.map(H=>H.controller?H.controller.signal:null),!0)]),{results:$,loaderResults:W,fetcherResults:Q}}function Ir(){A=!0,U.push(...Lr()),ut.forEach((k,C)=>{V.has(C)&&(Z.push(C),St(C))})}function ar(k,C,N){let B=Jr(v.matches,C);Pi(k),oe({errors:{[B.route.id]:N},fetchers:new Map(v.fetchers)})}function Pi(k){let C=v.fetchers.get(k);V.has(k)&&!(C&&C.state==="loading"&&Kt.has(k))&&St(k),ut.delete(k),Kt.delete(k),at.delete(k),v.fetchers.delete(k)}function St(k){let C=V.get(k);te(C,"Expected fetch controller: "+k),C.abort(),V.delete(k)}function Pn(k){for(let C of k){let N=Yt(C),B=ks(N.data);v.fetchers.set(C,B)}}function an(){let k=[],C=!1;for(let N of at){let B=v.fetchers.get(N);te(B,"Expected fetcher: "+N),B.state==="loading"&&(at.delete(N),k.push(N),C=!0)}return Pn(k),C}function un(k){let C=[];for(let[N,B]of Kt)if(B0}function Ho(k,C){let N=v.blockers.get(k)||zi;return b.get(k)!==C&&b.set(k,C),N}function Oi(k){v.blockers.delete(k),b.delete(k)}function ur(k,C){let N=v.blockers.get(k)||zi;te(N.state==="unblocked"&&C.state==="blocked"||N.state==="blocked"&&C.state==="blocked"||N.state==="blocked"&&C.state==="proceeding"||N.state==="blocked"&&C.state==="unblocked"||N.state==="proceeding"&&C.state==="unblocked","Invalid blocker state transition: "+N.state+" -> "+C.state);let B=new Map(v.blockers);B.set(k,C),oe({blockers:B})}function Mr(k){let{currentLocation:C,nextLocation:N,historyAction:B}=k;if(b.size===0)return;b.size>1&&Pr(!1,"A router only supports one blocker at a time");let G=Array.from(b.entries()),[$,W]=G[G.length-1],Q=v.blockers.get($);if(!(Q&&Q.state==="proceeding")&&W({currentLocation:C,nextLocation:N,historyAction:B}))return $}function Lr(k){let C=[];return F.forEach((N,B)=>{(!k||k(B))&&(N.cancel(),C.push(B),F.delete(B))}),C}function Ur(k,C,N){if(d=k,y=C,g=N||null,!S&&v.navigation===ha){S=!0;let B=cn(v.location,v.matches);B!=null&&oe({restoreScrollPosition:B})}return()=>{d=null,y=null,g=null}}function cr(k,C){return g&&g(k,C.map(B=>N_(B,v.loaderData)))||k.key}function Mt(k,C){if(d&&y){let N=cr(k,C);d[N]=y()}}function cn(k,C){if(d){let N=cr(k,C),B=d[N];if(typeof B=="number")return B}return null}function Di(k){o={},l=gu(k,i,void 0,o)}return _={get basename(){return a},get state(){return v},get routes(){return s},initialize:X,subscribe:ae,enableScrollRestoration:Ur,navigate:ft,fetch:Ti,revalidate:Gt,createHref:k=>e.history.createHref(k),encodeLocation:k=>e.history.encodeLocation(k),getFetcher:Yt,deleteFetcher:Pi,dispose:_e,getBlocker:Ho,deleteBlocker:Oi,_internalFetchControllers:V,_internalActiveDeferreds:F,_internalSetRoutes:Di},_}function x_(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function yu(e,t,n,r,i,o,s){let l,a;if(o!=null&&s!=="path"){l=[];for(let f of t)if(l.push(f),f.route.id===o){a=f;break}}else l=t,a=t[t.length-1];let u=wm(i||".",Tc(l).map(f=>f.pathnameBase),zo(e.pathname,n)||e.pathname,s==="path");return i==null&&(u.search=e.search,u.hash=e.hash),(i==null||i===""||i===".")&&a&&a.route.index&&!Pc(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Xn([n,u.pathname])),bo(u)}function dd(e,t,n,r){if(!r||!x_(r))return{path:n};if(r.formMethod&&!D_(r.formMethod))return{path:n,error:xt(405,{method:r.formMethod})};let i=()=>({path:n,error:xt(400,{type:"invalid-body"})}),o=r.formMethod||"get",s=e?o.toUpperCase():o.toLowerCase(),l=Tm(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!zt(s))return i();let d=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,y)=>{let[S,E]=y;return""+g+S+"="+E+` +`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:d}}}else if(r.formEncType==="application/json"){if(!zt(s))return i();try{let d=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:d,text:void 0}}}catch{return i()}}}te(typeof FormData=="function","FormData is not available in this environment");let a,u;if(r.formData)a=_u(r.formData),u=r.formData;else if(r.body instanceof FormData)a=_u(r.body),u=r.body;else if(r.body instanceof URLSearchParams)a=r.body,u=vd(a);else if(r.body==null)a=new URLSearchParams,u=new FormData;else try{a=new URLSearchParams(r.body),u=vd(a)}catch{return i()}let f={formMethod:s,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(zt(f.formMethod))return{path:n,submission:f};let h=sn(n);return t&&h.search&&Pc(h.search)&&a.append("index",""),h.search="?"+a,{path:bo(h),submission:f}}function k_(e,t){let n=e;if(t){let r=e.findIndex(i=>i.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function hd(e,t,n,r,i,o,s,l,a,u,f,h,d,g){let y=g?Object.values(g)[0]:d?Object.values(d)[0]:void 0,S=e.createURL(t.location),E=e.createURL(i),m=g?Object.keys(g)[0]:void 0,_=k_(n,m).filter((R,D)=>{if(R.route.lazy)return!0;if(R.route.loader==null)return!1;if(C_(t.loaderData,t.matches[D],R)||s.some(A=>A===R.route.id))return!0;let T=t.matches[D],O=R;return pd(R,ge({currentUrl:S,currentParams:T.params,nextUrl:E,nextParams:O.params},r,{actionResult:y,defaultShouldRevalidate:o||S.pathname+S.search===E.pathname+E.search||S.search!==E.search||Cm(T,O)}))}),v=[];return a.forEach((R,D)=>{if(!n.some(V=>V.route.id===R.routeId))return;let T=Xr(f,R.path,h);if(!T){v.push({key:D,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let O=t.fetchers.get(D),A=O&&O.state!=="idle"&&O.data===void 0&&!u.has(D),U=Su(T,R.path);(l.includes(D)||A||pd(U,ge({currentUrl:S,currentParams:t.matches[t.matches.length-1].params,nextUrl:E,nextParams:n[n.length-1].params},r,{actionResult:y,defaultShouldRevalidate:o})))&&v.push({key:D,routeId:R.routeId,path:R.path,matches:T,match:U,controller:new AbortController})}),[_,v]}function C_(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Cm(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function pd(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function md(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];te(i,"No route found in manifest");let o={};for(let s in r){let a=i[s]!==void 0&&s!=="hasErrorBoundary";Pr(!a,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!a&&!Ky.has(s)&&(o[s]=r[s])}Object.assign(i,o),Object.assign(i,ge({},t(i),{lazy:void 0}))}async function Bi(e,t,n,r,i,o,s,l){l===void 0&&(l={});let a,u,f,h=y=>{let S,E=new Promise((m,p)=>S=p);return f=()=>S(),t.signal.addEventListener("abort",f),Promise.race([y({request:t,params:n.params,context:l.requestContext}),E])};try{let y=n.route[e];if(n.route.lazy)if(y)u=(await Promise.all([h(y),md(n.route,o,i)]))[0];else if(await md(n.route,o,i),y=n.route[e],y)u=await h(y);else if(e==="action"){let S=new URL(t.url),E=S.pathname+S.search;throw xt(405,{method:t.method,pathname:E,routeId:n.route.id})}else return{type:Me.data,data:void 0};else if(y)u=await h(y);else{let S=new URL(t.url),E=S.pathname+S.search;throw xt(404,{pathname:E})}te(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(y){a=Me.error,u=y}finally{f&&t.signal.removeEventListener("abort",f)}if(O_(u)){let y=u.status;if(y_.has(y)){let m=u.headers.get("Location");if(te(m,"Redirects returned/thrown from loaders/actions must have a Location header"),!km.test(m))m=yu(new URL(t.url),r.slice(0,r.indexOf(n)+1),s,!0,m);else if(!l.isStaticRequest){let p=new URL(t.url),_=m.startsWith("//")?new URL(p.protocol+m):new URL(m),v=zo(_.pathname,s)!=null;_.origin===p.origin&&v&&(m=_.pathname+_.search+_.hash)}if(l.isStaticRequest)throw u.headers.set("Location",m),u;return{type:Me.redirect,status:y,location:m,revalidate:u.headers.get("X-Remix-Revalidate")!==null}}if(l.isRouteRequest)throw{type:a||Me.data,response:u};let S,E=u.headers.get("Content-Type");return E&&/\bapplication\/json\b/.test(E)?S=await u.json():S=await u.text(),a===Me.error?{type:a,error:new Rc(y,u.statusText,S),headers:u.headers}:{type:Me.data,data:S,statusCode:u.status,headers:u.headers}}if(a===Me.error)return{type:a,error:u};if(P_(u)){var d,g;return{type:Me.deferred,deferredData:u,statusCode:(d=u.init)==null?void 0:d.status,headers:((g=u.init)==null?void 0:g.headers)&&new Headers(u.init.headers)}}return{type:Me.data,data:u}}function $i(e,t,n,r){let i=e.createURL(Tm(t)).toString(),o={signal:n};if(r&&zt(r.formMethod)){let{formMethod:s,formEncType:l}=r;o.method=s.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(r.json)):l==="text/plain"?o.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?o.body=_u(r.formData):o.body=r.formData}return new Request(i,o)}function _u(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function vd(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function T_(e,t,n,r,i){let o={},s=null,l,a=!1,u={};return n.forEach((f,h)=>{let d=t[h].route.id;if(te(!li(f),"Cannot handle redirect results in processLoaderData"),so(f)){let g=Jr(e,d),y=f.error;r&&(y=Object.values(r)[0],r=void 0),s=s||{},s[g.route.id]==null&&(s[g.route.id]=y),o[d]=void 0,a||(a=!0,l=Em(f.error)?f.error.status:500),f.headers&&(u[d]=f.headers)}else _r(f)?(i.set(d,f.deferredData),o[d]=f.deferredData.data):o[d]=f.data,f.statusCode!=null&&f.statusCode!==200&&!a&&(l=f.statusCode),f.headers&&(u[d]=f.headers)}),r&&(s=r,o[Object.keys(r)[0]]=void 0),{loaderData:o,errors:s,statusCode:l||200,loaderHeaders:u}}function gd(e,t,n,r,i,o,s,l){let{loaderData:a,errors:u}=T_(t,n,r,i,l);for(let f=0;fr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function _d(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function xt(e,t){let{pathname:n,routeId:r,method:i,type:o}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new Rc(e||500,s,new Error(l),!0)}function Sd(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(li(n))return n}}function Tm(e){let t=typeof e=="string"?sn(e):e;return bo(ge({},t,{hash:""}))}function R_(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function _r(e){return e.type===Me.deferred}function so(e){return e.type===Me.error}function li(e){return(e&&e.type)===Me.redirect}function P_(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function O_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function D_(e){return g_.has(e.toLowerCase())}function zt(e){return m_.has(e.toLowerCase())}async function wd(e,t,n,r,i,o){for(let s=0;sh.route.id===a.route.id),f=u!=null&&!Cm(u,a)&&(o&&o[a.route.id])!==void 0;if(_r(l)&&(i||f)){let h=r[s];te(h,"Expected an AbortSignal for revalidating fetcher deferred result"),await Rm(l,h,i).then(d=>{d&&(n[s]=d||n[s])})}}}async function Rm(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Me.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Me.error,error:i}}return{type:Me.data,data:e.deferredData.data}}}function Pc(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function N_(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Su(e,t){let n=typeof t=="string"?sn(t).search:t.search;if(e[e.length-1].route.index&&Pc(n||""))return e[e.length-1];let r=Tc(e);return r[r.length-1]}function Ed(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:s}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function as(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function A_(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function qi(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t," _hasFetcherDoneAnything ":!0}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function I_(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0," _hasFetcherDoneAnything ":!0}}function ks(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}/** * React Router v6.14.1 * * Copyright (c) Remix Software Inc. @@ -60,7 +60,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Xs(){return Xs=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.pathnameBase)),s=L.useRef(!1);return Dm(()=>{s.current=!0}),L.useCallback(function(a,u){if(u===void 0&&(u={}),!s.current)return;if(typeof a=="number"){n.go(a);return}let f=wm(a,JSON.parse(o),i,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Xn([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,i,e])}function M_(e,t,n){Pl()||te(!1);let{navigator:r}=L.useContext(Tl),{matches:i}=L.useContext(xi),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let a=Oc(),u;if(t){var f;let S=typeof t=="string"?sn(t):t;l==="/"||(f=S.pathname)!=null&&f.startsWith(l)||te(!1),u=S}else u=a;let h=u.pathname||"/",d=l==="/"?h:h.slice(l.length)||"/",g=Xr(e,{pathname:d}),y=b_(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Xn([l,r.encodeLocation?r.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?l:Xn([l,r.encodeLocation?r.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n);return t&&y?L.createElement(Rl.Provider,{value:{location:Xs({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Oe.Pop}},y):y}function L_(){let e=q_(),t=Em(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},t),n?L.createElement("pre",{style:i},n):null,o)}const U_=L.createElement(L_,null);class F_ extends L.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?L.createElement(xi.Provider,{value:this.props.routeContext},L.createElement(Om.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function j_(e){let{routeContext:t,match:n,children:r}=e,i=L.useContext(Cl);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),L.createElement(xi.Provider,{value:t},r)}function b_(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let o=e,s=(r=n)==null?void 0:r.errors;if(s!=null){let l=o.findIndex(a=>a.route.id&&(s==null?void 0:s[a.route.id]));l>=0||te(!1),o=o.slice(0,Math.min(o.length,l+1))}return o.reduceRight((l,a,u)=>{let f=a.route.id?s==null?void 0:s[a.route.id]:null,h=null;n&&(h=a.route.errorElement||U_);let d=t.concat(o.slice(0,u+1)),g=()=>{let y;return f?y=h:a.route.Component?y=L.createElement(a.route.Component,null):a.route.element?y=a.route.element:y=l,L.createElement(j_,{match:a,routeContext:{outlet:l,matches:d,isDataRoute:n!=null},children:y})};return n&&(a.route.ErrorBoundary||a.route.errorElement||u===0)?L.createElement(F_,{location:n.location,revalidation:n.revalidation,component:h,error:f,children:g(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):g()},null)}var wu;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(wu||(wu={}));var Do;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(Do||(Do={}));function z_(e){let t=L.useContext(Cl);return t||te(!1),t}function B_(e){let t=L.useContext(Pm);return t||te(!1),t}function $_(e){let t=L.useContext(xi);return t||te(!1),t}function Nm(e){let t=$_(),n=t.matches[t.matches.length-1];return n.route.id||te(!1),n.route.id}function q_(){var e;let t=L.useContext(Om),n=B_(Do.UseRouteError),r=Nm(Do.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function H_(){let{router:e}=z_(wu.UseNavigateStable),t=Nm(Do.UseNavigateStable),n=L.useRef(!1);return Dm(()=>{n.current=!0}),L.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Xs({fromRouteId:t},o)))},[e,t])}const Q_="startTransition",xd=Av[Q_];function W_(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=L.useState(n.state),{v7_startTransition:s}=r||{},l=L.useCallback(h=>{s&&xd?xd(()=>o(h)):o(h)},[o,s]);L.useLayoutEffect(()=>n.subscribe(l),[n,l]);let a=L.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:h=>n.navigate(h),push:(h,d,g)=>n.navigate(h,{state:d,preventScrollReset:g==null?void 0:g.preventScrollReset}),replace:(h,d,g)=>n.navigate(h,{replace:!0,state:d,preventScrollReset:g==null?void 0:g.preventScrollReset})}),[n]),u=n.basename||"/",f=L.useMemo(()=>({router:n,navigator:a,static:!1,basename:u}),[n,a,u]);return L.createElement(L.Fragment,null,L.createElement(Cl.Provider,{value:f},L.createElement(Pm.Provider,{value:i},L.createElement(K_,{basename:u,location:i.location,navigationType:i.historyAction,navigator:a},i.initialized?L.createElement(V_,{routes:n.routes,state:i}):t))),null)}function V_(e){let{routes:t,state:n}=e;return M_(t,void 0,n)}function K_(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Oe.Pop,navigator:o,static:s=!1}=e;Pl()&&te(!1);let l=t.replace(/^\/*/,"/"),a=L.useMemo(()=>({basename:l,navigator:o,static:s}),[l,o,s]);typeof r=="string"&&(r=sn(r));let{pathname:u="/",search:f="",hash:h="",state:d=null,key:g="default"}=r,y=L.useMemo(()=>{let S=zo(u,l);return S==null?null:{location:{pathname:S,search:f,hash:h,state:d,key:g},navigationType:i}},[l,u,f,h,d,g,i]);return y==null?null:L.createElement(Tl.Provider,{value:a},L.createElement(Rl.Provider,{children:n,value:y}))}var kd;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(kd||(kd={}));new Promise(()=>{});function G_(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:L.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:L.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + */function Xs(){return Xs=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.pathnameBase)),s=L.useRef(!1);return Dm(()=>{s.current=!0}),L.useCallback(function(a,u){if(u===void 0&&(u={}),!s.current)return;if(typeof a=="number"){n.go(a);return}let f=wm(a,JSON.parse(o),i,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Xn([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,i,e])}function L_(e,t,n){Pl()||te(!1);let{navigator:r}=L.useContext(Tl),{matches:i}=L.useContext(xi),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let a=Oc(),u;if(t){var f;let S=typeof t=="string"?sn(t):t;l==="/"||(f=S.pathname)!=null&&f.startsWith(l)||te(!1),u=S}else u=a;let h=u.pathname||"/",d=l==="/"?h:h.slice(l.length)||"/",g=Xr(e,{pathname:d}),y=z_(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Xn([l,r.encodeLocation?r.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?l:Xn([l,r.encodeLocation?r.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n);return t&&y?L.createElement(Rl.Provider,{value:{location:Xs({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Oe.Pop}},y):y}function U_(){let e=H_(),t=Em(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},t),n?L.createElement("pre",{style:i},n):null,o)}const F_=L.createElement(U_,null);class j_ extends L.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?L.createElement(xi.Provider,{value:this.props.routeContext},L.createElement(Om.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function b_(e){let{routeContext:t,match:n,children:r}=e,i=L.useContext(Cl);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),L.createElement(xi.Provider,{value:t},r)}function z_(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let o=e,s=(r=n)==null?void 0:r.errors;if(s!=null){let l=o.findIndex(a=>a.route.id&&(s==null?void 0:s[a.route.id]));l>=0||te(!1),o=o.slice(0,Math.min(o.length,l+1))}return o.reduceRight((l,a,u)=>{let f=a.route.id?s==null?void 0:s[a.route.id]:null,h=null;n&&(h=a.route.errorElement||F_);let d=t.concat(o.slice(0,u+1)),g=()=>{let y;return f?y=h:a.route.Component?y=L.createElement(a.route.Component,null):a.route.element?y=a.route.element:y=l,L.createElement(b_,{match:a,routeContext:{outlet:l,matches:d,isDataRoute:n!=null},children:y})};return n&&(a.route.ErrorBoundary||a.route.errorElement||u===0)?L.createElement(j_,{location:n.location,revalidation:n.revalidation,component:h,error:f,children:g(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):g()},null)}var wu;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(wu||(wu={}));var Do;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(Do||(Do={}));function B_(e){let t=L.useContext(Cl);return t||te(!1),t}function $_(e){let t=L.useContext(Pm);return t||te(!1),t}function q_(e){let t=L.useContext(xi);return t||te(!1),t}function Nm(e){let t=q_(),n=t.matches[t.matches.length-1];return n.route.id||te(!1),n.route.id}function H_(){var e;let t=L.useContext(Om),n=$_(Do.UseRouteError),r=Nm(Do.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function Q_(){let{router:e}=B_(wu.UseNavigateStable),t=Nm(Do.UseNavigateStable),n=L.useRef(!1);return Dm(()=>{n.current=!0}),L.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Xs({fromRouteId:t},o)))},[e,t])}const W_="startTransition",xd=Iv[W_];function V_(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=L.useState(n.state),{v7_startTransition:s}=r||{},l=L.useCallback(h=>{s&&xd?xd(()=>o(h)):o(h)},[o,s]);L.useLayoutEffect(()=>n.subscribe(l),[n,l]);let a=L.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:h=>n.navigate(h),push:(h,d,g)=>n.navigate(h,{state:d,preventScrollReset:g==null?void 0:g.preventScrollReset}),replace:(h,d,g)=>n.navigate(h,{replace:!0,state:d,preventScrollReset:g==null?void 0:g.preventScrollReset})}),[n]),u=n.basename||"/",f=L.useMemo(()=>({router:n,navigator:a,static:!1,basename:u}),[n,a,u]);return L.createElement(L.Fragment,null,L.createElement(Cl.Provider,{value:f},L.createElement(Pm.Provider,{value:i},L.createElement(G_,{basename:u,location:i.location,navigationType:i.historyAction,navigator:a},i.initialized?L.createElement(K_,{routes:n.routes,state:i}):t))),null)}function K_(e){let{routes:t,state:n}=e;return L_(t,void 0,n)}function G_(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Oe.Pop,navigator:o,static:s=!1}=e;Pl()&&te(!1);let l=t.replace(/^\/*/,"/"),a=L.useMemo(()=>({basename:l,navigator:o,static:s}),[l,o,s]);typeof r=="string"&&(r=sn(r));let{pathname:u="/",search:f="",hash:h="",state:d=null,key:g="default"}=r,y=L.useMemo(()=>{let S=zo(u,l);return S==null?null:{location:{pathname:S,search:f,hash:h,state:d,key:g},navigationType:i}},[l,u,f,h,d,g,i]);return y==null?null:L.createElement(Tl.Provider,{value:a},L.createElement(Rl.Provider,{children:n,value:y}))}var kd;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(kd||(kd={}));new Promise(()=>{});function Y_(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:L.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:L.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** * React Router DOM v6.14.1 * * Copyright (c) Remix Software Inc. @@ -69,7 +69,7 @@ Error generating stack: `+o.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const No=typeof window>"u"||"Deno"in window;function kt(){}function Z_(e,t){return typeof e=="function"?e(t):e}function Eu(e){return typeof e=="number"&&e>=0&&e!==1/0}function Am(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Yi(e,t,n){return Ol(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function Mn(e,t,n){return Ol(e)?[{...t,queryKey:e},n]:[e||{},t]}function Rd(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:l}=e;if(Ol(s)){if(r){if(t.queryHash!==Nc(s,t.options))return!1}else if(!Zs(t.queryKey,s))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Pd(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:o}=e;if(Ol(o)){if(!t.options.mutationKey)return!1;if(n){if(Sr(t.options.mutationKey)!==Sr(o))return!1}else if(!Zs(t.options.mutationKey,o))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function Nc(e,t){return((t==null?void 0:t.queryKeyHashFn)||Sr)(e)}function Sr(e){return JSON.stringify(e,(t,n)=>ku(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Zs(e,t){return Im(e,t)}function Im(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Im(e[n],t[n])):!1}function Mm(e,t){if(e===t)return e;const n=Od(e)&&Od(t);if(n||ku(e)&&ku(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,s=n?[]:{};let l=0;for(let a=0;a"u")return!0;const n=t.prototype;return!(!Dd(n)||!n.hasOwnProperty("isPrototypeOf"))}function Dd(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ol(e){return Array.isArray(e)}function Lm(e){return new Promise(t=>{setTimeout(t,e)})}function Nd(e){Lm(0).then(e)}function e0(){if(typeof AbortController=="function")return new AbortController}function Cu(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Mm(e,t):t}class t0 extends Bo{constructor(){super(),this.setup=t=>{if(!No&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const el=new t0,Ad=["online","offline"];class n0 extends Bo{constructor(){super(),this.setup=t=>{if(!No&&window.addEventListener){const n=()=>t();return Ad.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{Ad.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const tl=new n0;function r0(e){return Math.min(1e3*2**e,3e4)}function Dl(e){return(e??"online")==="online"?tl.isOnline():!0}class Um{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function Cs(e){return e instanceof Um}function Fm(e){let t=!1,n=0,r=!1,i,o,s;const l=new Promise((E,m)=>{o=E,s=m}),a=E=>{r||(g(new Um(E)),e.abort==null||e.abort())},u=()=>{t=!0},f=()=>{t=!1},h=()=>!el.isFocused()||e.networkMode!=="always"&&!tl.isOnline(),d=E=>{r||(r=!0,e.onSuccess==null||e.onSuccess(E),i==null||i(),o(E))},g=E=>{r||(r=!0,e.onError==null||e.onError(E),i==null||i(),s(E))},y=()=>new Promise(E=>{i=m=>{const p=r||!h();return p&&E(m),p},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),S=()=>{if(r)return;let E;try{E=e.fn()}catch(m){E=Promise.reject(m)}Promise.resolve(E).then(d).catch(m=>{var p,_;if(r)return;const v=(p=e.retry)!=null?p:3,R=(_=e.retryDelay)!=null?_:r0,D=typeof R=="function"?R(n,m):R,T=v===!0||typeof v=="number"&&n{if(h())return y()}).then(()=>{t?g(m):S()})})};return Dl(e.networkMode)?S():y().then(S),{promise:l,cancel:a,continue:()=>(i==null?void 0:i())?l:Promise.resolve(),cancelRetry:u,continueRetry:f}}const Ac=console;function i0(){let e=[],t=0,n=f=>{f()},r=f=>{f()};const i=f=>{let h;t++;try{h=f()}finally{t--,t||l()}return h},o=f=>{t?e.push(f):Nd(()=>{n(f)})},s=f=>(...h)=>{o(()=>{f(...h)})},l=()=>{const f=e;e=[],f.length&&Nd(()=>{r(()=>{f.forEach(h=>{n(h)})})})};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f}}}const De=i0();class jm{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Eu(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(No?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class o0 extends jm{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||Ac,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||s0(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=Cu(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(kt).catch(kt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Am(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(y=>y.options.queryFn);g&&this.setOptions(g.options)}Array.isArray(this.options.queryKey);const s=e0(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},a=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};a(l);const u=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),f={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:u};if(a(f),(r=this.options.behavior)==null||r.onFetch(f),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=f.fetchOptions)==null?void 0:i.meta)){var h;this.dispatch({type:"fetch",meta:(h=f.fetchOptions)==null?void 0:h.meta})}const d=g=>{if(Cs(g)&&g.silent||this.dispatch({type:"error",error:g}),!Cs(g)){var y,S,E,m;(y=(S=this.cache.config).onError)==null||y.call(S,g,this),(E=(m=this.cache.config).onSettled)==null||E.call(m,this.state.data,g,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Fm({fn:f.fetchFn,abort:s==null?void 0:s.abort.bind(s),onSuccess:g=>{var y,S,E,m;if(typeof g>"u"){d(new Error(this.queryHash+" data is undefined"));return}this.setData(g),(y=(S=this.cache.config).onSuccess)==null||y.call(S,g,this),(E=(m=this.cache.config).onSettled)==null||E.call(m,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(g,y)=>{this.dispatch({type:"failed",failureCount:g,error:y})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var i,o;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:Dl(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(o=t.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Cs(s)&&s.revert&&this.revertState?{...this.revertState}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),De.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function s0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class l0 extends Bo{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const o=n.queryKey,s=(i=n.queryHash)!=null?i:Nc(o,n);let l=this.get(s);return l||(l=new o0({cache:this,logger:t.getLogger(),queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(l)),l}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){De.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=Mn(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>Rd(r,i))}findAll(t,n){const[r]=Mn(t,n);return Object.keys(r).length>0?this.queries.filter(i=>Rd(r,i)):this.queries}notify(t){De.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}onFocus(){De.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){De.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class a0 extends jm{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||Ac,this.observers=[],this.state=t.state||u0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var T;return this.retryer=Fm({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(O,A)=>{this.dispatch({type:"failed",failureCount:O,error:A})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(T=this.options.retry)!=null?T:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,o,s,l,a,u,f;if(!n){var h,d,g,y;this.dispatch({type:"loading",variables:this.options.variables}),await((h=(d=this.mutationCache.config).onMutate)==null?void 0:h.call(d,this.state.variables,this));const O=await((g=(y=this.options).onMutate)==null?void 0:g.call(y,this.state.variables));O!==this.state.context&&this.dispatch({type:"loading",context:O,variables:this.state.variables})}const T=await t();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,T,this.state.variables,this.state.context,this)),await((o=(s=this.options).onSuccess)==null?void 0:o.call(s,T,this.state.variables,this.state.context)),await((l=(a=this.mutationCache.config).onSettled)==null?void 0:l.call(a,T,null,this.state.variables,this.state.context,this)),await((u=(f=this.options).onSettled)==null?void 0:u.call(f,T,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:T}),T}catch(T){try{var S,E,m,p,_,v,R,D;throw await((S=(E=this.mutationCache.config).onError)==null?void 0:S.call(E,T,this.state.variables,this.state.context,this)),await((m=(p=this.options).onError)==null?void 0:m.call(p,T,this.state.variables,this.state.context)),await((_=(v=this.mutationCache.config).onSettled)==null?void 0:_.call(v,void 0,T,this.state.variables,this.state.context,this)),await((R=(D=this.options).onSettled)==null?void 0:R.call(D,void 0,T,this.state.variables,this.state.context)),T}finally{this.dispatch({type:"error",error:T})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Dl(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),De.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function u0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class c0 extends Bo{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new a0({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){De.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>Pd(t,n))}findAll(t){return this.mutations.filter(n=>Pd(t,n))}notify(t){De.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return De.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(kt)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function f0(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,o,s;const l=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,a=(r=e.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,u=a==null?void 0:a.pageParam,f=(a==null?void 0:a.direction)==="forward",h=(a==null?void 0:a.direction)==="backward",d=((o=e.state.data)==null?void 0:o.pages)||[],g=((s=e.state.data)==null?void 0:s.pageParams)||[];let y=g,S=!1;const E=D=>{Object.defineProperty(D,"signal",{enumerable:!0,get:()=>{var T;if((T=e.signal)!=null&&T.aborted)S=!0;else{var O;(O=e.signal)==null||O.addEventListener("abort",()=>{S=!0})}return e.signal}})},m=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),p=(D,T,O,A)=>(y=A?[T,...y]:[...y,T],A?[O,...D]:[...D,O]),_=(D,T,O,A)=>{if(S)return Promise.reject("Cancelled");if(typeof O>"u"&&!T&&D.length)return Promise.resolve(D);const U={queryKey:e.queryKey,pageParam:O,meta:e.options.meta};E(U);const Z=m(U);return Promise.resolve(Z).then(qe=>p(D,O,qe,A))};let v;if(!d.length)v=_([]);else if(f){const D=typeof u<"u",T=D?u:Id(e.options,d);v=_(d,D,T)}else if(h){const D=typeof u<"u",T=D?u:d0(e.options,d);v=_(d,D,T,!0)}else{y=[];const D=typeof e.options.getNextPageParam>"u";v=(l&&d[0]?l(d[0],0,d):!0)?_([],D,g[0]):Promise.resolve(p([],g[0],d[0]));for(let O=1;O{if(l&&d[O]?l(d[O],O,d):!0){const Z=D?g[O]:Id(e.options,A);return _(A,D,Z)}return Promise.resolve(p(A,g[O],d[O]))})}return v.then(D=>({pages:D,pageParams:y}))}}}}function Id(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function d0(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class h0{constructor(t={}){this.queryCache=t.queryCache||new l0,this.mutationCache=t.mutationCache||new c0,this.logger=t.logger||Ac,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=el.subscribe(()=>{el.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=tl.subscribe(()=>{tl.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=Mn(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}ensureQueryData(t,n,r){const i=Yi(t,n,r),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.queryCache.find(t),o=i==null?void 0:i.state.data,s=Z_(n,o);if(typeof s>"u")return;const l=Yi(t),a=this.defaultQueryOptions(l);return this.queryCache.build(this,a).setData(s,{...r,manual:!0})}setQueriesData(t,n,r){return De.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=Mn(t,n),i=this.queryCache;De.batch(()=>{i.findAll(r).forEach(o=>{i.remove(o)})})}resetQueries(t,n,r){const[i,o]=Mn(t,n,r),s=this.queryCache,l={type:"active",...i};return De.batch(()=>(s.findAll(i).forEach(a=>{a.reset()}),this.refetchQueries(l,o)))}cancelQueries(t,n,r){const[i,o={}]=Mn(t,n,r);typeof o.revert>"u"&&(o.revert=!0);const s=De.batch(()=>this.queryCache.findAll(i).map(l=>l.cancel(o)));return Promise.all(s).then(kt).catch(kt)}invalidateQueries(t,n,r){const[i,o]=Mn(t,n,r);return De.batch(()=>{var s,l;if(this.queryCache.findAll(i).forEach(u=>{u.invalidate()}),i.refetchType==="none")return Promise.resolve();const a={...i,type:(s=(l=i.refetchType)!=null?l:i.type)!=null?s:"active"};return this.refetchQueries(a,o)})}refetchQueries(t,n,r){const[i,o]=Mn(t,n,r),s=De.batch(()=>this.queryCache.findAll(i).filter(a=>!a.isDisabled()).map(a=>{var u;return a.fetch(void 0,{...o,cancelRefetch:(u=o==null?void 0:o.cancelRefetch)!=null?u:!0,meta:{refetchPage:i.refetchPage}})}));let l=Promise.all(s).then(kt);return o!=null&&o.throwOnError||(l=l.catch(kt)),l}fetchQuery(t,n,r){const i=Yi(t,n,r),o=this.defaultQueryOptions(i);typeof o.retry>"u"&&(o.retry=!1);const s=this.queryCache.build(this,o);return s.isStaleByTime(o.staleTime)?s.fetch(o):Promise.resolve(s.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(kt).catch(kt)}fetchInfiniteQuery(t,n,r){const i=Yi(t,n,r);return i.behavior=f0(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(kt).catch(kt)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(i=>Sr(t)===Sr(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>Zs(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>Sr(t)===Sr(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>Zs(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=Nc(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class p0 extends Bo{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),Md(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Tu(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Tu(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),xu(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const o=this.hasListeners();o&&Ld(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const s=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t),r=this.createResult(n,t);return v0(this,r,t)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kt)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),No||this.currentResult.isStale||!Eu(this.options.staleTime))return;const n=Am(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(No||this.options.enabled===!1||!Eu(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||el.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,i=this.options,o=this.currentResult,s=this.currentResultState,l=this.currentResultOptions,a=t!==r,u=a?t.state:this.currentQueryInitialState,f=a?this.currentResult:this.previousQueryResult,{state:h}=t;let{dataUpdatedAt:d,error:g,errorUpdatedAt:y,fetchStatus:S,status:E}=h,m=!1,p=!1,_;if(n._optimisticResults){const O=this.hasListeners(),A=!O&&Md(t,n),U=O&&Ld(t,r,n,i);(A||U)&&(S=Dl(t.options.networkMode)?"fetching":"paused",d||(E="loading")),n._optimisticResults==="isRestoring"&&(S="idle")}if(n.keepPreviousData&&!h.dataUpdatedAt&&f!=null&&f.isSuccess&&E!=="error")_=f.data,d=f.dataUpdatedAt,E=f.status,m=!0;else if(n.select&&typeof h.data<"u")if(o&&h.data===(s==null?void 0:s.data)&&n.select===this.selectFn)_=this.selectResult;else try{this.selectFn=n.select,_=n.select(h.data),_=Cu(o==null?void 0:o.data,_,n),this.selectResult=_,this.selectError=null}catch(O){this.selectError=O}else _=h.data;if(typeof n.placeholderData<"u"&&typeof _>"u"&&E==="loading"){let O;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))O=o.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),this.selectError=null}catch(A){this.selectError=A}typeof O<"u"&&(E="success",_=Cu(o==null?void 0:o.data,O,n),p=!0)}this.selectError&&(g=this.selectError,_=this.selectResult,y=Date.now(),E="error");const v=S==="fetching",R=E==="loading",D=E==="error";return{status:E,fetchStatus:S,isLoading:R,isSuccess:E==="success",isError:D,isInitialLoading:R&&v,data:_,dataUpdatedAt:d,error:g,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!R,isLoadingError:D&&h.dataUpdatedAt===0,isPaused:S==="paused",isPlaceholderData:p,isPreviousData:m,isRefetchError:D&&h.dataUpdatedAt!==0,isStale:Ic(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,xu(r,n))return;this.currentResult=r;const i={cache:!0},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!this.trackedProps.size)return!0;const a=new Set(l??this.trackedProps);return this.options.useErrorBoundary&&a.add("error"),Object.keys(this.currentResult).some(u=>{const f=u;return this.currentResult[f]!==n[f]&&a.has(f)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!Cs(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){De.batch(()=>{if(t.onSuccess){var n,r,i,o;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(o=this.options).onSettled)==null||i.call(o,this.currentResult.data,null)}else if(t.onError){var s,l,a,u;(s=(l=this.options).onError)==null||s.call(l,this.currentResult.error),(a=(u=this.options).onSettled)==null||a.call(u,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:f})=>{f(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function m0(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Md(e,t){return m0(e,t)||e.state.dataUpdatedAt>0&&Tu(e,t,t.refetchOnMount)}function Tu(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ic(e,t)}return!1}function Ld(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Ic(e,n)}function Ic(e,t){return e.isStaleByTime(t.staleTime)}function v0(e,t,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?t.isPlaceholderData:!xu(e.getCurrentResult(),t)}var bm={exports:{}},zm={};/** + */function Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const No=typeof window>"u"||"Deno"in window;function kt(){}function e0(e,t){return typeof e=="function"?e(t):e}function Eu(e){return typeof e=="number"&&e>=0&&e!==1/0}function Am(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Yi(e,t,n){return Ol(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function Mn(e,t,n){return Ol(e)?[{...t,queryKey:e},n]:[e||{},t]}function Rd(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:l}=e;if(Ol(s)){if(r){if(t.queryHash!==Nc(s,t.options))return!1}else if(!Zs(t.queryKey,s))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Pd(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:o}=e;if(Ol(o)){if(!t.options.mutationKey)return!1;if(n){if(Sr(t.options.mutationKey)!==Sr(o))return!1}else if(!Zs(t.options.mutationKey,o))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function Nc(e,t){return((t==null?void 0:t.queryKeyHashFn)||Sr)(e)}function Sr(e){return JSON.stringify(e,(t,n)=>ku(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Zs(e,t){return Im(e,t)}function Im(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Im(e[n],t[n])):!1}function Mm(e,t){if(e===t)return e;const n=Od(e)&&Od(t);if(n||ku(e)&&ku(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,s=n?[]:{};let l=0;for(let a=0;a"u")return!0;const n=t.prototype;return!(!Dd(n)||!n.hasOwnProperty("isPrototypeOf"))}function Dd(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ol(e){return Array.isArray(e)}function Lm(e){return new Promise(t=>{setTimeout(t,e)})}function Nd(e){Lm(0).then(e)}function t0(){if(typeof AbortController=="function")return new AbortController}function Cu(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Mm(e,t):t}class n0 extends Bo{constructor(){super(),this.setup=t=>{if(!No&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused!==t&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const el=new n0,Ad=["online","offline"];class r0 extends Bo{constructor(){super(),this.setup=t=>{if(!No&&window.addEventListener){const n=()=>t();return Ad.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{Ad.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online!==t&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const tl=new r0;function i0(e){return Math.min(1e3*2**e,3e4)}function Dl(e){return(e??"online")==="online"?tl.isOnline():!0}class Um{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function Cs(e){return e instanceof Um}function Fm(e){let t=!1,n=0,r=!1,i,o,s;const l=new Promise((E,m)=>{o=E,s=m}),a=E=>{r||(g(new Um(E)),e.abort==null||e.abort())},u=()=>{t=!0},f=()=>{t=!1},h=()=>!el.isFocused()||e.networkMode!=="always"&&!tl.isOnline(),d=E=>{r||(r=!0,e.onSuccess==null||e.onSuccess(E),i==null||i(),o(E))},g=E=>{r||(r=!0,e.onError==null||e.onError(E),i==null||i(),s(E))},y=()=>new Promise(E=>{i=m=>{const p=r||!h();return p&&E(m),p},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),S=()=>{if(r)return;let E;try{E=e.fn()}catch(m){E=Promise.reject(m)}Promise.resolve(E).then(d).catch(m=>{var p,_;if(r)return;const v=(p=e.retry)!=null?p:3,R=(_=e.retryDelay)!=null?_:i0,D=typeof R=="function"?R(n,m):R,T=v===!0||typeof v=="number"&&n{if(h())return y()}).then(()=>{t?g(m):S()})})};return Dl(e.networkMode)?S():y().then(S),{promise:l,cancel:a,continue:()=>(i==null?void 0:i())?l:Promise.resolve(),cancelRetry:u,continueRetry:f}}const Ac=console;function o0(){let e=[],t=0,n=f=>{f()},r=f=>{f()};const i=f=>{let h;t++;try{h=f()}finally{t--,t||l()}return h},o=f=>{t?e.push(f):Nd(()=>{n(f)})},s=f=>(...h)=>{o(()=>{f(...h)})},l=()=>{const f=e;e=[],f.length&&Nd(()=>{r(()=>{f.forEach(h=>{n(h)})})})};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f}}}const De=o0();class jm{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Eu(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(No?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class s0 extends jm{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||Ac,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||l0(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=Cu(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(kt).catch(kt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Am(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(y=>y.options.queryFn);g&&this.setOptions(g.options)}Array.isArray(this.options.queryKey);const s=t0(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},a=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};a(l);const u=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),f={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:u};if(a(f),(r=this.options.behavior)==null||r.onFetch(f),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=f.fetchOptions)==null?void 0:i.meta)){var h;this.dispatch({type:"fetch",meta:(h=f.fetchOptions)==null?void 0:h.meta})}const d=g=>{if(Cs(g)&&g.silent||this.dispatch({type:"error",error:g}),!Cs(g)){var y,S,E,m;(y=(S=this.cache.config).onError)==null||y.call(S,g,this),(E=(m=this.cache.config).onSettled)==null||E.call(m,this.state.data,g,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Fm({fn:f.fetchFn,abort:s==null?void 0:s.abort.bind(s),onSuccess:g=>{var y,S,E,m;if(typeof g>"u"){d(new Error(this.queryHash+" data is undefined"));return}this.setData(g),(y=(S=this.cache.config).onSuccess)==null||y.call(S,g,this),(E=(m=this.cache.config).onSettled)==null||E.call(m,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(g,y)=>{this.dispatch({type:"failed",failureCount:g,error:y})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var i,o;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:Dl(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(o=t.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Cs(s)&&s.revert&&this.revertState?{...this.revertState}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),De.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function l0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class a0 extends Bo{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const o=n.queryKey,s=(i=n.queryHash)!=null?i:Nc(o,n);let l=this.get(s);return l||(l=new s0({cache:this,logger:t.getLogger(),queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(l)),l}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){De.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=Mn(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>Rd(r,i))}findAll(t,n){const[r]=Mn(t,n);return Object.keys(r).length>0?this.queries.filter(i=>Rd(r,i)):this.queries}notify(t){De.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}onFocus(){De.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){De.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class u0 extends jm{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||Ac,this.observers=[],this.state=t.state||c0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var T;return this.retryer=Fm({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(O,A)=>{this.dispatch({type:"failed",failureCount:O,error:A})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(T=this.options.retry)!=null?T:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,o,s,l,a,u,f;if(!n){var h,d,g,y;this.dispatch({type:"loading",variables:this.options.variables}),await((h=(d=this.mutationCache.config).onMutate)==null?void 0:h.call(d,this.state.variables,this));const O=await((g=(y=this.options).onMutate)==null?void 0:g.call(y,this.state.variables));O!==this.state.context&&this.dispatch({type:"loading",context:O,variables:this.state.variables})}const T=await t();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,T,this.state.variables,this.state.context,this)),await((o=(s=this.options).onSuccess)==null?void 0:o.call(s,T,this.state.variables,this.state.context)),await((l=(a=this.mutationCache.config).onSettled)==null?void 0:l.call(a,T,null,this.state.variables,this.state.context,this)),await((u=(f=this.options).onSettled)==null?void 0:u.call(f,T,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:T}),T}catch(T){try{var S,E,m,p,_,v,R,D;throw await((S=(E=this.mutationCache.config).onError)==null?void 0:S.call(E,T,this.state.variables,this.state.context,this)),await((m=(p=this.options).onError)==null?void 0:m.call(p,T,this.state.variables,this.state.context)),await((_=(v=this.mutationCache.config).onSettled)==null?void 0:_.call(v,void 0,T,this.state.variables,this.state.context,this)),await((R=(D=this.options).onSettled)==null?void 0:R.call(D,void 0,T,this.state.variables,this.state.context)),T}finally{this.dispatch({type:"error",error:T})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Dl(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),De.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function c0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class f0 extends Bo{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new u0({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){De.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>Pd(t,n))}findAll(t){return this.mutations.filter(n=>Pd(t,n))}notify(t){De.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return De.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(kt)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function d0(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,o,s;const l=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,a=(r=e.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,u=a==null?void 0:a.pageParam,f=(a==null?void 0:a.direction)==="forward",h=(a==null?void 0:a.direction)==="backward",d=((o=e.state.data)==null?void 0:o.pages)||[],g=((s=e.state.data)==null?void 0:s.pageParams)||[];let y=g,S=!1;const E=D=>{Object.defineProperty(D,"signal",{enumerable:!0,get:()=>{var T;if((T=e.signal)!=null&&T.aborted)S=!0;else{var O;(O=e.signal)==null||O.addEventListener("abort",()=>{S=!0})}return e.signal}})},m=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),p=(D,T,O,A)=>(y=A?[T,...y]:[...y,T],A?[O,...D]:[...D,O]),_=(D,T,O,A)=>{if(S)return Promise.reject("Cancelled");if(typeof O>"u"&&!T&&D.length)return Promise.resolve(D);const U={queryKey:e.queryKey,pageParam:O,meta:e.options.meta};E(U);const Z=m(U);return Promise.resolve(Z).then(qe=>p(D,O,qe,A))};let v;if(!d.length)v=_([]);else if(f){const D=typeof u<"u",T=D?u:Id(e.options,d);v=_(d,D,T)}else if(h){const D=typeof u<"u",T=D?u:h0(e.options,d);v=_(d,D,T,!0)}else{y=[];const D=typeof e.options.getNextPageParam>"u";v=(l&&d[0]?l(d[0],0,d):!0)?_([],D,g[0]):Promise.resolve(p([],g[0],d[0]));for(let O=1;O{if(l&&d[O]?l(d[O],O,d):!0){const Z=D?g[O]:Id(e.options,A);return _(A,D,Z)}return Promise.resolve(p(A,g[O],d[O]))})}return v.then(D=>({pages:D,pageParams:y}))}}}}function Id(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function h0(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class p0{constructor(t={}){this.queryCache=t.queryCache||new a0,this.mutationCache=t.mutationCache||new f0,this.logger=t.logger||Ac,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=el.subscribe(()=>{el.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=tl.subscribe(()=>{tl.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=Mn(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}ensureQueryData(t,n,r){const i=Yi(t,n,r),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.queryCache.find(t),o=i==null?void 0:i.state.data,s=e0(n,o);if(typeof s>"u")return;const l=Yi(t),a=this.defaultQueryOptions(l);return this.queryCache.build(this,a).setData(s,{...r,manual:!0})}setQueriesData(t,n,r){return De.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=Mn(t,n),i=this.queryCache;De.batch(()=>{i.findAll(r).forEach(o=>{i.remove(o)})})}resetQueries(t,n,r){const[i,o]=Mn(t,n,r),s=this.queryCache,l={type:"active",...i};return De.batch(()=>(s.findAll(i).forEach(a=>{a.reset()}),this.refetchQueries(l,o)))}cancelQueries(t,n,r){const[i,o={}]=Mn(t,n,r);typeof o.revert>"u"&&(o.revert=!0);const s=De.batch(()=>this.queryCache.findAll(i).map(l=>l.cancel(o)));return Promise.all(s).then(kt).catch(kt)}invalidateQueries(t,n,r){const[i,o]=Mn(t,n,r);return De.batch(()=>{var s,l;if(this.queryCache.findAll(i).forEach(u=>{u.invalidate()}),i.refetchType==="none")return Promise.resolve();const a={...i,type:(s=(l=i.refetchType)!=null?l:i.type)!=null?s:"active"};return this.refetchQueries(a,o)})}refetchQueries(t,n,r){const[i,o]=Mn(t,n,r),s=De.batch(()=>this.queryCache.findAll(i).filter(a=>!a.isDisabled()).map(a=>{var u;return a.fetch(void 0,{...o,cancelRefetch:(u=o==null?void 0:o.cancelRefetch)!=null?u:!0,meta:{refetchPage:i.refetchPage}})}));let l=Promise.all(s).then(kt);return o!=null&&o.throwOnError||(l=l.catch(kt)),l}fetchQuery(t,n,r){const i=Yi(t,n,r),o=this.defaultQueryOptions(i);typeof o.retry>"u"&&(o.retry=!1);const s=this.queryCache.build(this,o);return s.isStaleByTime(o.staleTime)?s.fetch(o):Promise.resolve(s.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(kt).catch(kt)}fetchInfiniteQuery(t,n,r){const i=Yi(t,n,r);return i.behavior=d0(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(kt).catch(kt)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(i=>Sr(t)===Sr(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>Zs(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>Sr(t)===Sr(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>Zs(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=Nc(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class m0 extends Bo{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),Md(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Tu(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Tu(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),xu(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const o=this.hasListeners();o&&Ld(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const s=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t),r=this.createResult(n,t);return g0(this,r,t)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kt)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),No||this.currentResult.isStale||!Eu(this.options.staleTime))return;const n=Am(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(No||this.options.enabled===!1||!Eu(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||el.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,i=this.options,o=this.currentResult,s=this.currentResultState,l=this.currentResultOptions,a=t!==r,u=a?t.state:this.currentQueryInitialState,f=a?this.currentResult:this.previousQueryResult,{state:h}=t;let{dataUpdatedAt:d,error:g,errorUpdatedAt:y,fetchStatus:S,status:E}=h,m=!1,p=!1,_;if(n._optimisticResults){const O=this.hasListeners(),A=!O&&Md(t,n),U=O&&Ld(t,r,n,i);(A||U)&&(S=Dl(t.options.networkMode)?"fetching":"paused",d||(E="loading")),n._optimisticResults==="isRestoring"&&(S="idle")}if(n.keepPreviousData&&!h.dataUpdatedAt&&f!=null&&f.isSuccess&&E!=="error")_=f.data,d=f.dataUpdatedAt,E=f.status,m=!0;else if(n.select&&typeof h.data<"u")if(o&&h.data===(s==null?void 0:s.data)&&n.select===this.selectFn)_=this.selectResult;else try{this.selectFn=n.select,_=n.select(h.data),_=Cu(o==null?void 0:o.data,_,n),this.selectResult=_,this.selectError=null}catch(O){this.selectError=O}else _=h.data;if(typeof n.placeholderData<"u"&&typeof _>"u"&&E==="loading"){let O;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))O=o.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),this.selectError=null}catch(A){this.selectError=A}typeof O<"u"&&(E="success",_=Cu(o==null?void 0:o.data,O,n),p=!0)}this.selectError&&(g=this.selectError,_=this.selectResult,y=Date.now(),E="error");const v=S==="fetching",R=E==="loading",D=E==="error";return{status:E,fetchStatus:S,isLoading:R,isSuccess:E==="success",isError:D,isInitialLoading:R&&v,data:_,dataUpdatedAt:d,error:g,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!R,isLoadingError:D&&h.dataUpdatedAt===0,isPaused:S==="paused",isPlaceholderData:p,isPreviousData:m,isRefetchError:D&&h.dataUpdatedAt!==0,isStale:Ic(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,xu(r,n))return;this.currentResult=r;const i={cache:!0},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!this.trackedProps.size)return!0;const a=new Set(l??this.trackedProps);return this.options.useErrorBoundary&&a.add("error"),Object.keys(this.currentResult).some(u=>{const f=u;return this.currentResult[f]!==n[f]&&a.has(f)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!Cs(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){De.batch(()=>{if(t.onSuccess){var n,r,i,o;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(o=this.options).onSettled)==null||i.call(o,this.currentResult.data,null)}else if(t.onError){var s,l,a,u;(s=(l=this.options).onError)==null||s.call(l,this.currentResult.error),(a=(u=this.options).onSettled)==null||a.call(u,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:f})=>{f(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function v0(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Md(e,t){return v0(e,t)||e.state.dataUpdatedAt>0&&Tu(e,t,t.refetchOnMount)}function Tu(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ic(e,t)}return!1}function Ld(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Ic(e,n)}function Ic(e,t){return e.isStaleByTime(t.staleTime)}function g0(e,t,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?t.isPlaceholderData:!xu(e.getCurrentResult(),t)}var bm={exports:{}},zm={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -77,7 +77,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var gi=L;function g0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var y0=typeof Object.is=="function"?Object.is:g0,_0=gi.useState,S0=gi.useEffect,w0=gi.useLayoutEffect,E0=gi.useDebugValue;function x0(e,t){var n=t(),r=_0({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return w0(function(){i.value=n,i.getSnapshot=t,pa(i)&&o({inst:i})},[e,n,t]),S0(function(){return pa(i)&&o({inst:i}),e(function(){pa(i)&&o({inst:i})})},[e]),E0(n),n}function pa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!y0(e,n)}catch{return!0}}function k0(e,t){return t()}var C0=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?k0:x0;zm.useSyncExternalStore=gi.useSyncExternalStore!==void 0?gi.useSyncExternalStore:C0;bm.exports=zm;var Bm=bm.exports;const T0=Bm.useSyncExternalStore,Ud=L.createContext(void 0),$m=L.createContext(!1);function qm(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=Ud),window.ReactQueryClientContext):Ud)}const R0=({context:e}={})=>{const t=L.useContext(qm(e,L.useContext($m)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},P0=({client:e,children:t,context:n,contextSharing:r=!1})=>{L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=qm(n,r);return L.createElement($m.Provider,{value:!n&&r},L.createElement(i.Provider,{value:e},t))},Hm=L.createContext(!1),O0=()=>L.useContext(Hm);Hm.Provider;function D0(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const N0=L.createContext(D0()),A0=()=>L.useContext(N0);function I0(e,t){return typeof e=="function"?e(...t):!!e}const M0=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},L0=e=>{L.useEffect(()=>{e.clearReset()},[e])},U0=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&I0(n,[e.error,r]),F0=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},j0=(e,t)=>e.isLoading&&e.isFetching&&!t,b0=(e,t,n)=>(e==null?void 0:e.suspense)&&j0(t,n),z0=(e,t,n)=>t.fetchOptimistic(e).then(({data:r})=>{e.onSuccess==null||e.onSuccess(r),e.onSettled==null||e.onSettled(r,null)}).catch(r=>{n.clearReset(),e.onError==null||e.onError(r),e.onSettled==null||e.onSettled(void 0,r)});function B0(e,t){const n=R0({context:e.context}),r=O0(),i=A0(),o=n.defaultQueryOptions(e);o._optimisticResults=r?"isRestoring":"optimistic",o.onError&&(o.onError=De.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=De.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=De.batchCalls(o.onSettled)),F0(o),M0(o,i),L0(i);const[s]=L.useState(()=>new t(n,o)),l=s.getOptimisticResult(o);if(T0(L.useCallback(a=>{const u=r?()=>{}:s.subscribe(De.batchCalls(a));return s.updateResult(),u},[s,r]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),L.useEffect(()=>{s.setOptions(o,{listeners:!1})},[o,s]),b0(o,l,r))throw z0(o,s,i);if(U0({result:l,errorResetBoundary:i,useErrorBoundary:o.useErrorBoundary,query:s.getCurrentQuery()}))throw l.error;return o.notifyOnChangeProps?l:s.trackResult(l)}function Qm(e,t,n){const r=Yi(e,t,n);return B0(r,p0)}const Fd=e=>{let t;const n=new Set,r=(a,u)=>{const f=typeof a=="function"?a(t):a;if(!Object.is(f,t)){const h=t;t=u??typeof f!="object"?f:Object.assign({},t,f),n.forEach(d=>d(t,h))}},i=()=>t,l={setState:r,getState:i,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{n.clear()}};return t=e(r,i,l),l},$0=e=>e?Fd(e):Fd;var Wm={exports:{}},Vm={};/** + */var gi=L;function y0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _0=typeof Object.is=="function"?Object.is:y0,S0=gi.useState,w0=gi.useEffect,E0=gi.useLayoutEffect,x0=gi.useDebugValue;function k0(e,t){var n=t(),r=S0({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return E0(function(){i.value=n,i.getSnapshot=t,pa(i)&&o({inst:i})},[e,n,t]),w0(function(){return pa(i)&&o({inst:i}),e(function(){pa(i)&&o({inst:i})})},[e]),x0(n),n}function pa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_0(e,n)}catch{return!0}}function C0(e,t){return t()}var T0=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?C0:k0;zm.useSyncExternalStore=gi.useSyncExternalStore!==void 0?gi.useSyncExternalStore:T0;bm.exports=zm;var Bm=bm.exports;const R0=Bm.useSyncExternalStore,Ud=L.createContext(void 0),$m=L.createContext(!1);function qm(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=Ud),window.ReactQueryClientContext):Ud)}const P0=({context:e}={})=>{const t=L.useContext(qm(e,L.useContext($m)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},O0=({client:e,children:t,context:n,contextSharing:r=!1})=>{L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=qm(n,r);return L.createElement($m.Provider,{value:!n&&r},L.createElement(i.Provider,{value:e},t))},Hm=L.createContext(!1),D0=()=>L.useContext(Hm);Hm.Provider;function N0(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const A0=L.createContext(N0()),I0=()=>L.useContext(A0);function M0(e,t){return typeof e=="function"?e(...t):!!e}const L0=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},U0=e=>{L.useEffect(()=>{e.clearReset()},[e])},F0=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&M0(n,[e.error,r]),j0=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},b0=(e,t)=>e.isLoading&&e.isFetching&&!t,z0=(e,t,n)=>(e==null?void 0:e.suspense)&&b0(t,n),B0=(e,t,n)=>t.fetchOptimistic(e).then(({data:r})=>{e.onSuccess==null||e.onSuccess(r),e.onSettled==null||e.onSettled(r,null)}).catch(r=>{n.clearReset(),e.onError==null||e.onError(r),e.onSettled==null||e.onSettled(void 0,r)});function $0(e,t){const n=P0({context:e.context}),r=D0(),i=I0(),o=n.defaultQueryOptions(e);o._optimisticResults=r?"isRestoring":"optimistic",o.onError&&(o.onError=De.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=De.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=De.batchCalls(o.onSettled)),j0(o),L0(o,i),U0(i);const[s]=L.useState(()=>new t(n,o)),l=s.getOptimisticResult(o);if(R0(L.useCallback(a=>{const u=r?()=>{}:s.subscribe(De.batchCalls(a));return s.updateResult(),u},[s,r]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),L.useEffect(()=>{s.setOptions(o,{listeners:!1})},[o,s]),z0(o,l,r))throw B0(o,s,i);if(F0({result:l,errorResetBoundary:i,useErrorBoundary:o.useErrorBoundary,query:s.getCurrentQuery()}))throw l.error;return o.notifyOnChangeProps?l:s.trackResult(l)}function Qm(e,t,n){const r=Yi(e,t,n);return $0(r,m0)}const Fd=e=>{let t;const n=new Set,r=(a,u)=>{const f=typeof a=="function"?a(t):a;if(!Object.is(f,t)){const h=t;t=u??typeof f!="object"?f:Object.assign({},t,f),n.forEach(d=>d(t,h))}},i=()=>t,l={setState:r,getState:i,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{n.clear()}};return t=e(r,i,l),l},q0=e=>e?Fd(e):Fd;var Wm={exports:{}},Vm={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -85,11 +85,11 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Nl=L,q0=Bm;function H0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Q0=typeof Object.is=="function"?Object.is:H0,W0=q0.useSyncExternalStore,V0=Nl.useRef,K0=Nl.useEffect,G0=Nl.useMemo,Y0=Nl.useDebugValue;Vm.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=V0(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=G0(function(){function a(g){if(!u){if(u=!0,f=g,g=r(g),i!==void 0&&s.hasValue){var y=s.value;if(i(y,g))return h=y}return h=g}if(y=h,Q0(f,g))return y;var S=r(g);return i!==void 0&&i(y,S)?y:(f=g,h=S)}var u=!1,f,h,d=n===void 0?null:n;return[function(){return a(t())},d===null?void 0:function(){return a(d())}]},[t,n,r,i]);var l=W0(e,o[0],o[1]);return K0(function(){s.hasValue=!0,s.value=l},[l]),Y0(l),l};Wm.exports=Vm;var X0=Wm.exports;const J0=al(X0),{useSyncExternalStoreWithSelector:Z0}=J0;function e1(e,t=e.getState,n){const r=Z0(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return L.useDebugValue(r),r}const jd=e=>{const t=typeof e=="function"?$0(e):e,n=(r,i)=>e1(t,r,i);return Object.assign(n,t),n},t1=e=>e?jd(e):jd,bn=4,Zr=2,Ru=[{id:"RUB",title:"Рубль",symbol:"₽",in:"В рублях",decimals:bn,visible_decimals:Zr},{id:"GEL",title:"Лари",symbol:"₾",in:"В лари",decimals:bn,visible_decimals:Zr},{id:"TRY",title:"Лира",symbol:"₺",in:"В лирах",decimals:bn,visible_decimals:Zr},{id:"EUR",title:"Евро",symbol:"€",in:"В евро",decimals:bn,visible_decimals:Zr}],n1=e=>{const t={Ё:"YO",Й:"I",Ц:"TS",У:"U",К:"K",Е:"E",Н:"N",Г:"G",Ш:"SH",Щ:"SCH",З:"Z",Х:"H",Ъ:"",ё:"yo",й:"i",ц:"ts",у:"u",к:"k",е:"e",н:"n",г:"g",ш:"sh",щ:"sch",з:"z",х:"h",ъ:"",Ф:"F",Ы:"I",В:"V",А:"A",П:"P",Р:"R",О:"O",Л:"L",Д:"D",Ж:"ZH",Э:"E",ф:"f",ы:"i",в:"v",а:"a",п:"p",р:"r",о:"o",л:"l",д:"d",ж:"zh",э:"e",Я:"Ya",Ч:"CH",С:"S",М:"M",И:"I",Т:"T",Ь:"",Б:"B",Ю:"YU",я:"ya",ч:"ch",с:"s",м:"m",и:"i",т:"t",ь:"",б:"b",ю:"yu"};return e.split("").map(n=>t[n]||"").join("")},r1=e=>({_id:Math.round(Math.random()*1e10),first_name:e,last_name:e,username:Math.random()>.2?n1(e):void 0,profile_photo:`https://i.pravatar.cc/48/${Math.round(Math.random()*1e10)}`,_name:e}),i1=()=>{const e=["Александр","Дмитрий","Максим","Сергей","Андрей","Алексей","Артём","Илья","Кирилл","Михаил","Никита","Матвей","Роман","Егор","Арсений","Иван","Денис","Евгений","Тимофей","Владислав","Игорь","Владимир","Павел","Руслан","Марк","Константин","Тимур","Олег","Ярослав","Антон","Николай","Данил","Анастасия","Мария","Анна","Виктория","Екатерина","Наталья","Марина","Полина","София","Дарья","Алиса","Ксения","Александра","Елена"];return e[Math.floor(Math.random()*e.length)]},o1=e=>{const t=[];do{const n=i1();t.includes(n)||t.push(n)}while(t.length!==e);return t},s1=o1(6),Km=s1.map(e=>r1(e)),lo=Km.slice(0,4).map((e,t)=>({person_id:`Person${t}`,normalized_name:e._name,related_user_id:Math.random()>.3?e._id:null,is_payer:t==0,amount:Math.round(Math.random()*100)*10**bn}));lo.splice(1,0,{...lo[0],amount:lo[0].amount/3,is_payer:!1});const l1={_id:"1",chat_id:null,is_voice:!0,raw_text:lo.map(e=>`${e.normalized_name} ${e.is_payer?"заплатил":"должен"} ${(e.amount/10**bn).toFixed(0)}`).join(", "),shares:lo,is_confirmed:!1,currency_id:Ru[0].id},Vt=t1((e,t)=>({txId:void 0,setTxId:n=>e({txId:n}),users:[],setUsers:n=>e({users:n}),selectPersonId:null,setSelectPersonId:n=>e({selectPersonId:n}),currencies:Ru,currency:Ru[0],setCurrency:n=>{t().transaction!==void 0&&e({transaction:{...t().transaction,currency_id:n}})},transaction:void 0,setTransaction:n=>e({transaction:n}),isSuccess:null,setSuccess:n=>e({isSuccess:n})})),Al=()=>{const{txId:e,setTxId:t}=Vt(),n=Oc();if(e===void 0){const i=new URLSearchParams(n.search).get("txid");t(i||null)}},Gm=()=>{const e=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,[t,n]=L.useState(e()),r=()=>{n(e())};return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),{isDarkTheme:t}},Il=()=>{const{users:e,transaction:t,setTransaction:n,selectPersonId:r}=Vt(),i=(t==null?void 0:t.shares)||[],o=i.map(h=>h.related_user_id),s=e.filter(h=>!o.includes(h._id)),l=i.every(h=>h.related_user_id);return{users:e,unrelatedUsers:s,isRelationsComplete:l,getUserById:h=>e.find(d=>d._id===h),selectUser:h=>()=>{if(r!==null){const d=[...i],g=d.findIndex(y=>y.related_user_id===h._id);for(let y=0;y()=>{const d=[...i].filter(g=>g.person_id!==h);t&&n({...t,shares:d}),history.back()}}},Ym=({size:e})=>x.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 w-[50px] h-[50px]",style:{width:e,height:e},children:x.jsx("div",{className:"w-full h-full rounded-full border-[3px] border-button border-l-button/10 border-t-button/10 animate-[spin_0.6s_linear_infinite]"})});function ao({children:e,theme:t="default",disabled:n,isBusy:r,onClick:i}){const o={default:"mx-auto w-full max-w-[500px] md:max-w-[300px] block h-10 bg-button text-buttonText rounded-md text-[14px] leading-[20px] font-semibold enabled:hover:brightness-110 enabled:active:brightness-[1.2] disabled:opacity-40 transition-all",text:"h-6 text-[14px] leading-[24px] text-button hover:brightness-[1.2] active:brightness-[1.4] transition-all"}[t];return x.jsxs("div",{className:"relative",children:[x.jsx("button",{className:o,disabled:n||r,onClick:i,children:e}),r&&x.jsx(Ym,{size:30})]})}const a1=({onClick:e})=>{var t,n,r;const i=typeof window<"u"?(t=window)==null||(n=t.Telegram)==null||(r=n.WebApp)==null?void 0:r.BackButton:null;return i&&(L.useEffect(()=>(i.show(),()=>{i.hide()}),[]),L.useEffect(()=>{if(e)return i.onClick(e),()=>{i.offClick(e)}},[e])),null},u1=e=>L.createElement("svg",{width:12,height:20,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.53714 19.5928L0.292152 10.6788C-0.097384 10.3036 -0.097384 9.69738 0.292152 9.32117L9.53714 0.407154C10.0995 -0.135718 11.0144 -0.135718 11.5777 0.407154C12.14 0.950026 12.14 1.8311 11.5777 2.37397L3.66913 10.0005L11.5777 17.6251C12.14 18.1689 12.14 19.05 11.5777 19.5928C11.0144 20.1357 10.0995 20.1357 9.53714 19.5928Z",fill:"currentColor"}));function Ml({onBack:e,onCancel:t}){var n,r;return((r=(n=window==null?void 0:window.Telegram)==null?void 0:n.WebApp)==null?void 0:r.platform)!=="unknown"?x.jsx("div",{className:"h-3",children:x.jsx(a1,{onClick:e})}):x.jsxs("header",{className:"relative flex items-center justify-center h-[64px]",children:[t&&x.jsx("button",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-link hover:brightness-[1.2] active:brightness-[1.4] transition-all",onClick:t,children:"Отмена"}),e&&x.jsxs("button",{className:"flex items-center gap-[5px] absolute left-4 top-1/2 -translate-y-1/2 text-link hover:brightness-[1.2] active:brightness-[1.4] transition-all",onClick:e,children:[x.jsx(u1,{}),x.jsx("span",{children:"Назад"})]}),x.jsxs("div",{className:"flex flex-col items-center justify-center gap-0.5",children:[x.jsx("div",{className:"text-[17px] leading-[22px] font-semibold",children:"Split"}),x.jsx("div",{className:"text-hint text-[13px] leading-[18px] font-semibold opacity-70",children:"бот"})]})]})}const c1=e=>{const t=e?e.split(" "):[];return`${t[0]?t[0][0]:""}${t[1]?t[1][0]:""}`},f1=e=>{};function d1({url:e,fullName:t,size:n=40}){const r=f1(t),{isDarkTheme:i}=Gm(),s=!e&&t?r+"22":i?"#9AA6AC":"#EEF0F2",l=!e&&t?c1(t):null;return x.jsx("div",{className:"flex items-center justify-center rounded-full bg-cover bg-center",style:{width:n,height:n,backgroundColor:s,backgroundImage:`url(${e})`},children:l&&x.jsx("div",{className:"uppercase font-semibold text-main",style:{fontSize:.35*n+"px",lineHeight:.6*n+"px",color:r},children:l})})}function Mc({user:e,size:t=40}){const n=[...e!=null&&e.first_name?[e.first_name]:[],...e!=null&&e.last_name?[e.last_name]:[]].join(" ");return x.jsxs("div",{className:"w-full flex gap-2 items-center truncate",children:[x.jsx(d1,{url:e==null?void 0:e.profile_photo,size:t,fullName:n}),x.jsx("div",{className:"flex flex-col -gap-0.5 flex-1 text-left truncate text-[16px] leading-[20px]",children:e?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"truncate",children:[e.first_name," ",e.last_name]}),e.username&&x.jsxs("div",{className:"text-[14px] leading-[18px] text-hint truncate",children:["@",e.username]})]}):x.jsx("div",{className:"text-hint truncate",children:"(выберите)"})})]})}const uo=e=>(e/10**bn).toFixed(Zr),bd=e=>parseFloat(e)*10**bn||0,h1=(e,t)=>{const n=Zr,r=10,i=/[^0-9.]/,o=t.replace(/,/g,".").replace(i,"");if(!/^\d*.?\d*$/.test(o)||o.length>r)return e;const[l,a]=e.split("."),[u,f]=o.split(".");return l==="0"&&u==="00"||a==="0".repeat(n-1)&&f==="0".repeat(n)||f&&f.length>n?e:e===""&&o==="."?"0.":e==="0."&&o==="0"?"":e!=="0."&&o==="0"?"0.":o};function p1({amount:e,onChange:t}){const[n,r]=L.useState(uo(e));L.useEffect(()=>{const s=bd(n);e!==s&&r(uo(e))},[e,n]);const i=s=>{const l=s.target.value,a=h1(n,l);r(a);const u=bd(a);t(u)},o=()=>{r(uo(e))};return x.jsx("input",{type:"text",className:"w-[117px] h-10 p-2 rounded-md border border-[#DDE2E4] dark:border-[#6E7C87] dark:bg-[#D5DADD] text-right text-[16px] text-text dark:text-[#48535B] leading-[24px] focus:ring-2 focus:ring-button focus:outline-none appearance-none transition-all selection:bg-button selection:text-buttonText",inputMode:"decimal",placeholder:"0",value:n,onFocus:s=>{s.target.select()},onBlur:o,onChange:i})}function zd({related_user_id:e,amount:t,onChange:n}){const{getUserById:r}=Il(),i=e?r(e):void 0;return i?x.jsxs("div",{className:"flex gap-3",children:[x.jsx(Mc,{user:i,size:48}),x.jsx(p1,{amount:t,onChange:n})]}):null}function ai({children:e,className:t}){return x.jsx("div",{className:Yn("panel p-4 pb-6 rounded-3xl bg-bg",t),children:e})}function m1(){var r;const{transaction:e,users:t,txId:n}=Vt();return x.jsxs(ai,{className:"mt-10 text-[12px] break-words opacity-40 overflow-x-auto",children:[x.jsx("h2",{children:"Debug"}),x.jsx("strong",{children:"href = "}),location.href,x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"txid = "}),String(n),x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"transaction = "}),x.jsx("pre",{children:JSON.stringify(e,null,2)}),x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"users = "}),x.jsx("pre",{children:JSON.stringify(t,null,2)}),x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"window.Telegram.Webapp = "}),x.jsx("pre",{children:JSON.stringify((r=window.Telegram)==null?void 0:r.WebApp,null,2)})]})}function Ll({children:e,className:t}){return x.jsx("div",{className:Yn("fixed top-0 left-0 w-full h-full overflow-y-auto text-text bg-bg2",t),children:x.jsxs("div",{className:"limiter",children:[e,x.jsx(m1,{})]})})}var gn={DEBUG:!1,LIB_VERSION:"2.47.0"},Ee;if(typeof window>"u"){var Bd={hostname:""};Ee={navigator:{userAgent:""},document:{location:Bd,referrer:""},screen:{width:0,height:0},location:Bd}}else Ee=window;var Ul=Array.prototype,v1=Function.prototype,Xm=Object.prototype,zn=Ul.slice,$o=Xm.toString,Fl=Xm.hasOwnProperty,Pe=Ee.console,Bn=Ee.navigator,de=Ee.document,us=Ee.opera,nl=Ee.screen,tn=Bn.userAgent,ma=v1.bind,$d=Ul.forEach,qd=Ul.indexOf,Hd=Ul.map,g1=Array.isArray,Pu={},c={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},ce={log:function(){if(gn.DEBUG&&!c.isUndefined(Pe)&&Pe)try{Pe.log.apply(Pe,arguments)}catch{c.each(arguments,function(t){Pe.log(t)})}},warn:function(){if(gn.DEBUG&&!c.isUndefined(Pe)&&Pe){var e=["Mixpanel warning:"].concat(c.toArray(arguments));try{Pe.warn.apply(Pe,e)}catch{c.each(e,function(n){Pe.warn(n)})}}},error:function(){if(gn.DEBUG&&!c.isUndefined(Pe)&&Pe){var e=["Mixpanel error:"].concat(c.toArray(arguments));try{Pe.error.apply(Pe,e)}catch{c.each(e,function(n){Pe.error(n)})}}},critical:function(){if(!c.isUndefined(Pe)&&Pe){var e=["Mixpanel error:"].concat(c.toArray(arguments));try{Pe.error.apply(Pe,e)}catch{c.each(e,function(n){Pe.error(n)})}}}},va=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(ce,arguments)}},Lc=function(e){return{log:va(ce.log,e),error:va(ce.error,e),critical:va(ce.critical,e)}};c.bind=function(e,t){var n,r;if(ma&&e.bind===ma)return ma.apply(e,zn.call(arguments,1));if(!c.isFunction(e))throw new TypeError;return n=zn.call(arguments,2),r=function(){if(!(this instanceof r))return e.apply(t,n.concat(zn.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var s=e.apply(o,n.concat(zn.call(arguments)));return Object(s)===s?s:o},r};c.each=function(e,t,n){if(e!=null){if($d&&e.forEach===$d)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r0&&(t[r]=n)}),t};c.truncate=function(e,t){var n;return typeof e=="string"?n=e.slice(0,t):c.isArray(e)?(n=[],c.each(e,function(r){n.push(c.truncate(r,t))})):c.isObject(e)?(n={},c.each(e,function(r,i){n[i]=c.truncate(r,t)})):n=e,n};c.JSONEncode=function(){return function(e){var t=e,n=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(l){var a=s[l];return typeof a=="string"?a:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},r=function(i,o){var s="",l=" ",a=0,u="",f="",h=0,d=s,g=[],y=o[i];switch(y&&typeof y=="object"&&typeof y.toJSON=="function"&&(y=y.toJSON(i)),typeof y){case"string":return n(y);case"number":return isFinite(y)?String(y):"null";case"boolean":case"null":return String(y);case"object":if(!y)return"null";if(s+=l,g=[],$o.apply(y)==="[object Array]"){for(h=y.length,a=0;a{const t=typeof e=="function"?q0(e):e,n=(r,i)=>t1(t,r,i);return Object.assign(n,t),n},n1=e=>e?jd(e):jd,bn=4,Zr=2,Ru=[{id:"RUB",title:"Рубль",symbol:"₽",in:"В рублях",decimals:bn,visible_decimals:Zr},{id:"GEL",title:"Лари",symbol:"₾",in:"В лари",decimals:bn,visible_decimals:Zr},{id:"TRY",title:"Лира",symbol:"₺",in:"В лирах",decimals:bn,visible_decimals:Zr},{id:"EUR",title:"Евро",symbol:"€",in:"В евро",decimals:bn,visible_decimals:Zr}],r1=e=>{const t={Ё:"YO",Й:"I",Ц:"TS",У:"U",К:"K",Е:"E",Н:"N",Г:"G",Ш:"SH",Щ:"SCH",З:"Z",Х:"H",Ъ:"",ё:"yo",й:"i",ц:"ts",у:"u",к:"k",е:"e",н:"n",г:"g",ш:"sh",щ:"sch",з:"z",х:"h",ъ:"",Ф:"F",Ы:"I",В:"V",А:"A",П:"P",Р:"R",О:"O",Л:"L",Д:"D",Ж:"ZH",Э:"E",ф:"f",ы:"i",в:"v",а:"a",п:"p",р:"r",о:"o",л:"l",д:"d",ж:"zh",э:"e",Я:"Ya",Ч:"CH",С:"S",М:"M",И:"I",Т:"T",Ь:"",Б:"B",Ю:"YU",я:"ya",ч:"ch",с:"s",м:"m",и:"i",т:"t",ь:"",б:"b",ю:"yu"};return e.split("").map(n=>t[n]||"").join("")},i1=e=>({_id:Math.round(Math.random()*1e10),first_name:e,last_name:e,username:Math.random()>.2?r1(e):void 0,profile_photo:`https://i.pravatar.cc/48/${Math.round(Math.random()*1e10)}`,_name:e}),o1=()=>{const e=["Александр","Дмитрий","Максим","Сергей","Андрей","Алексей","Артём","Илья","Кирилл","Михаил","Никита","Матвей","Роман","Егор","Арсений","Иван","Денис","Евгений","Тимофей","Владислав","Игорь","Владимир","Павел","Руслан","Марк","Константин","Тимур","Олег","Ярослав","Антон","Николай","Данил","Анастасия","Мария","Анна","Виктория","Екатерина","Наталья","Марина","Полина","София","Дарья","Алиса","Ксения","Александра","Елена"];return e[Math.floor(Math.random()*e.length)]},s1=e=>{const t=[];do{const n=o1();t.includes(n)||t.push(n)}while(t.length!==e);return t},l1=s1(6),Km=l1.map(e=>i1(e)),lo=Km.slice(0,4).map((e,t)=>({person_id:`Person${t}`,normalized_name:e._name,related_user_id:Math.random()>.3?e._id:null,is_payer:t==0,amount:Math.round(Math.random()*100)*10**bn}));lo.splice(1,0,{...lo[0],amount:lo[0].amount/3,is_payer:!1});const a1={_id:"1",chat_id:null,is_voice:!0,raw_text:lo.map(e=>`${e.normalized_name} ${e.is_payer?"заплатил":"должен"} ${(e.amount/10**bn).toFixed(0)}`).join(", "),shares:lo,is_confirmed:!1,currency_id:Ru[0].id},Vt=n1((e,t)=>({txId:void 0,setTxId:n=>e({txId:n}),users:[],setUsers:n=>e({users:n}),selectPersonId:null,setSelectPersonId:n=>e({selectPersonId:n}),currencies:Ru,currency:Ru[0],setCurrency:n=>{t().transaction!==void 0&&e({transaction:{...t().transaction,currency_id:n}})},transaction:void 0,setTransaction:n=>e({transaction:n}),isSuccess:null,setSuccess:n=>e({isSuccess:n})})),Al=()=>{const{txId:e,setTxId:t}=Vt(),n=Oc();if(e===void 0){const i=new URLSearchParams(n.search).get("txid");t(i||null)}},Gm=()=>{const e=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,[t,n]=L.useState(e()),r=()=>{n(e())};return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),{isDarkTheme:t}},Il=()=>{const{users:e,transaction:t,setTransaction:n,selectPersonId:r}=Vt(),i=(t==null?void 0:t.shares)||[],o=i.map(h=>h.related_user_id),s=e.filter(h=>!o.includes(h._id)),l=i.length>1&&i.every(h=>h.related_user_id&&e.find(d=>d._id===h.related_user_id));return{users:e,unrelatedUsers:s,isRelationsComplete:l,getUserById:h=>e.find(d=>d._id===h),selectUser:h=>()=>{if(r!==null){const d=[...i],g=d.findIndex(y=>y.related_user_id===h._id);for(let y=0;y()=>{const d=[...i].filter(g=>g.person_id!==h);t&&n({...t,shares:d}),history.back()}}},Ym=({size:e})=>x.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 w-[50px] h-[50px]",style:{width:e,height:e},children:x.jsx("div",{className:"w-full h-full rounded-full border-[3px] border-button border-l-button/10 border-t-button/10 animate-[spin_0.6s_linear_infinite]"})});function ao({children:e,theme:t="default",disabled:n,isBusy:r,onClick:i}){const o={default:"mx-auto w-full max-w-[500px] md:max-w-[300px] block h-10 bg-button text-buttonText rounded-md text-[14px] leading-[20px] font-semibold enabled:hover:brightness-110 enabled:active:brightness-[1.2] disabled:opacity-40 transition-all",text:"h-6 text-[14px] leading-[24px] text-button hover:brightness-[1.2] active:brightness-[1.4] transition-all"}[t];return x.jsxs("div",{className:"relative",children:[x.jsx("button",{className:o,disabled:n||r,onClick:i,children:e}),r&&x.jsx(Ym,{size:30})]})}const u1=({onClick:e})=>{var t,n,r;const i=typeof window<"u"?(t=window)==null||(n=t.Telegram)==null||(r=n.WebApp)==null?void 0:r.BackButton:null;return i&&(L.useEffect(()=>(i.show(),()=>{i.hide()}),[]),L.useEffect(()=>{if(e)return i.onClick(e),()=>{i.offClick(e)}},[e])),null},c1=e=>L.createElement("svg",{width:12,height:20,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.53714 19.5928L0.292152 10.6788C-0.097384 10.3036 -0.097384 9.69738 0.292152 9.32117L9.53714 0.407154C10.0995 -0.135718 11.0144 -0.135718 11.5777 0.407154C12.14 0.950026 12.14 1.8311 11.5777 2.37397L3.66913 10.0005L11.5777 17.6251C12.14 18.1689 12.14 19.05 11.5777 19.5928C11.0144 20.1357 10.0995 20.1357 9.53714 19.5928Z",fill:"currentColor"}));function Ml({onBack:e,onCancel:t}){var n,r;return((r=(n=window==null?void 0:window.Telegram)==null?void 0:n.WebApp)==null?void 0:r.platform)!=="unknown"?x.jsx("div",{className:"h-3",children:x.jsx(u1,{onClick:e})}):x.jsxs("header",{className:"relative flex items-center justify-center h-[64px]",children:[t&&x.jsx("button",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-link hover:brightness-[1.2] active:brightness-[1.4] transition-all",onClick:t,children:"Отмена"}),e&&x.jsxs("button",{className:"flex items-center gap-[5px] absolute left-4 top-1/2 -translate-y-1/2 text-link hover:brightness-[1.2] active:brightness-[1.4] transition-all",onClick:e,children:[x.jsx(c1,{}),x.jsx("span",{children:"Назад"})]}),x.jsxs("div",{className:"flex flex-col items-center justify-center gap-0.5",children:[x.jsx("div",{className:"text-[17px] leading-[22px] font-semibold",children:"Split"}),x.jsx("div",{className:"text-hint text-[13px] leading-[18px] font-semibold opacity-70",children:"бот"})]})]})}const f1=e=>{const t=e?e.split(" "):[];return`${t[0]?t[0][0]:""}${t[1]?t[1][0]:""}`},d1=e=>{};function h1({url:e,fullName:t,size:n=40}){const r=d1(t),{isDarkTheme:i}=Gm(),s=!e&&t?r+"22":i?"#9AA6AC":"#EEF0F2",l=!e&&t?f1(t):null;return x.jsx("div",{className:"flex items-center justify-center rounded-full bg-cover bg-center",style:{width:n,height:n,backgroundColor:s,backgroundImage:`url(${e})`},children:l&&x.jsx("div",{className:"uppercase font-semibold text-main",style:{fontSize:.35*n+"px",lineHeight:.6*n+"px",color:r},children:l})})}function Mc({user:e,size:t=40}){const n=[...e!=null&&e.first_name?[e.first_name]:[],...e!=null&&e.last_name?[e.last_name]:[]].join(" ");return x.jsxs("div",{className:"w-full flex gap-2 items-center truncate",children:[x.jsx(h1,{url:e==null?void 0:e.profile_photo,size:t,fullName:n}),x.jsx("div",{className:"flex flex-col -gap-0.5 flex-1 text-left truncate text-[16px] leading-[20px]",children:e?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"truncate",children:[e.first_name," ",e.last_name]}),e.username&&x.jsxs("div",{className:"text-[14px] leading-[18px] text-hint truncate",children:["@",e.username]})]}):x.jsx("div",{className:"text-hint truncate",children:"(выберите)"})})]})}const uo=e=>(e/10**bn).toFixed(Zr),bd=e=>parseFloat(e)*10**bn||0,p1=(e,t)=>{const n=Zr,r=10,i=/[^0-9.]/,o=t.replace(/,/g,".").replace(i,"");if(!/^\d*.?\d*$/.test(o)||o.length>r)return e;const[l,a]=e.split("."),[u,f]=o.split(".");return l==="0"&&u==="00"||a==="0".repeat(n-1)&&f==="0".repeat(n)||f&&f.length>n?e:e===""&&o==="."?"0.":e==="0."&&o==="0"?"":e!=="0."&&o==="0"?"0.":o};function m1({amount:e,onChange:t}){const[n,r]=L.useState(uo(e));L.useEffect(()=>{const s=bd(n);e!==s&&r(uo(e))},[e,n]);const i=s=>{const l=s.target.value,a=p1(n,l);r(a);const u=bd(a);t(u)},o=()=>{r(uo(e))};return x.jsx("input",{type:"text",className:"w-[117px] h-10 p-2 rounded-md border border-[#DDE2E4] dark:border-[#6E7C87] dark:bg-[#D5DADD] text-right text-[16px] text-text dark:text-[#48535B] leading-[24px] focus:ring-2 focus:ring-button focus:outline-none appearance-none transition-all selection:bg-button selection:text-buttonText",inputMode:"decimal",placeholder:"0",value:n,onFocus:s=>{s.target.select()},onBlur:o,onChange:i})}function zd({related_user_id:e,amount:t,onChange:n}){const{getUserById:r}=Il(),i=e?r(e):void 0;return i?x.jsxs("div",{className:"flex gap-3",children:[x.jsx(Mc,{user:i,size:48}),x.jsx(m1,{amount:t,onChange:n})]}):null}function ai({children:e,className:t}){return x.jsx("div",{className:Yn("panel p-4 pb-6 rounded-3xl bg-bg",t),children:e})}function v1(){var r;const{transaction:e,users:t,txId:n}=Vt();return x.jsxs(ai,{className:"mt-10 text-[12px] break-words opacity-40 overflow-x-auto",children:[x.jsx("h2",{children:"Debug"}),x.jsx("strong",{children:"href = "}),location.href,x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"txid = "}),String(n),x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"transaction = "}),x.jsx("pre",{children:JSON.stringify(e,null,2)}),x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"users = "}),x.jsx("pre",{children:JSON.stringify(t,null,2)}),x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"window.Telegram.Webapp = "}),x.jsx("pre",{children:JSON.stringify((r=window.Telegram)==null?void 0:r.WebApp,null,2)})]})}function Ll({children:e,className:t}){return x.jsx("div",{className:Yn("fixed top-0 left-0 w-full h-full overflow-y-auto text-text bg-bg2",t),children:x.jsxs("div",{className:"limiter",children:[e,x.jsx(v1,{})]})})}var gn={DEBUG:!1,LIB_VERSION:"2.47.0"},Ee;if(typeof window>"u"){var Bd={hostname:""};Ee={navigator:{userAgent:""},document:{location:Bd,referrer:""},screen:{width:0,height:0},location:Bd}}else Ee=window;var Ul=Array.prototype,g1=Function.prototype,Xm=Object.prototype,zn=Ul.slice,$o=Xm.toString,Fl=Xm.hasOwnProperty,Pe=Ee.console,Bn=Ee.navigator,de=Ee.document,us=Ee.opera,nl=Ee.screen,tn=Bn.userAgent,ma=g1.bind,$d=Ul.forEach,qd=Ul.indexOf,Hd=Ul.map,y1=Array.isArray,Pu={},c={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},ce={log:function(){if(gn.DEBUG&&!c.isUndefined(Pe)&&Pe)try{Pe.log.apply(Pe,arguments)}catch{c.each(arguments,function(t){Pe.log(t)})}},warn:function(){if(gn.DEBUG&&!c.isUndefined(Pe)&&Pe){var e=["Mixpanel warning:"].concat(c.toArray(arguments));try{Pe.warn.apply(Pe,e)}catch{c.each(e,function(n){Pe.warn(n)})}}},error:function(){if(gn.DEBUG&&!c.isUndefined(Pe)&&Pe){var e=["Mixpanel error:"].concat(c.toArray(arguments));try{Pe.error.apply(Pe,e)}catch{c.each(e,function(n){Pe.error(n)})}}},critical:function(){if(!c.isUndefined(Pe)&&Pe){var e=["Mixpanel error:"].concat(c.toArray(arguments));try{Pe.error.apply(Pe,e)}catch{c.each(e,function(n){Pe.error(n)})}}}},va=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(ce,arguments)}},Lc=function(e){return{log:va(ce.log,e),error:va(ce.error,e),critical:va(ce.critical,e)}};c.bind=function(e,t){var n,r;if(ma&&e.bind===ma)return ma.apply(e,zn.call(arguments,1));if(!c.isFunction(e))throw new TypeError;return n=zn.call(arguments,2),r=function(){if(!(this instanceof r))return e.apply(t,n.concat(zn.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var s=e.apply(o,n.concat(zn.call(arguments)));return Object(s)===s?s:o},r};c.each=function(e,t,n){if(e!=null){if($d&&e.forEach===$d)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r0&&(t[r]=n)}),t};c.truncate=function(e,t){var n;return typeof e=="string"?n=e.slice(0,t):c.isArray(e)?(n=[],c.each(e,function(r){n.push(c.truncate(r,t))})):c.isObject(e)?(n={},c.each(e,function(r,i){n[i]=c.truncate(r,t)})):n=e,n};c.JSONEncode=function(){return function(e){var t=e,n=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(l){var a=s[l];return typeof a=="string"?a:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},r=function(i,o){var s="",l=" ",a=0,u="",f="",h=0,d=s,g=[],y=o[i];switch(y&&typeof y=="object"&&typeof y.toJSON=="function"&&(y=y.toJSON(i)),typeof y){case"string":return n(y);case"number":return isFinite(y)?String(y):"null";case"boolean":case"null":return String(y);case"object":if(!y)return"null";if(s+=l,g=[],$o.apply(y)==="[object Array]"){for(h=y.length,a=0;a="0"&&t<="9";)y+=t,o();if(t===".")for(y+=".";o()&&t>="0"&&t<="9";)y+=t;if(t==="e"||t==="E")for(y+=t,o(),(t==="-"||t==="+")&&(y+=t,o());t>="0"&&t<="9";)y+=t,o();if(g=+y,!isFinite(g))i("Bad number");else return g},l=function(){var g,y,S="",E;if(t==='"')for(;o();){if(t==='"')return o(),S;if(t==="\\")if(o(),t==="u"){for(E=0,y=0;y<4&&(g=parseInt(o(),16),!!isFinite(g));y+=1)E=E*16+g;S+=String.fromCharCode(E)}else if(typeof n[t]=="string")S+=n[t];else break;else S+=t}i("Bad string")},a=function(){for(;t&&t<=" ";)o()},u=function(){switch(t){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}i('Unexpected "'+t+'"')},f,h=function(){var g=[];if(t==="["){if(o("["),a(),t==="]")return o("]"),g;for(;t;){if(g.push(f()),a(),t==="]")return o("]"),g;o(","),a()}}i("Bad array")},d=function(){var g,y={};if(t==="{"){if(o("{"),a(),t==="}")return o("}"),y;for(;t;){if(g=l(),a(),o(":"),Object.hasOwnProperty.call(y,g)&&i('Duplicate key "'+g+'"'),y[g]=f(),a(),t==="}")return o("}"),y;o(","),a()}}i("Bad object")};return f=function(){switch(a(),t){case"{":return d();case"[":return h();case'"':return l();case"-":return s();default:return t>="0"&&t<="9"?s():u()}},function(g){var y;return r=g,e=0,t=" ",y=f(),a(),t&&i("Syntax error"),y}}();c.base64Encode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n,r,i,o,s,l,a,u,f=0,h=0,d="",g=[];if(!e)return e;e=c.utf8Encode(e);do n=e.charCodeAt(f++),r=e.charCodeAt(f++),i=e.charCodeAt(f++),u=n<<16|r<<8|i,o=u>>18&63,s=u>>12&63,l=u>>6&63,a=u&63,g[h++]=t.charAt(o)+t.charAt(s)+t.charAt(l)+t.charAt(a);while(f127&&s<2048?l=String.fromCharCode(s>>6|192,s&63|128):l=String.fromCharCode(s>>12|224,s>>6&63|128,s&63|128),l!==null&&(r>n&&(t+=e.substring(n,r)),t+=l,n=r=o+1)}return r>n&&(t+=e.substring(n,e.length)),t};c.UUID=function(){var e=function(){var r=1*new Date,i;if(Ee.performance&&Ee.performance.now)i=Ee.performance.now();else for(i=0;r==1*new Date;)i++;return r.toString(16)+Math.floor(i).toString(16)},t=function(){return Math.random().toString(16).replace(".","")},n=function(){var r=tn,i,o,s=[],l=0;function a(u,f){var h,d=0;for(h=0;h=4&&(l=a(l,s),s=[]);return s.length>0&&(l=a(l,s)),l.toString(16)};return function(){var r=(nl.height*nl.width).toString(16);return e()+"-"+t()+"-"+n()+"-"+r+"-"+e()}}();var Qd=["ahrefsbot","baiduspider","bingbot","bingpreview","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];c.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t=0}function r(i){if(!de.getElementsByTagName)return[];var o=i.split(" "),s,l,a,u,f,h,d,g,y,S,E=[de];for(h=0;h-1){l=s.split("#"),a=l[0];var m=l[1],p=de.getElementById(m);if(!p||a&&p.nodeName.toLowerCase()!=a)return[];E=[p];continue}if(s.indexOf(".")>-1){l=s.split("."),a=l[0];var _=l[1];for(a||(a="*"),u=[],f=0,d=0;d-1};break;default:O=function(A){return A.getAttribute(R)}}for(E=[],S=0,d=0;d=3?t[2]:""},properties:function(){return c.extend(c.strip_empty_properties({$os:c.info.os(),$browser:c.info.browser(tn,Bn.vendor,us),$referrer:de.referrer,$referring_domain:c.info.referringDomain(de.referrer),$device:c.info.device(tn)}),{$current_url:Ee.location.href,$browser_version:c.info.browserVersion(tn,Bn.vendor,us),$screen_height:nl.height,$screen_width:nl.width,mp_lib:"web",$lib_version:gn.LIB_VERSION,$insert_id:Uc(),time:c.timestamp()/1e3})},people_properties:function(){return c.extend(c.strip_empty_properties({$os:c.info.os(),$browser:c.info.browser(tn,Bn.vendor,us)}),{$browser_version:c.info.browserVersion(tn,Bn.vendor,us)})},mpPageViewProperties:function(){return c.strip_empty_properties({current_page_title:de.title,current_domain:Ee.location.hostname,current_url_path:Ee.location.pathname,current_url_protocol:Ee.location.protocol,current_url_search:Ee.location.search})}};var Uc=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},w1=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,E1=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Wd=function(e){var t=E1,n=e.split("."),r=n[n.length-1];(r.length>4||r==="com"||r==="org")&&(t=w1);var i=e.match(t);return i?i[0]:""},il=null,ol=null;typeof JSON<"u"&&(il=JSON.stringify,ol=JSON.parse);il=il||c.JSONEncode;ol=ol||c.JSONDecode;c.toArray=c.toArray;c.isObject=c.isObject;c.JSONEncode=c.JSONEncode;c.JSONDecode=c.JSONDecode;c.isBlockedUA=c.isBlockedUA;c.isEmptyObject=c.isEmptyObject;c.info=c.info;c.info.device=c.info.device;c.info.browser=c.info.browser;c.info.browserVersion=c.info.browserVersion;c.info.properties=c.info.properties;var kn=function(){};kn.prototype.create_properties=function(){};kn.prototype.event_handler=function(){};kn.prototype.after_track_handler=function(){};kn.prototype.init=function(e){return this.mp=e,this};kn.prototype.track=function(e,t,n,r){var i=this,o=c.dom_query(e);if(o.length===0){ce.error("The DOM query ("+e+") returned 0 elements");return}return c.each(o,function(s){c.register_event(s,this.override_event,function(l){var a={},u=i.create_properties(n,this),f=i.mp.get_config("track_links_timeout");i.event_handler(l,this,a),window.setTimeout(i.track_callback(r,u,a,!0),f),i.mp.track(t,u,i.track_callback(r,u,a))})},this),!0};kn.prototype.track_callback=function(e,t,n,r){r=r||!1;var i=this;return function(){n.callback_fired||(n.callback_fired=!0,!(e&&e(r,t)===!1)&&i.after_track_handler(t,n,r))}};kn.prototype.create_properties=function(e,t){var n;return typeof e=="function"?n=e(t):n=c.extend({},e),n};var yi=function(){this.override_event="click"};c.inherit(yi,kn);yi.prototype.create_properties=function(e,t){var n=yi.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n};yi.prototype.event_handler=function(e,t,n){n.new_tab=e.which===2||e.metaKey||e.ctrlKey||t.target==="_blank",n.href=t.href,n.new_tab||e.preventDefault()};yi.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var jl=function(){this.override_event="submit"};c.inherit(jl,kn);jl.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()};jl.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var x1=Lc("lock"),Jm=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};Jm.prototype.withLock=function(e,t,n){!n&&typeof t!="function"&&(n=t,t=null);var r=n||new Date().getTime()+"|"+Math.random(),i=new Date().getTime(),o=this.storageKey,s=this.pollIntervalMS,l=this.timeoutMS,a=this.storage,u=o+":X",f=o+":Y",h=o+":Z",d=function(p){t&&t(p)},g=function(p){if(new Date().getTime()-i>l){x1.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+r+"]"),a.removeItem(h),a.removeItem(f),E();return}setTimeout(function(){try{p()}catch(_){d(_)}},s*(Math.random()+.1))},y=function(p,_){p()?_():g(function(){y(p,_)})},S=function(){var p=a.getItem(f);if(p&&p!==r)return!1;if(a.setItem(f,r),a.getItem(f)===r)return!0;if(!rl(a,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},E=function(){a.setItem(u,r),y(S,function(){if(a.getItem(u)===r){m();return}g(function(){if(a.getItem(f)!==r){E();return}y(function(){return!a.getItem(h)},m)})})},m=function(){a.setItem(h,"1");try{e()}finally{a.removeItem(h),a.getItem(f)===r&&a.removeItem(f),a.getItem(u)===r&&a.removeItem(u)}};try{if(rl(a,!0))E();else throw new Error("localStorage support check failed")}catch(p){d(p)}};var Vd=Lc("batch"),or=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||c.bind(Vd.error,Vd),this.lock=new Jm(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};or.prototype.enqueue=function(e,t,n){var r={id:Uc(),flushAfter:new Date().getTime()+t*2,payload:e};this.lock.withLock(c.bind(function(){var o;try{var s=this.readFromStorage();s.push(r),o=this.saveToStorage(s),o&&this.memQueue.push(r)}catch{this.reportError("Error enqueueing item",e),o=!1}n&&n(o)},this),c.bind(function(o){this.reportError("Error acquiring storage lock",o),n&&n(!1)},this),this.pid)};or.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(t.lengtho.flushAfter&&!r[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}}return t};var Kd=function(e,t){var n=[];return c.each(e,function(r){r.id&&!t[r.id]&&n.push(r)}),n};or.prototype.removeItemsByID=function(e,t){var n={};c.each(e,function(i){n[i]=!0}),this.memQueue=Kd(this.memQueue,n);var r=c.bind(function(){var i;try{var o=this.readFromStorage();if(o=Kd(o,n),i=this.saveToStorage(o),i){o=this.readFromStorage();for(var s=0;s5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:u,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[d]}),h=!1):this.reportError("[dupe] found item with no ID",{item:u}),h&&o.push(f)}s[u.id]=f},this),o.length<1){this.resetFlush();return}this.requestInProgress=!0;var l=c.bind(function(u){this.requestInProgress=!1;try{var f=!1;if(e.unloading)this.queue.updatePayloads(s);else if(c.isObject(u)&&u.error==="timeout"&&new Date().getTime()-n>=t)this.reportError("Network timeout; retrying"),this.flush();else if(c.isObject(u)&&u.xhr_req&&(u.xhr_req.status>=500||u.xhr_req.status===429||u.error==="timeout")){var h=this.flushInterval*2,d=u.xhr_req.responseHeaders;if(d){var g=d["Retry-After"];g&&(h=parseInt(g,10)*1e3||h)}h=Math.min(k1,h),this.reportError("Error; retry in "+h+" ms"),this.scheduleFlush(h)}else if(c.isObject(u)&&u.xhr_req&&u.xhr_req.status===413)if(i.length>1){var y=Math.max(1,Math.floor(r/2));this.batchSize=Math.min(this.batchSize,y,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),f=!0;else f=!0;f&&(this.queue.removeItemsByID(c.map(i,function(S){return S.id}),c.bind(function(S){S?(this.consecutiveRemovalFailures=0,this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),c.each(i,c.bind(function(S){var E=S.id;E?(this.itemIdsSentSuccessfully[E]=this.itemIdsSentSuccessfully[E]||0,this.itemIdsSentSuccessfully[E]++,this.itemIdsSentSuccessfully[E]>5&&this.reportError("[dupe] item ID sent too many times",{item:S,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[E]})):this.reportError("[dupe] found item with no ID while removing",{item:S})},this)))}catch(S){this.reportError("Error handling API response",S),this.resetFlush()}},this),a={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(a.transport="sendBeacon"),co.log("MIXPANEL REQUEST:",o),this.sendRequest(o,a,l)}catch(u){this.reportError("Error flushing request queue",u),this.resetFlush()}};ln.prototype.reportError=function(e,t){if(co.error.apply(co.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){co.error(n)}};var C1="__mp_opt_in_out_";function T1(e,t){tv(!0,e,t)}function R1(e,t){tv(!1,e,t)}function P1(e,t){return ev(e,t)==="1"}function Zm(e,t){if(D1(t))return ce.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n=ev(e,t)==="0";return n&&ce.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function ki(e){return bc(e,function(t){return this.get_config(t)})}function sr(e){return bc(e,function(t){return this._get_config(t)})}function Ci(e){return bc(e,function(t){return this._get_config(t)})}function O1(e,t){t=t||{},Fc(t).remove(jc(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function Fc(e){return e=e||{},e.persistenceType==="localStorage"?c.localStorage:c.cookie}function jc(e,t){return t=t||{},(t.persistencePrefix||C1)+e}function ev(e,t){return Fc(t).get(jc(e,t))}function D1(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||Ee,n=t.navigator||{},r=!1;return c.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(i){c.includes([!0,1,"1","yes"],i)&&(r=!0)}),r}function tv(e,t,n){if(!c.isString(t)||!t.length){ce.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token");return}n=n||{},Fc(n).set(jc(t,n),e?1:0,c.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})}function bc(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),l=t.call(this,"window");r&&(n=Zm(r,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:l}))}catch(u){ce.error("Unexpected error when checking tracking opt-out status: "+u)}if(!n)return e.apply(this,arguments);var a=arguments[arguments.length-1];typeof a=="function"&&a(0)}}var er="$set",_i="$set_once",$t="$unset",Or="$add",En="$append",Dr="$union",tr="$remove",N1="$delete",nv={set_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[er]=r,n},unset_action:function(e){var t={},n=[];return c.isArray(e)||(e=[e]),c.each(e,function(r){this._is_reserved_property(r)||n.push(r)},this),t[$t]=n,t},set_once_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[_i]=r,n},union_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=c.isArray(i)?i:[i])},this):r[e]=c.isArray(t)?t:[t],n[Dr]=r,n},append_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[En]=r,n},remove_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[tr]=r,n},delete_action:function(){var e={};return e[N1]="",e}},ve=function(){};c.extend(ve.prototype,nv);ve.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n};ve.prototype.set=Ci(function(e,t,n){var r=this.set_action(e,t);return c.isObject(e)&&(n=t),this._send_request(r,n)});ve.prototype.set_once=Ci(function(e,t,n){var r=this.set_once_action(e,t);return c.isObject(e)&&(n=t),this._send_request(r,n)});ve.prototype.unset=Ci(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)});ve.prototype.union=Ci(function(e,t,n){c.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)});ve.prototype.delete=Ci(function(e){var t=this.delete_action();return this._send_request(t,e)});ve.prototype.remove=Ci(function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)});ve.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=c.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/groups/",batcher:this._mixpanel.request_batchers.groups},t)};ve.prototype._is_reserved_property=function(e){return e==="$group_key"||e==="$group_id"};ve.prototype._get_config=function(e){return this._mixpanel.get_config(e)};ve.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id};ve.prototype.remove=ve.prototype.remove;ve.prototype.set=ve.prototype.set;ve.prototype.set_once=ve.prototype.set_once;ve.prototype.union=ve.prototype.union;ve.prototype.unset=ve.prototype.unset;ve.prototype.toString=ve.prototype.toString;var Y=function(){};c.extend(Y.prototype,nv);Y.prototype._init=function(e){this._mixpanel=e};Y.prototype.set=sr(function(e,t,n){var r=this.set_action(e,t);return c.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[er]=c.extend({},c.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),r[er]),this._send_request(r,n)});Y.prototype.set_once=sr(function(e,t,n){var r=this.set_once_action(e,t);return c.isObject(e)&&(n=t),this._send_request(r,n)});Y.prototype.unset=sr(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)});Y.prototype.increment=sr(function(e,t,n){var r={},i={};return c.isObject(e)?(c.each(e,function(o,s){if(!this._is_reserved_property(s))if(isNaN(parseFloat(o))){ce.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[s]=o},this),n=t):(c.isUndefined(t)&&(t=1),i[e]=t),r[Or]=i,this._send_request(r,n)});Y.prototype.append=sr(function(e,t,n){c.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)});Y.prototype.remove=sr(function(e,t,n){c.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)});Y.prototype.union=sr(function(e,t,n){c.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)});Y.prototype.track_charge=sr(function(e,t,n){if(!c.isNumber(e)&&(e=parseFloat(e),isNaN(e))){ce.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",c.extend({$amount:e},t),n)});Y.prototype.clear_charges=function(e){return this.set("$transactions",[],e)};Y.prototype.delete_user=function(){if(!this._identify_called()){ce.error("mixpanel.people.delete_user() requires you to call identify() first");return}var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)};Y.prototype.toString=function(){return this._mixpanel.toString()+".people"};Y.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=c.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/engage/",batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),c.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),c.truncate(o,255))};Y.prototype._get_config=function(e){return this._mixpanel.get_config(e)};Y.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0};Y.prototype._enqueue=function(e){er in e?this._mixpanel.persistence._add_to_people_queue(er,e):_i in e?this._mixpanel.persistence._add_to_people_queue(_i,e):$t in e?this._mixpanel.persistence._add_to_people_queue($t,e):Or in e?this._mixpanel.persistence._add_to_people_queue(Or,e):En in e?this._mixpanel.persistence._add_to_people_queue(En,e):tr in e?this._mixpanel.persistence._add_to_people_queue(tr,e):Dr in e?this._mixpanel.persistence._add_to_people_queue(Dr,e):ce.error("Invalid call to _enqueue():",e)};Y.prototype._flush_one_queue=function(e,t,n,r){var i=this,o=c.extend({},this._mixpanel.persistence._get_queue(e)),s=o;!c.isUndefined(o)&&c.isObject(o)&&!c.isEmptyObject(o)&&(i._mixpanel.persistence._pop_from_people_queue(e,o),r&&(s=r(o)),t.call(i,s,function(l,a){l===0&&i._mixpanel.persistence._add_to_people_queue(e,o),c.isUndefined(n)||n(l,a)}))};Y.prototype._flush=function(e,t,n,r,i,o,s){var l=this,a=this._mixpanel.persistence._get_queue(En),u=this._mixpanel.persistence._get_queue(tr);if(this._flush_one_queue(er,this.set,e),this._flush_one_queue(_i,this.set_once,r),this._flush_one_queue($t,this.unset,o,function(E){return c.keys(E)}),this._flush_one_queue(Or,this.increment,t),this._flush_one_queue(Dr,this.union,i),!c.isUndefined(a)&&c.isArray(a)&&a.length){for(var f,h=function(E,m){E===0&&l._mixpanel.persistence._add_to_people_queue(En,f),c.isUndefined(n)||n(E,m)},d=a.length-1;d>=0;d--)f=a.pop(),c.isEmptyObject(f)||l.append(f,h);l._mixpanel.persistence.save()}if(!c.isUndefined(u)&&c.isArray(u)&&u.length){for(var g,y=function(E,m){E===0&&l._mixpanel.persistence._add_to_people_queue(tr,g),c.isUndefined(s)||s(E,m)},S=u.length-1;S>=0;S--)g=u.pop(),c.isEmptyObject(g)||l.remove(g,y);l._mixpanel.persistence.save()}};Y.prototype._is_reserved_property=function(e){return e==="$distinct_id"||e==="$token"||e==="$device_id"||e==="$user_id"||e==="$had_persisted_distinct_id"};Y.prototype.set=Y.prototype.set;Y.prototype.set_once=Y.prototype.set_once;Y.prototype.unset=Y.prototype.unset;Y.prototype.increment=Y.prototype.increment;Y.prototype.append=Y.prototype.append;Y.prototype.remove=Y.prototype.remove;Y.prototype.union=Y.prototype.union;Y.prototype.track_charge=Y.prototype.track_charge;Y.prototype.clear_charges=Y.prototype.clear_charges;Y.prototype.delete_user=Y.prototype.delete_user;Y.prototype.toString=Y.prototype.toString;var zc="__mps",Bc="__mpso",$c="__mpus",qc="__mpa",Hc="__mpap",Qc="__mpr",Wc="__mpu",rv="$people_distinct_id",sl="__alias",Ao="__timers",A1=[zc,Bc,$c,qc,Hc,Qc,Wc,rv,sl,Ao],ee=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;t!=="cookie"&&t!=="localStorage"&&(ce.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),t==="localStorage"&&c.localStorage.is_supported()?this.storage=c.localStorage:this.storage=c.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};ee.prototype.properties=function(){var e={};return c.each(this.props,function(t,n){c.include(A1,n)||(e[n]=t)}),e};ee.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=c.extend({},e))}};ee.prototype.upgrade=function(e){var t=e.upgrade,n,r;t&&(n="mp_super_properties",typeof t=="string"&&(n=t),r=this.storage.parse(n),this.storage.remove(n),this.storage.remove(n,!0),r&&(this.props=c.extend(this.props,r.all,r.events))),!e.cookie_name&&e.name!=="mixpanel"&&(n="mp_"+e.token+"_"+e.name,r=this.storage.parse(n),r&&(this.storage.remove(n),this.storage.remove(n,!0),this.register_once(r))),this.storage===c.localStorage&&(r=c.cookie.parse(this.name),c.cookie.remove(this.name),c.cookie.remove(this.name,!0),r&&this.register_once(r))};ee.prototype.save=function(){this.disabled||this.storage.set(this.name,c.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)};ee.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)};ee.prototype.clear=function(){this.remove(),this.props={}};ee.prototype.register_once=function(e,t,n){return c.isObject(e)?(typeof t>"u"&&(t="None"),this.expire_days=typeof n>"u"?this.default_expiry:n,c.each(e,function(r,i){(!this.props.hasOwnProperty(i)||this.props[i]===t)&&(this.props[i]=r)},this),this.save(),!0):!1};ee.prototype.register=function(e,t){return c.isObject(e)?(this.expire_days=typeof t>"u"?this.default_expiry:t,c.extend(this.props,e),this.save(),!0):!1};ee.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())};ee.prototype.update_search_keyword=function(e){this.register(c.info.searchInfo(e))};ee.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:c.info.referringDomain(e)||"$direct"},"")};ee.prototype.get_referrer_info=function(){return c.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};ee.prototype.safe_merge=function(e){return c.each(this.props,function(t,n){n in e||(e[n]=t)}),e};ee.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)};ee.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()};ee.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())};ee.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())};ee.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())};ee.prototype.get_cross_subdomain=function(){return this.cross_subdomain};ee.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())};ee.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],i=this._get_or_create_queue(er),o=this._get_or_create_queue(_i),s=this._get_or_create_queue($t),l=this._get_or_create_queue(Or),a=this._get_or_create_queue(Dr),u=this._get_or_create_queue(tr,[]),f=this._get_or_create_queue(En,[]);n===zc?(c.extend(i,r),this._pop_from_people_queue(Or,r),this._pop_from_people_queue(Dr,r),this._pop_from_people_queue($t,r)):n===Bc?(c.each(r,function(h,d){d in o||(o[d]=h)}),this._pop_from_people_queue($t,r)):n===$c?c.each(r,function(h){c.each([i,o,l,a],function(d){h in d&&delete d[h]}),c.each(f,function(d){h in d&&delete d[h]}),s[h]=!0}):n===qc?(c.each(r,function(h,d){d in i?i[d]+=h:(d in l||(l[d]=0),l[d]+=h)},this),this._pop_from_people_queue($t,r)):n===Wc?(c.each(r,function(h,d){c.isArray(h)&&(d in a||(a[d]=[]),a[d]=a[d].concat(h))}),this._pop_from_people_queue($t,r)):n===Qc?(u.push(r),this._pop_from_people_queue(En,r)):n===Hc&&(f.push(r),this._pop_from_people_queue($t,r)),ce.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),ce.log(t),this.save()};ee.prototype._pop_from_people_queue=function(e,t){var n=this._get_queue(e);c.isUndefined(n)||(c.each(t,function(r,i){e===En||e===tr?c.each(n,function(o){o[i]===r&&delete o[i]}):delete n[i]},this),this.save())};ee.prototype._get_queue_key=function(e){if(e===er)return zc;if(e===_i)return Bc;if(e===$t)return $c;if(e===Or)return qc;if(e===En)return Hc;if(e===tr)return Qc;if(e===Dr)return Wc;ce.error("Invalid queue:",e)};ee.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]};ee.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=c.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)};ee.prototype.set_event_timer=function(e,t){var n=this.props[Ao]||{};n[e]=t,this.props[Ao]=n,this.save()};ee.prototype.remove_event_timer=function(e){var t=this.props[Ao]||{},n=t[e];return c.isUndefined(n)||(delete this.props[Ao][e],this.save()),n};var Vc,Ve,iv=0,I1=1,M1=function(e){return e},Io=function(){},Rt="mixpanel",ov="base64",L1="json",Kc="$device:",ui=Ee.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,sv=!ui&&tn.indexOf("MSIE")===-1&&tn.indexOf("Mozilla")===-1,ll=null;Bn.sendBeacon&&(ll=function(){return Bn.sendBeacon.apply(Bn,arguments)});var Yd={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:ov,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Io,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Io,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{}},lv=!1,P=function(){},Ou=function(e,t,n){var r,i=n===Rt?Ve:Ve[n];if(i&&Vc===iv)r=i;else{if(i&&!c.isArray(i)){ce.error("You have already initialized "+n);return}r=new P}if(r._cached_groups={},r._init(e,t,n),r.people=new Y,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var o=c.info.campaignParams(null),s={},l=!1;c.each(o,function(a,u){s["initial_"+u]=a,a&&(l=!0)}),l&&r.people.set_once(s)}return gn.DEBUG=gn.DEBUG||r.get_config("debug"),!c.isUndefined(i)&&c.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};P.prototype.init=function(e,t,n){if(c.isUndefined(n)){this.report_error("You must name your new library: init(token, config, name)");return}if(n===Rt){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var r=Ou(e,t,n);return Ve[n]=r,r._loaded(),r};P.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var r={};if(!("api_payload_format"in t)){var i=t.api_host||Yd.api_host;i.match(/\.mixpanel\.com/)&&(r.api_payload_format=L1)}if(this.set_config(c.extend({},Yd,r,t,{name:n,token:e,callback_fn:(n===Rt?n:Rt+"."+n)+"._jsc"})),this._jsc=Io,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!c.localStorage.is_supported(!0)||!ui)this._batch_requests=!1,ce.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support");else if(this.init_batchers(),ll&&Ee.addEventListener){var o=c.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);Ee.addEventListener("pagehide",function(l){l.persisted&&o()}),Ee.addEventListener("visibilitychange",function(){de.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new ee(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=c.UUID();this.get_distinct_id()||this.register_once({distinct_id:Kc+s,$device_id:s},""),this.get_config("track_pageview")&&this.track_pageview()};P.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()};P.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(de.referrer),this.get_config("store_google")&&this.register(c.info.campaignParams(),{persistent:!1}),this.get_config("save_referrer")&&this.persistence.update_referrer_info(de.referrer)};P.prototype._dom_loaded=function(){c.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||c.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue};P.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!lv)return this.__dom_loaded_queue.push([e,t]),!1;var n=new e().init(this);return n.track.apply(n,t)};P.prototype._prepare_callback=function(e,t){if(c.isUndefined(e))return null;if(ui){var n=function(s){e(s,t)};return n}else{var r=this._jsc,i=""+Math.floor(Math.random()*1e8),o=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(s){delete r[i],e(s,t)},o}};P.prototype._send_request=function(e,t,n,r){var i=!0;if(sv)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;!r&&(c.isFunction(n)||typeof n=="string")&&(r=n,n=null),n=c.extend(o,n||{}),ui||(n.method="GET");var l=n.method==="POST",a=ll&&l&&n.transport.toLowerCase()==="sendbeacon",u=n.verbose;t.verbose&&(u=!0),this.get_config("test")&&(t.test=1),u&&(t.verbose=1),this.get_config("img")&&(t.img=1),ui||(r?t.callback=r:(u||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=new Date().getTime().toString(),l&&(s="data="+encodeURIComponent(t.data),delete t.data),e+="?"+c.HTTPBuildQuery(t);var f=this;if("img"in t){var h=de.createElement("img");h.src=e,de.body.appendChild(h)}else if(a){try{i=ll(e,s)}catch(m){f.report_error(m),i=!1}try{r&&r(i?1:0)}catch(m){f.report_error(m)}}else if(ui)try{var d=new XMLHttpRequest;d.open(n.method,e,!0);var g=this.get_config("xhr_headers");if(l&&(g["Content-Type"]="application/x-www-form-urlencoded"),c.each(g,function(m,p){d.setRequestHeader(p,m)}),n.timeout_ms&&typeof d.timeout<"u"){d.timeout=n.timeout_ms;var y=new Date().getTime()}d.withCredentials=!0,d.onreadystatechange=function(){if(d.readyState===4)if(d.status===200){if(r)if(u){var m;try{m=c.JSONDecode(d.responseText)}catch(_){if(f.report_error(_),n.ignore_json_errors)m=d.responseText;else return}r(m)}else r(Number(d.responseText))}else{var p;d.timeout&&!d.status&&new Date().getTime()-y>=d.timeout?p="timeout":p="Bad HTTP status: "+d.status+" "+d.statusText,f.report_error(p),r&&r(u?{status:0,error:p,xhr_req:d}:0)}},d.send(s)}catch(m){f.report_error(m),i=!1}else{var S=de.createElement("script");S.type="text/javascript",S.async=!0,S.defer=!0,S.src=e;var E=de.getElementsByTagName("script")[0];E.parentNode.insertBefore(S,E)}return i};P.prototype._execute_array=function(e){var t,n=[],r=[],i=[];c.each(e,function(s){s&&(t=s[0],c.isArray(t)?i.push(s):typeof s=="function"?s.call(this):c.isArray(s)&&t==="alias"?n.push(s):c.isArray(s)&&t.indexOf("track")!==-1&&typeof this[t]=="function"?i.push(s):r.push(s))},this);var o=function(s,l){c.each(s,function(a){if(c.isArray(a[0])){var u=l;c.each(a,function(f){u=u[f[0]].apply(u,f.slice(1))})}else this[a[0]].apply(this,a.slice(1))},l)};o(n,this),o(r,this),o(i,this)};P.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events};P.prototype.init_batchers=function(){var e=this.get_config("token");if(!this.are_batchers_initialized()){var t=c.bind(function(n){return new ln("__mpq_"+e+n.queue_suffix,{libConfig:this.config,sendRequestFunc:c.bind(function(r,i,o){this._send_request(this.get_config("api_host")+n.endpoint,this._encode_data_for_request(r),i,this._prepare_callback(o,r))},this),beforeSendHook:c.bind(function(r){return this._run_hook("before_send_"+n.type,r)},this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:c.bind(this.stop_batch_senders,this)})},this);this.request_batchers={events:t({type:"events",endpoint:"/track/",queue_suffix:"_ev"}),people:t({type:"people",endpoint:"/engage/",queue_suffix:"_pp"}),groups:t({type:"groups",endpoint:"/groups/",queue_suffix:"_gr"})}}this.get_config("batch_autostart")&&this.start_batch_senders()};P.prototype.start_batch_senders=function(){this.are_batchers_initialized()&&(this._batch_requests=!0,c.each(this.request_batchers,function(e){e.start()}))};P.prototype.stop_batch_senders=function(){this._batch_requests=!1,c.each(this.request_batchers,function(e){e.stop(),e.clear()})};P.prototype.push=function(e){this._execute_array([e])};P.prototype.disable=function(e){typeof e>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)};P.prototype._encode_data_for_request=function(e){var t=c.JSONEncode(e);return this.get_config("api_payload_format")===ov&&(t=c.base64Encode(t)),{data:t}};P.prototype._track_or_batch=function(e,t){var n=c.truncate(e.data,255),r=e.endpoint,i=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||Io;var l=!0,a=c.bind(function(){return s.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(ce.log("MIXPANEL REQUEST:"),ce.log(n),this._send_request(r,this._encode_data_for_request(n),s,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!o?i.enqueue(n,function(u){u?t(1,n):a()}):l=a(),l&&n};P.prototype.track=ki(function(e,t,n,r){!r&&typeof n=="function"&&(r=n,n=null),n=n||{};var i=n.transport;i&&(n.transport=i);var o=n.send_immediately;if(typeof r!="function"&&(r=Io),c.isUndefined(e)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(e)){r(0);return}t=t||{},t.token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!c.isUndefined(s)){var l=new Date().getTime()-s;t.$duration=parseFloat((l/1e3).toFixed(3))}this._set_default_superprops();var a=this.get_config("track_marketing")?c.info.marketingParams():{};t=c.extend({},c.info.properties(),a,this.persistence.properties(),this.unpersisted_superprops,t);var u=this.get_config("property_blacklist");c.isArray(u)?c.each(u,function(d){delete t[d]}):this.report_error("Invalid value for property_blacklist config: "+u);var f={event:e,properties:t},h=this._track_or_batch({type:"events",data:f,endpoint:this.get_config("api_host")+"/track/",batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:n},r);return h});P.prototype.set_group=ki(function(e,t,n){c.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)});P.prototype.add_group=ki(function(e,t,n){var r=this.get_property(e);if(r===void 0){var i={};i[e]=[t],this.register(i)}else r.indexOf(t)===-1&&(r.push(t),this.register(i));return this.people.union(e,t,n)});P.prototype.remove_group=ki(function(e,t,n){var r=this.get_property(e);if(r!==void 0){var i=r.indexOf(t);i>-1&&(r.splice(i,1),this.register({group_key:r})),r.length===0&&this.unregister(e)}return this.people.remove(e,t,n)});P.prototype.track_with_groups=ki(function(e,t,n,r){var i=c.extend({},t||{});return c.each(n,function(o,s){o!=null&&(i[s]=o)}),this.track(e,i,r)});P.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)};P.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]};P.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),r=this._cached_groups[n];return(r===void 0||r._group_key!==e||r._group_id!==t)&&(r=new ve,r._init(this,e,t),this._cached_groups[n]=r),r};P.prototype.track_pageview=ki(function(e,t){typeof e!="object"&&(e={}),t=t||{};var n=t.event_name||"$mp_web_page_view",r=c.extend(c.info.mpPageViewProperties(),c.info.campaignParams(),c.info.clickParams()),i=c.extend({},r,e);return this.track(n,i)});P.prototype.track_links=function(){return this._track_dom.call(this,yi,arguments)};P.prototype.track_forms=function(){return this._track_dom.call(this,jl,arguments)};P.prototype.time_event=function(e){if(c.isUndefined(e)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(e)||this.persistence.set_event_timer(e,new Date().getTime())};var U1={persistent:!0},Gc=function(e){var t;return c.isObject(e)?t=e:c.isUndefined(e)?t={}:t={days:e},c.extend({},U1,t)};P.prototype.register=function(e,t){var n=Gc(t);n.persistent?this.persistence.register(e,n.days):c.extend(this.unpersisted_superprops,e)};P.prototype.register_once=function(e,t,n){var r=Gc(n);r.persistent?this.persistence.register_once(e,t,r.days):(typeof t>"u"&&(t="None"),c.each(e,function(i,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===t)&&(this.unpersisted_superprops[o]=i)},this))};P.prototype.unregister=function(e,t){t=Gc(t),t.persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]};P.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)};P.prototype.identify=function(e,t,n,r,i,o,s,l){var a=this.get_distinct_id();if(e&&a!==e){if(typeof e=="string"&&e.indexOf(Kc)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var u=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==a&&e!==this.get_property(sl)&&(this.unregister(sl),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,i,o,s,l),e!==a&&this.track("$identify",{distinct_id:e,$anon_distinct_id:a},{skip_hooks:!0})};P.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=c.UUID();this.register_once({distinct_id:Kc+e,$device_id:e},"")};P.prototype.get_distinct_id=function(){return this.get_property("distinct_id")};P.prototype.alias=function(e,t){if(e===this.get_property(rv))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return c.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(sl,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){n.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)};P.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)};P.prototype.set_config=function(e){if(c.isObject(e)){c.extend(this.config,e);var t=e.batch_size;t&&c.each(this.request_batchers,function(n){n.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),gn.DEBUG=gn.DEBUG||this.get_config("debug")}};P.prototype.get_config=function(e){return this.config[e]};P.prototype._run_hook=function(e){var t=(this.config.hooks[e]||M1).apply(this,zn.call(arguments,1));return typeof t>"u"&&(this.report_error(e+" hook did not return a value"),t=null),t};P.prototype.get_property=function(e){return this.persistence.props[e]};P.prototype.toString=function(){var e=this.get_config("name");return e!==Rt&&(e=Rt+"."+e),e};P.prototype._event_is_disabled=function(e){return c.isBlockedUA(tn)||this._flags.disable_all_events||c.include(this.__disabled_events,e)};P.prototype._gdpr_init=function(){var e=this.get_config("opt_out_tracking_persistence_type")==="localStorage";e&&c.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||c.cookie.get("mp_optout"))&&(c.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))};P.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else if(e&&e.enable_persistence)t=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==t&&this.persistence.set_disabled(t),t&&c.each(this.request_batchers,function(n){n.clear()})};P.prototype._gdpr_call_func=function(e,t){return t=c.extend({track:c.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),c.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})};P.prototype.opt_in_tracking=function(e){e=c.extend({enable_persistence:!0},e),this._gdpr_call_func(T1,e),this._gdpr_update_persistence(e)};P.prototype.opt_out_tracking=function(e){e=c.extend({clear_persistence:!0,delete_user:!0},e),e.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(R1,e),this._gdpr_update_persistence(e)};P.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(P1,e)};P.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(Zm,e)};P.prototype.clear_opt_in_out_tracking=function(e){e=c.extend({enable_persistence:!0},e),this._gdpr_call_func(O1,e),this._gdpr_update_persistence(e)};P.prototype.report_error=function(e,t){ce.error.apply(ce.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){ce.error(n)}};P.prototype.init=P.prototype.init;P.prototype.reset=P.prototype.reset;P.prototype.disable=P.prototype.disable;P.prototype.time_event=P.prototype.time_event;P.prototype.track=P.prototype.track;P.prototype.track_links=P.prototype.track_links;P.prototype.track_forms=P.prototype.track_forms;P.prototype.track_pageview=P.prototype.track_pageview;P.prototype.register=P.prototype.register;P.prototype.register_once=P.prototype.register_once;P.prototype.unregister=P.prototype.unregister;P.prototype.identify=P.prototype.identify;P.prototype.alias=P.prototype.alias;P.prototype.name_tag=P.prototype.name_tag;P.prototype.set_config=P.prototype.set_config;P.prototype.get_config=P.prototype.get_config;P.prototype.get_property=P.prototype.get_property;P.prototype.get_distinct_id=P.prototype.get_distinct_id;P.prototype.toString=P.prototype.toString;P.prototype.opt_out_tracking=P.prototype.opt_out_tracking;P.prototype.opt_in_tracking=P.prototype.opt_in_tracking;P.prototype.has_opted_out_tracking=P.prototype.has_opted_out_tracking;P.prototype.has_opted_in_tracking=P.prototype.has_opted_in_tracking;P.prototype.clear_opt_in_out_tracking=P.prototype.clear_opt_in_out_tracking;P.prototype.get_group=P.prototype.get_group;P.prototype.set_group=P.prototype.set_group;P.prototype.add_group=P.prototype.add_group;P.prototype.remove_group=P.prototype.remove_group;P.prototype.track_with_groups=P.prototype.track_with_groups;P.prototype.start_batch_senders=P.prototype.start_batch_senders;P.prototype.stop_batch_senders=P.prototype.stop_batch_senders;ee.prototype.properties=ee.prototype.properties;ee.prototype.update_search_keyword=ee.prototype.update_search_keyword;ee.prototype.update_referrer_info=ee.prototype.update_referrer_info;ee.prototype.get_cross_subdomain=ee.prototype.get_cross_subdomain;ee.prototype.clear=ee.prototype.clear;var ei={},F1=function(){c.each(ei,function(e,t){t!==Rt&&(Ve[t]=e)}),Ve._=c},j1=function(){Ve.init=function(e,t,n){if(n)return Ve[n]||(Ve[n]=ei[n]=Ou(e,t,n),Ve[n]._loaded()),Ve[n];var r=Ve;ei[Rt]?r=ei[Rt]:e&&(r=Ou(e,t,Rt),r._loaded(),ei[Rt]=r),Ve=r,Vc===I1&&(Ee[Rt]=Ve),F1()}},b1=function(){function e(){e.done||(e.done=!0,lv=!0,sv=!1,c.each(ei,function(r){r._dom_loaded()}))}function t(){try{de.documentElement.doScroll("left")}catch{setTimeout(t,1);return}e()}if(de.addEventListener)de.readyState==="complete"?e():de.addEventListener("DOMContentLoaded",e,!1);else if(de.attachEvent){de.attachEvent("onreadystatechange",e);var n=!1;try{n=Ee.frameElement===null}catch{}de.documentElement.doScroll&&n&&t()}c.register_event(Ee,"load",e,!0)};function z1(){return Vc=iv,Ve=new P,j1(),Ve.init(),b1(),Ve}var B1=z1(),$1=B1;const av=al($1),q1="9b5c61bf2bf4c48916655fe862e8fcbd",H1=q1,uv={OPEN_WEBAPP:"open_webapp",SEND_TRANSACTION:"send_transaction"},cv=async e=>{console.info("[mixpanel]",e),await av.track(e)};av.init(H1,{loaded:()=>{cv(uv.OPEN_WEBAPP)}});const Yc="https://18.192.129.233.sslip.io",fv=60*1e3,Q1=()=>{const{setTransaction:e,txId:t}=Vt();return console.log("useTxQuery txId",t),Qm({queryKey:["tx",`tx-${t}`],queryFn:t?()=>fetch(`${Yc}/transactions/${t}`).then(n=>n.json()):()=>l1,onSuccess:n=>{console.log("success tx data",n),e(n)},staleTime:fv})},W1=e=>{const{setUsers:t}=Vt();return Qm({queryKey:["users",`chat-${e}`],queryFn:e?()=>fetch(`${Yc}/chats/${e}/users`).then(n=>n.json()).then(n=>n.users):()=>Km,onSuccess:n=>{console.log("success users data",n),t(n)},enabled:e!==void 0,staleTime:fv})},V1=e=>fetch(`${Yc}/transactions/${e._id}`,{method:"PUT",body:JSON.stringify(e),headers:{"Content-type":"application/json"}});function K1(){Al();const e=Dc(),[t,n]=L.useState(!1),{currencies:r,transaction:i,setTransaction:o,setSuccess:s}=Vt();if(!i)return null;const l=r.find(A=>A.id===i.currency_id),a=(A,U)=>{const Z=i.shares.findIndex(V=>V.person_id===A.person_id&&V.related_user_id===A.related_user_id&&V.is_payer===A.is_payer);if(~Z){const V=[...i.shares];V[Z].amount=U,o({...i,shares:V})}},u=i.shares.filter(A=>A.is_payer).reduce((A,U)=>A+U.amount,0),f=uo(u),h=i.shares.filter(A=>!A.is_payer).reduce((A,U)=>A+U.amount,0),d=uo(h),g=1,y=uh+g,m=i.shares.filter(A=>A.related_user_id&&A.is_payer),p=i.shares.filter(A=>A.related_user_id&&!A.is_payer),_=m.map(A=>A.related_user_id),v=p.map(A=>A.related_user_id),R=_.some(A=>v.includes(A)),D=p.every(A=>A.amount===p[0].amount),T=()=>{const A=Math.round(u/p.length),U=[...i.shares];o({...i,shares:U.map(Z=>Z.is_payer?Z:{...Z,amount:A})})},O=async()=>{var U,Z;const A={...i,is_confirmed:!0};n(!0);try{await cv(uv.SEND_TRANSACTION),console.log(JSON.stringify(A,null,2));const V=await V1(A);console.log("res",V);const qe=await V.json();console.log("res json",qe),V.ok?(s(!0),(Z=(U=window==null?void 0:window.Telegram)==null?void 0:U.WebApp)==null||Z.close()):s(!1)}catch{s(!1)}finally{n(!1)}};return x.jsxs(Ll,{children:[x.jsx(Ml,{onBack:()=>{e("/")}}),x.jsxs("div",{className:"mb-2 px-4 flex items-center justify-between",children:[x.jsx("h2",{className:"pt-[2px] pb-[6px]",children:"Проверить траты"}),x.jsx(ao,{theme:"text",onClick:()=>{e("/select-currency")},children:l?l.in:"Выберите валюту"})]}),x.jsxs(ai,{className:"!pb-4",children:[x.jsxs("h3",{className:Yn(!S&&"text-error"),children:[y&&"Не хватает",S&&"Всё верно",E&&"Перебор"]}),x.jsxs("div",{className:"mt-1 text-[14px] leading-[20px] text-hint",children:["Заплатили ",f," ",l==null?void 0:l.symbol,", должны ",d," ",l==null?void 0:l.symbol]})]}),x.jsxs(ai,{children:[x.jsx("h3",{children:"Заплатили"}),x.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[!m.length&&x.jsx("span",{className:"opacity-40",children:"(Пусто)"}),m.map((A,U)=>x.jsx(zd,{...A,onChange:Z=>{a(A,Z)}},`payer-share-${U}`))]})]}),x.jsxs(ai,{children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("h3",{children:["За ",R&&x.jsx("span",{children:"себя и за"})," других"]}),!!p.length&&(!D||!S)&&x.jsx(ao,{theme:"text",onClick:T,children:"Поровну"})]}),x.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[!p.length&&x.jsx("span",{className:"opacity-40",children:"(Пусто)"}),p.map((A,U)=>x.jsx(zd,{...A,onChange:Z=>{a(A,Z)}},`owe-share-${U}`))]}),x.jsx("div",{className:"mt-8 py-2",children:x.jsx(ao,{onClick:O,disabled:!S,isBusy:t,children:"Сохранить"})})]})]})}function Xc(){return x.jsx("div",{className:"h-[1px] -my-[0.5px] mx-4 bg-[#E5E9EB] dark:bg-[#84919A]"})}function G1(){var u;Al();const{users:e,unrelatedUsers:t,selectUser:n,deleteUser:r}=Il(),{selectPersonId:i,transaction:o}=Vt(),s=i!==null?e:t,l=i!==null?(u=((o==null?void 0:o.shares)||[]).find(f=>f.person_id===i))==null?void 0:u.normalized_name:null,a=l?`Выберите, кто "${l}"`:"Выберите человека";return x.jsxs(Ll,{className:"!bg-bg",children:[x.jsx(Ml,{onBack:()=>{history.back()}}),x.jsxs("div",{className:"mb-2 px-4 flex items-center justify-between gap-3",children:[x.jsx("h2",{className:"pt-[2px] pb-[6px]",children:a}),i!==null&&x.jsx(ao,{theme:"text",onClick:r(i),children:"Удалить"})]}),x.jsx("div",{className:"mt-4 overflow-y-auto",children:s.map((f,h,d)=>x.jsxs(x.Fragment,{children:[x.jsx("button",{className:"w-full px-4 py-2 hover:bg-text/5 active:bg-text/10 transition-all",onClick:n(f),children:x.jsx(Mc,{user:f})}),hi(n),children:[x.jsx("input",{className:"hidden",id:`${e}-${n}`,name:e,checked:r}),x.jsx("div",{className:"p-1.5",children:x.jsx("div",{className:Yn("flex items-center justify-center w-5 h-5 border-2 rounded-full text-hint",r&&"!text-link"),children:x.jsx("div",{className:Yn("w-[10px] h-[10px] rounded-full bg-link opacity-0 transition-all",r&&"!opacity-100")})})}),x.jsx("div",{className:"flex-1",children:t})]})}function X1(){Al();const e=Dc(),{currencies:t,transaction:n,setCurrency:r}=Vt(),i=o=>{r(o),e("/check")};return x.jsxs(Ll,{className:"!bg-bg",children:[x.jsx(Ml,{onBack:()=>{history.back()}}),x.jsx("div",{className:"px-4",children:x.jsx("h2",{children:"Выберите валюту"})}),x.jsx("div",{className:"mt-4 overflow-y-auto",children:t.map((o,s)=>x.jsxs("div",{children:[x.jsx(Y1,{group:"currencies",label:`${o.symbol} ${o.title}`,value:o.id,checked:(n==null?void 0:n.currency_id)===o.id,onChange:i},`currencies-${o.id}`),sL.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{d:"M8 1C8 0.447715 7.55228 0 7 0C6.44772 0 6 0.447715 6 1V6H1C0.447715 6 0 6.44771 0 7C0 7.55228 0.447715 8 1 8H6V13C6 13.5523 6.44772 14 7 14C7.55228 14 8 13.5523 8 13V8H13C13.5523 8 14 7.55228 14 7C14 6.44772 13.5523 6 13 6H8V1Z",fill:"currentColor"}));/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:dv,setPrototypeOf:Xd,isFrozen:Z1,getPrototypeOf:eS,getOwnPropertyDescriptor:tS}=Object;let{freeze:Ze,seal:Wt,create:nS}=Object,{apply:Du,construct:Nu}=typeof Reflect<"u"&&Reflect;Du||(Du=function(t,n,r){return t.apply(n,r)});Ze||(Ze=function(t){return t});Wt||(Wt=function(t){return t});Nu||(Nu=function(t,n){return new t(...n)});const rS=At(Array.prototype.forEach),Jd=At(Array.prototype.pop),Hi=At(Array.prototype.push),Ts=At(String.prototype.toLowerCase),ya=At(String.prototype.toString),iS=At(String.prototype.match),Ft=At(String.prototype.replace),oS=At(String.prototype.indexOf),sS=At(String.prototype.trim),ht=At(RegExp.prototype.test),Qi=lS(TypeError);function At(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i/gm),dS=Wt(/\${[\w\W]*}/gm),hS=Wt(/^data-[\-\w.\u00B7-\uFFFF]/),pS=Wt(/^aria-[\-\w]+$/),hv=Wt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mS=Wt(/^(?:\w+script|data):/i),vS=Wt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),pv=Wt(/^html$/i);var rh=Object.freeze({__proto__:null,MUSTACHE_EXPR:cS,ERB_EXPR:fS,TMPLIT_EXPR:dS,DATA_ATTR:hS,ARIA_ATTR:pS,IS_ALLOWED_URI:hv,IS_SCRIPT_OR_DATA:mS,ATTR_WHITESPACE:vS,DOCTYPE_NAME:pv});const gS=()=>typeof window>"u"?null:window,yS=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function mv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gS();const t=q=>mv(q);if(t.version="3.0.5",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;const n=e.document,r=n.currentScript;let{document:i}=e;const{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:a,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:g}=e,y=a.prototype,S=cs(y,"cloneNode"),E=cs(y,"nextSibling"),m=cs(y,"childNodes"),p=cs(y,"parentNode");if(typeof s=="function"){const q=i.createElement("template");q.content&&q.content.ownerDocument&&(i=q.content.ownerDocument)}let _,v="";const{implementation:R,createNodeIterator:D,createDocumentFragment:T,getElementsByTagName:O}=i,{importNode:A}=n;let U={};t.isSupported=typeof dv=="function"&&typeof p=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Z,ERB_EXPR:V,TMPLIT_EXPR:qe,DATA_ATTR:Cn,ARIA_ATTR:Kt,IS_SCRIPT_OR_DATA:at,ATTR_WHITESPACE:ut}=rh;let{IS_ALLOWED_URI:F}=rh,b=null;const K=J({},[...Zd,..._a,...Sa,...wa,...eh]);let X=null;const _e=J({},[...th,...Ea,...nh,...fs]);let ae=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,ct=null,ft=!0,Gt=!0,It=!1,qo=!0,Tn=!1,Yt=!1,Ti=!1,Ri=!1,Rn=!1,Xt=!1,lr=!1,Ir=!0,ar=!1;const Pi="user-content-";let St=!0,Pn=!1,an={},un=null;const Ho=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Oi=null;const ur=J({},["audio","video","img","source","image","track"]);let Mr=null;const Lr=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ur="http://www.w3.org/1998/Math/MathML",cr="http://www.w3.org/2000/svg",Mt="http://www.w3.org/1999/xhtml";let cn=Mt,Di=!1,k=null;const C=J({},[Ur,cr,Mt],ya);let N;const B=["application/xhtml+xml","text/html"],G="text/html";let $,W=null;const Q=i.createElement("form"),H=function(w){return w instanceof RegExp||w instanceof Function},se=function(w){if(!(W&&W===w)){if((!w||typeof w!="object")&&(w={}),w=jr(w),N=B.indexOf(w.PARSER_MEDIA_TYPE)===-1?N=G:N=w.PARSER_MEDIA_TYPE,$=N==="application/xhtml+xml"?ya:Ts,b="ALLOWED_TAGS"in w?J({},w.ALLOWED_TAGS,$):K,X="ALLOWED_ATTR"in w?J({},w.ALLOWED_ATTR,$):_e,k="ALLOWED_NAMESPACES"in w?J({},w.ALLOWED_NAMESPACES,ya):C,Mr="ADD_URI_SAFE_ATTR"in w?J(jr(Lr),w.ADD_URI_SAFE_ATTR,$):Lr,Oi="ADD_DATA_URI_TAGS"in w?J(jr(ur),w.ADD_DATA_URI_TAGS,$):ur,un="FORBID_CONTENTS"in w?J({},w.FORBID_CONTENTS,$):Ho,oe="FORBID_TAGS"in w?J({},w.FORBID_TAGS,$):{},ct="FORBID_ATTR"in w?J({},w.FORBID_ATTR,$):{},an="USE_PROFILES"in w?w.USE_PROFILES:!1,ft=w.ALLOW_ARIA_ATTR!==!1,Gt=w.ALLOW_DATA_ATTR!==!1,It=w.ALLOW_UNKNOWN_PROTOCOLS||!1,qo=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Tn=w.SAFE_FOR_TEMPLATES||!1,Yt=w.WHOLE_DOCUMENT||!1,Rn=w.RETURN_DOM||!1,Xt=w.RETURN_DOM_FRAGMENT||!1,lr=w.RETURN_TRUSTED_TYPE||!1,Ri=w.FORCE_BODY||!1,Ir=w.SANITIZE_DOM!==!1,ar=w.SANITIZE_NAMED_PROPS||!1,St=w.KEEP_CONTENT!==!1,Pn=w.IN_PLACE||!1,F=w.ALLOWED_URI_REGEXP||hv,cn=w.NAMESPACE||Mt,ae=w.CUSTOM_ELEMENT_HANDLING||{},w.CUSTOM_ELEMENT_HANDLING&&H(w.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ae.tagNameCheck=w.CUSTOM_ELEMENT_HANDLING.tagNameCheck),w.CUSTOM_ELEMENT_HANDLING&&H(w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ae.attributeNameCheck=w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ae.allowCustomizedBuiltInElements=w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Tn&&(Gt=!1),Xt&&(Rn=!0),an&&(b=J({},[...eh]),X=[],an.html===!0&&(J(b,Zd),J(X,th)),an.svg===!0&&(J(b,_a),J(X,Ea),J(X,fs)),an.svgFilters===!0&&(J(b,Sa),J(X,Ea),J(X,fs)),an.mathMl===!0&&(J(b,wa),J(X,nh),J(X,fs))),w.ADD_TAGS&&(b===K&&(b=jr(b)),J(b,w.ADD_TAGS,$)),w.ADD_ATTR&&(X===_e&&(X=jr(X)),J(X,w.ADD_ATTR,$)),w.ADD_URI_SAFE_ATTR&&J(Mr,w.ADD_URI_SAFE_ATTR,$),w.FORBID_CONTENTS&&(un===Ho&&(un=jr(un)),J(un,w.FORBID_CONTENTS,$)),St&&(b["#text"]=!0),Yt&&J(b,["html","head","body"]),b.table&&(J(b,["tbody"]),delete oe.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=w.TRUSTED_TYPES_POLICY,v=_.createHTML("")}else _===void 0&&(_=yS(g,r)),_!==null&&typeof v=="string"&&(v=_.createHTML(""));Ze&&Ze(w),W=w}},re=J({},["mi","mo","mn","ms","mtext"]),He=J({},["foreignobject","desc","title","annotation-xml"]),Re=J({},["title","style","font","a","script"]),Ae=J({},_a);J(Ae,Sa),J(Ae,aS);const nt=J({},wa);J(nt,uS);const fr=function(w){let I=p(w);(!I||!I.tagName)&&(I={namespaceURI:cn,tagName:"template"});const j=Ts(w.tagName),ue=Ts(I.tagName);return k[w.namespaceURI]?w.namespaceURI===cr?I.namespaceURI===Mt?j==="svg":I.namespaceURI===Ur?j==="svg"&&(ue==="annotation-xml"||re[ue]):!!Ae[j]:w.namespaceURI===Ur?I.namespaceURI===Mt?j==="math":I.namespaceURI===cr?j==="math"&&He[ue]:!!nt[j]:w.namespaceURI===Mt?I.namespaceURI===cr&&!He[ue]||I.namespaceURI===Ur&&!re[ue]?!1:!nt[j]&&(Re[j]||!Ae[j]):!!(N==="application/xhtml+xml"&&k[w.namespaceURI]):!1},Lt=function(w){Hi(t.removed,{element:w});try{w.parentNode.removeChild(w)}catch{w.remove()}},On=function(w,I){try{Hi(t.removed,{attribute:I.getAttributeNode(w),from:I})}catch{Hi(t.removed,{attribute:null,from:I})}if(I.removeAttribute(w),w==="is"&&!X[w])if(Rn||Xt)try{Lt(I)}catch{}else try{I.setAttribute(w,"")}catch{}},wt=function(w){let I,j;if(Ri)w=""+w;else{const Et=iS(w,/^[\r\n\t ]+/);j=Et&&Et[0]}N==="application/xhtml+xml"&&cn===Mt&&(w=''+w+"");const ue=_?_.createHTML(w):w;if(cn===Mt)try{I=new d().parseFromString(ue,N)}catch{}if(!I||!I.documentElement){I=R.createDocument(cn,"template",null);try{I.documentElement.innerHTML=Di?v:ue}catch{}}const Fe=I.body||I.documentElement;return w&&j&&Fe.insertBefore(i.createTextNode(j),Fe.childNodes[0]||null),cn===Mt?O.call(I,Yt?"html":"body")[0]:Yt?I.documentElement:Fe},dr=function(w){return D.call(w.ownerDocument||w,w,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},Ni=function(w){return w instanceof h&&(typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||!(w.attributes instanceof f)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function")},Dn=function(w){return typeof l=="object"?w instanceof l:w&&typeof w=="object"&&typeof w.nodeType=="number"&&typeof w.nodeName=="string"},dt=function(w,I,j){U[w]&&rS(U[w],ue=>{ue.call(t,I,j,W)})},hr=function(w){let I;if(dt("beforeSanitizeElements",w,null),Ni(w))return Lt(w),!0;const j=$(w.nodeName);if(dt("uponSanitizeElement",w,{tagName:j,allowedTags:b}),w.hasChildNodes()&&!Dn(w.firstElementChild)&&(!Dn(w.content)||!Dn(w.content.firstElementChild))&&ht(/<[/\w]/g,w.innerHTML)&&ht(/<[/\w]/g,w.textContent))return Lt(w),!0;if(!b[j]||oe[j]){if(!oe[j]&&Ye(j)&&(ae.tagNameCheck instanceof RegExp&&ht(ae.tagNameCheck,j)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(j)))return!1;if(St&&!un[j]){const ue=p(w)||w.parentNode,Fe=m(w)||w.childNodes;if(Fe&&ue){const Et=Fe.length;for(let Se=Et-1;Se>=0;--Se)ue.insertBefore(S(Fe[Se],!0),E(w))}}return Lt(w),!0}return w instanceof a&&!fr(w)||(j==="noscript"||j==="noembed"||j==="noframes")&&ht(/<\/no(script|embed|frames)/i,w.innerHTML)?(Lt(w),!0):(Tn&&w.nodeType===3&&(I=w.textContent,I=Ft(I,Z," "),I=Ft(I,V," "),I=Ft(I,qe," "),w.textContent!==I&&(Hi(t.removed,{element:w.cloneNode()}),w.textContent=I)),dt("afterSanitizeElements",w,null),!1)},fe=function(w,I,j){if(Ir&&(I==="id"||I==="name")&&(j in i||j in Q))return!1;if(!(Gt&&!ct[I]&&ht(Cn,I))){if(!(ft&&ht(Kt,I))){if(!X[I]||ct[I]){if(!(Ye(w)&&(ae.tagNameCheck instanceof RegExp&&ht(ae.tagNameCheck,w)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(w))&&(ae.attributeNameCheck instanceof RegExp&&ht(ae.attributeNameCheck,I)||ae.attributeNameCheck instanceof Function&&ae.attributeNameCheck(I))||I==="is"&&ae.allowCustomizedBuiltInElements&&(ae.tagNameCheck instanceof RegExp&&ht(ae.tagNameCheck,j)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(j))))return!1}else if(!Mr[I]){if(!ht(F,Ft(j,ut,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&w!=="script"&&oS(j,"data:")===0&&Oi[w])){if(!(It&&!ht(at,Ft(j,ut,"")))){if(j)return!1}}}}}}return!0},Ye=function(w){return w.indexOf("-")>0},fn=function(w){let I,j,ue,Fe;dt("beforeSanitizeAttributes",w,null);const{attributes:Et}=w;if(!Et)return;const Se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X};for(Fe=Et.length;Fe--;){I=Et[Fe];const{name:Jt,namespaceURI:bl}=I;if(j=Jt==="value"?I.value:sS(I.value),ue=$(Jt),Se.attrName=ue,Se.attrValue=j,Se.keepAttr=!0,Se.forceKeepAttr=void 0,dt("uponSanitizeAttribute",w,Se),j=Se.attrValue,Se.forceKeepAttr||(On(Jt,w),!Se.keepAttr))continue;if(!qo&&ht(/\/>/i,j)){On(Jt,w);continue}Tn&&(j=Ft(j,Z," "),j=Ft(j,V," "),j=Ft(j,qe," "));const Jc=$(w.nodeName);if(fe(Jc,ue,j)){if(ar&&(ue==="id"||ue==="name")&&(On(Jt,w),j=Pi+j),_&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!bl)switch(g.getAttributeType(Jc,ue)){case"TrustedHTML":{j=_.createHTML(j);break}case"TrustedScriptURL":{j=_.createScriptURL(j);break}}try{bl?w.setAttributeNS(bl,Jt,j):w.setAttribute(Jt,j),Jd(t.removed)}catch{}}}dt("afterSanitizeAttributes",w,null)},Ie=function q(w){let I;const j=dr(w);for(dt("beforeSanitizeShadowDOM",w,null);I=j.nextNode();)dt("uponSanitizeShadowNode",I,null),!hr(I)&&(I.content instanceof o&&q(I.content),fn(I));dt("afterSanitizeShadowDOM",w,null)};return t.sanitize=function(q){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I,j,ue,Fe;if(Di=!q,Di&&(q=""),typeof q!="string"&&!Dn(q))if(typeof q.toString=="function"){if(q=q.toString(),typeof q!="string")throw Qi("dirty is not a string, aborting")}else throw Qi("toString is not a function");if(!t.isSupported)return q;if(Ti||se(w),t.removed=[],typeof q=="string"&&(Pn=!1),Pn){if(q.nodeName){const Jt=$(q.nodeName);if(!b[Jt]||oe[Jt])throw Qi("root node is forbidden and cannot be sanitized in-place")}}else if(q instanceof l)I=wt(""),j=I.ownerDocument.importNode(q,!0),j.nodeType===1&&j.nodeName==="BODY"||j.nodeName==="HTML"?I=j:I.appendChild(j);else{if(!Rn&&!Tn&&!Yt&&q.indexOf("<")===-1)return _&&lr?_.createHTML(q):q;if(I=wt(q),!I)return Rn?null:lr?v:""}I&&Ri&&Lt(I.firstChild);const Et=dr(Pn?q:I);for(;ue=Et.nextNode();)hr(ue)||(ue.content instanceof o&&Ie(ue.content),fn(ue));if(Pn)return q;if(Rn){if(Xt)for(Fe=T.call(I.ownerDocument);I.firstChild;)Fe.appendChild(I.firstChild);else Fe=I;return(X.shadowroot||X.shadowrootmode)&&(Fe=A.call(n,Fe,!0)),Fe}let Se=Yt?I.outerHTML:I.innerHTML;return Yt&&b["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&ht(pv,I.ownerDocument.doctype.name)&&(Se=" -`+Se),Tn&&(Se=Ft(Se,Z," "),Se=Ft(Se,V," "),Se=Ft(Se,qe," ")),_&&lr?_.createHTML(Se):Se},t.setConfig=function(q){se(q),Ti=!0},t.clearConfig=function(){W=null,Ti=!1},t.isValidAttribute=function(q,w,I){W||se({});const j=$(q),ue=$(w);return fe(j,ue,I)},t.addHook=function(q,w){typeof w=="function"&&(U[q]=U[q]||[],Hi(U[q],w))},t.removeHook=function(q){if(U[q])return Jd(U[q])},t.removeHooks=function(q){U[q]&&(U[q]=[])},t.removeAllHooks=function(){U={}},t}var _S=mv();const SS=({string:e,allowedTags:t})=>{const n=_S.sanitize(e,{ALLOWED_TAGS:t});return x.jsx("span",{dangerouslySetInnerHTML:{__html:n}})},wS=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 6.29289C9.68342 5.90237 10.3166 5.90237 10.7071 6.29289L15.7071 11.2929C16.0976 11.6834 16.0976 12.3166 15.7071 12.7071L10.7071 17.7071C10.3166 18.0976 9.68342 18.0976 9.29289 17.7071C8.90237 17.3166 8.90237 16.6834 9.29289 16.2929L13.5858 12L9.29289 7.70711C8.90237 7.31658 8.90237 6.68342 9.29289 6.29289Z",fill:"currentColor"}));function ES({normalized_name:e,related_user_id:t,onClick:n}){const{getUserById:r}=Il(),i=t?r(t):void 0;return x.jsxs("button",{className:"w-full flex gap-3 text-left items-center px-4 py-2.5 truncate hover:bg-text/5 active:bg-text/10 transition-all",onClick:n,children:[x.jsx("div",{className:"flex w-[35%] truncate",children:e?x.jsx("div",{className:"truncate",children:e==="MESSAGE_AUTHOR"?x.jsx("span",{className:"font-semibold",children:"Вы"}):x.jsx("span",{children:e})}):x.jsx("div",{className:"truncate opacity-30",children:"(доп.)"})}),x.jsx("div",{className:"flex w-[55%] truncate",children:x.jsx(Mc,{user:i})}),x.jsx("div",{className:"h-6 w-6 text-hint opacity-50",children:x.jsx(wS,{})})]})}function xa(){Al();const e=Dc(),{transaction:t,setSelectPersonId:n}=Vt(),{unrelatedUsers:r,isRelationsComplete:i}=Il();if(!t)return null;const o=t.shares.reduce((u,f)=>u.map(d=>d.person_id).includes(f.person_id)?u:[...u,f],[]),s=u=>{n(u),e("/select-user")},l=()=>{n(null),e("/select-user")},a=()=>{alert("close webapp...")};return x.jsxs(Ll,{children:[x.jsx(Ml,{onCancel:a}),x.jsxs(ai,{children:[x.jsx("div",{className:"text-[12px] leading-[1.33em] font-medium text-hint",children:"Сообщение"}),x.jsxs("div",{className:"mt-1",children:[!!t.is_voice&&x.jsx("span",{children:"🎙 "}),t.formatted_text?x.jsx(SS,{allowedTags:["b","strong"],string:t.formatted_text}):x.jsx("strong",{children:t.raw_text})]})]}),x.jsxs(ai,{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Соотнесите людей"}),x.jsx("div",{className:"mt-1 text-[14px] leading-[20px] text-hint",children:"Со временем мы запомним соотношения"}),x.jsx("div",{className:"mt-2 -mx-4 overflow-y-auto",children:o.map((u,f)=>x.jsxs("div",{children:[x.jsx(ES,{...u,onClick:()=>s(u.person_id)},`UserRelation-${f}`),f{e("/check")},children:"Далее"})})]})]})}function xS(){const{isLoading:e,error:t,data:n}=Q1(),{isLoading:r,error:i}=W1(n?n.chat_id:void 0),o=e||r,s=t||i,{isSuccess:l}=Vt(),a=o||s||l;return x.jsx("div",{className:Yn("fixed top-0 left-0 w-full h-full overflow-y-auto bg-bg2 transition-all",a?"opacity-100":"pointer-events-none opacity-0"),children:x.jsxs("div",{className:"flex items-center justify-center w-full min-h-full",children:[o&&x.jsx(Ym,{size:50}),!!s&&x.jsxs("div",{className:"p-4 text-center text-[#c00]",children:["Ошибка: ",s.message]}),!!l&&x.jsx("div",{className:"p-4 text-center text-button text-[24px]",children:"Успешно!"}),l===!1&&x.jsx("div",{className:"p-4 text-center text-[#c00] text-[24px]",children:"Ошибка сохранения"})]})})}const kS=new h0;function CS(){const{isDarkTheme:e}=Gm(),{txId:t}=Vt(),n=Y_([{path:"/",element:x.jsx(xa,{}),errorElement:x.jsx(xa,{})},{path:"*",element:x.jsx(xa,{})},{path:"/select-user",element:x.jsx(G1,{})},{path:"/check",element:x.jsx(K1,{})},{path:"/select-currency",element:x.jsx(X1,{})}]);return x.jsx(P0,{client:kS,children:x.jsxs("div",{className:Yn(e?"theme-dark":"theme-light"),children:[x.jsx(W_,{router:n}),x.jsx(xS,{}),t===null&&x.jsx("div",{className:"fixed bottom-0 width-auto left-[50%] -translate-x-[50%] text-[13px] font-semibold px-2 py-1 bg-[#3a3] text-white rounded-t-md",children:"Демо-режим"})]})})}ka.createRoot(document.getElementById("root")).render(x.jsx(hh.StrictMode,{children:x.jsx(CS,{})})); +`);var t="",n,r,i=0,o;for(n=r=0,i=e.length,o=0;o127&&s<2048?l=String.fromCharCode(s>>6|192,s&63|128):l=String.fromCharCode(s>>12|224,s>>6&63|128,s&63|128),l!==null&&(r>n&&(t+=e.substring(n,r)),t+=l,n=r=o+1)}return r>n&&(t+=e.substring(n,e.length)),t};c.UUID=function(){var e=function(){var r=1*new Date,i;if(Ee.performance&&Ee.performance.now)i=Ee.performance.now();else for(i=0;r==1*new Date;)i++;return r.toString(16)+Math.floor(i).toString(16)},t=function(){return Math.random().toString(16).replace(".","")},n=function(){var r=tn,i,o,s=[],l=0;function a(u,f){var h,d=0;for(h=0;h=4&&(l=a(l,s),s=[]);return s.length>0&&(l=a(l,s)),l.toString(16)};return function(){var r=(nl.height*nl.width).toString(16);return e()+"-"+t()+"-"+n()+"-"+r+"-"+e()}}();var Qd=["ahrefsbot","baiduspider","bingbot","bingpreview","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];c.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t=0}function r(i){if(!de.getElementsByTagName)return[];var o=i.split(" "),s,l,a,u,f,h,d,g,y,S,E=[de];for(h=0;h-1){l=s.split("#"),a=l[0];var m=l[1],p=de.getElementById(m);if(!p||a&&p.nodeName.toLowerCase()!=a)return[];E=[p];continue}if(s.indexOf(".")>-1){l=s.split("."),a=l[0];var _=l[1];for(a||(a="*"),u=[],f=0,d=0;d-1};break;default:O=function(A){return A.getAttribute(R)}}for(E=[],S=0,d=0;d=3?t[2]:""},properties:function(){return c.extend(c.strip_empty_properties({$os:c.info.os(),$browser:c.info.browser(tn,Bn.vendor,us),$referrer:de.referrer,$referring_domain:c.info.referringDomain(de.referrer),$device:c.info.device(tn)}),{$current_url:Ee.location.href,$browser_version:c.info.browserVersion(tn,Bn.vendor,us),$screen_height:nl.height,$screen_width:nl.width,mp_lib:"web",$lib_version:gn.LIB_VERSION,$insert_id:Uc(),time:c.timestamp()/1e3})},people_properties:function(){return c.extend(c.strip_empty_properties({$os:c.info.os(),$browser:c.info.browser(tn,Bn.vendor,us)}),{$browser_version:c.info.browserVersion(tn,Bn.vendor,us)})},mpPageViewProperties:function(){return c.strip_empty_properties({current_page_title:de.title,current_domain:Ee.location.hostname,current_url_path:Ee.location.pathname,current_url_protocol:Ee.location.protocol,current_url_search:Ee.location.search})}};var Uc=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},E1=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,x1=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Wd=function(e){var t=x1,n=e.split("."),r=n[n.length-1];(r.length>4||r==="com"||r==="org")&&(t=E1);var i=e.match(t);return i?i[0]:""},il=null,ol=null;typeof JSON<"u"&&(il=JSON.stringify,ol=JSON.parse);il=il||c.JSONEncode;ol=ol||c.JSONDecode;c.toArray=c.toArray;c.isObject=c.isObject;c.JSONEncode=c.JSONEncode;c.JSONDecode=c.JSONDecode;c.isBlockedUA=c.isBlockedUA;c.isEmptyObject=c.isEmptyObject;c.info=c.info;c.info.device=c.info.device;c.info.browser=c.info.browser;c.info.browserVersion=c.info.browserVersion;c.info.properties=c.info.properties;var kn=function(){};kn.prototype.create_properties=function(){};kn.prototype.event_handler=function(){};kn.prototype.after_track_handler=function(){};kn.prototype.init=function(e){return this.mp=e,this};kn.prototype.track=function(e,t,n,r){var i=this,o=c.dom_query(e);if(o.length===0){ce.error("The DOM query ("+e+") returned 0 elements");return}return c.each(o,function(s){c.register_event(s,this.override_event,function(l){var a={},u=i.create_properties(n,this),f=i.mp.get_config("track_links_timeout");i.event_handler(l,this,a),window.setTimeout(i.track_callback(r,u,a,!0),f),i.mp.track(t,u,i.track_callback(r,u,a))})},this),!0};kn.prototype.track_callback=function(e,t,n,r){r=r||!1;var i=this;return function(){n.callback_fired||(n.callback_fired=!0,!(e&&e(r,t)===!1)&&i.after_track_handler(t,n,r))}};kn.prototype.create_properties=function(e,t){var n;return typeof e=="function"?n=e(t):n=c.extend({},e),n};var yi=function(){this.override_event="click"};c.inherit(yi,kn);yi.prototype.create_properties=function(e,t){var n=yi.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n};yi.prototype.event_handler=function(e,t,n){n.new_tab=e.which===2||e.metaKey||e.ctrlKey||t.target==="_blank",n.href=t.href,n.new_tab||e.preventDefault()};yi.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var jl=function(){this.override_event="submit"};c.inherit(jl,kn);jl.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()};jl.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var k1=Lc("lock"),Jm=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};Jm.prototype.withLock=function(e,t,n){!n&&typeof t!="function"&&(n=t,t=null);var r=n||new Date().getTime()+"|"+Math.random(),i=new Date().getTime(),o=this.storageKey,s=this.pollIntervalMS,l=this.timeoutMS,a=this.storage,u=o+":X",f=o+":Y",h=o+":Z",d=function(p){t&&t(p)},g=function(p){if(new Date().getTime()-i>l){k1.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+r+"]"),a.removeItem(h),a.removeItem(f),E();return}setTimeout(function(){try{p()}catch(_){d(_)}},s*(Math.random()+.1))},y=function(p,_){p()?_():g(function(){y(p,_)})},S=function(){var p=a.getItem(f);if(p&&p!==r)return!1;if(a.setItem(f,r),a.getItem(f)===r)return!0;if(!rl(a,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},E=function(){a.setItem(u,r),y(S,function(){if(a.getItem(u)===r){m();return}g(function(){if(a.getItem(f)!==r){E();return}y(function(){return!a.getItem(h)},m)})})},m=function(){a.setItem(h,"1");try{e()}finally{a.removeItem(h),a.getItem(f)===r&&a.removeItem(f),a.getItem(u)===r&&a.removeItem(u)}};try{if(rl(a,!0))E();else throw new Error("localStorage support check failed")}catch(p){d(p)}};var Vd=Lc("batch"),or=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||c.bind(Vd.error,Vd),this.lock=new Jm(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};or.prototype.enqueue=function(e,t,n){var r={id:Uc(),flushAfter:new Date().getTime()+t*2,payload:e};this.lock.withLock(c.bind(function(){var o;try{var s=this.readFromStorage();s.push(r),o=this.saveToStorage(s),o&&this.memQueue.push(r)}catch{this.reportError("Error enqueueing item",e),o=!1}n&&n(o)},this),c.bind(function(o){this.reportError("Error acquiring storage lock",o),n&&n(!1)},this),this.pid)};or.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(t.lengtho.flushAfter&&!r[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}}return t};var Kd=function(e,t){var n=[];return c.each(e,function(r){r.id&&!t[r.id]&&n.push(r)}),n};or.prototype.removeItemsByID=function(e,t){var n={};c.each(e,function(i){n[i]=!0}),this.memQueue=Kd(this.memQueue,n);var r=c.bind(function(){var i;try{var o=this.readFromStorage();if(o=Kd(o,n),i=this.saveToStorage(o),i){o=this.readFromStorage();for(var s=0;s5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:u,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[d]}),h=!1):this.reportError("[dupe] found item with no ID",{item:u}),h&&o.push(f)}s[u.id]=f},this),o.length<1){this.resetFlush();return}this.requestInProgress=!0;var l=c.bind(function(u){this.requestInProgress=!1;try{var f=!1;if(e.unloading)this.queue.updatePayloads(s);else if(c.isObject(u)&&u.error==="timeout"&&new Date().getTime()-n>=t)this.reportError("Network timeout; retrying"),this.flush();else if(c.isObject(u)&&u.xhr_req&&(u.xhr_req.status>=500||u.xhr_req.status===429||u.error==="timeout")){var h=this.flushInterval*2,d=u.xhr_req.responseHeaders;if(d){var g=d["Retry-After"];g&&(h=parseInt(g,10)*1e3||h)}h=Math.min(C1,h),this.reportError("Error; retry in "+h+" ms"),this.scheduleFlush(h)}else if(c.isObject(u)&&u.xhr_req&&u.xhr_req.status===413)if(i.length>1){var y=Math.max(1,Math.floor(r/2));this.batchSize=Math.min(this.batchSize,y,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),f=!0;else f=!0;f&&(this.queue.removeItemsByID(c.map(i,function(S){return S.id}),c.bind(function(S){S?(this.consecutiveRemovalFailures=0,this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),c.each(i,c.bind(function(S){var E=S.id;E?(this.itemIdsSentSuccessfully[E]=this.itemIdsSentSuccessfully[E]||0,this.itemIdsSentSuccessfully[E]++,this.itemIdsSentSuccessfully[E]>5&&this.reportError("[dupe] item ID sent too many times",{item:S,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[E]})):this.reportError("[dupe] found item with no ID while removing",{item:S})},this)))}catch(S){this.reportError("Error handling API response",S),this.resetFlush()}},this),a={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(a.transport="sendBeacon"),co.log("MIXPANEL REQUEST:",o),this.sendRequest(o,a,l)}catch(u){this.reportError("Error flushing request queue",u),this.resetFlush()}};ln.prototype.reportError=function(e,t){if(co.error.apply(co.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){co.error(n)}};var T1="__mp_opt_in_out_";function R1(e,t){tv(!0,e,t)}function P1(e,t){tv(!1,e,t)}function O1(e,t){return ev(e,t)==="1"}function Zm(e,t){if(N1(t))return ce.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n=ev(e,t)==="0";return n&&ce.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function ki(e){return bc(e,function(t){return this.get_config(t)})}function sr(e){return bc(e,function(t){return this._get_config(t)})}function Ci(e){return bc(e,function(t){return this._get_config(t)})}function D1(e,t){t=t||{},Fc(t).remove(jc(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function Fc(e){return e=e||{},e.persistenceType==="localStorage"?c.localStorage:c.cookie}function jc(e,t){return t=t||{},(t.persistencePrefix||T1)+e}function ev(e,t){return Fc(t).get(jc(e,t))}function N1(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||Ee,n=t.navigator||{},r=!1;return c.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(i){c.includes([!0,1,"1","yes"],i)&&(r=!0)}),r}function tv(e,t,n){if(!c.isString(t)||!t.length){ce.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token");return}n=n||{},Fc(n).set(jc(t,n),e?1:0,c.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})}function bc(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),l=t.call(this,"window");r&&(n=Zm(r,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:l}))}catch(u){ce.error("Unexpected error when checking tracking opt-out status: "+u)}if(!n)return e.apply(this,arguments);var a=arguments[arguments.length-1];typeof a=="function"&&a(0)}}var er="$set",_i="$set_once",$t="$unset",Or="$add",En="$append",Dr="$union",tr="$remove",A1="$delete",nv={set_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[er]=r,n},unset_action:function(e){var t={},n=[];return c.isArray(e)||(e=[e]),c.each(e,function(r){this._is_reserved_property(r)||n.push(r)},this),t[$t]=n,t},set_once_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[_i]=r,n},union_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=c.isArray(i)?i:[i])},this):r[e]=c.isArray(t)?t:[t],n[Dr]=r,n},append_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[En]=r,n},remove_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[tr]=r,n},delete_action:function(){var e={};return e[A1]="",e}},ve=function(){};c.extend(ve.prototype,nv);ve.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n};ve.prototype.set=Ci(function(e,t,n){var r=this.set_action(e,t);return c.isObject(e)&&(n=t),this._send_request(r,n)});ve.prototype.set_once=Ci(function(e,t,n){var r=this.set_once_action(e,t);return c.isObject(e)&&(n=t),this._send_request(r,n)});ve.prototype.unset=Ci(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)});ve.prototype.union=Ci(function(e,t,n){c.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)});ve.prototype.delete=Ci(function(e){var t=this.delete_action();return this._send_request(t,e)});ve.prototype.remove=Ci(function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)});ve.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=c.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/groups/",batcher:this._mixpanel.request_batchers.groups},t)};ve.prototype._is_reserved_property=function(e){return e==="$group_key"||e==="$group_id"};ve.prototype._get_config=function(e){return this._mixpanel.get_config(e)};ve.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id};ve.prototype.remove=ve.prototype.remove;ve.prototype.set=ve.prototype.set;ve.prototype.set_once=ve.prototype.set_once;ve.prototype.union=ve.prototype.union;ve.prototype.unset=ve.prototype.unset;ve.prototype.toString=ve.prototype.toString;var Y=function(){};c.extend(Y.prototype,nv);Y.prototype._init=function(e){this._mixpanel=e};Y.prototype.set=sr(function(e,t,n){var r=this.set_action(e,t);return c.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[er]=c.extend({},c.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),r[er]),this._send_request(r,n)});Y.prototype.set_once=sr(function(e,t,n){var r=this.set_once_action(e,t);return c.isObject(e)&&(n=t),this._send_request(r,n)});Y.prototype.unset=sr(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)});Y.prototype.increment=sr(function(e,t,n){var r={},i={};return c.isObject(e)?(c.each(e,function(o,s){if(!this._is_reserved_property(s))if(isNaN(parseFloat(o))){ce.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[s]=o},this),n=t):(c.isUndefined(t)&&(t=1),i[e]=t),r[Or]=i,this._send_request(r,n)});Y.prototype.append=sr(function(e,t,n){c.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)});Y.prototype.remove=sr(function(e,t,n){c.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)});Y.prototype.union=sr(function(e,t,n){c.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)});Y.prototype.track_charge=sr(function(e,t,n){if(!c.isNumber(e)&&(e=parseFloat(e),isNaN(e))){ce.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",c.extend({$amount:e},t),n)});Y.prototype.clear_charges=function(e){return this.set("$transactions",[],e)};Y.prototype.delete_user=function(){if(!this._identify_called()){ce.error("mixpanel.people.delete_user() requires you to call identify() first");return}var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)};Y.prototype.toString=function(){return this._mixpanel.toString()+".people"};Y.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=c.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/engage/",batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),c.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),c.truncate(o,255))};Y.prototype._get_config=function(e){return this._mixpanel.get_config(e)};Y.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0};Y.prototype._enqueue=function(e){er in e?this._mixpanel.persistence._add_to_people_queue(er,e):_i in e?this._mixpanel.persistence._add_to_people_queue(_i,e):$t in e?this._mixpanel.persistence._add_to_people_queue($t,e):Or in e?this._mixpanel.persistence._add_to_people_queue(Or,e):En in e?this._mixpanel.persistence._add_to_people_queue(En,e):tr in e?this._mixpanel.persistence._add_to_people_queue(tr,e):Dr in e?this._mixpanel.persistence._add_to_people_queue(Dr,e):ce.error("Invalid call to _enqueue():",e)};Y.prototype._flush_one_queue=function(e,t,n,r){var i=this,o=c.extend({},this._mixpanel.persistence._get_queue(e)),s=o;!c.isUndefined(o)&&c.isObject(o)&&!c.isEmptyObject(o)&&(i._mixpanel.persistence._pop_from_people_queue(e,o),r&&(s=r(o)),t.call(i,s,function(l,a){l===0&&i._mixpanel.persistence._add_to_people_queue(e,o),c.isUndefined(n)||n(l,a)}))};Y.prototype._flush=function(e,t,n,r,i,o,s){var l=this,a=this._mixpanel.persistence._get_queue(En),u=this._mixpanel.persistence._get_queue(tr);if(this._flush_one_queue(er,this.set,e),this._flush_one_queue(_i,this.set_once,r),this._flush_one_queue($t,this.unset,o,function(E){return c.keys(E)}),this._flush_one_queue(Or,this.increment,t),this._flush_one_queue(Dr,this.union,i),!c.isUndefined(a)&&c.isArray(a)&&a.length){for(var f,h=function(E,m){E===0&&l._mixpanel.persistence._add_to_people_queue(En,f),c.isUndefined(n)||n(E,m)},d=a.length-1;d>=0;d--)f=a.pop(),c.isEmptyObject(f)||l.append(f,h);l._mixpanel.persistence.save()}if(!c.isUndefined(u)&&c.isArray(u)&&u.length){for(var g,y=function(E,m){E===0&&l._mixpanel.persistence._add_to_people_queue(tr,g),c.isUndefined(s)||s(E,m)},S=u.length-1;S>=0;S--)g=u.pop(),c.isEmptyObject(g)||l.remove(g,y);l._mixpanel.persistence.save()}};Y.prototype._is_reserved_property=function(e){return e==="$distinct_id"||e==="$token"||e==="$device_id"||e==="$user_id"||e==="$had_persisted_distinct_id"};Y.prototype.set=Y.prototype.set;Y.prototype.set_once=Y.prototype.set_once;Y.prototype.unset=Y.prototype.unset;Y.prototype.increment=Y.prototype.increment;Y.prototype.append=Y.prototype.append;Y.prototype.remove=Y.prototype.remove;Y.prototype.union=Y.prototype.union;Y.prototype.track_charge=Y.prototype.track_charge;Y.prototype.clear_charges=Y.prototype.clear_charges;Y.prototype.delete_user=Y.prototype.delete_user;Y.prototype.toString=Y.prototype.toString;var zc="__mps",Bc="__mpso",$c="__mpus",qc="__mpa",Hc="__mpap",Qc="__mpr",Wc="__mpu",rv="$people_distinct_id",sl="__alias",Ao="__timers",I1=[zc,Bc,$c,qc,Hc,Qc,Wc,rv,sl,Ao],ee=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;t!=="cookie"&&t!=="localStorage"&&(ce.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),t==="localStorage"&&c.localStorage.is_supported()?this.storage=c.localStorage:this.storage=c.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};ee.prototype.properties=function(){var e={};return c.each(this.props,function(t,n){c.include(I1,n)||(e[n]=t)}),e};ee.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=c.extend({},e))}};ee.prototype.upgrade=function(e){var t=e.upgrade,n,r;t&&(n="mp_super_properties",typeof t=="string"&&(n=t),r=this.storage.parse(n),this.storage.remove(n),this.storage.remove(n,!0),r&&(this.props=c.extend(this.props,r.all,r.events))),!e.cookie_name&&e.name!=="mixpanel"&&(n="mp_"+e.token+"_"+e.name,r=this.storage.parse(n),r&&(this.storage.remove(n),this.storage.remove(n,!0),this.register_once(r))),this.storage===c.localStorage&&(r=c.cookie.parse(this.name),c.cookie.remove(this.name),c.cookie.remove(this.name,!0),r&&this.register_once(r))};ee.prototype.save=function(){this.disabled||this.storage.set(this.name,c.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)};ee.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)};ee.prototype.clear=function(){this.remove(),this.props={}};ee.prototype.register_once=function(e,t,n){return c.isObject(e)?(typeof t>"u"&&(t="None"),this.expire_days=typeof n>"u"?this.default_expiry:n,c.each(e,function(r,i){(!this.props.hasOwnProperty(i)||this.props[i]===t)&&(this.props[i]=r)},this),this.save(),!0):!1};ee.prototype.register=function(e,t){return c.isObject(e)?(this.expire_days=typeof t>"u"?this.default_expiry:t,c.extend(this.props,e),this.save(),!0):!1};ee.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())};ee.prototype.update_search_keyword=function(e){this.register(c.info.searchInfo(e))};ee.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:c.info.referringDomain(e)||"$direct"},"")};ee.prototype.get_referrer_info=function(){return c.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};ee.prototype.safe_merge=function(e){return c.each(this.props,function(t,n){n in e||(e[n]=t)}),e};ee.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)};ee.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()};ee.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())};ee.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())};ee.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())};ee.prototype.get_cross_subdomain=function(){return this.cross_subdomain};ee.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())};ee.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],i=this._get_or_create_queue(er),o=this._get_or_create_queue(_i),s=this._get_or_create_queue($t),l=this._get_or_create_queue(Or),a=this._get_or_create_queue(Dr),u=this._get_or_create_queue(tr,[]),f=this._get_or_create_queue(En,[]);n===zc?(c.extend(i,r),this._pop_from_people_queue(Or,r),this._pop_from_people_queue(Dr,r),this._pop_from_people_queue($t,r)):n===Bc?(c.each(r,function(h,d){d in o||(o[d]=h)}),this._pop_from_people_queue($t,r)):n===$c?c.each(r,function(h){c.each([i,o,l,a],function(d){h in d&&delete d[h]}),c.each(f,function(d){h in d&&delete d[h]}),s[h]=!0}):n===qc?(c.each(r,function(h,d){d in i?i[d]+=h:(d in l||(l[d]=0),l[d]+=h)},this),this._pop_from_people_queue($t,r)):n===Wc?(c.each(r,function(h,d){c.isArray(h)&&(d in a||(a[d]=[]),a[d]=a[d].concat(h))}),this._pop_from_people_queue($t,r)):n===Qc?(u.push(r),this._pop_from_people_queue(En,r)):n===Hc&&(f.push(r),this._pop_from_people_queue($t,r)),ce.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),ce.log(t),this.save()};ee.prototype._pop_from_people_queue=function(e,t){var n=this._get_queue(e);c.isUndefined(n)||(c.each(t,function(r,i){e===En||e===tr?c.each(n,function(o){o[i]===r&&delete o[i]}):delete n[i]},this),this.save())};ee.prototype._get_queue_key=function(e){if(e===er)return zc;if(e===_i)return Bc;if(e===$t)return $c;if(e===Or)return qc;if(e===En)return Hc;if(e===tr)return Qc;if(e===Dr)return Wc;ce.error("Invalid queue:",e)};ee.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]};ee.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=c.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)};ee.prototype.set_event_timer=function(e,t){var n=this.props[Ao]||{};n[e]=t,this.props[Ao]=n,this.save()};ee.prototype.remove_event_timer=function(e){var t=this.props[Ao]||{},n=t[e];return c.isUndefined(n)||(delete this.props[Ao][e],this.save()),n};var Vc,Ve,iv=0,M1=1,L1=function(e){return e},Io=function(){},Rt="mixpanel",ov="base64",U1="json",Kc="$device:",ui=Ee.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,sv=!ui&&tn.indexOf("MSIE")===-1&&tn.indexOf("Mozilla")===-1,ll=null;Bn.sendBeacon&&(ll=function(){return Bn.sendBeacon.apply(Bn,arguments)});var Yd={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:ov,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Io,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Io,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{}},lv=!1,P=function(){},Ou=function(e,t,n){var r,i=n===Rt?Ve:Ve[n];if(i&&Vc===iv)r=i;else{if(i&&!c.isArray(i)){ce.error("You have already initialized "+n);return}r=new P}if(r._cached_groups={},r._init(e,t,n),r.people=new Y,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var o=c.info.campaignParams(null),s={},l=!1;c.each(o,function(a,u){s["initial_"+u]=a,a&&(l=!0)}),l&&r.people.set_once(s)}return gn.DEBUG=gn.DEBUG||r.get_config("debug"),!c.isUndefined(i)&&c.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};P.prototype.init=function(e,t,n){if(c.isUndefined(n)){this.report_error("You must name your new library: init(token, config, name)");return}if(n===Rt){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var r=Ou(e,t,n);return Ve[n]=r,r._loaded(),r};P.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var r={};if(!("api_payload_format"in t)){var i=t.api_host||Yd.api_host;i.match(/\.mixpanel\.com/)&&(r.api_payload_format=U1)}if(this.set_config(c.extend({},Yd,r,t,{name:n,token:e,callback_fn:(n===Rt?n:Rt+"."+n)+"._jsc"})),this._jsc=Io,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!c.localStorage.is_supported(!0)||!ui)this._batch_requests=!1,ce.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support");else if(this.init_batchers(),ll&&Ee.addEventListener){var o=c.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);Ee.addEventListener("pagehide",function(l){l.persisted&&o()}),Ee.addEventListener("visibilitychange",function(){de.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new ee(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=c.UUID();this.get_distinct_id()||this.register_once({distinct_id:Kc+s,$device_id:s},""),this.get_config("track_pageview")&&this.track_pageview()};P.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()};P.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(de.referrer),this.get_config("store_google")&&this.register(c.info.campaignParams(),{persistent:!1}),this.get_config("save_referrer")&&this.persistence.update_referrer_info(de.referrer)};P.prototype._dom_loaded=function(){c.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||c.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue};P.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!lv)return this.__dom_loaded_queue.push([e,t]),!1;var n=new e().init(this);return n.track.apply(n,t)};P.prototype._prepare_callback=function(e,t){if(c.isUndefined(e))return null;if(ui){var n=function(s){e(s,t)};return n}else{var r=this._jsc,i=""+Math.floor(Math.random()*1e8),o=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(s){delete r[i],e(s,t)},o}};P.prototype._send_request=function(e,t,n,r){var i=!0;if(sv)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;!r&&(c.isFunction(n)||typeof n=="string")&&(r=n,n=null),n=c.extend(o,n||{}),ui||(n.method="GET");var l=n.method==="POST",a=ll&&l&&n.transport.toLowerCase()==="sendbeacon",u=n.verbose;t.verbose&&(u=!0),this.get_config("test")&&(t.test=1),u&&(t.verbose=1),this.get_config("img")&&(t.img=1),ui||(r?t.callback=r:(u||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=new Date().getTime().toString(),l&&(s="data="+encodeURIComponent(t.data),delete t.data),e+="?"+c.HTTPBuildQuery(t);var f=this;if("img"in t){var h=de.createElement("img");h.src=e,de.body.appendChild(h)}else if(a){try{i=ll(e,s)}catch(m){f.report_error(m),i=!1}try{r&&r(i?1:0)}catch(m){f.report_error(m)}}else if(ui)try{var d=new XMLHttpRequest;d.open(n.method,e,!0);var g=this.get_config("xhr_headers");if(l&&(g["Content-Type"]="application/x-www-form-urlencoded"),c.each(g,function(m,p){d.setRequestHeader(p,m)}),n.timeout_ms&&typeof d.timeout<"u"){d.timeout=n.timeout_ms;var y=new Date().getTime()}d.withCredentials=!0,d.onreadystatechange=function(){if(d.readyState===4)if(d.status===200){if(r)if(u){var m;try{m=c.JSONDecode(d.responseText)}catch(_){if(f.report_error(_),n.ignore_json_errors)m=d.responseText;else return}r(m)}else r(Number(d.responseText))}else{var p;d.timeout&&!d.status&&new Date().getTime()-y>=d.timeout?p="timeout":p="Bad HTTP status: "+d.status+" "+d.statusText,f.report_error(p),r&&r(u?{status:0,error:p,xhr_req:d}:0)}},d.send(s)}catch(m){f.report_error(m),i=!1}else{var S=de.createElement("script");S.type="text/javascript",S.async=!0,S.defer=!0,S.src=e;var E=de.getElementsByTagName("script")[0];E.parentNode.insertBefore(S,E)}return i};P.prototype._execute_array=function(e){var t,n=[],r=[],i=[];c.each(e,function(s){s&&(t=s[0],c.isArray(t)?i.push(s):typeof s=="function"?s.call(this):c.isArray(s)&&t==="alias"?n.push(s):c.isArray(s)&&t.indexOf("track")!==-1&&typeof this[t]=="function"?i.push(s):r.push(s))},this);var o=function(s,l){c.each(s,function(a){if(c.isArray(a[0])){var u=l;c.each(a,function(f){u=u[f[0]].apply(u,f.slice(1))})}else this[a[0]].apply(this,a.slice(1))},l)};o(n,this),o(r,this),o(i,this)};P.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events};P.prototype.init_batchers=function(){var e=this.get_config("token");if(!this.are_batchers_initialized()){var t=c.bind(function(n){return new ln("__mpq_"+e+n.queue_suffix,{libConfig:this.config,sendRequestFunc:c.bind(function(r,i,o){this._send_request(this.get_config("api_host")+n.endpoint,this._encode_data_for_request(r),i,this._prepare_callback(o,r))},this),beforeSendHook:c.bind(function(r){return this._run_hook("before_send_"+n.type,r)},this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:c.bind(this.stop_batch_senders,this)})},this);this.request_batchers={events:t({type:"events",endpoint:"/track/",queue_suffix:"_ev"}),people:t({type:"people",endpoint:"/engage/",queue_suffix:"_pp"}),groups:t({type:"groups",endpoint:"/groups/",queue_suffix:"_gr"})}}this.get_config("batch_autostart")&&this.start_batch_senders()};P.prototype.start_batch_senders=function(){this.are_batchers_initialized()&&(this._batch_requests=!0,c.each(this.request_batchers,function(e){e.start()}))};P.prototype.stop_batch_senders=function(){this._batch_requests=!1,c.each(this.request_batchers,function(e){e.stop(),e.clear()})};P.prototype.push=function(e){this._execute_array([e])};P.prototype.disable=function(e){typeof e>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)};P.prototype._encode_data_for_request=function(e){var t=c.JSONEncode(e);return this.get_config("api_payload_format")===ov&&(t=c.base64Encode(t)),{data:t}};P.prototype._track_or_batch=function(e,t){var n=c.truncate(e.data,255),r=e.endpoint,i=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||Io;var l=!0,a=c.bind(function(){return s.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(ce.log("MIXPANEL REQUEST:"),ce.log(n),this._send_request(r,this._encode_data_for_request(n),s,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!o?i.enqueue(n,function(u){u?t(1,n):a()}):l=a(),l&&n};P.prototype.track=ki(function(e,t,n,r){!r&&typeof n=="function"&&(r=n,n=null),n=n||{};var i=n.transport;i&&(n.transport=i);var o=n.send_immediately;if(typeof r!="function"&&(r=Io),c.isUndefined(e)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(e)){r(0);return}t=t||{},t.token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!c.isUndefined(s)){var l=new Date().getTime()-s;t.$duration=parseFloat((l/1e3).toFixed(3))}this._set_default_superprops();var a=this.get_config("track_marketing")?c.info.marketingParams():{};t=c.extend({},c.info.properties(),a,this.persistence.properties(),this.unpersisted_superprops,t);var u=this.get_config("property_blacklist");c.isArray(u)?c.each(u,function(d){delete t[d]}):this.report_error("Invalid value for property_blacklist config: "+u);var f={event:e,properties:t},h=this._track_or_batch({type:"events",data:f,endpoint:this.get_config("api_host")+"/track/",batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:n},r);return h});P.prototype.set_group=ki(function(e,t,n){c.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)});P.prototype.add_group=ki(function(e,t,n){var r=this.get_property(e);if(r===void 0){var i={};i[e]=[t],this.register(i)}else r.indexOf(t)===-1&&(r.push(t),this.register(i));return this.people.union(e,t,n)});P.prototype.remove_group=ki(function(e,t,n){var r=this.get_property(e);if(r!==void 0){var i=r.indexOf(t);i>-1&&(r.splice(i,1),this.register({group_key:r})),r.length===0&&this.unregister(e)}return this.people.remove(e,t,n)});P.prototype.track_with_groups=ki(function(e,t,n,r){var i=c.extend({},t||{});return c.each(n,function(o,s){o!=null&&(i[s]=o)}),this.track(e,i,r)});P.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)};P.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]};P.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),r=this._cached_groups[n];return(r===void 0||r._group_key!==e||r._group_id!==t)&&(r=new ve,r._init(this,e,t),this._cached_groups[n]=r),r};P.prototype.track_pageview=ki(function(e,t){typeof e!="object"&&(e={}),t=t||{};var n=t.event_name||"$mp_web_page_view",r=c.extend(c.info.mpPageViewProperties(),c.info.campaignParams(),c.info.clickParams()),i=c.extend({},r,e);return this.track(n,i)});P.prototype.track_links=function(){return this._track_dom.call(this,yi,arguments)};P.prototype.track_forms=function(){return this._track_dom.call(this,jl,arguments)};P.prototype.time_event=function(e){if(c.isUndefined(e)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(e)||this.persistence.set_event_timer(e,new Date().getTime())};var F1={persistent:!0},Gc=function(e){var t;return c.isObject(e)?t=e:c.isUndefined(e)?t={}:t={days:e},c.extend({},F1,t)};P.prototype.register=function(e,t){var n=Gc(t);n.persistent?this.persistence.register(e,n.days):c.extend(this.unpersisted_superprops,e)};P.prototype.register_once=function(e,t,n){var r=Gc(n);r.persistent?this.persistence.register_once(e,t,r.days):(typeof t>"u"&&(t="None"),c.each(e,function(i,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===t)&&(this.unpersisted_superprops[o]=i)},this))};P.prototype.unregister=function(e,t){t=Gc(t),t.persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]};P.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)};P.prototype.identify=function(e,t,n,r,i,o,s,l){var a=this.get_distinct_id();if(e&&a!==e){if(typeof e=="string"&&e.indexOf(Kc)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var u=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==a&&e!==this.get_property(sl)&&(this.unregister(sl),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,i,o,s,l),e!==a&&this.track("$identify",{distinct_id:e,$anon_distinct_id:a},{skip_hooks:!0})};P.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=c.UUID();this.register_once({distinct_id:Kc+e,$device_id:e},"")};P.prototype.get_distinct_id=function(){return this.get_property("distinct_id")};P.prototype.alias=function(e,t){if(e===this.get_property(rv))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return c.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(sl,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){n.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)};P.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)};P.prototype.set_config=function(e){if(c.isObject(e)){c.extend(this.config,e);var t=e.batch_size;t&&c.each(this.request_batchers,function(n){n.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),gn.DEBUG=gn.DEBUG||this.get_config("debug")}};P.prototype.get_config=function(e){return this.config[e]};P.prototype._run_hook=function(e){var t=(this.config.hooks[e]||L1).apply(this,zn.call(arguments,1));return typeof t>"u"&&(this.report_error(e+" hook did not return a value"),t=null),t};P.prototype.get_property=function(e){return this.persistence.props[e]};P.prototype.toString=function(){var e=this.get_config("name");return e!==Rt&&(e=Rt+"."+e),e};P.prototype._event_is_disabled=function(e){return c.isBlockedUA(tn)||this._flags.disable_all_events||c.include(this.__disabled_events,e)};P.prototype._gdpr_init=function(){var e=this.get_config("opt_out_tracking_persistence_type")==="localStorage";e&&c.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||c.cookie.get("mp_optout"))&&(c.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))};P.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else if(e&&e.enable_persistence)t=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==t&&this.persistence.set_disabled(t),t&&c.each(this.request_batchers,function(n){n.clear()})};P.prototype._gdpr_call_func=function(e,t){return t=c.extend({track:c.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),c.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})};P.prototype.opt_in_tracking=function(e){e=c.extend({enable_persistence:!0},e),this._gdpr_call_func(R1,e),this._gdpr_update_persistence(e)};P.prototype.opt_out_tracking=function(e){e=c.extend({clear_persistence:!0,delete_user:!0},e),e.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(P1,e),this._gdpr_update_persistence(e)};P.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(O1,e)};P.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(Zm,e)};P.prototype.clear_opt_in_out_tracking=function(e){e=c.extend({enable_persistence:!0},e),this._gdpr_call_func(D1,e),this._gdpr_update_persistence(e)};P.prototype.report_error=function(e,t){ce.error.apply(ce.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){ce.error(n)}};P.prototype.init=P.prototype.init;P.prototype.reset=P.prototype.reset;P.prototype.disable=P.prototype.disable;P.prototype.time_event=P.prototype.time_event;P.prototype.track=P.prototype.track;P.prototype.track_links=P.prototype.track_links;P.prototype.track_forms=P.prototype.track_forms;P.prototype.track_pageview=P.prototype.track_pageview;P.prototype.register=P.prototype.register;P.prototype.register_once=P.prototype.register_once;P.prototype.unregister=P.prototype.unregister;P.prototype.identify=P.prototype.identify;P.prototype.alias=P.prototype.alias;P.prototype.name_tag=P.prototype.name_tag;P.prototype.set_config=P.prototype.set_config;P.prototype.get_config=P.prototype.get_config;P.prototype.get_property=P.prototype.get_property;P.prototype.get_distinct_id=P.prototype.get_distinct_id;P.prototype.toString=P.prototype.toString;P.prototype.opt_out_tracking=P.prototype.opt_out_tracking;P.prototype.opt_in_tracking=P.prototype.opt_in_tracking;P.prototype.has_opted_out_tracking=P.prototype.has_opted_out_tracking;P.prototype.has_opted_in_tracking=P.prototype.has_opted_in_tracking;P.prototype.clear_opt_in_out_tracking=P.prototype.clear_opt_in_out_tracking;P.prototype.get_group=P.prototype.get_group;P.prototype.set_group=P.prototype.set_group;P.prototype.add_group=P.prototype.add_group;P.prototype.remove_group=P.prototype.remove_group;P.prototype.track_with_groups=P.prototype.track_with_groups;P.prototype.start_batch_senders=P.prototype.start_batch_senders;P.prototype.stop_batch_senders=P.prototype.stop_batch_senders;ee.prototype.properties=ee.prototype.properties;ee.prototype.update_search_keyword=ee.prototype.update_search_keyword;ee.prototype.update_referrer_info=ee.prototype.update_referrer_info;ee.prototype.get_cross_subdomain=ee.prototype.get_cross_subdomain;ee.prototype.clear=ee.prototype.clear;var ei={},j1=function(){c.each(ei,function(e,t){t!==Rt&&(Ve[t]=e)}),Ve._=c},b1=function(){Ve.init=function(e,t,n){if(n)return Ve[n]||(Ve[n]=ei[n]=Ou(e,t,n),Ve[n]._loaded()),Ve[n];var r=Ve;ei[Rt]?r=ei[Rt]:e&&(r=Ou(e,t,Rt),r._loaded(),ei[Rt]=r),Ve=r,Vc===M1&&(Ee[Rt]=Ve),j1()}},z1=function(){function e(){e.done||(e.done=!0,lv=!0,sv=!1,c.each(ei,function(r){r._dom_loaded()}))}function t(){try{de.documentElement.doScroll("left")}catch{setTimeout(t,1);return}e()}if(de.addEventListener)de.readyState==="complete"?e():de.addEventListener("DOMContentLoaded",e,!1);else if(de.attachEvent){de.attachEvent("onreadystatechange",e);var n=!1;try{n=Ee.frameElement===null}catch{}de.documentElement.doScroll&&n&&t()}c.register_event(Ee,"load",e,!0)};function B1(){return Vc=iv,Ve=new P,b1(),Ve.init(),z1(),Ve}var $1=B1(),q1=$1;const av=al(q1),H1="9b5c61bf2bf4c48916655fe862e8fcbd",Q1=H1,uv={OPEN_WEBAPP:"open_webapp",SEND_TRANSACTION:"send_transaction"},cv=async e=>{console.info("[mixpanel]",e),await av.track(e)};av.init(Q1,{loaded:()=>{cv(uv.OPEN_WEBAPP)}});const Yc="https://18.192.129.233.sslip.io",fv=60*1e3,dv=e=>{if(!e.ok)throw new Error(`Backend ${e.status}`);return e.json()},W1=()=>{const{setTransaction:e,txId:t}=Vt();return console.log("useTxQuery txId",t),Qm({queryKey:["tx",`tx-${t}`],queryFn:t?()=>fetch(`${Yc}/transactions/${t}`).then(dv):()=>a1,onSuccess:n=>{console.log("success tx data",n),e(n)},staleTime:fv})},V1=e=>{const{setUsers:t}=Vt();return Qm({queryKey:["users",`chat-${e}`],queryFn:e?()=>fetch(`${Yc}/chats/${e}/users`).then(dv).then(n=>n.users):()=>Km,onSuccess:n=>{console.log("success users data",n),t(n)},enabled:e!==void 0,staleTime:fv})},K1=e=>fetch(`${Yc}/transactions/${e._id}`,{method:"PUT",body:JSON.stringify(e),headers:{"Content-type":"application/json"}});function G1(){Al();const e=Dc(),[t,n]=L.useState(!1),{currencies:r,transaction:i,setTransaction:o,setSuccess:s}=Vt();if(!i)return null;const l=r.find(A=>A.id===i.currency_id),a=(A,U)=>{const Z=i.shares.findIndex(V=>V.person_id===A.person_id&&V.related_user_id===A.related_user_id&&V.is_payer===A.is_payer);if(~Z){const V=[...i.shares];V[Z].amount=U,o({...i,shares:V})}},u=i.shares.filter(A=>A.is_payer).reduce((A,U)=>A+U.amount,0),f=uo(u),h=i.shares.filter(A=>!A.is_payer).reduce((A,U)=>A+U.amount,0),d=uo(h),g=1,y=uh+g,m=i.shares.filter(A=>A.related_user_id&&A.is_payer),p=i.shares.filter(A=>A.related_user_id&&!A.is_payer),_=m.map(A=>A.related_user_id),v=p.map(A=>A.related_user_id),R=_.some(A=>v.includes(A)),D=p.every(A=>A.amount===p[0].amount),T=()=>{const A=Math.round(u/p.length),U=[...i.shares];o({...i,shares:U.map(Z=>Z.is_payer?Z:{...Z,amount:A})})},O=async()=>{var U,Z;const A={...i,is_confirmed:!0};n(!0);try{await cv(uv.SEND_TRANSACTION),console.log(JSON.stringify(A,null,2));const V=await K1(A);console.log("res",V);const qe=await V.json();console.log("res json",qe),V.ok?(s(!0),(Z=(U=window==null?void 0:window.Telegram)==null?void 0:U.WebApp)==null||Z.close()):s(!1)}catch{s(!1)}finally{n(!1)}};return x.jsxs(Ll,{children:[x.jsx(Ml,{onBack:()=>{e("/")}}),x.jsxs("div",{className:"mb-2 px-4 flex items-center justify-between",children:[x.jsx("h2",{className:"pt-[2px] pb-[6px]",children:"Проверить траты"}),x.jsx(ao,{theme:"text",onClick:()=>{e("/select-currency")},children:l?l.in:"Выберите валюту"})]}),x.jsxs(ai,{className:"!pb-4",children:[x.jsxs("h3",{className:Yn(!S&&"text-error"),children:[y&&"Не хватает",S&&"Всё верно",E&&"Перебор"]}),x.jsxs("div",{className:"mt-1 text-[14px] leading-[20px] text-hint",children:["Заплатили ",f," ",l==null?void 0:l.symbol,", должны ",d," ",l==null?void 0:l.symbol]})]}),x.jsxs(ai,{children:[x.jsx("h3",{children:"Заплатили"}),x.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[!m.length&&x.jsx("span",{className:"opacity-40",children:"(Пусто)"}),m.map((A,U)=>x.jsx(zd,{...A,onChange:Z=>{a(A,Z)}},`payer-share-${U}`))]})]}),x.jsxs(ai,{children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("h3",{children:["За ",R&&x.jsx("span",{children:"себя и за"})," других"]}),!!p.length&&(!D||!S)&&x.jsx(ao,{theme:"text",onClick:T,children:"Поровну"})]}),x.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[!p.length&&x.jsx("span",{className:"opacity-40",children:"(Пусто)"}),p.map((A,U)=>x.jsx(zd,{...A,onChange:Z=>{a(A,Z)}},`owe-share-${U}`))]}),x.jsx("div",{className:"mt-8 py-2",children:x.jsx(ao,{onClick:O,disabled:!S,isBusy:t,children:"Сохранить"})})]})]})}function Xc(){return x.jsx("div",{className:"h-[1px] -my-[0.5px] mx-4 bg-[#E5E9EB] dark:bg-[#84919A]"})}function Y1(){var u;Al();const{users:e,unrelatedUsers:t,selectUser:n,deleteUser:r}=Il(),{selectPersonId:i,transaction:o}=Vt(),s=i!==null?e:t,l=i!==null?(u=((o==null?void 0:o.shares)||[]).find(f=>f.person_id===i))==null?void 0:u.normalized_name:null,a=l?`Выберите, кто "${l}"`:"Выберите человека";return x.jsxs(Ll,{className:"!bg-bg",children:[x.jsx(Ml,{onBack:()=>{history.back()}}),x.jsxs("div",{className:"mb-2 px-4 flex items-center justify-between gap-3",children:[x.jsx("h2",{className:"pt-[2px] pb-[6px]",children:a}),i!==null&&x.jsx(ao,{theme:"text",onClick:r(i),children:"Удалить"})]}),x.jsx("div",{className:"mt-4 overflow-y-auto",children:s.map((f,h,d)=>x.jsxs(x.Fragment,{children:[x.jsx("button",{className:"w-full px-4 py-2 hover:bg-text/5 active:bg-text/10 transition-all",onClick:n(f),children:x.jsx(Mc,{user:f})}),hi(n),children:[x.jsx("input",{className:"hidden",id:`${e}-${n}`,name:e,checked:r}),x.jsx("div",{className:"p-1.5",children:x.jsx("div",{className:Yn("flex items-center justify-center w-5 h-5 border-2 rounded-full text-hint",r&&"!text-link"),children:x.jsx("div",{className:Yn("w-[10px] h-[10px] rounded-full bg-link opacity-0 transition-all",r&&"!opacity-100")})})}),x.jsx("div",{className:"flex-1",children:t})]})}function J1(){Al();const e=Dc(),{currencies:t,transaction:n,setCurrency:r}=Vt(),i=o=>{r(o),e("/check")};return x.jsxs(Ll,{className:"!bg-bg",children:[x.jsx(Ml,{onBack:()=>{history.back()}}),x.jsx("div",{className:"px-4",children:x.jsx("h2",{children:"Выберите валюту"})}),x.jsx("div",{className:"mt-4 overflow-y-auto",children:t.map((o,s)=>x.jsxs("div",{children:[x.jsx(X1,{group:"currencies",label:`${o.symbol} ${o.title}`,value:o.id,checked:(n==null?void 0:n.currency_id)===o.id,onChange:i},`currencies-${o.id}`),sL.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{d:"M8 1C8 0.447715 7.55228 0 7 0C6.44772 0 6 0.447715 6 1V6H1C0.447715 6 0 6.44771 0 7C0 7.55228 0.447715 8 1 8H6V13C6 13.5523 6.44772 14 7 14C7.55228 14 8 13.5523 8 13V8H13C13.5523 8 14 7.55228 14 7C14 6.44772 13.5523 6 13 6H8V1Z",fill:"currentColor"}));/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:hv,setPrototypeOf:Xd,isFrozen:eS,getPrototypeOf:tS,getOwnPropertyDescriptor:nS}=Object;let{freeze:Ze,seal:Wt,create:rS}=Object,{apply:Du,construct:Nu}=typeof Reflect<"u"&&Reflect;Du||(Du=function(t,n,r){return t.apply(n,r)});Ze||(Ze=function(t){return t});Wt||(Wt=function(t){return t});Nu||(Nu=function(t,n){return new t(...n)});const iS=At(Array.prototype.forEach),Jd=At(Array.prototype.pop),Hi=At(Array.prototype.push),Ts=At(String.prototype.toLowerCase),ya=At(String.prototype.toString),oS=At(String.prototype.match),Ft=At(String.prototype.replace),sS=At(String.prototype.indexOf),lS=At(String.prototype.trim),ht=At(RegExp.prototype.test),Qi=aS(TypeError);function At(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i/gm),hS=Wt(/\${[\w\W]*}/gm),pS=Wt(/^data-[\-\w.\u00B7-\uFFFF]/),mS=Wt(/^aria-[\-\w]+$/),pv=Wt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vS=Wt(/^(?:\w+script|data):/i),gS=Wt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mv=Wt(/^html$/i);var rh=Object.freeze({__proto__:null,MUSTACHE_EXPR:fS,ERB_EXPR:dS,TMPLIT_EXPR:hS,DATA_ATTR:pS,ARIA_ATTR:mS,IS_ALLOWED_URI:pv,IS_SCRIPT_OR_DATA:vS,ATTR_WHITESPACE:gS,DOCTYPE_NAME:mv});const yS=()=>typeof window>"u"?null:window,_S=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function vv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yS();const t=q=>vv(q);if(t.version="3.0.5",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;const n=e.document,r=n.currentScript;let{document:i}=e;const{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:a,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:g}=e,y=a.prototype,S=cs(y,"cloneNode"),E=cs(y,"nextSibling"),m=cs(y,"childNodes"),p=cs(y,"parentNode");if(typeof s=="function"){const q=i.createElement("template");q.content&&q.content.ownerDocument&&(i=q.content.ownerDocument)}let _,v="";const{implementation:R,createNodeIterator:D,createDocumentFragment:T,getElementsByTagName:O}=i,{importNode:A}=n;let U={};t.isSupported=typeof hv=="function"&&typeof p=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Z,ERB_EXPR:V,TMPLIT_EXPR:qe,DATA_ATTR:Cn,ARIA_ATTR:Kt,IS_SCRIPT_OR_DATA:at,ATTR_WHITESPACE:ut}=rh;let{IS_ALLOWED_URI:F}=rh,b=null;const K=J({},[...Zd,..._a,...Sa,...wa,...eh]);let X=null;const _e=J({},[...th,...Ea,...nh,...fs]);let ae=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,ct=null,ft=!0,Gt=!0,It=!1,qo=!0,Tn=!1,Yt=!1,Ti=!1,Ri=!1,Rn=!1,Xt=!1,lr=!1,Ir=!0,ar=!1;const Pi="user-content-";let St=!0,Pn=!1,an={},un=null;const Ho=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Oi=null;const ur=J({},["audio","video","img","source","image","track"]);let Mr=null;const Lr=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ur="http://www.w3.org/1998/Math/MathML",cr="http://www.w3.org/2000/svg",Mt="http://www.w3.org/1999/xhtml";let cn=Mt,Di=!1,k=null;const C=J({},[Ur,cr,Mt],ya);let N;const B=["application/xhtml+xml","text/html"],G="text/html";let $,W=null;const Q=i.createElement("form"),H=function(w){return w instanceof RegExp||w instanceof Function},se=function(w){if(!(W&&W===w)){if((!w||typeof w!="object")&&(w={}),w=jr(w),N=B.indexOf(w.PARSER_MEDIA_TYPE)===-1?N=G:N=w.PARSER_MEDIA_TYPE,$=N==="application/xhtml+xml"?ya:Ts,b="ALLOWED_TAGS"in w?J({},w.ALLOWED_TAGS,$):K,X="ALLOWED_ATTR"in w?J({},w.ALLOWED_ATTR,$):_e,k="ALLOWED_NAMESPACES"in w?J({},w.ALLOWED_NAMESPACES,ya):C,Mr="ADD_URI_SAFE_ATTR"in w?J(jr(Lr),w.ADD_URI_SAFE_ATTR,$):Lr,Oi="ADD_DATA_URI_TAGS"in w?J(jr(ur),w.ADD_DATA_URI_TAGS,$):ur,un="FORBID_CONTENTS"in w?J({},w.FORBID_CONTENTS,$):Ho,oe="FORBID_TAGS"in w?J({},w.FORBID_TAGS,$):{},ct="FORBID_ATTR"in w?J({},w.FORBID_ATTR,$):{},an="USE_PROFILES"in w?w.USE_PROFILES:!1,ft=w.ALLOW_ARIA_ATTR!==!1,Gt=w.ALLOW_DATA_ATTR!==!1,It=w.ALLOW_UNKNOWN_PROTOCOLS||!1,qo=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Tn=w.SAFE_FOR_TEMPLATES||!1,Yt=w.WHOLE_DOCUMENT||!1,Rn=w.RETURN_DOM||!1,Xt=w.RETURN_DOM_FRAGMENT||!1,lr=w.RETURN_TRUSTED_TYPE||!1,Ri=w.FORCE_BODY||!1,Ir=w.SANITIZE_DOM!==!1,ar=w.SANITIZE_NAMED_PROPS||!1,St=w.KEEP_CONTENT!==!1,Pn=w.IN_PLACE||!1,F=w.ALLOWED_URI_REGEXP||pv,cn=w.NAMESPACE||Mt,ae=w.CUSTOM_ELEMENT_HANDLING||{},w.CUSTOM_ELEMENT_HANDLING&&H(w.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ae.tagNameCheck=w.CUSTOM_ELEMENT_HANDLING.tagNameCheck),w.CUSTOM_ELEMENT_HANDLING&&H(w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ae.attributeNameCheck=w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ae.allowCustomizedBuiltInElements=w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Tn&&(Gt=!1),Xt&&(Rn=!0),an&&(b=J({},[...eh]),X=[],an.html===!0&&(J(b,Zd),J(X,th)),an.svg===!0&&(J(b,_a),J(X,Ea),J(X,fs)),an.svgFilters===!0&&(J(b,Sa),J(X,Ea),J(X,fs)),an.mathMl===!0&&(J(b,wa),J(X,nh),J(X,fs))),w.ADD_TAGS&&(b===K&&(b=jr(b)),J(b,w.ADD_TAGS,$)),w.ADD_ATTR&&(X===_e&&(X=jr(X)),J(X,w.ADD_ATTR,$)),w.ADD_URI_SAFE_ATTR&&J(Mr,w.ADD_URI_SAFE_ATTR,$),w.FORBID_CONTENTS&&(un===Ho&&(un=jr(un)),J(un,w.FORBID_CONTENTS,$)),St&&(b["#text"]=!0),Yt&&J(b,["html","head","body"]),b.table&&(J(b,["tbody"]),delete oe.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=w.TRUSTED_TYPES_POLICY,v=_.createHTML("")}else _===void 0&&(_=_S(g,r)),_!==null&&typeof v=="string"&&(v=_.createHTML(""));Ze&&Ze(w),W=w}},re=J({},["mi","mo","mn","ms","mtext"]),He=J({},["foreignobject","desc","title","annotation-xml"]),Re=J({},["title","style","font","a","script"]),Ae=J({},_a);J(Ae,Sa),J(Ae,uS);const nt=J({},wa);J(nt,cS);const fr=function(w){let I=p(w);(!I||!I.tagName)&&(I={namespaceURI:cn,tagName:"template"});const j=Ts(w.tagName),ue=Ts(I.tagName);return k[w.namespaceURI]?w.namespaceURI===cr?I.namespaceURI===Mt?j==="svg":I.namespaceURI===Ur?j==="svg"&&(ue==="annotation-xml"||re[ue]):!!Ae[j]:w.namespaceURI===Ur?I.namespaceURI===Mt?j==="math":I.namespaceURI===cr?j==="math"&&He[ue]:!!nt[j]:w.namespaceURI===Mt?I.namespaceURI===cr&&!He[ue]||I.namespaceURI===Ur&&!re[ue]?!1:!nt[j]&&(Re[j]||!Ae[j]):!!(N==="application/xhtml+xml"&&k[w.namespaceURI]):!1},Lt=function(w){Hi(t.removed,{element:w});try{w.parentNode.removeChild(w)}catch{w.remove()}},On=function(w,I){try{Hi(t.removed,{attribute:I.getAttributeNode(w),from:I})}catch{Hi(t.removed,{attribute:null,from:I})}if(I.removeAttribute(w),w==="is"&&!X[w])if(Rn||Xt)try{Lt(I)}catch{}else try{I.setAttribute(w,"")}catch{}},wt=function(w){let I,j;if(Ri)w=""+w;else{const Et=oS(w,/^[\r\n\t ]+/);j=Et&&Et[0]}N==="application/xhtml+xml"&&cn===Mt&&(w=''+w+"");const ue=_?_.createHTML(w):w;if(cn===Mt)try{I=new d().parseFromString(ue,N)}catch{}if(!I||!I.documentElement){I=R.createDocument(cn,"template",null);try{I.documentElement.innerHTML=Di?v:ue}catch{}}const Fe=I.body||I.documentElement;return w&&j&&Fe.insertBefore(i.createTextNode(j),Fe.childNodes[0]||null),cn===Mt?O.call(I,Yt?"html":"body")[0]:Yt?I.documentElement:Fe},dr=function(w){return D.call(w.ownerDocument||w,w,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},Ni=function(w){return w instanceof h&&(typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||!(w.attributes instanceof f)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function")},Dn=function(w){return typeof l=="object"?w instanceof l:w&&typeof w=="object"&&typeof w.nodeType=="number"&&typeof w.nodeName=="string"},dt=function(w,I,j){U[w]&&iS(U[w],ue=>{ue.call(t,I,j,W)})},hr=function(w){let I;if(dt("beforeSanitizeElements",w,null),Ni(w))return Lt(w),!0;const j=$(w.nodeName);if(dt("uponSanitizeElement",w,{tagName:j,allowedTags:b}),w.hasChildNodes()&&!Dn(w.firstElementChild)&&(!Dn(w.content)||!Dn(w.content.firstElementChild))&&ht(/<[/\w]/g,w.innerHTML)&&ht(/<[/\w]/g,w.textContent))return Lt(w),!0;if(!b[j]||oe[j]){if(!oe[j]&&Ye(j)&&(ae.tagNameCheck instanceof RegExp&&ht(ae.tagNameCheck,j)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(j)))return!1;if(St&&!un[j]){const ue=p(w)||w.parentNode,Fe=m(w)||w.childNodes;if(Fe&&ue){const Et=Fe.length;for(let Se=Et-1;Se>=0;--Se)ue.insertBefore(S(Fe[Se],!0),E(w))}}return Lt(w),!0}return w instanceof a&&!fr(w)||(j==="noscript"||j==="noembed"||j==="noframes")&&ht(/<\/no(script|embed|frames)/i,w.innerHTML)?(Lt(w),!0):(Tn&&w.nodeType===3&&(I=w.textContent,I=Ft(I,Z," "),I=Ft(I,V," "),I=Ft(I,qe," "),w.textContent!==I&&(Hi(t.removed,{element:w.cloneNode()}),w.textContent=I)),dt("afterSanitizeElements",w,null),!1)},fe=function(w,I,j){if(Ir&&(I==="id"||I==="name")&&(j in i||j in Q))return!1;if(!(Gt&&!ct[I]&&ht(Cn,I))){if(!(ft&&ht(Kt,I))){if(!X[I]||ct[I]){if(!(Ye(w)&&(ae.tagNameCheck instanceof RegExp&&ht(ae.tagNameCheck,w)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(w))&&(ae.attributeNameCheck instanceof RegExp&&ht(ae.attributeNameCheck,I)||ae.attributeNameCheck instanceof Function&&ae.attributeNameCheck(I))||I==="is"&&ae.allowCustomizedBuiltInElements&&(ae.tagNameCheck instanceof RegExp&&ht(ae.tagNameCheck,j)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(j))))return!1}else if(!Mr[I]){if(!ht(F,Ft(j,ut,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&w!=="script"&&sS(j,"data:")===0&&Oi[w])){if(!(It&&!ht(at,Ft(j,ut,"")))){if(j)return!1}}}}}}return!0},Ye=function(w){return w.indexOf("-")>0},fn=function(w){let I,j,ue,Fe;dt("beforeSanitizeAttributes",w,null);const{attributes:Et}=w;if(!Et)return;const Se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X};for(Fe=Et.length;Fe--;){I=Et[Fe];const{name:Jt,namespaceURI:bl}=I;if(j=Jt==="value"?I.value:lS(I.value),ue=$(Jt),Se.attrName=ue,Se.attrValue=j,Se.keepAttr=!0,Se.forceKeepAttr=void 0,dt("uponSanitizeAttribute",w,Se),j=Se.attrValue,Se.forceKeepAttr||(On(Jt,w),!Se.keepAttr))continue;if(!qo&&ht(/\/>/i,j)){On(Jt,w);continue}Tn&&(j=Ft(j,Z," "),j=Ft(j,V," "),j=Ft(j,qe," "));const Jc=$(w.nodeName);if(fe(Jc,ue,j)){if(ar&&(ue==="id"||ue==="name")&&(On(Jt,w),j=Pi+j),_&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!bl)switch(g.getAttributeType(Jc,ue)){case"TrustedHTML":{j=_.createHTML(j);break}case"TrustedScriptURL":{j=_.createScriptURL(j);break}}try{bl?w.setAttributeNS(bl,Jt,j):w.setAttribute(Jt,j),Jd(t.removed)}catch{}}}dt("afterSanitizeAttributes",w,null)},Ie=function q(w){let I;const j=dr(w);for(dt("beforeSanitizeShadowDOM",w,null);I=j.nextNode();)dt("uponSanitizeShadowNode",I,null),!hr(I)&&(I.content instanceof o&&q(I.content),fn(I));dt("afterSanitizeShadowDOM",w,null)};return t.sanitize=function(q){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I,j,ue,Fe;if(Di=!q,Di&&(q=""),typeof q!="string"&&!Dn(q))if(typeof q.toString=="function"){if(q=q.toString(),typeof q!="string")throw Qi("dirty is not a string, aborting")}else throw Qi("toString is not a function");if(!t.isSupported)return q;if(Ti||se(w),t.removed=[],typeof q=="string"&&(Pn=!1),Pn){if(q.nodeName){const Jt=$(q.nodeName);if(!b[Jt]||oe[Jt])throw Qi("root node is forbidden and cannot be sanitized in-place")}}else if(q instanceof l)I=wt(""),j=I.ownerDocument.importNode(q,!0),j.nodeType===1&&j.nodeName==="BODY"||j.nodeName==="HTML"?I=j:I.appendChild(j);else{if(!Rn&&!Tn&&!Yt&&q.indexOf("<")===-1)return _&&lr?_.createHTML(q):q;if(I=wt(q),!I)return Rn?null:lr?v:""}I&&Ri&&Lt(I.firstChild);const Et=dr(Pn?q:I);for(;ue=Et.nextNode();)hr(ue)||(ue.content instanceof o&&Ie(ue.content),fn(ue));if(Pn)return q;if(Rn){if(Xt)for(Fe=T.call(I.ownerDocument);I.firstChild;)Fe.appendChild(I.firstChild);else Fe=I;return(X.shadowroot||X.shadowrootmode)&&(Fe=A.call(n,Fe,!0)),Fe}let Se=Yt?I.outerHTML:I.innerHTML;return Yt&&b["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&ht(mv,I.ownerDocument.doctype.name)&&(Se=" +`+Se),Tn&&(Se=Ft(Se,Z," "),Se=Ft(Se,V," "),Se=Ft(Se,qe," ")),_&&lr?_.createHTML(Se):Se},t.setConfig=function(q){se(q),Ti=!0},t.clearConfig=function(){W=null,Ti=!1},t.isValidAttribute=function(q,w,I){W||se({});const j=$(q),ue=$(w);return fe(j,ue,I)},t.addHook=function(q,w){typeof w=="function"&&(U[q]=U[q]||[],Hi(U[q],w))},t.removeHook=function(q){if(U[q])return Jd(U[q])},t.removeHooks=function(q){U[q]&&(U[q]=[])},t.removeAllHooks=function(){U={}},t}var SS=vv();const wS=({string:e,allowedTags:t})=>{const n=SS.sanitize(e,{ALLOWED_TAGS:t});return x.jsx("span",{dangerouslySetInnerHTML:{__html:n}})},ES=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 6.29289C9.68342 5.90237 10.3166 5.90237 10.7071 6.29289L15.7071 11.2929C16.0976 11.6834 16.0976 12.3166 15.7071 12.7071L10.7071 17.7071C10.3166 18.0976 9.68342 18.0976 9.29289 17.7071C8.90237 17.3166 8.90237 16.6834 9.29289 16.2929L13.5858 12L9.29289 7.70711C8.90237 7.31658 8.90237 6.68342 9.29289 6.29289Z",fill:"currentColor"}));function xS({normalized_name:e,related_user_id:t,onClick:n}){const{getUserById:r}=Il(),i=t?r(t):void 0;return x.jsxs("button",{className:"w-full flex gap-3 text-left items-center px-4 py-2.5 truncate hover:bg-text/5 active:bg-text/10 transition-all",onClick:n,children:[x.jsx("div",{className:"flex w-[35%] truncate",children:e?x.jsx("div",{className:"truncate",children:e==="MESSAGE_AUTHOR"?x.jsx("span",{className:"font-semibold",children:"Вы"}):x.jsx("span",{children:e})}):x.jsx("div",{className:"truncate opacity-30",children:"(доп.)"})}),x.jsx("div",{className:"flex w-[55%] truncate",children:x.jsx(Mc,{user:i})}),x.jsx("div",{className:"h-6 w-6 text-hint opacity-50",children:x.jsx(ES,{})})]})}function xa(){Al();const e=Dc(),{transaction:t,setSelectPersonId:n}=Vt(),{unrelatedUsers:r,isRelationsComplete:i}=Il();if(!t)return null;const o=t.shares.reduce((u,f)=>u.map(d=>d.person_id).includes(f.person_id)?u:[...u,f],[]),s=u=>{n(u),e("/select-user")},l=()=>{n(null),e("/select-user")},a=()=>{alert("close webapp...")};return x.jsxs(Ll,{children:[x.jsx(Ml,{onCancel:a}),x.jsxs(ai,{children:[x.jsx("div",{className:"text-[12px] leading-[1.33em] font-medium text-hint",children:"Сообщение"}),x.jsxs("div",{className:"mt-1",children:[!!t.is_voice&&x.jsx("span",{children:"🎙 "}),t.formatted_text?x.jsx(wS,{allowedTags:["b","strong"],string:t.formatted_text}):x.jsx("strong",{children:t.raw_text})]})]}),x.jsxs(ai,{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Соотнесите людей"}),x.jsx("div",{className:"mt-1 text-[14px] leading-[20px] text-hint",children:"Со временем мы запомним соотношения"}),x.jsx("div",{className:"mt-2 -mx-4 overflow-y-auto",children:o.map((u,f)=>x.jsxs("div",{children:[x.jsx(xS,{...u,onClick:()=>s(u.person_id)},`UserRelation-${f}`),f{e("/check")},children:"Далее"})})]})]})}function kS(){const{isLoading:e,error:t,data:n}=W1(),{isLoading:r,error:i}=V1(n?n.chat_id:void 0),o=e||r,s=t||i,{isSuccess:l}=Vt(),a=o||s||l;return x.jsx("div",{className:Yn("fixed top-0 left-0 w-full h-full overflow-y-auto bg-bg2 transition-all",a?"opacity-100":"pointer-events-none opacity-0"),children:x.jsxs("div",{className:"flex items-center justify-center w-full min-h-full",children:[o&&!s&&x.jsx(Ym,{size:50}),!!s&&x.jsxs("div",{className:"p-4 text-center text-[#c00]",children:["Error: ",s.message]}),!!l&&x.jsx("div",{className:"p-4 text-center text-button text-[24px]",children:"Успешно!"}),l===!1&&x.jsx("div",{className:"p-4 text-center text-[#c00] text-[24px]",children:"Ошибка сохранения"})]})})}const CS=new p0;function TS(){const{isDarkTheme:e}=Gm(),{txId:t}=Vt(),n=X_([{path:"/",element:x.jsx(xa,{}),errorElement:x.jsx(xa,{})},{path:"*",element:x.jsx(xa,{})},{path:"/select-user",element:x.jsx(Y1,{})},{path:"/check",element:x.jsx(G1,{})},{path:"/select-currency",element:x.jsx(J1,{})}]);return x.jsx(O0,{client:CS,children:x.jsxs("div",{className:Yn(e?"theme-dark":"theme-light"),children:[x.jsx(V_,{router:n}),x.jsx(kS,{}),t===null&&x.jsx("div",{className:"fixed bottom-0 width-auto left-[50%] -translate-x-[50%] text-[13px] font-semibold px-2 py-1 bg-[#3a3] text-white rounded-t-md",children:"Демо-режим"})]})})}ka.createRoot(document.getElementById("root")).render(x.jsx(hh.StrictMode,{children:x.jsx(TS,{})})); diff --git a/index.html b/index.html index 7f9f884..f2b3cb7 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ - +