diff --git a/assets/BuildGame.data.unityweb b/assets/BuildGame.data.unityweb index 128dce1..86eccbb 100644 Binary files a/assets/BuildGame.data.unityweb and b/assets/BuildGame.data.unityweb differ diff --git a/assets/BuildGame.framework.js.unityweb b/assets/BuildGame.framework.js.unityweb index d851085..36af6aa 100644 Binary files a/assets/BuildGame.framework.js.unityweb and b/assets/BuildGame.framework.js.unityweb differ diff --git a/assets/BuildGame.wasm.unityweb b/assets/BuildGame.wasm.unityweb index 5caa7d0..741e7a6 100644 Binary files a/assets/BuildGame.wasm.unityweb and b/assets/BuildGame.wasm.unityweb differ diff --git a/assets/index-CR6L1_s3.js b/assets/index-CR6L1_s3.js deleted file mode 100644 index 6e1b439..0000000 --- a/assets/index-CR6L1_s3.js +++ /dev/null @@ -1,40 +0,0 @@ -var Pc=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var Up=Pc(nr=>{(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=t(l);fetch(l.href,i)}})();var nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vs={exports:{}},fl={},ms={exports:{}},z={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var tr=Symbol.for("react.element"),zc=Symbol.for("react.portal"),Tc=Symbol.for("react.fragment"),Mc=Symbol.for("react.strict_mode"),Uc=Symbol.for("react.profiler"),Ic=Symbol.for("react.provider"),Rc=Symbol.for("react.context"),Oc=Symbol.for("react.forward_ref"),jc=Symbol.for("react.suspense"),Dc=Symbol.for("react.memo"),Fc=Symbol.for("react.lazy"),eu=Symbol.iterator;function $c(e){return e===null||typeof e!="object"?null:(e=eu&&e[eu]||e["@@iterator"],typeof e=="function"?e:null)}var ys={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},hs=Object.assign,gs={};function at(e,n,t){this.props=e,this.context=n,this.refs=gs,this.updater=t||ys}at.prototype.isReactComponent={};at.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,n,"setState")};at.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ws(){}ws.prototype=at.prototype;function lo(e,n,t){this.props=e,this.context=n,this.refs=gs,this.updater=t||ys}var io=lo.prototype=new ws;io.constructor=lo;hs(io,at.prototype);io.isPureReactComponent=!0;var nu=Array.isArray,Ss=Object.prototype.hasOwnProperty,oo={current:null},ks={key:!0,ref:!0,__self:!0,__source:!0};function Es(e,n,t){var r,l={},i=null,o=null;if(n!=null)for(r in n.ref!==void 0&&(o=n.ref),n.key!==void 0&&(i=""+n.key),n)Ss.call(n,r)&&!ks.hasOwnProperty(r)&&(l[r]=n[r]);var u=arguments.length-2;if(u===1)l.children=t;else if(1>>1,X=_[H];if(0>>1;Hl(Dl,L))Snl(cr,Dl)?(_[H]=cr,_[Sn]=L,H=Sn):(_[H]=Dl,_[wn]=L,H=wn);else if(Snl(cr,L))_[H]=cr,_[Sn]=L,H=Sn;else break e}}return P}function l(_,P){var L=_.sortIndex-P.sortIndex;return L!==0?L:_.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var s=[],a=[],v=1,m=null,p=3,g=!1,w=!1,S=!1,I=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(_){for(var P=t(a);P!==null;){if(P.callback===null)r(a);else if(P.startTime<=_)r(a),P.sortIndex=P.expirationTime,n(s,P);else break;P=t(a)}}function y(_){if(S=!1,d(_),!w)if(t(s)!==null)w=!0,Ol(k);else{var P=t(a);P!==null&&jl(y,P.startTime-_)}}function k(_,P){w=!1,S&&(S=!1,f(N),N=-1),g=!0;var L=p;try{for(d(P),m=t(s);m!==null&&(!(m.expirationTime>P)||_&&!Pe());){var H=m.callback;if(typeof H=="function"){m.callback=null,p=m.priorityLevel;var X=H(m.expirationTime<=P);P=e.unstable_now(),typeof X=="function"?m.callback=X:m===t(s)&&r(s),d(P)}else r(s);m=t(s)}if(m!==null)var ar=!0;else{var wn=t(a);wn!==null&&jl(y,wn.startTime-P),ar=!1}return ar}finally{m=null,p=L,g=!1}}var C=!1,x=null,N=-1,W=5,T=-1;function Pe(){return!(e.unstable_now()-T_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return t(s)},e.unstable_next=function(_){switch(p){case 1:case 2:case 3:var P=3;break;default:P=p}var L=p;p=P;try{return _()}finally{p=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,P){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var L=p;p=_;try{return P()}finally{p=L}},e.unstable_scheduleCallback=function(_,P,L){var H=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0H?(_.sortIndex=L,n(a,_),t(s)===null&&_===t(a)&&(S?(f(N),N=-1):S=!0,jl(y,L-H))):(_.sortIndex=X,n(s,_),w||g||(w=!0,Ol(k))),_},e.unstable_shouldYield=Pe,e.unstable_wrapCallback=function(_){var P=p;return function(){var L=p;p=P;try{return _.apply(this,arguments)}finally{p=L}}}})(Ps);Ns.exports=Ps;var Jc=Ns.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var qc=D,ge=Jc;function h(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fi=Object.prototype.hasOwnProperty,bc=/^[: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]*$/,ru={},lu={};function ef(e){return fi.call(lu,e)?!0:fi.call(ru,e)?!1:bc.test(e)?lu[e]=!0:(ru[e]=!0,!1)}function nf(e,n,t,r){if(t!==null&&t.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tf(e,n,t,r){if(n===null||typeof n>"u"||nf(e,n,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function ae(e,n,t,r,l,i,o){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=i,this.removeEmptyString=o}var ee={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ee[e]=new ae(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];ee[n]=new ae(n,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ee[e]=new ae(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ee[e]=new ae(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){ee[e]=new ae(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ee[e]=new ae(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ee[e]=new ae(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ee[e]=new ae(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ee[e]=new ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var so=/[\-:]([a-z])/g;function ao(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 n=e.replace(so,ao);ee[n]=new ae(n,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(so,ao);ee[n]=new ae(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(so,ao);ee[n]=new ae(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ee[e]=new ae(e,1,!1,e.toLowerCase(),null,!1,!1)});ee.xlinkHref=new ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ee[e]=new ae(e,1,!1,e.toLowerCase(),null,!0,!0)});function co(e,n,t,r){var l=ee.hasOwnProperty(n)?ee[n]:null;(l!==null?l.type!==0:r||!(2u||l[o]!==i[u]){var s=` -`+l[o].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=o&&0<=u);break}}}finally{Al=!1,Error.prepareStackTrace=t}return(e=e?e.displayName||e.name:"")?xt(e):""}function rf(e){switch(e.tag){case 5:return xt(e.type);case 16:return xt("Lazy");case 13:return xt("Suspense");case 19:return xt("SuspenseList");case 0:case 2:case 15:return e=Bl(e.type,!1),e;case 11:return e=Bl(e.type.render,!1),e;case 1:return e=Bl(e.type,!0),e;default:return""}}function mi(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 Fn:return"Fragment";case Dn:return"Portal";case di:return"Profiler";case fo:return"StrictMode";case pi:return"Suspense";case vi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ts:return(e.displayName||"Context")+".Consumer";case zs:return(e._context.displayName||"Context")+".Provider";case po:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vo:return n=e.displayName||null,n!==null?n:mi(e.type)||"Memo";case be:n=e._payload,e=e._init;try{return mi(e(n))}catch{}}return null}function lf(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return mi(n);case 8:return n===fo?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function vn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Us(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function of(e){var n=Us(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),r=""+e[n];if(!e.hasOwnProperty(n)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var l=t.get,i=t.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,n,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function pr(e){e._valueTracker||(e._valueTracker=of(e))}function Is(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue(),r="";return e&&(r=Us(e)?e.checked?"true":"false":e.value),e=r,e!==t?(n.setValue(e),!0):!1}function Br(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 yi(e,n){var t=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??e._wrapperState.initialChecked})}function ou(e,n){var t=n.defaultValue==null?"":n.defaultValue,r=n.checked!=null?n.checked:n.defaultChecked;t=vn(n.value!=null?n.value:t),e._wrapperState={initialChecked:r,initialValue:t,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function Rs(e,n){n=n.checked,n!=null&&co(e,"checked",n,!1)}function hi(e,n){Rs(e,n);var t=vn(n.value),r=n.type;if(t!=null)r==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+t):e.value!==""+t&&(e.value=""+t);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?gi(e,n.type,t):n.hasOwnProperty("defaultValue")&&gi(e,n.type,vn(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function uu(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var r=n.type;if(!(r!=="submit"&&r!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,t||n===e.value||(e.value=n),e.defaultValue=n}t=e.name,t!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,t!==""&&(e.name=t)}function gi(e,n,t){(n!=="number"||Br(e.ownerDocument)!==e)&&(t==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t))}var Nt=Array.isArray;function Xn(e,n,t,r){if(e=e.options,n){n={};for(var l=0;l"+n.valueOf().toString()+"",n=vr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function $t(e,n){if(n){var t=e.firstChild;if(t&&t===e.lastChild&&t.nodeType===3){t.nodeValue=n;return}}e.textContent=n}var zt={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},uf=["Webkit","ms","Moz","O"];Object.keys(zt).forEach(function(e){uf.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),zt[n]=zt[e]})});function Fs(e,n,t){return n==null||typeof n=="boolean"||n===""?"":t||typeof n!="number"||n===0||zt.hasOwnProperty(e)&&zt[e]?(""+n).trim():n+"px"}function $s(e,n){e=e.style;for(var t in n)if(n.hasOwnProperty(t)){var r=t.indexOf("--")===0,l=Fs(t,n[t],r);t==="float"&&(t="cssFloat"),r?e.setProperty(t,l):e[t]=l}}var sf=B({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 ki(e,n){if(n){if(sf[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(h(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(h(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(h(61))}if(n.style!=null&&typeof n.style!="object")throw Error(h(62))}}function Ei(e,n){if(e.indexOf("-")===-1)return typeof n.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 _i=null;function mo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ci=null,Zn=null,Jn=null;function cu(e){if(e=ir(e)){if(typeof Ci!="function")throw Error(h(280));var n=e.stateNode;n&&(n=yl(n),Ci(e.stateNode,e.type,n))}}function As(e){Zn?Jn?Jn.push(e):Jn=[e]:Zn=e}function Bs(){if(Zn){var e=Zn,n=Jn;if(Jn=Zn=null,cu(e),n)for(e=0;e>>=0,e===0?32:31-(wf(e)/Sf|0)|0}var mr=64,yr=4194304;function Pt(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 Qr(e,n){var t=e.pendingLanes;if(t===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=t&268435455;if(o!==0){var u=o&~l;u!==0?r=Pt(u):(i&=o,i!==0&&(r=Pt(i)))}else o=t&~l,o!==0?r=Pt(o):i!==0&&(r=Pt(i));if(r===0)return 0;if(n!==0&&n!==r&&!(n&l)&&(l=r&-r,i=n&-n,l>=i||l===16&&(i&4194240)!==0))return n;if(r&4&&(r|=t&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=r;0t;t++)n.push(e);return n}function rr(e,n,t){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-Ue(n),e[n]=t}function Cf(e,n){var t=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Mt),wu=" ",Su=!1;function ua(e,n){switch(e){case"keyup":return qf.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $n=!1;function ed(e,n){switch(e){case"compositionend":return sa(n);case"keypress":return n.which!==32?null:(Su=!0,wu);case"textInput":return e=n.data,e===wu&&Su?null:e;default:return null}}function nd(e,n){if($n)return e==="compositionend"||!_o&&ua(e,n)?(e=ia(),Mr=So=rn=null,$n=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:t,offset:n-e};e=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Cu(t)}}function da(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?da(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function pa(){for(var e=window,n=Br();n instanceof e.HTMLIFrameElement;){try{var t=typeof n.contentWindow.location.href=="string"}catch{t=!1}if(t)e=n.contentWindow;else break;n=Br(e.document)}return n}function Co(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function cd(e){var n=pa(),t=e.focusedElem,r=e.selectionRange;if(n!==t&&t&&t.ownerDocument&&da(t.ownerDocument.documentElement,t)){if(r!==null&&Co(t)){if(n=r.start,e=r.end,e===void 0&&(e=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(e,t.value.length);else if(e=(n=t.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var l=t.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=xu(t,i);var o=xu(t,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(n=n.createRange(),n.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(n),e.extend(o.node,o.offset)):(n.setEnd(o.node,o.offset),e.addRange(n)))}}for(n=[],e=t;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,An=null,Ti=null,It=null,Mi=!1;function Nu(e,n,t){var r=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;Mi||An==null||An!==Br(r)||(r=An,"selectionStart"in r&&Co(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}),It&&Qt(It,r)||(It=r,r=Yr(Ti,"onSelect"),0Wn||(e.current=Di[Wn],Di[Wn]=null,Wn--)}function R(e,n){Wn++,Di[Wn]=e.current,e.current=n}var mn={},ie=hn(mn),de=hn(!1),Ln=mn;function rt(e,n){var t=e.type.contextTypes;if(!t)return mn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===n)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in t)l[i]=n[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=l),l}function pe(e){return e=e.childContextTypes,e!=null}function Zr(){j(de),j(ie)}function Iu(e,n,t){if(ie.current!==mn)throw Error(h(168));R(ie,n),R(de,t)}function Ea(e,n,t){var r=e.stateNode;if(n=n.childContextTypes,typeof r.getChildContext!="function")return t;r=r.getChildContext();for(var l in r)if(!(l in n))throw Error(h(108,lf(e)||"Unknown",l));return B({},t,r)}function Jr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mn,Ln=ie.current,R(ie,e),R(de,de.current),!0}function Ru(e,n,t){var r=e.stateNode;if(!r)throw Error(h(169));t?(e=Ea(e,n,Ln),r.__reactInternalMemoizedMergedChildContext=e,j(de),j(ie),R(ie,e)):j(de),R(de,t)}var Ve=null,hl=!1,ni=!1;function _a(e){Ve===null?Ve=[e]:Ve.push(e)}function Ed(e){hl=!0,_a(e)}function gn(){if(!ni&&Ve!==null){ni=!0;var e=0,n=U;try{var t=Ve;for(U=1;e>=o,l-=o,We=1<<32-Ue(n)+l|t<N?(W=x,x=null):W=x.sibling;var T=p(f,x,d[N],y);if(T===null){x===null&&(x=W);break}e&&x&&T.alternate===null&&n(f,x),c=i(T,c,N),C===null?k=T:C.sibling=T,C=T,x=W}if(N===d.length)return t(f,x),F&&kn(f,N),k;if(x===null){for(;NN?(W=x,x=null):W=x.sibling;var Pe=p(f,x,T.value,y);if(Pe===null){x===null&&(x=W);break}e&&x&&Pe.alternate===null&&n(f,x),c=i(Pe,c,N),C===null?k=Pe:C.sibling=Pe,C=Pe,x=W}if(T.done)return t(f,x),F&&kn(f,N),k;if(x===null){for(;!T.done;N++,T=d.next())T=m(f,T.value,y),T!==null&&(c=i(T,c,N),C===null?k=T:C.sibling=T,C=T);return F&&kn(f,N),k}for(x=r(f,x);!T.done;N++,T=d.next())T=g(x,f,N,T.value,y),T!==null&&(e&&T.alternate!==null&&x.delete(T.key===null?N:T.key),c=i(T,c,N),C===null?k=T:C.sibling=T,C=T);return e&&x.forEach(function(pt){return n(f,pt)}),F&&kn(f,N),k}function I(f,c,d,y){if(typeof d=="object"&&d!==null&&d.type===Fn&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case dr:e:{for(var k=d.key,C=c;C!==null;){if(C.key===k){if(k=d.type,k===Fn){if(C.tag===7){t(f,C.sibling),c=l(C,d.props.children),c.return=f,f=c;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===be&&Du(k)===C.type){t(f,C.sibling),c=l(C,d.props),c.ref=St(f,C,d),c.return=f,f=c;break e}t(f,C);break}else n(f,C);C=C.sibling}d.type===Fn?(c=Pn(d.props.children,f.mode,y,d.key),c.return=f,f=c):(y=$r(d.type,d.key,d.props,null,f.mode,y),y.ref=St(f,c,d),y.return=f,f=y)}return o(f);case Dn:e:{for(C=d.key;c!==null;){if(c.key===C)if(c.tag===4&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){t(f,c.sibling),c=l(c,d.children||[]),c.return=f,f=c;break e}else{t(f,c);break}else n(f,c);c=c.sibling}c=ai(d,f.mode,y),c.return=f,f=c}return o(f);case be:return C=d._init,I(f,c,C(d._payload),y)}if(Nt(d))return w(f,c,d,y);if(mt(d))return S(f,c,d,y);_r(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,c!==null&&c.tag===6?(t(f,c.sibling),c=l(c,d),c.return=f,f=c):(t(f,c),c=si(d,f.mode,y),c.return=f,f=c),o(f)):t(f,c)}return I}var it=Pa(!0),La=Pa(!1),el=hn(null),nl=null,Kn=null,Lo=null;function zo(){Lo=Kn=nl=null}function To(e){var n=el.current;j(el),e._currentValue=n}function Ai(e,n,t){for(;e!==null;){var r=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,r!==null&&(r.childLanes|=n)):r!==null&&(r.childLanes&n)!==n&&(r.childLanes|=n),e===t)break;e=e.return}}function bn(e,n){nl=e,Lo=Kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&n&&(fe=!0),e.firstContext=null)}function xe(e){var n=e._currentValue;if(Lo!==e)if(e={context:e,memoizedValue:n,next:null},Kn===null){if(nl===null)throw Error(h(308));Kn=e,nl.dependencies={lanes:0,firstContext:e}}else Kn=Kn.next=e;return n}var Cn=null;function Mo(e){Cn===null?Cn=[e]:Cn.push(e)}function za(e,n,t,r){var l=n.interleaved;return l===null?(t.next=t,Mo(n)):(t.next=l.next,l.next=t),n.interleaved=t,Ye(e,r)}function Ye(e,n){e.lanes|=n;var t=e.alternate;for(t!==null&&(t.lanes|=n),t=e,e=e.return;e!==null;)e.childLanes|=n,t=e.alternate,t!==null&&(t.childLanes|=n),t=e,e=e.return;return t.tag===3?t.stateNode:null}var en=!1;function Uo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ta(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qe(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function cn(e,n,t){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,M&2){var l=r.pending;return l===null?n.next=n:(n.next=l.next,l.next=n),r.pending=n,Ye(e,t)}return l=r.interleaved,l===null?(n.next=n,Mo(r)):(n.next=l.next,l.next=n),r.interleaved=n,Ye(e,t)}function Ir(e,n,t){if(n=n.updateQueue,n!==null&&(n=n.shared,(t&4194240)!==0)){var r=n.lanes;r&=e.pendingLanes,t|=r,n.lanes=t,ho(e,t)}}function Fu(e,n){var t=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,t===r)){var l=null,i=null;if(t=t.firstBaseUpdate,t!==null){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};i===null?l=i=o:i=i.next=o,t=t.next}while(t!==null);i===null?l=i=n:i=i.next=n}else l=i=n;t={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=t;return}e=t.lastBaseUpdate,e===null?t.firstBaseUpdate=n:e.next=n,t.lastBaseUpdate=n}function tl(e,n,t,r){var l=e.updateQueue;en=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var s=u,a=s.next;s.next=null,o===null?i=a:o.next=a,o=s;var v=e.alternate;v!==null&&(v=v.updateQueue,u=v.lastBaseUpdate,u!==o&&(u===null?v.firstBaseUpdate=a:u.next=a,v.lastBaseUpdate=s))}if(i!==null){var m=l.baseState;o=0,v=a=s=null,u=i;do{var p=u.lane,g=u.eventTime;if((r&p)===p){v!==null&&(v=v.next={eventTime:g,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var w=e,S=u;switch(p=n,g=t,S.tag){case 1:if(w=S.payload,typeof w=="function"){m=w.call(g,m,p);break e}m=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=S.payload,p=typeof w=="function"?w.call(g,m,p):w,p==null)break e;m=B({},m,p);break e;case 2:en=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,p=l.effects,p===null?l.effects=[u]:p.push(u))}else g={eventTime:g,lane:p,tag:u.tag,payload:u.payload,callback:u.callback,next:null},v===null?(a=v=g,s=m):v=v.next=g,o|=p;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;p=u,u=p.next,p.next=null,l.lastBaseUpdate=p,l.shared.pending=null}}while(!0);if(v===null&&(s=m),l.baseState=s,l.firstBaseUpdate=a,l.lastBaseUpdate=v,n=l.shared.interleaved,n!==null){l=n;do o|=l.lane,l=l.next;while(l!==n)}else i===null&&(l.shared.lanes=0);Mn|=o,e.lanes=o,e.memoizedState=m}}function $u(e,n,t){if(e=n.effects,n.effects=null,e!==null)for(n=0;nt?t:4,e(!0);var r=ri.transition;ri.transition={};try{e(!1),n()}finally{U=t,ri.transition=r}}function Ga(){return Ne().memoizedState}function Nd(e,n,t){var r=dn(e);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},Ya(e))Xa(n,t);else if(t=za(e,n,t,r),t!==null){var l=ue();Ie(t,e,r,l),Za(t,n,r)}}function Pd(e,n,t){var r=dn(e),l={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(Ya(e))Xa(n,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=n.lastRenderedReducer,i!==null))try{var o=n.lastRenderedState,u=i(o,t);if(l.hasEagerState=!0,l.eagerState=u,Re(u,o)){var s=n.interleaved;s===null?(l.next=l,Mo(n)):(l.next=s.next,s.next=l),n.interleaved=l;return}}catch{}finally{}t=za(e,n,l,r),t!==null&&(l=ue(),Ie(t,e,r,l),Za(t,n,r))}}function Ya(e){var n=e.alternate;return e===A||n!==null&&n===A}function Xa(e,n){Rt=ll=!0;var t=e.pending;t===null?n.next=n:(n.next=t.next,t.next=n),e.pending=n}function Za(e,n,t){if(t&4194240){var r=n.lanes;r&=e.pendingLanes,t|=r,n.lanes=t,ho(e,t)}}var il={readContext:xe,useCallback:ne,useContext:ne,useEffect:ne,useImperativeHandle:ne,useInsertionEffect:ne,useLayoutEffect:ne,useMemo:ne,useReducer:ne,useRef:ne,useState:ne,useDebugValue:ne,useDeferredValue:ne,useTransition:ne,useMutableSource:ne,useSyncExternalStore:ne,useId:ne,unstable_isNewReconciler:!1},Ld={readContext:xe,useCallback:function(e,n){return je().memoizedState=[e,n===void 0?null:n],e},useContext:xe,useEffect:Bu,useImperativeHandle:function(e,n,t){return t=t!=null?t.concat([e]):null,Or(4194308,4,Va.bind(null,n,e),t)},useLayoutEffect:function(e,n){return Or(4194308,4,e,n)},useInsertionEffect:function(e,n){return Or(4,2,e,n)},useMemo:function(e,n){var t=je();return n=n===void 0?null:n,e=e(),t.memoizedState=[e,n],e},useReducer:function(e,n,t){var r=je();return n=t!==void 0?t(n):n,r.memoizedState=r.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=Nd.bind(null,A,e),[r.memoizedState,e]},useRef:function(e){var n=je();return e={current:e},n.memoizedState=e},useState:Au,useDebugValue:Ao,useDeferredValue:function(e){return je().memoizedState=e},useTransition:function(){var e=Au(!1),n=e[0];return e=xd.bind(null,e[1]),je().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,t){var r=A,l=je();if(F){if(t===void 0)throw Error(h(407));t=t()}else{if(t=n(),J===null)throw Error(h(349));Tn&30||Ra(r,n,t)}l.memoizedState=t;var i={value:t,getSnapshot:n};return l.queue=i,Bu(ja.bind(null,r,i,e),[e]),r.flags|=2048,bt(9,Oa.bind(null,r,i,t,n),void 0,null),t},useId:function(){var e=je(),n=J.identifierPrefix;if(F){var t=He,r=We;t=(r&~(1<<32-Ue(r)-1)).toString(32)+t,n=":"+n+"R"+t,t=Jt++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(t,{is:r.is}):(e=o.createElement(t),t==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,t),e[De]=n,e[Yt]=r,oc(e,n,!1,!1),n.stateNode=e;e:{switch(o=Ei(t,r),t){case"dialog":O("cancel",e),O("close",e),l=r;break;case"iframe":case"object":case"embed":O("load",e),l=r;break;case"video":case"audio":for(l=0;lst&&(n.flags|=128,r=!0,kt(i,!1),n.lanes=4194304)}else{if(!r)if(e=rl(o),e!==null){if(n.flags|=128,r=!0,t=e.updateQueue,t!==null&&(n.updateQueue=t,n.flags|=4),kt(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!F)return te(n),null}else 2*Q()-i.renderingStartTime>st&&t!==1073741824&&(n.flags|=128,r=!0,kt(i,!1),n.lanes=4194304);i.isBackwards?(o.sibling=n.child,n.child=o):(t=i.last,t!==null?t.sibling=o:n.child=o,i.last=o)}return i.tail!==null?(n=i.tail,i.rendering=n,i.tail=n.sibling,i.renderingStartTime=Q(),n.sibling=null,t=$.current,R($,r?t&1|2:t&1),n):(te(n),null);case 22:case 23:return Ko(),r=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(n.flags|=8192),r&&n.mode&1?me&1073741824&&(te(n),n.subtreeFlags&6&&(n.flags|=8192)):te(n),null;case 24:return null;case 25:return null}throw Error(h(156,n.tag))}function jd(e,n){switch(No(n),n.tag){case 1:return pe(n.type)&&Zr(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ot(),j(de),j(ie),Oo(),e=n.flags,e&65536&&!(e&128)?(n.flags=e&-65537|128,n):null;case 5:return Ro(n),null;case 13:if(j($),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(h(340));lt()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return j($),null;case 4:return ot(),null;case 10:return To(n.type._context),null;case 22:case 23:return Ko(),null;case 24:return null;default:return null}}var xr=!1,le=!1,Dd=typeof WeakSet=="function"?WeakSet:Set,E=null;function Gn(e,n){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(r){V(e,n,r)}else t.current=null}function Xi(e,n,t){try{t()}catch(r){V(e,n,r)}}var qu=!1;function Fd(e,n){if(Ui=Kr,e=pa(),Co(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{t=(t=e.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&r.rangeCount!==0){t=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{t.nodeType,i.nodeType}catch{t=null;break e}var o=0,u=-1,s=-1,a=0,v=0,m=e,p=null;n:for(;;){for(var g;m!==t||l!==0&&m.nodeType!==3||(u=o+l),m!==i||r!==0&&m.nodeType!==3||(s=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(g=m.firstChild)!==null;)p=m,m=g;for(;;){if(m===e)break n;if(p===t&&++a===l&&(u=o),p===i&&++v===r&&(s=o),(g=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=g}t=u===-1||s===-1?null:{start:u,end:s}}else t=null}t=t||{start:0,end:0}}else t=null;for(Ii={focusedElem:e,selectionRange:t},Kr=!1,E=n;E!==null;)if(n=E,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,E=e;else for(;E!==null;){n=E;try{var w=n.alternate;if(n.flags&1024)switch(n.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var S=w.memoizedProps,I=w.memoizedState,f=n.stateNode,c=f.getSnapshotBeforeUpdate(n.elementType===n.type?S:ze(n.type,S),I);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var d=n.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(h(163))}}catch(y){V(n,n.return,y)}if(e=n.sibling,e!==null){e.return=n.return,E=e;break}E=n.return}return w=qu,qu=!1,w}function Ot(e,n,t){var r=n.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Xi(n,t,i)}l=l.next}while(l!==r)}}function Sl(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var t=n=n.next;do{if((t.tag&e)===e){var r=t.create;t.destroy=r()}t=t.next}while(t!==n)}}function Zi(e){var n=e.ref;if(n!==null){var t=e.stateNode;switch(e.tag){case 5:e=t;break;default:e=t}typeof n=="function"?n(e):n.current=e}}function ac(e){var n=e.alternate;n!==null&&(e.alternate=null,ac(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[De],delete n[Yt],delete n[ji],delete n[Sd],delete n[kd])),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 cc(e){return e.tag===5||e.tag===3||e.tag===4}function bu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cc(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 Ji(e,n,t){var r=e.tag;if(r===5||r===6)e=e.stateNode,n?t.nodeType===8?t.parentNode.insertBefore(e,n):t.insertBefore(e,n):(t.nodeType===8?(n=t.parentNode,n.insertBefore(e,t)):(n=t,n.appendChild(e)),t=t._reactRootContainer,t!=null||n.onclick!==null||(n.onclick=Xr));else if(r!==4&&(e=e.child,e!==null))for(Ji(e,n,t),e=e.sibling;e!==null;)Ji(e,n,t),e=e.sibling}function qi(e,n,t){var r=e.tag;if(r===5||r===6)e=e.stateNode,n?t.insertBefore(e,n):t.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(qi(e,n,t),e=e.sibling;e!==null;)qi(e,n,t),e=e.sibling}var q=null,Te=!1;function Je(e,n,t){for(t=t.child;t!==null;)fc(e,n,t),t=t.sibling}function fc(e,n,t){if(Fe&&typeof Fe.onCommitFiberUnmount=="function")try{Fe.onCommitFiberUnmount(dl,t)}catch{}switch(t.tag){case 5:le||Gn(t,n);case 6:var r=q,l=Te;q=null,Je(e,n,t),q=r,Te=l,q!==null&&(Te?(e=q,t=t.stateNode,e.nodeType===8?e.parentNode.removeChild(t):e.removeChild(t)):q.removeChild(t.stateNode));break;case 18:q!==null&&(Te?(e=q,t=t.stateNode,e.nodeType===8?ei(e.parentNode,t):e.nodeType===1&&ei(e,t),Wt(e)):ei(q,t.stateNode));break;case 4:r=q,l=Te,q=t.stateNode.containerInfo,Te=!0,Je(e,n,t),q=r,Te=l;break;case 0:case 11:case 14:case 15:if(!le&&(r=t.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Xi(t,n,o),l=l.next}while(l!==r)}Je(e,n,t);break;case 1:if(!le&&(Gn(t,n),r=t.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(u){V(t,n,u)}Je(e,n,t);break;case 21:Je(e,n,t);break;case 22:t.mode&1?(le=(r=le)||t.memoizedState!==null,Je(e,n,t),le=r):Je(e,n,t);break;default:Je(e,n,t)}}function es(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var t=e.stateNode;t===null&&(t=e.stateNode=new Dd),n.forEach(function(r){var l=Gd.bind(null,e,r);t.has(r)||(t.add(r),r.then(l,l))})}}function Le(e,n){var t=n.deletions;if(t!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=Q()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ad(r/1960))-r,10e?16:e,ln===null)var r=!1;else{if(e=ln,ln=null,sl=0,M&6)throw Error(h(331));var l=M;for(M|=4,E=e.current;E!==null;){var i=E,o=i.child;if(E.flags&16){var u=i.deletions;if(u!==null){for(var s=0;sQ()-Ho?Nn(e,0):Wo|=t),ve(e,n)}function wc(e,n){n===0&&(e.mode&1?(n=yr,yr<<=1,!(yr&130023424)&&(yr=4194304)):n=1);var t=ue();e=Ye(e,n),e!==null&&(rr(e,n,t),ve(e,t))}function Kd(e){var n=e.memoizedState,t=0;n!==null&&(t=n.retryLane),wc(e,t)}function Gd(e,n){var t=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(t=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(h(314))}r!==null&&r.delete(n),wc(e,t)}var Sc;Sc=function(e,n,t){if(e!==null)if(e.memoizedProps!==n.pendingProps||de.current)fe=!0;else{if(!(e.lanes&t)&&!(n.flags&128))return fe=!1,Rd(e,n,t);fe=!!(e.flags&131072)}else fe=!1,F&&n.flags&1048576&&Ca(n,br,n.index);switch(n.lanes=0,n.tag){case 2:var r=n.type;jr(e,n),e=n.pendingProps;var l=rt(n,ie.current);bn(n,t),l=Do(null,n,r,e,l,t);var i=Fo();return n.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,pe(r)?(i=!0,Jr(n)):i=!1,n.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Uo(n),l.updater=wl,n.stateNode=l,l._reactInternals=n,Vi(n,r,e,t),n=Qi(null,n,r,!0,i,t)):(n.tag=0,F&&i&&xo(n),oe(null,n,l,t),n=n.child),n;case 16:r=n.elementType;e:{switch(jr(e,n),e=n.pendingProps,l=r._init,r=l(r._payload),n.type=r,l=n.tag=Xd(r),e=ze(r,e),l){case 0:n=Hi(null,n,r,e,t);break e;case 1:n=Xu(null,n,r,e,t);break e;case 11:n=Gu(null,n,r,e,t);break e;case 14:n=Yu(null,n,r,ze(r.type,e),t);break e}throw Error(h(306,r,""))}return n;case 0:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:ze(r,l),Hi(e,n,r,l,t);case 1:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:ze(r,l),Xu(e,n,r,l,t);case 3:e:{if(rc(n),e===null)throw Error(h(387));r=n.pendingProps,i=n.memoizedState,l=i.element,Ta(e,n),tl(n,r,null,t);var o=n.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},n.updateQueue.baseState=i,n.memoizedState=i,n.flags&256){l=ut(Error(h(423)),n),n=Zu(e,n,r,t,l);break e}else if(r!==l){l=ut(Error(h(424)),n),n=Zu(e,n,r,t,l);break e}else for(ye=an(n.stateNode.containerInfo.firstChild),he=n,F=!0,Me=null,t=La(n,null,r,t),n.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(lt(),r===l){n=Xe(e,n,t);break e}oe(e,n,r,t)}n=n.child}return n;case 5:return Ma(n),e===null&&$i(n),r=n.type,l=n.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,Ri(r,l)?o=null:i!==null&&Ri(r,i)&&(n.flags|=32),tc(e,n),oe(e,n,o,t),n.child;case 6:return e===null&&$i(n),null;case 13:return lc(e,n,t);case 4:return Io(n,n.stateNode.containerInfo),r=n.pendingProps,e===null?n.child=it(n,null,r,t):oe(e,n,r,t),n.child;case 11:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:ze(r,l),Gu(e,n,r,l,t);case 7:return oe(e,n,n.pendingProps,t),n.child;case 8:return oe(e,n,n.pendingProps.children,t),n.child;case 12:return oe(e,n,n.pendingProps.children,t),n.child;case 10:e:{if(r=n.type._context,l=n.pendingProps,i=n.memoizedProps,o=l.value,R(el,r._currentValue),r._currentValue=o,i!==null)if(Re(i.value,o)){if(i.children===l.children&&!de.current){n=Xe(e,n,t);break e}}else for(i=n.child,i!==null&&(i.return=n);i!==null;){var u=i.dependencies;if(u!==null){o=i.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=Qe(-1,t&-t),s.tag=2;var a=i.updateQueue;if(a!==null){a=a.shared;var v=a.pending;v===null?s.next=s:(s.next=v.next,v.next=s),a.pending=s}}i.lanes|=t,s=i.alternate,s!==null&&(s.lanes|=t),Ai(i.return,t,n),u.lanes|=t;break}s=s.next}}else if(i.tag===10)o=i.type===n.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(h(341));o.lanes|=t,u=o.alternate,u!==null&&(u.lanes|=t),Ai(o,t,n),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===n){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}oe(e,n,l.children,t),n=n.child}return n;case 9:return l=n.type,r=n.pendingProps.children,bn(n,t),l=xe(l),r=r(l),n.flags|=1,oe(e,n,r,t),n.child;case 14:return r=n.type,l=ze(r,n.pendingProps),l=ze(r.type,l),Yu(e,n,r,l,t);case 15:return ec(e,n,n.type,n.pendingProps,t);case 17:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:ze(r,l),jr(e,n),n.tag=1,pe(r)?(e=!0,Jr(n)):e=!1,bn(n,t),Ja(n,r,l),Vi(n,r,l,t),Qi(null,n,r,!0,e,t);case 19:return ic(e,n,t);case 22:return nc(e,n,t)}throw Error(h(156,n.tag))};function kc(e,n){return Ys(e,n)}function Yd(e,n,t,r){this.tag=e,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,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 _e(e,n,t,r){return new Yd(e,n,t,r)}function Yo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xd(e){if(typeof e=="function")return Yo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===po)return 11;if(e===vo)return 14}return 2}function pn(e,n){var t=e.alternate;return t===null?(t=_e(e.tag,n,e.key,e.mode),t.elementType=e.elementType,t.type=e.type,t.stateNode=e.stateNode,t.alternate=e,e.alternate=t):(t.pendingProps=n,t.type=e.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=e.flags&14680064,t.childLanes=e.childLanes,t.lanes=e.lanes,t.child=e.child,t.memoizedProps=e.memoizedProps,t.memoizedState=e.memoizedState,t.updateQueue=e.updateQueue,n=e.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},t.sibling=e.sibling,t.index=e.index,t.ref=e.ref,t}function $r(e,n,t,r,l,i){var o=2;if(r=e,typeof e=="function")Yo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Fn:return Pn(t.children,l,i,n);case fo:o=8,l|=8;break;case di:return e=_e(12,t,n,l|2),e.elementType=di,e.lanes=i,e;case pi:return e=_e(13,t,n,l),e.elementType=pi,e.lanes=i,e;case vi:return e=_e(19,t,n,l),e.elementType=vi,e.lanes=i,e;case Ms:return El(t,l,i,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case zs:o=10;break e;case Ts:o=9;break e;case po:o=11;break e;case vo:o=14;break e;case be:o=16,r=null;break e}throw Error(h(130,e==null?e:typeof e,""))}return n=_e(o,t,n,l),n.elementType=e,n.type=r,n.lanes=i,n}function Pn(e,n,t,r){return e=_e(7,e,r,n),e.lanes=t,e}function El(e,n,t,r){return e=_e(22,e,r,n),e.elementType=Ms,e.lanes=t,e.stateNode={isHidden:!1},e}function si(e,n,t){return e=_e(6,e,null,n),e.lanes=t,e}function ai(e,n,t){return n=_e(4,e.children!==null?e.children:[],e.key,n),n.lanes=t,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Zd(e,n,t,r,l){this.tag=n,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=Wl(0),this.expirationTimes=Wl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Xo(e,n,t,r,l,i,o,u,s){return e=new Zd(e,n,t,u,s),n===1?(n=1,i===!0&&(n|=8)):n=0,i=_e(3,null,null,n),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Uo(i),e}function Jd(e,n,t){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xc)}catch(e){console.error(e)}}xc(),xs.exports=we;var tp=xs.exports,ss=tp;ci.createRoot=ss.createRoot,ci.hydrateRoot=ss.hydrateRoot;var nr={},Pl={},Ll={};Object.defineProperty(Ll,"__esModule",{value:!0});Ll.useUnityCanvasId=void 0;var rp=D,lp=0,ip="react-unity-webgl-canvas",op=function(e){if(e.id!==void 0)return e.id;var n=(0,rp.useMemo)(function(){return[ip,++lp].join("-")},[]);return n};Ll.useUnityCanvasId=op;var zl={},ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.UnityLoaderStatus=void 0;var as;(function(e){e.Idle="Idle",e.Loading="Loading",e.Loaded="Loaded",e.Error="Error"})(as||(ur.UnityLoaderStatus=as={}));var dt={};Object.defineProperty(dt,"__esModule",{value:!0});dt.isBrowserEnvironment=void 0;dt.isBrowserEnvironment=typeof window<"u"&&typeof document<"u";var up=nt&&nt.__awaiter||function(e,n,t,r){function l(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function u(v){try{a(r.next(v))}catch(m){o(m)}}function s(v){try{a(r.throw(v))}catch(m){o(m)}}function a(v){v.done?i(v.value):l(v.value).then(u,s)}a((r=r.apply(e,n||[])).next())})},sp=nt&&nt.__generator||function(e,n){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,l,i,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(v){return s([a,v])}}function s(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(t=0)),t;)try{if(r=1,l&&(i=a[0]&2?l.return:a[0]?l.throw||((i=l.return)&&i.call(l),0):l.next)&&!(i=i.call(l,a[1])).done)return i;switch(l=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,l=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]"u"){console.warn(_p.errorMessages.noEventListener,{eventName:l});return}return u.callback.apply(u,i)},[e]);return(0,_t.useEffect)(function(){return Ar.push(r),function(){Ar.splice(Ar.indexOf(r),1)}},[r]),{addEventListener:n,removeEventListener:t}};Il.useEventSystem=Np;var Rl={};Object.defineProperty(Rl,"__esModule",{value:!0});Rl.useNullableState=void 0;var Pp=D,Lp=function(e){return(0,Pp.useState)(e||null)};Rl.useNullableState=Lp;Object.defineProperty(Ul,"__esModule",{value:!0});Ul.useUnityContext=void 0;var Ae=D,Ct=sr,zp=Il,ps=Rl,Tp=function(e){var n=(0,ps.useNullableState)(),t=n[0],r=n[1],l=(0,Ae.useState)(0),i=l[0],o=l[1],u=(0,Ae.useState)(!1),s=u[0],a=u[1],v=(0,ps.useNullableState)(),m=v[0],p=v[1],g=(0,zp.useEventSystem)(),w=(0,Ae.useRef)({setLoadingProgression:o,setInitialisationError:p,setUnityInstance:r,setIsLoaded:a,unityConfig:e}),S=(0,Ae.useCallback)(function(y){if(t===null){console.warn(Ct.errorMessages.requestFullscreenNoUnityInstance);return}t.SetFullscreen(y===!0?1:0)},[t]),I=(0,Ae.useCallback)(function(){if(t===null||typeof t.Module.canvas>"u"){console.warn(Ct.errorMessages.requestPointerLockNoUnityInstanceOrCanvas);return}return t.Module.canvas.requestPointerLock()},[t]),f=(0,Ae.useCallback)(function(y,k,C){if(t===null){console.warn(Ct.errorMessages.sendMessageNoUnityInstance);return}t.SendMessage(y,k,C)},[t]),c=(0,Ae.useCallback)(function(y,k){if(t===null||typeof t.Module.canvas>"u"){console.warn(Ct.errorMessages.screenshotNoUnityInstanceOrCanvas);return}return t.Module.canvas.toDataURL(y,k)},[t]),d=(0,Ae.useCallback)(function(){return t===null?(console.warn(Ct.errorMessages.quitNoUnityInstance),Promise.reject()):t.Quit()},[t]);return(0,Ae.useEffect)(function(){a(i===1)},[i]),{unityProvider:w.current,loadingProgression:i,initialisationError:m,isLoaded:s,UNSAFE__unityInstance:t,requestFullscreen:S,requestPointerLock:I,sendMessage:f,unload:d,takeScreenshot:c,addEventListener:g.addEventListener,removeEventListener:g.removeEventListener}};Ul.useUnityContext=Tp;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.useUnityContext=e.Unity=void 0;var n=Pl;Object.defineProperty(e,"Unity",{enumerable:!0,get:function(){return n.Unity}});var t=Ul;Object.defineProperty(e,"useUnityContext",{enumerable:!0,get:function(){return t.useUnityContext}})})(nr);const re=window.Telegram.WebApp;function Mp(){const[e,n]=D.useState(!1);D.useState(""),D.useState(!1);const{unityProvider:t,isLoaded:r,loadingProgression:l,addEventListener:i,removeEventListener:o,sendMessage:u}=nr.useUnityContext({productName:"Focus Bear",productVersion:"1.0.0",companyName:"Arism Lab",loaderUrl:"assets/BuildGame.loader.js",dataUrl:"assets/BuildGame.data.unityweb",frameworkUrl:"assets/BuildGame.framework.js.unityweb",codeUrl:"assets/BuildGame.wasm.unityweb",streamingAssetsUrl:"StreamingAssets"}),[s,a]=D.useState(window.devicePixelRatio),v=D.useCallback(()=>{const g={reason:"Securely store your private key using biometric authentication"};re.BiometricManager.requestAccess(g,w=>{w?(re.MainButton.text="Access Granted "+re.BiometricManager.isInited+" "+re.BiometricManager.isBiometricAvailable,n(!0),re.BiometricManager.authenticate({reason:"Authenticate to store private key"},(S,I)=>{S?re.BiometricManager.updateBiometricToken("your-private-key-here",c=>{c?re.MainButton.text="Private key: "+I:re.MainButton.text="Failed to store the private key."}):console.error("Authentication failed.")})):(re.MainButton.text="Access Denied "+re.BiometricManager.isInited+" "+re.BiometricManager.isBiometricAvailable,n(!1)),re.MainButton.show()})},[]),m=D.useCallback(g=>{u("DialogCanvas","SetMessageText",g)},[u]),p=D.useCallback(()=>{re.BiometricManager.authenticate({reason:"Authenticate to retrieve private key"},(g,w)=>{if(g){const S=w.toString();m(S)}else console.error("Authentication failed.")})},[m]);return D.useEffect(()=>{u("MainGameCanvas","HideMainScreen")},[e]),D.useEffect(()=>(i("OnCreateWalletButtonClicked",v),()=>{o("OnCreateWalletButtonClicked",v)}),[i,o,v]),D.useEffect(()=>(i("OnExportKeyButtonClicked",p),()=>{o("OnExportKeyButtonClicked",p)}),[i,o,p]),D.useEffect(function(){re.ready(),re.isClosingConfirmationEnabled=!0,re.BiometricManager.init(()=>{})},[]),D.useEffect(()=>{const g=()=>{a(window.devicePixelRatio)},w=window.matchMedia(`screen and (resolution: ${s}dppx)`);return w.addEventListener("change",g),()=>{w.removeEventListener("change",g)}},[s]),qe.jsxs("div",{id:"unity-container",className:"unity-responsive",children:[qe.jsx(nr.Unity,{unityProvider:t,style:{width:"100%",height:"100%"},devicePixelRatio:s}),!r&&qe.jsxs("div",{id:"unity-loading-bar",children:[qe.jsx("div",{id:"unity-logo"}),qe.jsx("div",{id:"unity-progress-bar-empty",children:qe.jsx("div",{id:"unity-progress-bar-full",style:{width:`${l*100}%`}})})]})]})}ci.createRoot(document.getElementById("root")).render(qe.jsx(Hc.StrictMode,{children:qe.jsx(Mp,{})}))});export default Up(); diff --git a/assets/index-SHWATZhq.js b/assets/index-SHWATZhq.js new file mode 100644 index 0000000..22beedd --- /dev/null +++ b/assets/index-SHWATZhq.js @@ -0,0 +1,53 @@ +var u_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var tA=u_(So=>{(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 a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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)}})();var rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xp={exports:{}},ks={},Qp={exports:{}},$={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Po=Symbol.for("react.element"),c_=Symbol.for("react.portal"),f_=Symbol.for("react.fragment"),d_=Symbol.for("react.strict_mode"),h_=Symbol.for("react.profiler"),p_=Symbol.for("react.provider"),g_=Symbol.for("react.context"),y_=Symbol.for("react.forward_ref"),m_=Symbol.for("react.suspense"),__=Symbol.for("react.memo"),v_=Symbol.for("react.lazy"),Td=Symbol.iterator;function w_(e){return e===null||typeof e!="object"?null:(e=Td&&e[Td]||e["@@iterator"],typeof e=="function"?e:null)}var Jp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},e0=Object.assign,t0={};function di(e,t,n){this.props=e,this.context=t,this.refs=t0,this.updater=n||Jp}di.prototype.isReactComponent={};di.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};di.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function n0(){}n0.prototype=di.prototype;function Ac(e,t,n){this.props=e,this.context=t,this.refs=t0,this.updater=n||Jp}var Tc=Ac.prototype=new n0;Tc.constructor=Ac;e0(Tc,di.prototype);Tc.isPureReactComponent=!0;var Nd=Array.isArray,r0=Object.prototype.hasOwnProperty,Nc={current:null},i0={key:!0,ref:!0,__self:!0,__source:!0};function o0(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)r0.call(t,r)&&!i0.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1>>1,V=A[z];if(0>>1;zi(bt,D))qei(Ye,bt)?(A[z]=Ye,A[qe]=D,z=qe):(A[z]=bt,A[Ce]=D,z=Ce);else if(qei(Ye,D))A[z]=Ye,A[qe]=D,z=qe;else break e}}return O}function i(A,O){var D=A.sortIndex-O.sortIndex;return D!==0?D:A.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var u=[],l=[],c=1,f=null,p=3,y=!1,m=!1,_=!1,w=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(A){for(var O=n(l);O!==null;){if(O.callback===null)r(l);else if(O.startTime<=A)r(l),O.sortIndex=O.expirationTime,t(u,O);else break;O=n(l)}}function v(A){if(_=!1,g(A),!m)if(n(u)!==null)m=!0,I(S);else{var O=n(l);O!==null&&U(v,O.startTime-A)}}function S(A,O){m=!1,_&&(_=!1,d(k),k=-1),y=!0;var D=p;try{for(g(O),f=n(u);f!==null&&(!(f.expirationTime>O)||A&&!N());){var z=f.callback;if(typeof z=="function"){f.callback=null,p=f.priorityLevel;var V=z(f.expirationTime<=O);O=e.unstable_now(),typeof V=="function"?f.callback=V:f===n(u)&&r(u),g(O)}else r(u);f=n(u)}if(f!==null)var Ge=!0;else{var Ce=n(l);Ce!==null&&U(v,Ce.startTime-O),Ge=!1}return Ge}finally{f=null,p=D,y=!1}}var x=!1,E=null,k=-1,R=5,C=-1;function N(){return!(e.unstable_now()-CA||125z?(A.sortIndex=D,t(l,A),n(u)===null&&A===n(l)&&(_?(d(k),k=-1):_=!0,U(v,D-z))):(A.sortIndex=V,t(u,A),m||y||(m=!0,I(S))),A},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(A){var O=p;return function(){var D=p;p=O;try{return A.apply(this,arguments)}finally{p=D}}}})(c0);u0.exports=c0;var O_=u0.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var L_=G,nt=O_;function T(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cu=Object.prototype.hasOwnProperty,B_=/^[: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]*$/,Rd={},Od={};function P_(e){return cu.call(Od,e)?!0:cu.call(Rd,e)?!1:B_.test(e)?Od[e]=!0:(Rd[e]=!0,!1)}function D_(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 U_(e,t,n,r){if(t===null||typeof t>"u"||D_(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 ze(e,t,n,r,i,o,a){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=a}var ke={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ke[e]=new ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ke[t]=new ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ke[e]=new ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ke[e]=new ze(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){ke[e]=new ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ke[e]=new ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ke[e]=new ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ke[e]=new ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ke[e]=new ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var Rc=/[\-:]([a-z])/g;function Oc(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(Rc,Oc);ke[t]=new ze(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(Rc,Oc);ke[t]=new ze(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(Rc,Oc);ke[t]=new ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ke[e]=new ze(e,1,!1,e.toLowerCase(),null,!1,!1)});ke.xlinkHref=new ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ke[e]=new ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function Lc(e,t,n,r){var i=ke.hasOwnProperty(t)?ke[t]:null;(i!==null?i.type!==0:r||!(2s||i[a]!==o[s]){var u=` +`+i[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=s);break}}}finally{pl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$i(e):""}function $_(e){switch(e.tag){case 5:return $i(e.type);case 16:return $i("Lazy");case 13:return $i("Suspense");case 19:return $i("SuspenseList");case 0:case 2:case 15:return e=gl(e.type,!1),e;case 11:return e=gl(e.type.render,!1),e;case 1:return e=gl(e.type,!0),e;default:return""}}function pu(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 Rr:return"Fragment";case Ir:return"Portal";case fu:return"Profiler";case Bc:return"StrictMode";case du:return"Suspense";case hu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case h0:return(e.displayName||"Context")+".Consumer";case d0:return(e._context.displayName||"Context")+".Provider";case Pc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Dc:return t=e.displayName||null,t!==null?t:pu(e.type)||"Memo";case ln:t=e._payload,e=e._init;try{return pu(e(t))}catch{}}return null}function z_(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 pu(t);case 8:return t===Bc?"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 Tn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function g0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function M_(e){var t=g0(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(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ta(e){e._valueTracker||(e._valueTracker=M_(e))}function y0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=g0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fa(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 gu(e,t){var n=t.checked;return re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Bd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Tn(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 m0(e,t){t=t.checked,t!=null&&Lc(e,"checked",t,!1)}function yu(e,t){m0(e,t);var n=Tn(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")?mu(e,t.type,n):t.hasOwnProperty("defaultValue")&&mu(e,t.type,Tn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Pd(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 mu(e,t,n){(t!=="number"||Fa(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zi=Array.isArray;function jr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=na.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function oo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zi={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},H_=["Webkit","ms","Moz","O"];Object.keys(Zi).forEach(function(e){H_.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zi[t]=Zi[e]})});function E0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Zi.hasOwnProperty(e)&&Zi[e]?(""+t).trim():t+"px"}function S0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=E0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var F_=re({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 wu(e,t){if(t){if(F_[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(T(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(T(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(T(61))}if(t.style!=null&&typeof t.style!="object")throw Error(T(62))}}function Eu(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 Su=null;function Uc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xu=null,Vr=null,Zr=null;function $d(e){if(e=$o(e)){if(typeof xu!="function")throw Error(T(280));var t=e.stateNode;t&&(t=Ns(t),xu(e.stateNode,e.type,t))}}function x0(e){Vr?Zr?Zr.push(e):Zr=[e]:Vr=e}function k0(){if(Vr){var e=Vr,t=Zr;if(Zr=Vr=null,$d(e),t)for(e=0;e>>=0,e===0?32:31-(J_(e)/ev|0)|0}var ra=64,ia=4194304;function Mi(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 Ka(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=Mi(s):(o&=a,o!==0&&(r=Mi(o)))}else a=n&~i,a!==0?r=Mi(a):o!==0&&(r=Mi(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 Do(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wt(t),e[t]=n}function iv(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=Wi),Wd=" ",Gd=!1;function V0(e,t){switch(e){case"keyup":return Ov.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Z0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Or=!1;function Bv(e,t){switch(e){case"compositionend":return Z0(t);case"keypress":return t.which!==32?null:(Gd=!0,Wd);case"textInput":return e=t.data,e===Wd&&Gd?null:e;default:return null}}function Pv(e,t){if(Or)return e==="compositionend"||!Zc&&V0(e,t)?(e=F0(),Ta=Fc=hn=null,Or=!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=Qd(n)}}function q0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?q0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Y0(){for(var e=window,t=Fa();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fa(e.document)}return t}function Kc(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 Vv(e){var t=Y0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&q0(n.ownerDocument.documentElement,n)){if(r!==null&&Kc(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=Jd(n,o);var a=Jd(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.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,Lr=null,Nu=null,qi=null,Iu=!1;function eh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Iu||Lr==null||Lr!==Fa(r)||(r=Lr,"selectionStart"in r&&Kc(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}),qi&&fo(qi,r)||(qi=r,r=qa(Nu,"onSelect"),0Dr||(e.current=Du[Dr],Du[Dr]=null,Dr--)}function q(e,t){Dr++,Du[Dr]=e.current,e.current=t}var Nn={},Ne=$n(Nn),Ze=$n(!1),ir=Nn;function Qr(e,t){var n=e.type.contextTypes;if(!n)return Nn;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 Ke(e){return e=e.childContextTypes,e!=null}function Xa(){X(Ze),X(Ne)}function sh(e,t,n){if(Ne.current!==Nn)throw Error(T(168));q(Ne,t),q(Ze,n)}function og(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(T(108,z_(e)||"Unknown",i));return re({},n,r)}function Qa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Nn,ir=Ne.current,q(Ne,e),q(Ze,Ze.current),!0}function lh(e,t,n){var r=e.stateNode;if(!r)throw Error(T(169));n?(e=og(e,t,ir),r.__reactInternalMemoizedMergedChildContext=e,X(Ze),X(Ne),q(Ne,e)):X(Ze),q(Ze,n)}var jt=null,Is=!1,Nl=!1;function ag(e){jt===null?jt=[e]:jt.push(e)}function nw(e){Is=!0,ag(e)}function zn(){if(!Nl&&jt!==null){Nl=!0;var e=0,t=W;try{var n=jt;for(W=1;e>=a,i-=a,Wt=1<<32-wt(t)+i|n<k?(R=E,E=null):R=E.sibling;var C=p(d,E,g[k],v);if(C===null){E===null&&(E=R);break}e&&E&&C.alternate===null&&t(d,E),h=o(C,h,k),x===null?S=C:x.sibling=C,x=C,E=R}if(k===g.length)return n(d,E),J&&Vn(d,k),S;if(E===null){for(;kk?(R=E,E=null):R=E.sibling;var N=p(d,E,C.value,v);if(N===null){E===null&&(E=R);break}e&&E&&N.alternate===null&&t(d,E),h=o(N,h,k),x===null?S=N:x.sibling=N,x=N,E=R}if(C.done)return n(d,E),J&&Vn(d,k),S;if(E===null){for(;!C.done;k++,C=g.next())C=f(d,C.value,v),C!==null&&(h=o(C,h,k),x===null?S=C:x.sibling=C,x=C);return J&&Vn(d,k),S}for(E=r(d,E);!C.done;k++,C=g.next())C=y(E,d,k,C.value,v),C!==null&&(e&&C.alternate!==null&&E.delete(C.key===null?k:C.key),h=o(C,h,k),x===null?S=C:x.sibling=C,x=C);return e&&E.forEach(function(K){return t(d,K)}),J&&Vn(d,k),S}function w(d,h,g,v){if(typeof g=="object"&&g!==null&&g.type===Rr&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ea:e:{for(var S=g.key,x=h;x!==null;){if(x.key===S){if(S=g.type,S===Rr){if(x.tag===7){n(d,x.sibling),h=i(x,g.props.children),h.return=d,d=h;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ln&&fh(S)===x.type){n(d,x.sibling),h=i(x,g.props),h.ref=Ii(d,x,g),h.return=d,d=h;break e}n(d,x);break}else t(d,x);x=x.sibling}g.type===Rr?(h=nr(g.props.children,d.mode,v,g.key),h.return=d,d=h):(v=Da(g.type,g.key,g.props,null,d.mode,v),v.ref=Ii(d,h,g),v.return=d,d=v)}return a(d);case Ir:e:{for(x=g.key;h!==null;){if(h.key===x)if(h.tag===4&&h.stateNode.containerInfo===g.containerInfo&&h.stateNode.implementation===g.implementation){n(d,h.sibling),h=i(h,g.children||[]),h.return=d,d=h;break e}else{n(d,h);break}else t(d,h);h=h.sibling}h=Ul(g,d.mode,v),h.return=d,d=h}return a(d);case ln:return x=g._init,w(d,h,x(g._payload),v)}if(zi(g))return m(d,h,g,v);if(Ci(g))return _(d,h,g,v);fa(d,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,h!==null&&h.tag===6?(n(d,h.sibling),h=i(h,g),h.return=d,d=h):(n(d,h),h=Dl(g,d.mode,v),h.return=d,d=h),a(d)):n(d,h)}return w}var ei=cg(!0),fg=cg(!1),ts=$n(null),ns=null,zr=null,Yc=null;function Xc(){Yc=zr=ns=null}function Qc(e){var t=ts.current;X(ts),e._currentValue=t}function zu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Wr(e,t){ns=e,Yc=zr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Fe=!0),e.firstContext=null)}function ft(e){var t=e._currentValue;if(Yc!==e)if(e={context:e,memoizedValue:t,next:null},zr===null){if(ns===null)throw Error(T(308));zr=e,ns.dependencies={lanes:0,firstContext:e}}else zr=zr.next=e;return t}var qn=null;function Jc(e){qn===null?qn=[e]:qn.push(e)}function dg(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Jc(t)):(n.next=i.next,i.next=n),t.interleaved=n,Jt(e,r)}function Jt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var un=!1;function ef(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Yt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function wn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,j&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Jt(e,n)}return i=r.interleaved,i===null?(t.next=t,Jc(r)):(t.next=i.next,i.next=t),r.interleaved=t,Jt(e,n)}function Ia(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zc(e,n)}}function dh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function rs(e,t,n,r){var i=e.updateQueue;un=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var u=s,l=u.next;u.next=null,a===null?o=l:a.next=l,a=u;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(s===null?c.firstBaseUpdate=l:s.next=l,c.lastBaseUpdate=u))}if(o!==null){var f=i.baseState;a=0,c=l=u=null,s=o;do{var p=s.lane,y=s.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:y,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var m=e,_=s;switch(p=t,y=n,_.tag){case 1:if(m=_.payload,typeof m=="function"){f=m.call(y,f,p);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=_.payload,p=typeof m=="function"?m.call(y,f,p):m,p==null)break e;f=re({},f,p);break e;case 2:un=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else y={eventTime:y,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(l=c=y,u=f):c=c.next=y,a|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(c===null&&(u=f),i.baseState=u,i.firstBaseUpdate=l,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);sr|=a,e.lanes=a,e.memoizedState=f}}function hh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Rl.transition;Rl.transition={};try{e(!1),t()}finally{W=n,Rl.transition=r}}function Ig(){return dt().memoizedState}function aw(e,t,n){var r=Sn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Rg(e))Og(t,n);else if(n=dg(e,t,n,r),n!==null){var i=Pe();Et(n,e,r,i),Lg(n,t,r)}}function sw(e,t,n){var r=Sn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rg(e))Og(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,xt(s,a)){var u=t.interleaved;u===null?(i.next=i,Jc(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=dg(e,t,i,r),n!==null&&(i=Pe(),Et(n,e,r,i),Lg(n,t,r))}}function Rg(e){var t=e.alternate;return e===ne||t!==null&&t===ne}function Og(e,t){Yi=os=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,zc(e,n)}}var as={readContext:ft,useCallback:be,useContext:be,useEffect:be,useImperativeHandle:be,useInsertionEffect:be,useLayoutEffect:be,useMemo:be,useReducer:be,useRef:be,useState:be,useDebugValue:be,useDeferredValue:be,useTransition:be,useMutableSource:be,useSyncExternalStore:be,useId:be,unstable_isNewReconciler:!1},lw={readContext:ft,useCallback:function(e,t){return It().memoizedState=[e,t===void 0?null:t],e},useContext:ft,useEffect:gh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Oa(4194308,4,Cg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Oa(4194308,4,e,t)},useInsertionEffect:function(e,t){return Oa(4,2,e,t)},useMemo:function(e,t){var n=It();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=It();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=aw.bind(null,ne,e),[r.memoizedState,e]},useRef:function(e){var t=It();return e={current:e},t.memoizedState=e},useState:ph,useDebugValue:uf,useDeferredValue:function(e){return It().memoizedState=e},useTransition:function(){var e=ph(!1),t=e[0];return e=ow.bind(null,e[1]),It().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ne,i=It();if(J){if(n===void 0)throw Error(T(407));n=n()}else{if(n=t(),_e===null)throw Error(T(349));ar&30||mg(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,gh(vg.bind(null,r,o,e),[e]),r.flags|=2048,wo(9,_g.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=It(),t=_e.identifierPrefix;if(J){var n=Gt,r=Wt;n=(r&~(1<<32-wt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=_o++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Ot]=t,e[go]=r,jg(e,t,!1,!1),t.stateNode=e;e:{switch(a=Eu(n,r),n){case"dialog":Y("cancel",e),Y("close",e),i=r;break;case"iframe":case"object":case"embed":Y("load",e),i=r;break;case"video":case"audio":for(i=0;iri&&(t.flags|=128,r=!0,Ri(o,!1),t.lanes=4194304)}else{if(!r)if(e=is(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ri(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!J)return Ae(t),null}else 2*le()-o.renderingStartTime>ri&&n!==1073741824&&(t.flags|=128,r=!0,Ri(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=le(),t.sibling=null,n=te.current,q(te,r?n&1|2:n&1),t):(Ae(t),null);case 22:case 23:return gf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Qe&1073741824&&(Ae(t),t.subtreeFlags&6&&(t.flags|=8192)):Ae(t),null;case 24:return null;case 25:return null}throw Error(T(156,t.tag))}function yw(e,t){switch(Gc(t),t.tag){case 1:return Ke(t.type)&&Xa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ti(),X(Ze),X(Ne),rf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return nf(t),null;case 13:if(X(te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(T(340));Jr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(te),null;case 4:return ti(),null;case 10:return Qc(t.type._context),null;case 22:case 23:return gf(),null;case 24:return null;default:return null}}var ha=!1,Te=!1,mw=typeof WeakSet=="function"?WeakSet:Set,B=null;function Mr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ae(e,t,r)}else n.current=null}function Gu(e,t,n){try{n()}catch(r){ae(e,t,r)}}var bh=!1;function _w(e,t){if(Ru=Wa,e=Y0(),Kc(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 a=0,s=-1,u=-1,l=0,c=0,f=e,p=null;t:for(;;){for(var y;f!==n||i!==0&&f.nodeType!==3||(s=a+i),f!==o||r!==0&&f.nodeType!==3||(u=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(y=f.firstChild)!==null;)p=f,f=y;for(;;){if(f===e)break t;if(p===n&&++l===i&&(s=a),p===o&&++c===r&&(u=a),(y=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=y}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ou={focusedElem:e,selectionRange:n},Wa=!1,B=t;B!==null;)if(t=B,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,B=e;else for(;B!==null;){t=B;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var _=m.memoizedProps,w=m.memoizedState,d=t.stateNode,h=d.getSnapshotBeforeUpdate(t.elementType===t.type?_:yt(t.type,_),w);d.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(T(163))}}catch(v){ae(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,B=e;break}B=t.return}return m=bh,bh=!1,m}function Xi(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&&Gu(t,n,o)}i=i.next}while(i!==r)}}function Ls(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 qu(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 Kg(e){var t=e.alternate;t!==null&&(e.alternate=null,Kg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ot],delete t[go],delete t[Pu],delete t[ew],delete t[tw])),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 Wg(e){return e.tag===5||e.tag===3||e.tag===4}function Ah(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wg(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 Yu(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=Ya));else if(r!==4&&(e=e.child,e!==null))for(Yu(e,t,n),e=e.sibling;e!==null;)Yu(e,t,n),e=e.sibling}function Xu(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(Xu(e,t,n),e=e.sibling;e!==null;)Xu(e,t,n),e=e.sibling}var ve=null,mt=!1;function nn(e,t,n){for(n=n.child;n!==null;)Gg(e,t,n),n=n.sibling}function Gg(e,t,n){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(Cs,n)}catch{}switch(n.tag){case 5:Te||Mr(n,t);case 6:var r=ve,i=mt;ve=null,nn(e,t,n),ve=r,mt=i,ve!==null&&(mt?(e=ve,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ve.removeChild(n.stateNode));break;case 18:ve!==null&&(mt?(e=ve,n=n.stateNode,e.nodeType===8?Tl(e.parentNode,n):e.nodeType===1&&Tl(e,n),uo(e)):Tl(ve,n.stateNode));break;case 4:r=ve,i=mt,ve=n.stateNode.containerInfo,mt=!0,nn(e,t,n),ve=r,mt=i;break;case 0:case 11:case 14:case 15:if(!Te&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&Gu(n,t,a),i=i.next}while(i!==r)}nn(e,t,n);break;case 1:if(!Te&&(Mr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){ae(n,t,s)}nn(e,t,n);break;case 21:nn(e,t,n);break;case 22:n.mode&1?(Te=(r=Te)||n.memoizedState!==null,nn(e,t,n),Te=r):nn(e,t,n);break;default:nn(e,t,n)}}function Th(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mw),t.forEach(function(r){var i=Aw.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function gt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ww(r/1960))-r,10e?16:e,pn===null)var r=!1;else{if(e=pn,pn=null,us=0,j&6)throw Error(T(331));var i=j;for(j|=4,B=e.current;B!==null;){var o=B,a=o.child;if(B.flags&16){var s=o.deletions;if(s!==null){for(var u=0;ule()-hf?tr(e,0):df|=n),We(e,t)}function ny(e,t){t===0&&(e.mode&1?(t=ia,ia<<=1,!(ia&130023424)&&(ia=4194304)):t=1);var n=Pe();e=Jt(e,t),e!==null&&(Do(e,t,n),We(e,n))}function bw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ny(e,n)}function Aw(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(T(314))}r!==null&&r.delete(t),ny(e,n)}var ry;ry=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ze.current)Fe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Fe=!1,pw(e,t,n);Fe=!!(e.flags&131072)}else Fe=!1,J&&t.flags&1048576&&sg(t,es,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;La(e,t),e=t.pendingProps;var i=Qr(t,Ne.current);Wr(t,n),i=af(null,t,r,e,i,n);var o=sf();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,Ke(r)?(o=!0,Qa(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ef(t),i.updater=Os,t.stateNode=i,i._reactInternals=t,Hu(t,r,e,n),t=Vu(null,t,r,!0,o,n)):(t.tag=0,J&&o&&Wc(t),Re(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(La(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Nw(r),e=yt(r,e),i){case 0:t=ju(null,t,r,e,n);break e;case 1:t=xh(null,t,r,e,n);break e;case 11:t=Eh(null,t,r,e,n);break e;case 14:t=Sh(null,t,r,yt(r.type,e),n);break e}throw Error(T(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yt(r,i),ju(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yt(r,i),xh(e,t,r,i,n);case 3:e:{if(Mg(t),e===null)throw Error(T(387));r=t.pendingProps,o=t.memoizedState,i=o.element,hg(e,t),rs(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=ni(Error(T(423)),t),t=kh(e,t,r,n,i);break e}else if(r!==i){i=ni(Error(T(424)),t),t=kh(e,t,r,n,i);break e}else for(Je=vn(t.stateNode.containerInfo.firstChild),tt=t,J=!0,_t=null,n=fg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Jr(),r===i){t=en(e,t,n);break e}Re(e,t,r,n)}t=t.child}return t;case 5:return pg(t),e===null&&$u(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,Lu(r,i)?a=null:o!==null&&Lu(r,o)&&(t.flags|=32),zg(e,t),Re(e,t,a,n),t.child;case 6:return e===null&&$u(t),null;case 13:return Hg(e,t,n);case 4:return tf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ei(t,null,r,n):Re(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yt(r,i),Eh(e,t,r,i,n);case 7:return Re(e,t,t.pendingProps,n),t.child;case 8:return Re(e,t,t.pendingProps.children,n),t.child;case 12:return Re(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,q(ts,r._currentValue),r._currentValue=a,o!==null)if(xt(o.value,a)){if(o.children===i.children&&!Ze.current){t=en(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=Yt(-1,n&-n),u.tag=2;var l=o.updateQueue;if(l!==null){l=l.shared;var c=l.pending;c===null?u.next=u:(u.next=c.next,c.next=u),l.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),zu(o.return,n,t),s.lanes|=n;break}u=u.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(T(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),zu(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Re(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Wr(t,n),i=ft(i),r=r(i),t.flags|=1,Re(e,t,r,n),t.child;case 14:return r=t.type,i=yt(r,t.pendingProps),i=yt(r.type,i),Sh(e,t,r,i,n);case 15:return Ug(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yt(r,i),La(e,t),t.tag=1,Ke(r)?(e=!0,Qa(t)):e=!1,Wr(t,n),Bg(t,r,i),Hu(t,r,i,n),Vu(null,t,r,!0,e,n);case 19:return Fg(e,t,n);case 22:return $g(e,t,n)}throw Error(T(156,t.tag))};function iy(e,t){return R0(e,t)}function Tw(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 ut(e,t,n,r){return new Tw(e,t,n,r)}function mf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nw(e){if(typeof e=="function")return mf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Pc)return 11;if(e===Dc)return 14}return 2}function xn(e,t){var n=e.alternate;return n===null?(n=ut(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 Da(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")mf(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Rr:return nr(n.children,i,o,t);case Bc:a=8,i|=8;break;case fu:return e=ut(12,n,t,i|2),e.elementType=fu,e.lanes=o,e;case du:return e=ut(13,n,t,i),e.elementType=du,e.lanes=o,e;case hu:return e=ut(19,n,t,i),e.elementType=hu,e.lanes=o,e;case p0:return Ps(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case d0:a=10;break e;case h0:a=9;break e;case Pc:a=11;break e;case Dc:a=14;break e;case ln:a=16,r=null;break e}throw Error(T(130,e==null?e:typeof e,""))}return t=ut(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function nr(e,t,n,r){return e=ut(7,e,r,t),e.lanes=n,e}function Ps(e,t,n,r){return e=ut(22,e,r,t),e.elementType=p0,e.lanes=n,e.stateNode={isHidden:!1},e}function Dl(e,t,n){return e=ut(6,e,null,t),e.lanes=n,e}function Ul(e,t,n){return t=ut(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Iw(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=ml(0),this.expirationTimes=ml(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ml(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function _f(e,t,n,r,i,o,a,s,u){return e=new Iw(e,t,n,s,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ut(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ef(o),e}function Rw(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ly)}catch(e){console.error(e)}}ly(),l0.exports=rt;var Dw=l0.exports,Dh=Dw;uu.createRoot=Dh.createRoot,uu.hydrateRoot=Dh.hydrateRoot;var So={},Ms={},Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.useUnityCanvasId=void 0;var Uw=G,$w=0,zw="react-unity-webgl-canvas",Mw=function(e){if(e.id!==void 0)return e.id;var t=(0,Uw.useMemo)(function(){return[zw,++$w].join("-")},[]);return t};Hs.useUnityCanvasId=Mw;var Fs={},Mo={};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.UnityLoaderStatus=void 0;var Uh;(function(e){e.Idle="Idle",e.Loading="Loading",e.Loaded="Loaded",e.Error="Error"})(Uh||(Mo.UnityLoaderStatus=Uh={}));var gi={};Object.defineProperty(gi,"__esModule",{value:!0});gi.isBrowserEnvironment=void 0;gi.isBrowserEnvironment=typeof window<"u"&&typeof document<"u";var Hw=rr&&rr.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{l(r.next(c))}catch(f){a(f)}}function u(c){try{l(r.throw(c))}catch(f){a(f)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})},Fw=rr&&rr.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]"u"){console.warn(rE.errorMessages.noEventListener,{eventName:i});return}return s.callback.apply(s,o)},[e]);return(0,Li.useEffect)(function(){return Ua.push(r),function(){Ua.splice(Ua.indexOf(r),1)}},[r]),{addEventListener:t,removeEventListener:n}};Ks.useEventSystem=aE;var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.useNullableState=void 0;var sE=G,lE=function(e){return(0,sE.useState)(e||null)};Ws.useNullableState=lE;Object.defineProperty(Zs,"__esModule",{value:!0});Zs.useUnityContext=void 0;var Mt=G,Bi=Ho,uE=Ks,Hh=Ws,cE=function(e){var t=(0,Hh.useNullableState)(),n=t[0],r=t[1],i=(0,Mt.useState)(0),o=i[0],a=i[1],s=(0,Mt.useState)(!1),u=s[0],l=s[1],c=(0,Hh.useNullableState)(),f=c[0],p=c[1],y=(0,uE.useEventSystem)(),m=(0,Mt.useRef)({setLoadingProgression:a,setInitialisationError:p,setUnityInstance:r,setIsLoaded:l,unityConfig:e}),_=(0,Mt.useCallback)(function(v){if(n===null){console.warn(Bi.errorMessages.requestFullscreenNoUnityInstance);return}n.SetFullscreen(v===!0?1:0)},[n]),w=(0,Mt.useCallback)(function(){if(n===null||typeof n.Module.canvas>"u"){console.warn(Bi.errorMessages.requestPointerLockNoUnityInstanceOrCanvas);return}return n.Module.canvas.requestPointerLock()},[n]),d=(0,Mt.useCallback)(function(v,S,x){if(n===null){console.warn(Bi.errorMessages.sendMessageNoUnityInstance);return}n.SendMessage(v,S,x)},[n]),h=(0,Mt.useCallback)(function(v,S){if(n===null||typeof n.Module.canvas>"u"){console.warn(Bi.errorMessages.screenshotNoUnityInstanceOrCanvas);return}return n.Module.canvas.toDataURL(v,S)},[n]),g=(0,Mt.useCallback)(function(){return n===null?(console.warn(Bi.errorMessages.quitNoUnityInstance),Promise.reject()):n.Quit()},[n]);return(0,Mt.useEffect)(function(){l(o===1)},[o]),{unityProvider:m.current,loadingProgression:o,initialisationError:f,isLoaded:u,UNSAFE__unityInstance:n,requestFullscreen:_,requestPointerLock:w,sendMessage:d,unload:g,takeScreenshot:h,addEventListener:y.addEventListener,removeEventListener:y.removeEventListener}};Zs.useUnityContext=cE;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.useUnityContext=e.Unity=void 0;var t=Ms;Object.defineProperty(e,"Unity",{enumerable:!0,get:function(){return t.Unity}});var n=Zs;Object.defineProperty(e,"useUnityContext",{enumerable:!0,get:function(){return n.useUnityContext}})})(So);/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function fE(e){return e instanceof Uint8Array||e!=null&&typeof e=="object"&&e.constructor.name==="Uint8Array"}function dE(...e){const t=o=>o,n=(o,a)=>s=>o(a(s)),r=e.map(o=>o.encode).reduceRight(n,t),i=e.map(o=>o.decode).reduce(n,t);return{encode:r,decode:i}}function hE(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})}}}function pE(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let n of t)if(typeof n!="string")throw new Error(`join.encode: non-string input=${n}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function gE(e,t="="){if(typeof t!="string")throw new Error("padding chr should be string");return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let r of n)if(typeof r!="string")throw new Error(`padding.encode: non-string input=${r}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!="string")throw new Error("padding.encode input should be array of strings");for(let i of n)if(typeof i!="string")throw new Error(`padding.decode: non-string input=${i}`);let r=n.length;if(r*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw new Error("Invalid padding: string has too much padding");return n.slice(0,r)}}}const uy=(e,t)=>t?uy(t,e%t):e,ds=(e,t)=>e+(t-uy(e,t));function Fh(e,t,n,r){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(ds(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${ds(t,n)}`);let i=0,o=0;const a=2**n-1,s=[];for(const u of e){if(u>=2**t)throw new Error(`convertRadix2: invalid data word=${u} from=${t}`);if(i=i<32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=n;o-=n)s.push((i>>o-n&a)>>>0);i&=2**o-1}if(i=i<=t)throw new Error("Excess padding");if(!r&&i)throw new Error(`Non-zero padding: ${i}`);return r&&o>0&&s.push(i>>>0),s}function yE(e,t=!1){if(e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(ds(8,e)>32||ds(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!fE(n))throw new Error("radix2.encode input should be Uint8Array");return Fh(Array.from(n),8,e,!t)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!="number")throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(Fh(n,e,8,t))}}}const cy=dE(yE(6),hE("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),gE(6),pE(""));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fy=BigInt(0),Gs=BigInt(1),mE=BigInt(2),qs=e=>e instanceof Uint8Array,_E=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function In(e){if(!qs(e))throw new Error("Uint8Array expected");let t="";for(let n=0;nr+i.length,0));let n=0;return e.forEach(r=>{if(!qs(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}function vE(e,t){if(e.length!==t.length)return!1;for(let n=0;nfy;e>>=Gs,t+=1);return t}function SE(e,t){return e>>BigInt(t)&Gs}const xE=(e,t,n)=>e|(n?Gs:fy)<(mE<new Uint8Array(e),jh=e=>Uint8Array.from(e);function hy(e,t,n){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=$l(e),i=$l(e),o=0;const a=()=>{r.fill(1),i.fill(0),o=0},s=(...f)=>n(i,r,...f),u=(f=$l())=>{i=s(jh([0]),f),r=s(),f.length!==0&&(i=s(jh([1]),f),r=s())},l=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const p=[];for(;f{a(),u(f);let y;for(;!(y=p(l()));)u();return a(),y}}const kE={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Fo(e,t,n={}){const r=(i,o,a)=>{const s=kE[o];if(typeof s!="function")throw new Error(`Invalid validator "${o}", expected function`);const u=e[i];if(!(a&&u===void 0)&&!s(u,e))throw new Error(`Invalid param ${String(i)}=${u} (${typeof u}), expected ${o}`)};for(const[i,o]of Object.entries(t))r(i,o,!1);for(const[i,o]of Object.entries(n))r(i,o,!0);return e}const CE=Object.freeze(Object.defineProperty({__proto__:null,bitGet:SE,bitLen:EE,bitMask:Xs,bitSet:xE,bytesToHex:In,bytesToNumberBE:De,bytesToNumberLE:Sf,concatBytes:oi,createHmacDrbg:hy,ensureBytes:ot,equalBytes:vE,hexToBytes:Rn,hexToNumber:Ys,numberToBytesBE:ii,numberToBytesLE:xf,numberToHexUnpadded:dy,numberToVarBytesBE:kf,utf8ToBytes:wE,validateObject:Fo},Symbol.toStringTag,{value:"Module"}));function hs(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function Cf(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function bE(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");hs(e.outputLen),hs(e.blockLen)}function ai(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function py(e,t){Cf(e);const n=t.outputLen;if(e.length>Vh&ya)}:{h:Number(e>>Vh&ya)|0,l:Number(e&ya)|0}}function TE(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;ie<>>32-n,IE=(e,t,n)=>t<>>32-n,RE=(e,t,n)=>t<>>64-n,OE=(e,t,n)=>e<>>64-n,zl=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const gy=e=>e instanceof Uint8Array,LE=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Ml=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Tt=(e,t)=>e<<32-t|e>>>t,BE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!BE)throw new Error("Non little-endian hardware is not supported");function yy(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Qs(e){if(typeof e=="string"&&(e=yy(e)),!gy(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function PE(...e){const t=new Uint8Array(e.reduce((r,i)=>r+i.length,0));let n=0;return e.forEach(r=>{if(!gy(r))throw new Error("Uint8Array expected");t.set(r,n),n+=r.length}),t}class bf{clone(){return this._cloneInto()}}function my(e){const t=r=>e().update(Qs(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function DE(e=32){if(zl&&typeof zl.getRandomValues=="function")return zl.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}const[_y,vy,wy]=[[],[],[]],UE=BigInt(0),Pi=BigInt(1),$E=BigInt(2),zE=BigInt(7),ME=BigInt(256),HE=BigInt(113);for(let e=0,t=Pi,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],_y.push(2*(5*r+n)),vy.push((e+1)*(e+2)/2%64);let i=UE;for(let o=0;o<7;o++)t=(t<>zE)*HE)%ME,t&$E&&(i^=Pi<<(Pi<n>32?RE(e,t,n):NE(e,t,n),Kh=(e,t,n)=>n>32?OE(e,t,n):IE(e,t,n);function VE(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let a=0;a<10;a++)n[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const s=(a+8)%10,u=(a+2)%10,l=n[u],c=n[u+1],f=Zh(l,c,1)^n[s],p=Kh(l,c,1)^n[s+1];for(let y=0;y<50;y+=10)e[a+y]^=f,e[a+y+1]^=p}let i=e[2],o=e[3];for(let a=0;a<24;a++){const s=vy[a],u=Zh(i,o,s),l=Kh(i,o,s),c=_y[a];i=e[c],o=e[c+1],e[c]=u,e[c+1]=l}for(let a=0;a<50;a+=10){for(let s=0;s<10;s++)n[s]=e[a+s];for(let s=0;s<10;s++)e[a+s]^=~n[(s+2)%10]&n[(s+4)%10]}e[0]^=FE[r],e[1]^=jE[r]}n.fill(0)}class Af extends bf{constructor(t,n,r,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,hs(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=LE(this.state)}keccak(){VE(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){ai(this);const{blockLen:n,state:r}=this;t=Qs(t);const i=t.length;for(let o=0;o=r&&this.keccak();const a=Math.min(r-this.posOut,o-i);t.set(n.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return hs(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(py(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:i,rounds:o,enableXOF:a}=this;return t||(t=new Af(n,r,i,a,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=r,t.outputLen=i,t.enableXOF=a,t.destroyed=this.destroyed,t}}const ZE=(e,t,n)=>my(()=>new Af(t,e,n)),KE=ZE(1,136,256/8);function WE(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const i=BigInt(32),o=BigInt(4294967295),a=Number(n>>i&o),s=Number(n&o),u=r?4:0,l=r?0:4;e.setUint32(t+u,a,r),e.setUint32(t+l,s,r)}class GE extends bf{constructor(t,n,r,i){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ml(this.buffer)}update(t){ai(this);const{view:n,buffer:r,blockLen:i}=this;t=Qs(t);const o=t.length;for(let a=0;ai-a&&(this.process(r,0),a=0);for(let f=a;fc.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;fe&t^~e&n,YE=(e,t,n)=>e&t^e&n^t&n,XE=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),rn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),on=new Uint32Array(64);class QE extends GE{constructor(){super(64,32,8,!1),this.A=rn[0]|0,this.B=rn[1]|0,this.C=rn[2]|0,this.D=rn[3]|0,this.E=rn[4]|0,this.F=rn[5]|0,this.G=rn[6]|0,this.H=rn[7]|0}get(){const{A:t,B:n,C:r,D:i,E:o,F:a,G:s,H:u}=this;return[t,n,r,i,o,a,s,u]}set(t,n,r,i,o,a,s,u){this.A=t|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=a|0,this.G=s|0,this.H=u|0}process(t,n){for(let f=0;f<16;f++,n+=4)on[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const p=on[f-15],y=on[f-2],m=Tt(p,7)^Tt(p,18)^p>>>3,_=Tt(y,17)^Tt(y,19)^y>>>10;on[f]=_+on[f-7]+m+on[f-16]|0}let{A:r,B:i,C:o,D:a,E:s,F:u,G:l,H:c}=this;for(let f=0;f<64;f++){const p=Tt(s,6)^Tt(s,11)^Tt(s,25),y=c+p+qE(s,u,l)+XE[f]+on[f]|0,_=(Tt(r,2)^Tt(r,13)^Tt(r,22))+YE(r,i,o)|0;c=l,l=u,u=s,s=a+y|0,a=o,o=i,i=r,r=y+_|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,a=a+this.D|0,s=s+this.E|0,u=u+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(r,i,o,a,s,u,l,c)}roundClean(){on.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Tf=my(()=>new QE);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Se=BigInt(0),ue=BigInt(1),Kn=BigInt(2),JE=BigInt(3),rc=BigInt(4),Wh=BigInt(5),Gh=BigInt(8);BigInt(9);BigInt(16);function Oe(e,t){const n=e%t;return n>=Se?n:t+n}function e2(e,t,n){if(n<=Se||t 0");if(n===ue)return Se;let r=ue;for(;t>Se;)t&ue&&(r=r*e%n),e=e*e%n,t>>=ue;return r}function ps(e,t){if(e===Se||t<=Se)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=Oe(e,t),r=t,i=Se,o=ue;for(;n!==Se;){const s=r/n,u=r%n,l=i-o*s;r=n,n=u,i=o,o=l}if(r!==ue)throw new Error("invert: does not exist");return Oe(i,t)}function t2(e){const t=(e-ue)/Kn;let n,r,i;for(n=e-ue,r=0;n%Kn===Se;n/=Kn,r++);for(i=Kn;i(r[i]="function",r),t);return Fo(e,n)}function Ey(e,t,n){if(n 0");if(n===Se)return e.ONE;if(n===ue)return t;let r=e.ONE,i=t;for(;n>Se;)n&ue&&(r=e.mul(r,i)),i=e.sqr(i),n>>=ue;return r}function i2(e,t){const n=new Array(t.length),r=t.reduce((o,a,s)=>e.is0(a)?o:(n[s]=o,e.mul(o,a)),e.ONE),i=e.inv(r);return t.reduceRight((o,a,s)=>e.is0(a)?o:(n[s]=e.mul(o,n[s]),e.mul(o,a)),i),n}function Sy(e,t){const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function xy(e,t,n=!1,r={}){if(e<=Se)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:i,nByteLength:o}=Sy(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const a=n2(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:Xs(i),ZERO:Se,ONE:ue,create:u=>Oe(u,e),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return Se<=u&&uu===Se,isOdd:u=>(u&ue)===ue,neg:u=>Oe(-u,e),eql:(u,l)=>u===l,sqr:u=>Oe(u*u,e),add:(u,l)=>Oe(u+l,e),sub:(u,l)=>Oe(u-l,e),mul:(u,l)=>Oe(u*l,e),pow:(u,l)=>Ey(s,u,l),div:(u,l)=>Oe(u*ps(l,e),e),sqrN:u=>u*u,addN:(u,l)=>u+l,subN:(u,l)=>u-l,mulN:(u,l)=>u*l,inv:u=>ps(u,e),sqrt:r.sqrt||(u=>a(s,u)),invertBatch:u=>i2(s,u),cmov:(u,l,c)=>c?l:u,toBytes:u=>n?xf(u,o):ii(u,o),fromBytes:u=>{if(u.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${u.length}`);return n?Sf(u):De(u)}});return Object.freeze(s)}function ky(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Cy(e){const t=ky(e);return t+Math.ceil(t/2)}function o2(e,t,n=!1){const r=e.length,i=ky(t),o=Cy(t);if(r<16||r1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const a=n?De(e):Sf(e),s=Oe(a,t-ue)+ue;return n?xf(s,i):ii(s,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function by(e){const{Fp:t,mds:n,reversePartialPowIdx:r,roundConstants:i}=e,{roundsFull:o,roundsPartial:a,sboxPower:s,t:u}=e;Js(t);for(const m of["t","roundsFull","roundsPartial"])if(typeof e[m]!="number"||!Number.isSafeInteger(e[m]))throw new Error(`Poseidon: invalid param ${m}=${e[m]} (${typeof e[m]})`);if(!Array.isArray(n)||n.length!==u)throw new Error("Poseidon: wrong MDS matrix");const l=n.map(m=>{if(!Array.isArray(m)||m.length!==u)throw new Error(`Poseidon MDS matrix row: ${m}`);return m.map(_=>{if(typeof _!="bigint")throw new Error(`Poseidon MDS matrix value=${_}`);return t.create(_)})});if(r!==void 0&&typeof r!="boolean")throw new Error(`Poseidon: invalid param reversePartialPowIdx=${r}`);if(o%2!==0)throw new Error(`Poseidon roundsFull is not even: ${o}`);const c=o+a;if(!Array.isArray(i)||i.length!==c)throw new Error("Poseidon: wrong round constants");const f=i.map(m=>{if(!Array.isArray(m)||m.length!==u)throw new Error(`Poseidon wrong round constants: ${m}`);return m.map(_=>{if(typeof _!="bigint"||!t.isValid(_))throw new Error(`Poseidon wrong round constant=${_}`);return t.create(_)})});if(!s||![3,5,7].includes(s))throw new Error(`Poseidon wrong sboxPower=${s}`);const p=BigInt(s);let y=m=>Ey(t,m,p);return s===3?y=m=>t.mul(t.sqrN(m),m):s===5&&(y=m=>t.mul(t.sqrN(t.sqrN(m)),m)),Object.freeze({...e,rounds:c,sboxFn:y,roundConstants:f,mds:l})}function a2(e,t){if(typeof t!="number")throw new Error("poseidonSplitConstants: wrong t");if(!Array.isArray(e)||e.length%t)throw new Error("poseidonSplitConstants: wrong rc");const n=[];let r=[];for(let i=0;i(y=y.map((w,d)=>n.add(w,i[_][d])),m?y=y.map(w=>s(w)):y[c]=s(y[c]),y=r.map(w=>w.reduce((d,h,g)=>n.add(d,n.mulN(h,y[g])),n.ZERO)),y),p=function(m){if(!Array.isArray(m)||m.length!==u)throw new Error(`Poseidon: wrong values (expected array of bigints with length ${u})`);m=m.map(w=>{if(typeof w!="bigint")throw new Error(`Poseidon: wrong value=${w} (${typeof w})`);return n.create(w)});let _=0;for(let w=0;w{const a=o.negate();return i?a:o},r=i=>{const o=Math.ceil(t/i)+1,a=2**(i-1);return{windows:o,windowSize:a}};return{constTimeNegate:n,unsafeLadder(i,o){let a=e.ZERO,s=i;for(;o>l2;)o&Hl&&(a=a.add(s)),s=s.double(),o>>=Hl;return a},precomputeWindow(i,o){const{windows:a,windowSize:s}=r(o),u=[];let l=i,c=l;for(let f=0;f>=y,w>u&&(w-=p,a+=Hl);const d=_,h=_+Math.abs(w)-1,g=m%2!==0,v=w<0;w===0?c=c.add(n(g,o[d])):l=l.add(n(v,o[h]))}return{p:l,f:c}},wNAFCached(i,o,a,s){const u=i._WINDOW_SIZE||1;let l=o.get(i);return l||(l=this.precomputeWindow(i,u),u!==1&&o.set(i,s(l))),this.wNAF(u,l,a)}}}function Ty(e){return Js(e.Fp),Fo(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Sy(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function c2(e){const t=Ty(e);Fo(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:f2,hexToBytes:d2}=CE,qt={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=qt;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t("Invalid signature integer: wrong length");if(r[0]&128)throw new t("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:f2(r),l:e.subarray(n+2)}},toSig(e){const{Err:t}=qt,n=typeof e=="string"?d2(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==r-2)throw new t("Invalid signature: incorrect length");const{d:i,l:o}=qt._parseInt(n.subarray(2)),{d:a,l:s}=qt._parseInt(o);if(s.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(e){const t=l=>Number.parseInt(l[0],16)&8?"00"+l:l,n=l=>{const c=l.toString(16);return c.length&1?`0${c}`:c},r=t(n(e.s)),i=t(n(e.r)),o=r.length/2,a=i.length/2,s=n(o),u=n(a);return`30${n(a+o+4)}02${u}${i}02${s}${r}`}},vt=BigInt(0),ie=BigInt(1),an=BigInt(2),gs=BigInt(3),qh=BigInt(4);function Ny(e){const t=c2(e),{Fp:n}=t,r=t.toBytes||((m,_,w)=>{const d=_.toAffine();return oi(Uint8Array.from([4]),n.toBytes(d.x),n.toBytes(d.y))}),i=t.fromBytes||(m=>{const _=m.subarray(1),w=n.fromBytes(_.subarray(0,n.BYTES)),d=n.fromBytes(_.subarray(n.BYTES,2*n.BYTES));return{x:w,y:d}});function o(m){const{a:_,b:w}=t,d=n.sqr(m),h=n.mul(d,m);return n.add(n.add(h,n.mul(m,_)),w)}if(!n.eql(n.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function a(m){return typeof m=="bigint"&&vtn.eql(g,n.ZERO);return h(w)&&h(d)?f.ZERO:new f(w,d,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(_){const w=n.invertBatch(_.map(d=>d.pz));return _.map((d,h)=>d.toAffine(w[h])).map(f.fromAffine)}static fromHex(_){const w=f.fromAffine(i(ot("pointHex",_)));return w.assertValidity(),w}static fromPrivateKey(_){return f.BASE.multiply(u(_))}_setWindowSize(_){this._WINDOW_SIZE=_,l.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:_,y:w}=this.toAffine();if(!n.isValid(_)||!n.isValid(w))throw new Error("bad point: x or y not FE");const d=n.sqr(w),h=o(_);if(!n.eql(d,h))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:_}=this.toAffine();if(n.isOdd)return!n.isOdd(_);throw new Error("Field doesn't support isOdd")}equals(_){c(_);const{px:w,py:d,pz:h}=this,{px:g,py:v,pz:S}=_,x=n.eql(n.mul(w,S),n.mul(g,h)),E=n.eql(n.mul(d,S),n.mul(v,h));return x&&E}negate(){return new f(this.px,n.neg(this.py),this.pz)}double(){const{a:_,b:w}=t,d=n.mul(w,gs),{px:h,py:g,pz:v}=this;let S=n.ZERO,x=n.ZERO,E=n.ZERO,k=n.mul(h,h),R=n.mul(g,g),C=n.mul(v,v),N=n.mul(h,g);return N=n.add(N,N),E=n.mul(h,v),E=n.add(E,E),S=n.mul(_,E),x=n.mul(d,C),x=n.add(S,x),S=n.sub(R,x),x=n.add(R,x),x=n.mul(S,x),S=n.mul(N,S),E=n.mul(d,E),C=n.mul(_,C),N=n.sub(k,C),N=n.mul(_,N),N=n.add(N,E),E=n.add(k,k),k=n.add(E,k),k=n.add(k,C),k=n.mul(k,N),x=n.add(x,k),C=n.mul(g,v),C=n.add(C,C),k=n.mul(C,N),S=n.sub(S,k),E=n.mul(C,R),E=n.add(E,E),E=n.add(E,E),new f(S,x,E)}add(_){c(_);const{px:w,py:d,pz:h}=this,{px:g,py:v,pz:S}=_;let x=n.ZERO,E=n.ZERO,k=n.ZERO;const R=t.a,C=n.mul(t.b,gs);let N=n.mul(w,g),K=n.mul(d,v),F=n.mul(h,S),P=n.add(w,d),b=n.add(g,v);P=n.mul(P,b),b=n.add(N,K),P=n.sub(P,b),b=n.add(w,h);let I=n.add(g,S);return b=n.mul(b,I),I=n.add(N,F),b=n.sub(b,I),I=n.add(d,h),x=n.add(v,S),I=n.mul(I,x),x=n.add(K,F),I=n.sub(I,x),k=n.mul(R,b),x=n.mul(C,F),k=n.add(x,k),x=n.sub(K,k),k=n.add(K,k),E=n.mul(x,k),K=n.add(N,N),K=n.add(K,N),F=n.mul(R,F),b=n.mul(C,b),K=n.add(K,F),F=n.sub(N,F),F=n.mul(R,F),b=n.add(b,F),N=n.mul(K,b),E=n.add(E,N),N=n.mul(I,b),x=n.mul(P,x),x=n.sub(x,N),N=n.mul(P,K),k=n.mul(I,k),k=n.add(k,N),new f(x,E,k)}subtract(_){return this.add(_.negate())}is0(){return this.equals(f.ZERO)}wNAF(_){return y.wNAFCached(this,l,_,w=>{const d=n.invertBatch(w.map(h=>h.pz));return w.map((h,g)=>h.toAffine(d[g])).map(f.fromAffine)})}multiplyUnsafe(_){const w=f.ZERO;if(_===vt)return w;if(s(_),_===ie)return this;const{endo:d}=t;if(!d)return y.unsafeLadder(this,_);let{k1neg:h,k1:g,k2neg:v,k2:S}=d.splitScalar(_),x=w,E=w,k=this;for(;g>vt||S>vt;)g&ie&&(x=x.add(k)),S&ie&&(E=E.add(k)),k=k.double(),g>>=ie,S>>=ie;return h&&(x=x.negate()),v&&(E=E.negate()),E=new f(n.mul(E.px,d.beta),E.py,E.pz),x.add(E)}multiply(_){s(_);let w=_,d,h;const{endo:g}=t;if(g){const{k1neg:v,k1:S,k2neg:x,k2:E}=g.splitScalar(w);let{p:k,f:R}=this.wNAF(S),{p:C,f:N}=this.wNAF(E);k=y.constTimeNegate(v,k),C=y.constTimeNegate(x,C),C=new f(n.mul(C.px,g.beta),C.py,C.pz),d=k.add(C),h=R.add(N)}else{const{p:v,f:S}=this.wNAF(w);d=v,h=S}return f.normalizeZ([d,h])[0]}multiplyAndAddUnsafe(_,w,d){const h=f.BASE,g=(S,x)=>x===vt||x===ie||!S.equals(h)?S.multiplyUnsafe(x):S.multiply(x),v=g(this,w).add(g(_,d));return v.is0()?void 0:v}toAffine(_){const{px:w,py:d,pz:h}=this,g=this.is0();_==null&&(_=g?n.ONE:n.inv(h));const v=n.mul(w,_),S=n.mul(d,_),x=n.mul(h,_);if(g)return{x:n.ZERO,y:n.ZERO};if(!n.eql(x,n.ONE))throw new Error("invZ was invalid");return{x:v,y:S}}isTorsionFree(){const{h:_,isTorsionFree:w}=t;if(_===ie)return!0;if(w)return w(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:_,clearCofactor:w}=t;return _===ie?this:w?w(f,this):this.multiplyUnsafe(t.h)}toRawBytes(_=!0){return this.assertValidity(),r(f,this,_)}toHex(_=!0){return In(this.toRawBytes(_))}}f.BASE=new f(t.Gx,t.Gy,n.ONE),f.ZERO=new f(n.ZERO,n.ONE,n.ZERO);const p=t.nBitLength,y=u2(f,t.endo?Math.ceil(p/2):p);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:u,weierstrassEquation:o,isWithinCurveOrder:a}}function h2(e){const t=Ty(e);return Fo(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Iy(e){const t=h2(e),{Fp:n,n:r}=t,i=n.BYTES+1,o=2*n.BYTES+1;function a(b){return vtIn(ii(b,t.nByteLength));function m(b){const I=r>>ie;return b>I}function _(b){return m(b)?s(-b):b}const w=(b,I,U)=>De(b.slice(I,U));class d{constructor(I,U,A){this.r=I,this.s=U,this.recovery=A,this.assertValidity()}static fromCompact(I){const U=t.nByteLength;return I=ot("compactSignature",I,U*2),new d(w(I,0,U),w(I,U,2*U))}static fromDER(I){const{r:U,s:A}=qt.toSig(ot("DER",I));return new d(U,A)}assertValidity(){if(!p(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!p(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(I){return new d(this.r,this.s,I)}recoverPublicKey(I){const{r:U,s:A,recovery:O}=this,D=E(ot("msgHash",I));if(O==null||![0,1,2,3].includes(O))throw new Error("recovery id invalid");const z=O===2||O===3?U+t.n:U;if(z>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const V=O&1?"03":"02",Ge=l.fromHex(V+y(z)),Ce=u(z),bt=s(-D*Ce),qe=s(A*Ce),Ye=l.BASE.multiplyAndAddUnsafe(Ge,bt,qe);if(!Ye)throw new Error("point at infinify");return Ye.assertValidity(),Ye}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new d(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Rn(this.toDERHex())}toDERHex(){return qt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Rn(this.toCompactHex())}toCompactHex(){return y(this.r)+y(this.s)}}const h={isValidPrivateKey(b){try{return c(b),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const b=Cy(t.n);return o2(t.randomBytes(b),t.n)},precompute(b=8,I=l.BASE){return I._setWindowSize(b),I.multiply(BigInt(3)),I}};function g(b,I=!0){return l.fromPrivateKey(b).toRawBytes(I)}function v(b){const I=b instanceof Uint8Array,U=typeof b=="string",A=(I||U)&&b.length;return I?A===i||A===o:U?A===2*i||A===2*o:b instanceof l}function S(b,I,U=!0){if(v(b))throw new Error("first arg must be private key");if(!v(I))throw new Error("second arg must be public key");return l.fromHex(I).multiply(c(b)).toRawBytes(U)}const x=t.bits2int||function(b){const I=De(b),U=b.length*8-t.nBitLength;return U>0?I>>BigInt(U):I},E=t.bits2int_modN||function(b){return s(x(b))},k=Xs(t.nBitLength);function R(b){if(typeof b!="bigint")throw new Error("bigint expected");if(!(vt<=b&&bFn in U))throw new Error("sign() legacy options not supported");const{hash:A,randomBytes:O}=t;let{lowS:D,prehash:z,extraEntropy:V}=U;D==null&&(D=!0),b=ot("msgHash",b),z&&(b=ot("prehashed msgHash",A(b)));const Ge=E(b),Ce=c(I),bt=[R(Ce),R(Ge)];if(V!=null){const Fn=V===!0?O(n.BYTES):V;bt.push(ot("extraEntropy",Fn))}const qe=oi(...bt),Ye=Ge;function fl(Fn){const wr=x(Fn);if(!p(wr))return;const Cd=u(wr),Er=l.BASE.multiply(wr).toAffine(),pt=s(Er.x);if(pt===vt)return;const Sr=s(Cd*s(Ye+pt*Ce));if(Sr===vt)return;let bd=(Er.x===pt?0:2)|Number(Er.y&ie),Ad=Sr;return D&&m(Sr)&&(Ad=_(Sr),bd^=1),new d(pt,Ad,bd)}return{seed:qe,k2sig:fl}}const N={lowS:t.lowS,prehash:!1},K={lowS:t.lowS,prehash:!1};function F(b,I,U=N){const{seed:A,k2sig:O}=C(b,I,U),D=t;return hy(D.hash.outputLen,D.nByteLength,D.hmac)(A,O)}l.BASE._setWindowSize(8);function P(b,I,U,A=K){var Er;const O=b;if(I=ot("msgHash",I),U=ot("publicKey",U),"strict"in A)throw new Error("options.strict was renamed to lowS");const{lowS:D,prehash:z}=A;let V,Ge;try{if(typeof O=="string"||O instanceof Uint8Array)try{V=d.fromDER(O)}catch(pt){if(!(pt instanceof qt.Err))throw pt;V=d.fromCompact(O)}else if(typeof O=="object"&&typeof O.r=="bigint"&&typeof O.s=="bigint"){const{r:pt,s:Sr}=O;V=new d(pt,Sr)}else throw new Error("PARSE");Ge=l.fromHex(U)}catch(pt){if(pt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(D&&V.hasHighS())return!1;z&&(I=t.hash(I));const{r:Ce,s:bt}=V,qe=E(I),Ye=u(bt),fl=s(qe*Ye),Fn=s(Ce*Ye),wr=(Er=l.BASE.multiplyAndAddUnsafe(Ge,fl,Fn))==null?void 0:Er.toAffine();return wr?s(wr.x)===Ce:!1}return{CURVE:t,getPublicKey:g,getSharedSecret:S,sign:F,verify:P,ProjectivePoint:l,Signature:d,utils:h}}function Ry(e,t){const n=e.ORDER;let r=vt;for(let m=n-ie;m%an===vt;m/=an)r+=ie;const i=r,o=an<{let w=f,d=e.pow(_,l),h=e.sqr(d);h=e.mul(h,_);let g=e.mul(m,h);g=e.pow(g,u),g=e.mul(g,d),d=e.mul(g,_),h=e.mul(g,m);let v=e.mul(h,d);g=e.pow(v,c);let S=e.eql(g,e.ONE);d=e.mul(h,p),g=e.mul(v,w),h=e.cmov(d,h,S),v=e.cmov(g,v,S);for(let x=i;x>ie;x--){let E=x-an;E=an<{let h=e.sqr(d);const g=e.mul(w,d);h=e.mul(h,g);let v=e.pow(h,m);v=e.mul(v,g);const S=e.mul(v,_),x=e.mul(e.sqr(v),d),E=e.eql(x,w);let k=e.cmov(S,v,E);return{isValid:E,value:k}}}return y}function p2(e,t){if(Js(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const n=Ry(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return r=>{let i,o,a,s,u,l,c,f;i=e.sqr(r),i=e.mul(i,t.Z),o=e.sqr(i),o=e.add(o,i),a=e.add(o,e.ONE),a=e.mul(a,t.B),s=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),s=e.mul(s,t.A),o=e.sqr(a),l=e.sqr(s),u=e.mul(l,t.A),o=e.add(o,u),o=e.mul(o,a),l=e.mul(l,s),u=e.mul(l,t.B),o=e.add(o,u),c=e.mul(i,a);const{isValid:p,value:y}=n(o,l);f=e.mul(i,r),f=e.mul(f,y),c=e.cmov(c,a,p),f=e.cmov(f,y,p);const m=e.isOdd(r)===e.isOdd(f);return f=e.cmov(e.neg(f),f,m),c=e.div(c,s),{x:c,y:f}}}const g2=Object.freeze(Object.defineProperty({__proto__:null,DER:qt,SWUFpSqrtRatio:Ry,mapToCurveSimpleSWU:p2,weierstrass:Iy,weierstrassPoints:Ny},Symbol.toStringTag,{value:"Module"}));class Oy extends bf{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,bE(t);const r=Qs(n);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?t.create().update(r).digest():r);for(let a=0;anew Oy(e,t).update(n).digest();Ly.create=(e,t)=>new Oy(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function y2(e){return{hash:e,hmac:(t,...n)=>Ly(e,t,PE(...n)),randomBytes:DE}}const xo=BigInt("3618502788666131213697322783095070105526743751716087489154079457884512865583"),Xn=BigInt("0x800000000000000000000000000000000000000000000000000000000000000"),By=252;function Yh(e){for(;e[0]===0;)e=e.subarray(1);const t=e.length*8-By,n=De(e);return t>0?n>>BigInt(t):n}function Py(e){return typeof e=="string"&&(e=If(e),e.length&1&&(e="0"+e)),Rn(e)}const mr=Iy({a:BigInt(1),b:BigInt("3141592653589793238462643383279502884197169399375105820974944592307816406665"),Fp:xy(BigInt("0x800000000000011000000000000000000000000000000000000000000000001")),n:xo,nBitLength:By,Gx:BigInt("874739451078007766457464989774322083649278607533249481151382481072868806602"),Gy:BigInt("152666792071518830868575557812948353041420400780739481342941381225525861407"),h:BigInt(1),lowS:!1,...y2(Tf),bits2int:Yh,bits2int_modN:e=>{const t=De(e).toString(16);return t.length===63&&(e=Py(t+"0")),Oe(Yh(e),xo)}}),m2=mr;function si(e){return ot("",typeof e=="string"?Py(e):e)}function Nf(e){return In(si(e)).padStart(64,"0")}function Dy(e,t=!1){return mr.getPublicKey(Nf(e),t)}function _2(e,t){return mr.getSharedSecret(Nf(e),t)}function Uy(e){const{r:t,s:n}=e;if(t<0n||t>=Xn)throw new Error(`Signature.r should be [1, ${Xn})`);const r=ps(n,xo);if(r<0n||r>=Xn)throw new Error(`inv(Signature.s) should be [1, ${Xn})`)}function $y(e){const t=si(e);if(De(t)>=Xn)throw new Error(`msgHash should be [0, ${Xn})`);return t}function v2(e,t,n){const r=mr.sign($y(e),Nf(t),n);return Uy(r),r}function w2(e,t,n){if(!(e instanceof $a)){const r=si(e);try{e=$a.fromDER(r)}catch(i){if(!(i instanceof qt.Err))throw i;e=$a.fromCompact(r)}}return Uy(e),mr.verify(e,$y(t),si(n))}const{CURVE:E2,ProjectivePoint:Ar,Signature:$a,utils:zy}=mr;function My(e){return`0x${In(e.subarray(1)).replace(/^0+/gm,"")}`}function If(e){return e.replace(/^0x/i,"")}function Hy(e){const t=si(e),n=2n**256n,r=n-Oe(n,xo);for(let i=0;;i++){const o=ic(oi(t,kf(BigInt(i))));if(oNumber(e&x2);function k2(e,t,n,r){const i=ma(ic(e)),o=ma(ic(t)),a=Ys(If(n));return`m/2645'/${i}'/${o}'/${ma(a)}'/${ma(a>>31n)}'/${r}`}const ko=[new Ar(2089986280348253421170679821480865132823066470938446095505822317253594081284n,1713931329540660377023406109199410414810705867260802078187082345529207694986n,1n),new Ar(996781205833008774514500082376783249102396023663454813447423147977397232763n,1668503676786377725805489344771023921079126552019160156920634619255970485781n,1n),new Ar(2251563274489750535117886426533222435294046428347329203627021249169616184184n,1798716007562728905295480679789526322175868328062420237419143593021674992973n,1n),new Ar(2138414695194151160943305727036575959195309218611738193261179310511854807447n,113410276730064486255102093846540133784865286929052426931474106396135072156n,1n),new Ar(2379962749567351885752724891227938183011949129833673362440656643086021394946n,776496453633298175483985398648758586525933812536653089401905292063708816422n,1n)];function jy(e,t){const n=[];let r=e;for(let i=0;i<248;i++)n.push(r),r=r.double();r=t;for(let i=0;i<4;i++)n.push(r),r=r.double();return n}const C2=jy(ko[1],ko[2]),b2=jy(ko[3],ko[4]);function A2(e){let t;if(typeof e=="bigint")t=e;else if(typeof e=="number"){if(!Number.isSafeInteger(e))throw new Error(`Invalid pedersenArg: ${e}`);t=BigInt(e)}else t=De(si(e));if(!(0n<=t&&t>=1n}return e}function el(e,t){let n=ko[0];return n=Xh(n,e,C2),n=Xh(n,t,b2),My(n.toRawBytes(!0))}const T2=(e,t=el)=>[0,...e,e.length].reduce((n,r)=>t(n,r)),N2=Xs(250),yi=e=>De(KE(e))&N2,ic=e=>De(Tf(e)),Vy=xy(BigInt("3618502788666131213697322783095070105623107215331596699973092056135872020481"));function oc(e,t,n){const r=e.fromBytes(Tf(yy(`${t}${n}`)));return e.create(r)}function Zy(e,t,n,r=0){const i=[],o=[];for(let a=0;ao.map(s=>e.inv(e.sub(a,s))))}const I2=[[3,1,1],[1,-1,1],[1,1,-2]].map(e=>e.map(BigInt));function Rf(e,t){if(Js(e.Fp),!Number.isSafeInteger(e.rate)||!Number.isSafeInteger(e.capacity))throw new Error(`Wrong poseidon opts: ${e}`);const n=e.rate+e.capacity,r=e.roundsFull+e.roundsPartial,i=[];for(let a=0;a=a&&i.startsWith(o.substring(0,a)))return!0}return!1}var Fi=function(e){return e.underflow="underflow",e.overflow="overflow",e.truncate_integer="truncate_integer",e.truncate_float="truncate_float",e}({});function $2(e){if(!U2(e,{approx:!1})){if(Vo(e))return Fi.truncate_integer;var t=parseFloat(e);return isFinite(t)?t===0?Fi.underflow:Fi.truncate_float:Fi.overflow}}function Qh(e){return e.replace(z2,"").replace(H2,"").replace(F2,"").replace(M2,"")}var z2=/[eE][+-]?\d+$/,M2=/^-?(0*)?/,H2=/\./,F2=/0+$/;function li(e){"@babel/helpers - typeof";return li=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},li(e)}function j2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V2(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:Y2,r=0,i=s();return m(i),w(),t?Q2(i,t):i;function o(){if(e.charCodeAt(r)===cS){r++,l();for(var P={},b=!0;rP)return n(e.slice(P,r))}function p(){if(e.charCodeAt(r)!==_S)throw new SyntaxError("Comma ',' expected after value ".concat(F()));r++}function y(){if(e.charCodeAt(r)!==wS)throw new SyntaxError("Colon ':' expected after property name ".concat(F()));r++}function m(P){if(P===void 0)throw new SyntaxError("JSON value expected ".concat(F()))}function _(P){if(P===void 0)throw new SyntaxError("Array item expected ".concat(F()))}function w(){if(r=Lf&&e<=Bf||e>=ES&&e<=CS||e>=SS&&e<=bS}function va(e){return e>=Lf&&e<=Bf}function aS(e){return e>=mS&&e<=Bf}function sS(e){return e>=32&&e<=1114111}function uc(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(function(r,i){return uc(r,t[i])});if(Jh(e)&&Jh(t)){var n=Fl(new Set([].concat(Fl(Object.keys(e)),Fl(Object.keys(t)))));return n.every(function(r){return uc(e[r],t[r])})}return!1}function Jh(e){return sc(e)==="object"&&e!==null}var lS={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` +`,r:"\r",t:" "},uS=92,cS=123,ep=125,fS=91,tp=93,dS=32,hS=10,pS=9,gS=13,jl=34,yS=43,np=45,Lf=48,mS=49,Bf=57,_S=44,vS=46,wS=58,ES=65,SS=97,xS=69,kS=101,CS=70,bS=102;function ys(e){"@babel/helpers - typeof";return ys=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ys(e)}function Yy(e,t,n,r){var i=AS(n),o=typeof t=="function"?t.call({"":e},"",e):e;return a(o,"");function a(c,f){if(Array.isArray(r)){var p=r.find(function(m){return m.test(c)});if(p){var y=p.stringify(c);if(typeof y!="string"||!Wy(y))throw new Error("Invalid JSON number: output of a number stringifier must be a string containing a JSON number "+"(output: ".concat(y,")"));return y}}if(typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c===null||c instanceof Date||c instanceof Boolean||c instanceof Number||c instanceof String)return JSON.stringify(c);if(c&&c.isLosslessNumber||typeof c=="bigint")return c.toString();if(Array.isArray(c))return s(c,f);if(c&&ys(c)==="object")return u(c,f)}function s(c,f){if(c.length===0)return"[]";for(var p=i?f+i:void 0,y=i?`[ +`:"[",m=0;m=0;)e[t]=0}const IS=0,Xy=1,RS=2,OS=3,LS=258,Pf=29,Zo=256,Co=Zo+1+Pf,qr=30,Df=19,Qy=2*Co+1,Qn=15,Vl=16,BS=7,Uf=256,Jy=16,em=17,tm=18,cc=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),za=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),PS=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),nm=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DS=512,Vt=new Array((Co+2)*2);mi(Vt);const eo=new Array(qr*2);mi(eo);const bo=new Array(DS);mi(bo);const Ao=new Array(LS-OS+1);mi(Ao);const $f=new Array(Pf);mi($f);const ms=new Array(qr);mi(ms);function Zl(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let rm,im,om;function Kl(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const am=e=>e<256?bo[e]:bo[256+(e>>>7)],To=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},je=(e,t,n)=>{e.bi_valid>Vl-n?(e.bi_buf|=t<>Vl-e.bi_valid,e.bi_valid+=n-Vl):(e.bi_buf|=t<{je(e,n[t*2],n[t*2+1])},sm=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},US=e=>{e.bi_valid===16?(To(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},$S=(e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,u=t.stat_desc.max_length;let l,c,f,p,y,m,_=0;for(p=0;p<=Qn;p++)e.bl_count[p]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;lu&&(p=u,_++),n[c*2+1]=p,!(c>r)&&(e.bl_count[p]++,y=0,c>=s&&(y=a[c-s]),m=n[c*2],e.opt_len+=m*(p+y),o&&(e.static_len+=m*(i[c*2+1]+y)));if(_!==0){do{for(p=u-1;e.bl_count[p]===0;)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[u]--,_-=2}while(_>0);for(p=u;p!==0;p--)for(c=e.bl_count[p];c!==0;)f=e.heap[--l],!(f>r)&&(n[f*2+1]!==p&&(e.opt_len+=(p-n[f*2+1])*n[f*2],n[f*2+1]=p),c--)}},lm=(e,t,n)=>{const r=new Array(Qn+1);let i=0,o,a;for(o=1;o<=Qn;o++)i=i+n[o-1]<<1,r[o]=i;for(a=0;a<=t;a++){let s=e[a*2+1];s!==0&&(e[a*2]=sm(r[s]++,s))}},zS=()=>{let e,t,n,r,i;const o=new Array(Qn+1);for(n=0,r=0;r>=7;r{let t;for(t=0;t{e.bi_valid>8?To(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},op=(e,t,n,r)=>{const i=t*2,o=n*2;return e[i]{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i{let r,i,o=0,a,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+o++]&255,r+=(e.pending_buf[e.sym_buf+o++]&255)<<8,i=e.pending_buf[e.sym_buf+o++],r===0?Lt(e,i,t):(a=Ao[i],Lt(e,a+Zo+1,t),s=cc[a],s!==0&&(i-=$f[a],je(e,i,s)),r--,a=am(r),Lt(e,a,n),s=za[a],s!==0&&(r-=ms[a],je(e,r,s)));while(o{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,u=-1,l;for(e.heap_len=0,e.heap_max=Qy,a=0;a>1;a>=1;a--)Wl(e,n,a);l=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Wl(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[l*2]=n[a*2]+n[s*2],e.depth[l]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[a*2+1]=n[s*2+1]=l,e.heap[1]=l++,Wl(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],$S(e,t),lm(n,u,e.bl_count)},sp=(e,t,n)=>{let r,i=-1,o,a=t[0*2+1],s=0,u=7,l=4;for(a===0&&(u=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)o=a,a=t[(r+1)*2+1],!(++s{let r,i=-1,o,a=t[0*2+1],s=0,u=7,l=4;for(a===0&&(u=138,l=3),r=0;r<=n;r++)if(o=a,a=t[(r+1)*2+1],!(++s{let t;for(sp(e,e.dyn_ltree,e.l_desc.max_code),sp(e,e.dyn_dtree,e.d_desc.max_code),fc(e,e.bl_desc),t=Df-1;t>=3&&e.bl_tree[nm[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},HS=(e,t,n,r)=>{let i;for(je(e,t-257,5),je(e,n-1,5),je(e,r-4,4),i=0;i{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return rp;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return ip;for(n=32;n{up||(zS(),up=!0),e.l_desc=new Kl(e.dyn_ltree,rm),e.d_desc=new Kl(e.dyn_dtree,im),e.bl_desc=new Kl(e.bl_tree,om),e.bi_buf=0,e.bi_valid=0,um(e)},fm=(e,t,n,r)=>{je(e,(IS<<1)+(r?1:0),3),cm(e),To(e,n),To(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},VS=e=>{je(e,Xy<<1,3),Lt(e,Uf,Vt),US(e)},ZS=(e,t,n,r)=>{let i,o,a=0;e.level>0?(e.strm.data_type===NS&&(e.strm.data_type=FS(e)),fc(e,e.l_desc),fc(e,e.d_desc),a=MS(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=n+5,n+4<=i&&t!==-1?fm(e,t,n,r):e.strategy===TS||o===i?(je(e,(Xy<<1)+(r?1:0),3),ap(e,Vt,eo)):(je(e,(RS<<1)+(r?1:0),3),HS(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),ap(e,e.dyn_ltree,e.dyn_dtree)),um(e),r&&cm(e)},KS=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Ao[n]+Zo+1)*2]++,e.dyn_dtree[am(t)*2]++),e.sym_next===e.sym_end);var WS=jS,GS=fm,qS=ZS,YS=KS,XS=VS,QS={_tr_init:WS,_tr_stored_block:GS,_tr_flush_block:qS,_tr_tally:YS,_tr_align:XS};const JS=(e,t,n,r)=>{let i=e&65535|0,o=e>>>16&65535|0,a=0;for(;n!==0;){a=n>2e3?2e3:n,n-=a;do i=i+t[r++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0};var No=JS;const ex=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},tx=new Uint32Array(ex()),nx=(e,t,n,r)=>{const i=tx,o=r+n;e^=-1;for(let a=r;a>>8^i[(e^t[a])&255];return e^-1};var ge=nx,ur={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},_i={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:rx,_tr_stored_block:dc,_tr_flush_block:ix,_tr_tally:kn,_tr_align:ox}=QS,{Z_NO_FLUSH:Cn,Z_PARTIAL_FLUSH:ax,Z_FULL_FLUSH:sx,Z_FINISH:lt,Z_BLOCK:cp,Z_OK:we,Z_STREAM_END:fp,Z_STREAM_ERROR:Ut,Z_DATA_ERROR:lx,Z_BUF_ERROR:Gl,Z_DEFAULT_COMPRESSION:ux,Z_FILTERED:cx,Z_HUFFMAN_ONLY:wa,Z_RLE:fx,Z_FIXED:dx,Z_DEFAULT_STRATEGY:hx,Z_UNKNOWN:px,Z_DEFLATED:tl}=_i,gx=9,yx=15,mx=8,_x=29,vx=256,hc=vx+1+_x,wx=30,Ex=19,Sx=2*hc+1,xx=15,M=3,gn=258,$t=gn+M+1,kx=32,ui=42,zf=57,pc=69,gc=73,yc=91,mc=103,Jn=113,ji=666,Be=1,vi=2,cr=3,wi=4,Cx=3,er=(e,t)=>(e.msg=ur[t],t),dp=e=>e*2-(e>4?9:0),dn=e=>{let t=e.length;for(;--t>=0;)e[t]=0},bx=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)};let Ax=(e,t,n)=>(t<{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},et=(e,t)=>{ix(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Xe(e.strm)},Z=(e,t)=>{e.pending_buf[e.pending++]=t},Di=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},_c=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=No(e.adler,t,i,n):e.state.wrap===2&&(e.adler=ge(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},dm=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,o,a=e.prev_length,s=e.nice_match;const u=e.strstart>e.w_size-$t?e.strstart-(e.w_size-$t):0,l=e.window,c=e.w_mask,f=e.prev,p=e.strstart+gn;let y=l[r+a-1],m=l[r+a];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(l[i+a]!==m||l[i+a-1]!==y||l[i]!==l[r]||l[++i]!==l[r+1])){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&ra){if(e.match_start=t,a=o,o>=s)break;y=l[r+a-1],m=l[r+a]}}while((t=f[t&c])>u&&--n!==0);return a<=e.lookahead?a:e.lookahead},ci=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-$t)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),bx(e),r+=t),e.strm.avail_in===0)break;if(n=_c(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=M)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=bn(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=bn(e,e.ins_h,e.window[i+M-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,o,a=0,s=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_outi+e.strm.avail_in&&(r=i+e.strm.avail_in),r>o&&(r=o),r>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Xe(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(_c(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(a===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_watero&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(_c(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,n=o>e.w_size?e.w_size:o,i=e.strstart-e.block_start,(i>=n||(i||t===lt)&&t!==Cn&&e.strm.avail_in===0&&i<=o)&&(r=i>o?o:i,a=t===lt&&e.strm.avail_in===0&&r===i?1:0,dc(e,e.block_start,r,a),e.block_start+=r,Xe(e.strm)),a?cr:Be)},ql=(e,t)=>{let n,r;for(;;){if(e.lookahead<$t){if(ci(e),e.lookahead<$t&&t===Cn)return Be;if(e.lookahead===0)break}if(n=0,e.lookahead>=M&&(e.ins_h=bn(e,e.ins_h,e.window[e.strstart+M-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-$t&&(e.match_length=dm(e,n)),e.match_length>=M)if(r=kn(e,e.strstart-e.match_start,e.match_length-M),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=M){e.match_length--;do e.strstart++,e.ins_h=bn(e,e.ins_h,e.window[e.strstart+M-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=bn(e,e.ins_h,e.window[e.strstart+1]);else r=kn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(et(e,!1),e.strm.avail_out===0))return Be}return e.insert=e.strstart{let n,r,i;for(;;){if(e.lookahead<$t){if(ci(e),e.lookahead<$t&&t===Cn)return Be;if(e.lookahead===0)break}if(n=0,e.lookahead>=M&&(e.ins_h=bn(e,e.ins_h,e.window[e.strstart+M-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=M-1,n!==0&&e.prev_length4096)&&(e.match_length=M-1)),e.prev_length>=M&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-M,r=kn(e,e.strstart-1-e.prev_match,e.prev_length-M),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=bn(e,e.ins_h,e.window[e.strstart+M-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=M-1,e.strstart++,r&&(et(e,!1),e.strm.avail_out===0))return Be}else if(e.match_available){if(r=kn(e,0,e.window[e.strstart-1]),r&&et(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Be}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=kn(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let n,r,i,o;const a=e.window;for(;;){if(e.lookahead<=gn){if(ci(e),e.lookahead<=gn&&t===Cn)return Be;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=M&&e.strstart>0&&(i=e.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=e.strstart+gn;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=M?(n=kn(e,1,e.match_length-M),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=kn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(et(e,!1),e.strm.avail_out===0))return Be}return e.insert=0,t===lt?(et(e,!0),e.strm.avail_out===0?cr:wi):e.sym_next&&(et(e,!1),e.strm.avail_out===0)?Be:vi},Nx=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(ci(e),e.lookahead===0)){if(t===Cn)return Be;break}if(e.match_length=0,n=kn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(et(e,!1),e.strm.avail_out===0))return Be}return e.insert=0,t===lt?(et(e,!0),e.strm.avail_out===0?cr:wi):e.sym_next&&(et(e,!1),e.strm.avail_out===0)?Be:vi};function Nt(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const Vi=[new Nt(0,0,0,0,hm),new Nt(4,4,8,4,ql),new Nt(4,5,16,8,ql),new Nt(4,6,32,32,ql),new Nt(4,4,16,16,Cr),new Nt(8,16,32,32,Cr),new Nt(8,16,128,128,Cr),new Nt(8,32,128,256,Cr),new Nt(32,128,258,1024,Cr),new Nt(32,258,258,4096,Cr)],Ix=e=>{e.window_size=2*e.w_size,dn(e.head),e.max_lazy_match=Vi[e.level].max_lazy,e.good_match=Vi[e.level].good_length,e.nice_match=Vi[e.level].nice_length,e.max_chain_length=Vi[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=M-1,e.match_available=0,e.ins_h=0};function Rx(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=tl,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Sx*2),this.dyn_dtree=new Uint16Array((2*wx+1)*2),this.bl_tree=new Uint16Array((2*Ex+1)*2),dn(this.dyn_ltree),dn(this.dyn_dtree),dn(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(xx+1),this.heap=new Uint16Array(2*hc+1),dn(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*hc+1),dn(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Ko=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==ui&&t.status!==zf&&t.status!==pc&&t.status!==gc&&t.status!==yc&&t.status!==mc&&t.status!==Jn&&t.status!==ji?1:0},pm=e=>{if(Ko(e))return er(e,Ut);e.total_in=e.total_out=0,e.data_type=px;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?zf:t.wrap?ui:Jn,e.adler=t.wrap===2?0:1,t.last_flush=-2,rx(t),we},gm=e=>{const t=pm(e);return t===we&&Ix(e.state),t},Ox=(e,t)=>Ko(e)||e.state.wrap!==2?Ut:(e.state.gzhead=t,we),ym=(e,t,n,r,i,o)=>{if(!e)return Ut;let a=1;if(t===ux&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>gx||n!==tl||r<8||r>15||t<0||t>9||o<0||o>dx||r===8&&a!==1)return er(e,Ut);r===8&&(r=9);const s=new Rx;return e.state=s,s.strm=e,s.status=ui,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<ym(e,t,tl,yx,mx,hx),Bx=(e,t)=>{if(Ko(e)||t>cp||t<0)return e?er(e,Ut):Ut;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===ji&&t!==lt)return er(e,e.avail_out===0?Gl:Ut);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Xe(e),e.avail_out===0)return n.last_flush=-1,we}else if(e.avail_in===0&&dp(t)<=dp(r)&&t!==lt)return er(e,Gl);if(n.status===ji&&e.avail_in!==0)return er(e,Gl);if(n.status===ui&&n.wrap===0&&(n.status=Jn),n.status===ui){let i=tl+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=wa||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,i|=o<<6,n.strstart!==0&&(i|=kx),i+=31-i%31,Di(n,i),n.strstart!==0&&(Di(n,e.adler>>>16),Di(n,e.adler&65535)),e.adler=1,n.status=Jn,Xe(e),n.pending!==0)return n.last_flush=-1,we}if(n.status===zf){if(e.adler=0,Z(n,31),Z(n,139),Z(n,8),n.gzhead)Z(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Z(n,n.gzhead.time&255),Z(n,n.gzhead.time>>8&255),Z(n,n.gzhead.time>>16&255),Z(n,n.gzhead.time>>24&255),Z(n,n.level===9?2:n.strategy>=wa||n.level<2?4:0),Z(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Z(n,n.gzhead.extra.length&255),Z(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=ge(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=pc;else if(Z(n,0),Z(n,0),Z(n,0),Z(n,0),Z(n,0),Z(n,n.level===9?2:n.strategy>=wa||n.level<2?4:0),Z(n,Cx),n.status=Jn,Xe(e),n.pending!==0)return n.last_flush=-1,we}if(n.status===pc){if(n.gzhead.extra){let i=n.pending,o=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+o>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=ge(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,Xe(e),n.pending!==0)return n.last_flush=-1,we;i=0,o-=s}let a=new Uint8Array(n.gzhead.extra);n.pending_buf.set(a.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=ge(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=gc}if(n.status===gc){if(n.gzhead.name){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=ge(e.adler,n.pending_buf,n.pending-i,i)),Xe(e),n.pending!==0)return n.last_flush=-1,we;i=0}n.gzindexi&&(e.adler=ge(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=yc}if(n.status===yc){if(n.gzhead.comment){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=ge(e.adler,n.pending_buf,n.pending-i,i)),Xe(e),n.pending!==0)return n.last_flush=-1,we;i=0}n.gzindexi&&(e.adler=ge(e.adler,n.pending_buf,n.pending-i,i))}n.status=mc}if(n.status===mc){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Xe(e),n.pending!==0))return n.last_flush=-1,we;Z(n,e.adler&255),Z(n,e.adler>>8&255),e.adler=0}if(n.status=Jn,Xe(e),n.pending!==0)return n.last_flush=-1,we}if(e.avail_in!==0||n.lookahead!==0||t!==Cn&&n.status!==ji){let i=n.level===0?hm(n,t):n.strategy===wa?Nx(n,t):n.strategy===fx?Tx(n,t):Vi[n.level].func(n,t);if((i===cr||i===wi)&&(n.status=ji),i===Be||i===cr)return e.avail_out===0&&(n.last_flush=-1),we;if(i===vi&&(t===ax?ox(n):t!==cp&&(dc(n,0,0,!1),t===sx&&(dn(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Xe(e),e.avail_out===0))return n.last_flush=-1,we}return t!==lt?we:n.wrap<=0?fp:(n.wrap===2?(Z(n,e.adler&255),Z(n,e.adler>>8&255),Z(n,e.adler>>16&255),Z(n,e.adler>>24&255),Z(n,e.total_in&255),Z(n,e.total_in>>8&255),Z(n,e.total_in>>16&255),Z(n,e.total_in>>24&255)):(Di(n,e.adler>>>16),Di(n,e.adler&65535)),Xe(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?we:fp)},Px=e=>{if(Ko(e))return Ut;const t=e.state.status;return e.state=null,t===Jn?er(e,lx):we},Dx=(e,t)=>{let n=t.length;if(Ko(e))return Ut;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==ui||r.lookahead)return Ut;if(i===1&&(e.adler=No(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(dn(r.head),r.strstart=0,r.block_start=0,r.insert=0);let u=new Uint8Array(r.w_size);u.set(t.subarray(n-r.w_size,n),0),t=u,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,ci(r);r.lookahead>=M;){let u=r.strstart,l=r.lookahead-(M-1);do r.ins_h=bn(r,r.ins_h,r.window[u+M-1]),r.prev[u&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=u,u++;while(--l);r.strstart=u,r.lookahead=M-1,ci(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=M-1,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,we};var Ux=Lx,$x=ym,zx=gm,Mx=pm,Hx=Ox,Fx=Bx,jx=Px,Vx=Dx,Zx="pako deflate (from Nodeca project)",to={deflateInit:Ux,deflateInit2:$x,deflateReset:zx,deflateResetKeep:Mx,deflateSetHeader:Hx,deflate:Fx,deflateEnd:jx,deflateSetDictionary:Vx,deflateInfo:Zx};const Kx=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Wx=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)Kx(n,r)&&(e[r]=n[r])}}return e},Gx=e=>{let t=0;for(let r=0,i=e.length;r=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Io[254]=Io[254]=1;var qx=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t};const Yx=(e,t)=>{if(t<65534&&e.subarray&&mm)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i;const o=new Array(n*2);for(i=0,r=0;r4){o[i++]=65533,r+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&r1){o[i++]=65533;continue}a<65536?o[i++]=a:(a-=65536,o[i++]=55296|a>>10&1023,o[i++]=56320|a&1023)}return Yx(o,i)},Qx=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Io[e[n]]>t?n:t},Ro={string2buf:qx,buf2string:Xx,utf8border:Qx};function Jx(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var _m=Jx;const vm=Object.prototype.toString,{Z_NO_FLUSH:ek,Z_SYNC_FLUSH:tk,Z_FULL_FLUSH:nk,Z_FINISH:rk,Z_OK:_s,Z_STREAM_END:ik,Z_DEFAULT_COMPRESSION:ok,Z_DEFAULT_STRATEGY:ak,Z_DEFLATED:sk}=_i;function Wo(e){this.options=nl.assign({level:ok,method:sk,chunkSize:16384,windowBits:15,memLevel:8,strategy:ak},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _m,this.strm.avail_out=0;let n=to.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==_s)throw new Error(ur[n]);if(t.header&&to.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=Ro.string2buf(t.dictionary):vm.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=to.deflateSetDictionary(this.strm,r),n!==_s)throw new Error(ur[n]);this._dict_set=!0}}Wo.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?rk:ek,typeof e=="string"?n.input=Ro.string2buf(e):vm.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===tk||o===nk)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=to.deflate(n,o),i===ik)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=to.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===_s;if(n.avail_out===0){this.onData(n.output);continue}if(o>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};Wo.prototype.onData=function(e){this.chunks.push(e)};Wo.prototype.onEnd=function(e){e===_s&&(this.result=nl.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Mf(e,t){const n=new Wo(t);if(n.push(e,!0),n.err)throw n.msg||ur[n.err];return n.result}function lk(e,t){return t=t||{},t.raw=!0,Mf(e,t)}function uk(e,t){return t=t||{},t.gzip=!0,Mf(e,t)}var ck=Wo,fk=Mf,dk=lk,hk=uk,pk=_i,gk={Deflate:ck,deflate:fk,deflateRaw:dk,gzip:hk,constants:pk};const Ea=16209,yk=16191;var mk=function(t,n){let r,i,o,a,s,u,l,c,f,p,y,m,_,w,d,h,g,v,S,x,E,k,R,C;const N=t.state;r=t.next_in,R=t.input,i=r+(t.avail_in-5),o=t.next_out,C=t.output,a=o-(n-t.avail_out),s=o+(t.avail_out-257),u=N.dmax,l=N.wsize,c=N.whave,f=N.wnext,p=N.window,y=N.hold,m=N.bits,_=N.lencode,w=N.distcode,d=(1<>>24,y>>>=v,m-=v,v=g>>>16&255,v===0)C[o++]=g&65535;else if(v&16){S=g&65535,v&=15,v&&(m>>=v,m-=v),m<15&&(y+=R[r++]<>>24,y>>>=v,m-=v,v=g>>>16&255,v&16){if(x=g&65535,v&=15,mu){t.msg="invalid distance too far back",N.mode=Ea;break e}if(y>>>=v,m-=v,v=o-a,x>v){if(v=x-v,v>c&&N.sane){t.msg="invalid distance too far back",N.mode=Ea;break e}if(E=0,k=p,f===0){if(E+=l-v,v2;)C[o++]=k[E++],C[o++]=k[E++],C[o++]=k[E++],S-=3;S&&(C[o++]=k[E++],S>1&&(C[o++]=k[E++]))}else{E=o-x;do C[o++]=C[E++],C[o++]=C[E++],C[o++]=C[E++],S-=3;while(S>2);S&&(C[o++]=C[E++],S>1&&(C[o++]=C[E++]))}}else if(v&64){t.msg="invalid distance code",N.mode=Ea;break e}else{g=w[(g&65535)+(y&(1<>3,r-=S,m-=S<<3,y&=(1<{const u=s.bits;let l=0,c=0,f=0,p=0,y=0,m=0,_=0,w=0,d=0,h=0,g,v,S,x,E,k=null,R;const C=new Uint16Array(br+1),N=new Uint16Array(br+1);let K=null,F,P,b;for(l=0;l<=br;l++)C[l]=0;for(c=0;c=1&&C[p]===0;p--);if(y>p&&(y=p),p===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,s.bits=1,0;for(f=1;f0&&(e===gp||p!==1))return-1;for(N[1]=0,l=1;lhp||e===yp&&d>pp)return 1;for(;;){F=l-_,a[c]+1=R?(P=K[a[c]-R],b=k[a[c]-R]):(P=96,b=0),g=1<>_)+v]=F<<24|P<<16|b|0;while(v!==0);for(g=1<>=1;if(g!==0?(h&=g-1,h+=g):h=0,c++,--C[l]===0){if(l===p)break;l=t[n+a[c]]}if(l>y&&(h&x)!==S){for(_===0&&(_=y),E+=f,m=l-_,w=1<hp||e===yp&&d>pp)return 1;S=h&x,i[S]=y<<24|m<<16|E-o|0}}return h!==0&&(i[E+h]=l-_<<24|64<<16|0),s.bits=y,0};var no=Sk;const xk=0,wm=1,Em=2,{Z_FINISH:mp,Z_BLOCK:kk,Z_TREES:Sa,Z_OK:fr,Z_STREAM_END:Ck,Z_NEED_DICT:bk,Z_STREAM_ERROR:ht,Z_DATA_ERROR:Sm,Z_MEM_ERROR:xm,Z_BUF_ERROR:Ak,Z_DEFLATED:_p}=_i,rl=16180,vp=16181,wp=16182,Ep=16183,Sp=16184,xp=16185,kp=16186,Cp=16187,bp=16188,Ap=16189,vs=16190,Ht=16191,Xl=16192,Tp=16193,Ql=16194,Np=16195,Ip=16196,Rp=16197,Op=16198,xa=16199,ka=16200,Lp=16201,Bp=16202,Pp=16203,Dp=16204,Up=16205,Jl=16206,$p=16207,zp=16208,Q=16209,km=16210,Cm=16211,Tk=852,Nk=592,Ik=15,Rk=Ik,Mp=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Ok(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const _r=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.modeCm?1:0},bm=e=>{if(_r(e))return ht;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=rl,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(Tk),t.distcode=t.distdyn=new Int32Array(Nk),t.sane=1,t.back=-1,fr},Am=e=>{if(_r(e))return ht;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,bm(e)},Tm=(e,t)=>{let n;if(_r(e))return ht;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?ht:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,Am(e))},Nm=(e,t)=>{if(!e)return ht;const n=new Ok;e.state=n,n.strm=e,n.window=null,n.mode=rl;const r=Tm(e,t);return r!==fr&&(e.state=null),r},Lk=e=>Nm(e,Rk);let Hp=!0,eu,tu;const Bk=e=>{if(Hp){eu=new Int32Array(512),tu=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(no(wm,e.lens,0,288,eu,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;no(Em,e.lens,0,32,tu,0,e.work,{bits:5}),Hp=!1}e.lencode=eu,e.lenbits=9,e.distcode=tu,e.distbits=5},Im=(e,t,n,r)=>{let i;const o=e.state;return o.window===null&&(o.wsize=1<=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),r-=i,r?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave{let n,r,i,o,a,s,u,l,c,f,p,y,m,_,w=0,d,h,g,v,S,x,E,k;const R=new Uint8Array(4);let C,N;const K=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(_r(e)||!e.output||!e.input&&e.avail_in!==0)return ht;n=e.state,n.mode===Ht&&(n.mode=Xl),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,l=n.hold,c=n.bits,f=s,p=u,k=fr;e:for(;;)switch(n.mode){case rl:if(n.wrap===0){n.mode=Xl;break}for(;c<16;){if(s===0)break e;s--,l+=r[o++]<>>8&255,n.check=ge(n.check,R,2,0),l=0,c=0,n.mode=vp;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",n.mode=Q;break}if((l&15)!==_p){e.msg="unknown compression method",n.mode=Q;break}if(l>>>=4,c-=4,E=(l&15)+8,n.wbits===0&&(n.wbits=E),E>15||E>n.wbits){e.msg="invalid window size",n.mode=Q;break}n.dmax=1<>8&1),n.flags&512&&n.wrap&4&&(R[0]=l&255,R[1]=l>>>8&255,n.check=ge(n.check,R,2,0)),l=0,c=0,n.mode=wp;case wp:for(;c<32;){if(s===0)break e;s--,l+=r[o++]<>>8&255,R[2]=l>>>16&255,R[3]=l>>>24&255,n.check=ge(n.check,R,4,0)),l=0,c=0,n.mode=Ep;case Ep:for(;c<16;){if(s===0)break e;s--,l+=r[o++]<>8),n.flags&512&&n.wrap&4&&(R[0]=l&255,R[1]=l>>>8&255,n.check=ge(n.check,R,2,0)),l=0,c=0,n.mode=Sp;case Sp:if(n.flags&1024){for(;c<16;){if(s===0)break e;s--,l+=r[o++]<>>8&255,n.check=ge(n.check,R,2,0)),l=0,c=0}else n.head&&(n.head.extra=null);n.mode=xp;case xp:if(n.flags&1024&&(y=n.length,y>s&&(y=s),y&&(n.head&&(E=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+y),E)),n.flags&512&&n.wrap&4&&(n.check=ge(n.check,r,y,o)),s-=y,o+=y,n.length-=y),n.length))break e;n.length=0,n.mode=kp;case kp:if(n.flags&2048){if(s===0)break e;y=0;do E=r[o+y++],n.head&&E&&n.length<65536&&(n.head.name+=String.fromCharCode(E));while(E&&y>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Ht;break;case Ap:for(;c<32;){if(s===0)break e;s--,l+=r[o++]<>>=c&7,c-=c&7,n.mode=Jl;break}for(;c<3;){if(s===0)break e;s--,l+=r[o++]<>>=1,c-=1,l&3){case 0:n.mode=Tp;break;case 1:if(Bk(n),n.mode=xa,t===Sa){l>>>=2,c-=2;break e}break;case 2:n.mode=Ip;break;case 3:e.msg="invalid block type",n.mode=Q}l>>>=2,c-=2;break;case Tp:for(l>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,l+=r[o++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=Q;break}if(n.length=l&65535,l=0,c=0,n.mode=Ql,t===Sa)break e;case Ql:n.mode=Np;case Np:if(y=n.length,y){if(y>s&&(y=s),y>u&&(y=u),y===0)break e;i.set(r.subarray(o,o+y),a),s-=y,o+=y,u-=y,a+=y,n.length-=y;break}n.mode=Ht;break;case Ip:for(;c<14;){if(s===0)break e;s--,l+=r[o++]<>>=5,c-=5,n.ndist=(l&31)+1,l>>>=5,c-=5,n.ncode=(l&15)+4,l>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Q;break}n.have=0,n.mode=Rp;case Rp:for(;n.have>>=3,c-=3}for(;n.have<19;)n.lens[K[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,C={bits:n.lenbits},k=no(xk,n.lens,0,19,n.lencode,0,n.work,C),n.lenbits=C.bits,k){e.msg="invalid code lengths set",n.mode=Q;break}n.have=0,n.mode=Op;case Op:for(;n.have>>24,h=w>>>16&255,g=w&65535,!(d<=c);){if(s===0)break e;s--,l+=r[o++]<>>=d,c-=d,n.lens[n.have++]=g;else{if(g===16){for(N=d+2;c>>=d,c-=d,n.have===0){e.msg="invalid bit length repeat",n.mode=Q;break}E=n.lens[n.have-1],y=3+(l&3),l>>>=2,c-=2}else if(g===17){for(N=d+3;c>>=d,c-=d,E=0,y=3+(l&7),l>>>=3,c-=3}else{for(N=d+7;c>>=d,c-=d,E=0,y=11+(l&127),l>>>=7,c-=7}if(n.have+y>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Q;break}for(;y--;)n.lens[n.have++]=E}}if(n.mode===Q)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Q;break}if(n.lenbits=9,C={bits:n.lenbits},k=no(wm,n.lens,0,n.nlen,n.lencode,0,n.work,C),n.lenbits=C.bits,k){e.msg="invalid literal/lengths set",n.mode=Q;break}if(n.distbits=6,n.distcode=n.distdyn,C={bits:n.distbits},k=no(Em,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,C),n.distbits=C.bits,k){e.msg="invalid distances set",n.mode=Q;break}if(n.mode=xa,t===Sa)break e;case xa:n.mode=ka;case ka:if(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=l,n.bits=c,mk(e,p),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,l=n.hold,c=n.bits,n.mode===Ht&&(n.back=-1);break}for(n.back=0;w=n.lencode[l&(1<>>24,h=w>>>16&255,g=w&65535,!(d<=c);){if(s===0)break e;s--,l+=r[o++]<>v)],d=w>>>24,h=w>>>16&255,g=w&65535,!(v+d<=c);){if(s===0)break e;s--,l+=r[o++]<>>=v,c-=v,n.back+=v}if(l>>>=d,c-=d,n.back+=d,n.length=g,h===0){n.mode=Up;break}if(h&32){n.back=-1,n.mode=Ht;break}if(h&64){e.msg="invalid literal/length code",n.mode=Q;break}n.extra=h&15,n.mode=Lp;case Lp:if(n.extra){for(N=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Bp;case Bp:for(;w=n.distcode[l&(1<>>24,h=w>>>16&255,g=w&65535,!(d<=c);){if(s===0)break e;s--,l+=r[o++]<>v)],d=w>>>24,h=w>>>16&255,g=w&65535,!(v+d<=c);){if(s===0)break e;s--,l+=r[o++]<>>=v,c-=v,n.back+=v}if(l>>>=d,c-=d,n.back+=d,h&64){e.msg="invalid distance code",n.mode=Q;break}n.offset=g,n.extra=h&15,n.mode=Pp;case Pp:if(n.extra){for(N=n.extra;c>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Q;break}n.mode=Dp;case Dp:if(u===0)break e;if(y=p-u,n.offset>y){if(y=n.offset-y,y>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Q;break}y>n.wnext?(y-=n.wnext,m=n.wsize-y):m=n.wnext-y,y>n.length&&(y=n.length),_=n.window}else _=i,m=a-n.offset,y=n.length;y>u&&(y=u),u-=y,n.length-=y;do i[a++]=_[m++];while(--y);n.length===0&&(n.mode=ka);break;case Up:if(u===0)break e;i[a++]=n.length,u--,n.mode=ka;break;case Jl:if(n.wrap){for(;c<32;){if(s===0)break e;s--,l|=r[o++]<{if(_r(e))return ht;let t=e.state;return t.window&&(t.window=null),e.state=null,fr},Uk=(e,t)=>{if(_r(e))return ht;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,fr):ht},$k=(e,t)=>{const n=t.length;let r,i,o;return _r(e)||(r=e.state,r.wrap!==0&&r.mode!==vs)?ht:r.mode===vs&&(i=1,i=No(i,t,n,0),i!==r.check)?Sm:(o=Im(e,t,n,n),o?(r.mode=km,xm):(r.havedict=1,fr))};var zk=Am,Mk=Tm,Hk=bm,Fk=Lk,jk=Nm,Vk=Pk,Zk=Dk,Kk=Uk,Wk=$k,Gk="pako inflate (from Nodeca project)",Zt={inflateReset:zk,inflateReset2:Mk,inflateResetKeep:Hk,inflateInit:Fk,inflateInit2:jk,inflate:Vk,inflateEnd:Zk,inflateGetHeader:Kk,inflateSetDictionary:Wk,inflateInfo:Gk};function qk(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Yk=qk;const Rm=Object.prototype.toString,{Z_NO_FLUSH:Xk,Z_FINISH:Qk,Z_OK:Oo,Z_STREAM_END:nu,Z_NEED_DICT:ru,Z_STREAM_ERROR:Jk,Z_DATA_ERROR:Fp,Z_MEM_ERROR:eC}=_i;function Go(e){this.options=nl.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _m,this.strm.avail_out=0;let n=Zt.inflateInit2(this.strm,t.windowBits);if(n!==Oo)throw new Error(ur[n]);if(this.header=new Yk,Zt.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Ro.string2buf(t.dictionary):Rm.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Zt.inflateSetDictionary(this.strm,t.dictionary),n!==Oo)))throw new Error(ur[n])}Go.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Qk:Xk,Rm.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=Zt.inflate(n,a),o===ru&&i&&(o=Zt.inflateSetDictionary(n,i),o===Oo?o=Zt.inflate(n,a):o===Fp&&(o=ru));n.avail_in>0&&o===nu&&n.state.wrap>0&&e[n.next_in]!==0;)Zt.inflateReset(n),o=Zt.inflate(n,a);switch(o){case Jk:case Fp:case ru:case eC:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||o===nu))if(this.options.to==="string"){let u=Ro.utf8border(n.output,n.next_out),l=n.next_out-u,c=Ro.buf2string(n.output,u);n.next_out=l,n.avail_out=r-l,l&&n.output.set(n.output.subarray(u,u+l),0),this.onData(c)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===Oo&&s===0)){if(o===nu)return o=Zt.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};Go.prototype.onData=function(e){this.chunks.push(e)};Go.prototype.onEnd=function(e){e===Oo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=nl.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Hf(e,t){const n=new Go(t);if(n.push(e),n.err)throw n.msg||ur[n.err];return n.result}function tC(e,t){return t=t||{},t.raw=!0,Hf(e,t)}var nC=Go,rC=Hf,iC=tC,oC=Hf,aC=_i,sC={Inflate:nC,inflate:rC,inflateRaw:iC,ungzip:oC,constants:aC};const{Deflate:iA,deflate:oA,deflateRaw:aA,gzip:lC}=gk,{Inflate:sA,inflate:lA,inflateRaw:uA,ungzip:uC}=sC;var cC=lC,fC=uC,Ee=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Ie={searchParams:"URLSearchParams"in Ee,iterable:"Symbol"in Ee&&"iterator"in Symbol,blob:"FileReader"in Ee&&"Blob"in Ee&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Ee,arrayBuffer:"ArrayBuffer"in Ee};function dC(e){return e&&DataView.prototype.isPrototypeOf(e)}if(Ie.arrayBuffer)var hC=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],pC=ArrayBuffer.isView||function(e){return e&&hC.indexOf(Object.prototype.toString.call(e))>-1};function Ei(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Ff(e){return typeof e!="string"&&(e=String(e)),e}function jf(e){var t={next:function(){var n=e.shift();return{done:n===void 0,value:n}}};return Ie.iterable&&(t[Symbol.iterator]=function(){return t}),t}function he(e){this.map={},e instanceof he?e.forEach(function(t,n){this.append(n,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}he.prototype.append=function(e,t){e=Ei(e),t=Ff(t);var n=this.map[e];this.map[e]=n?n+", "+t:t};he.prototype.delete=function(e){delete this.map[Ei(e)]};he.prototype.get=function(e){return e=Ei(e),this.has(e)?this.map[e]:null};he.prototype.has=function(e){return this.map.hasOwnProperty(Ei(e))};he.prototype.set=function(e,t){this.map[Ei(e)]=Ff(t)};he.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)};he.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),jf(e)};he.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),jf(e)};he.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),jf(e)};Ie.iterable&&(he.prototype[Symbol.iterator]=he.prototype.entries);function iu(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function Om(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function gC(e){var t=new FileReader,n=Om(t);return t.readAsArrayBuffer(e),n}function yC(e){var t=new FileReader,n=Om(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=r?r[1]:"utf-8";return t.readAsText(e,i),n}function mC(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}function dr(e,t){if(!(this instanceof dr))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var n=t.body;if(e instanceof dr){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new he(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&e._bodyInit!=null&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new he(t.headers)),this.method=vC(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in Ee){var o=new AbortController;return o.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}dr.prototype.clone=function(){return new dr(this,{body:this._bodyInit})};function wC(e){var t=new FormData;return e.trim().split("&").forEach(function(n){if(n){var r=n.split("="),i=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}}),t}function EC(e){var t=new he,n=e.replace(/\r?\n[\t ]+/g," ");return n.split("\r").map(function(r){return r.indexOf(` +`)===0?r.substr(1,r.length):r}).forEach(function(r){var i=r.split(":"),o=i.shift().trim();if(o){var a=i.join(":").trim();try{t.append(o,a)}catch(s){console.warn("Response "+s.message)}}}),t}Lm.call(dr.prototype);function zt(e,t){if(!(this instanceof zt))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new he(t.headers),this.url=t.url||"",this._initBody(e)}Lm.call(zt.prototype);zt.prototype.clone=function(){return new zt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new he(this.headers),url:this.url})};zt.error=function(){var e=new zt(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var SC=[301,302,303,307,308];zt.redirect=function(e,t){if(SC.indexOf(t)===-1)throw new RangeError("Invalid status code");return new zt(null,{status:t,headers:{location:e}})};var Wn=Ee.DOMException;try{new Wn}catch{Wn=function(t,n){this.message=t,this.name=n;var r=Error(t);this.stack=r.stack},Wn.prototype=Object.create(Error.prototype),Wn.prototype.constructor=Wn}function Bm(e,t){return new Promise(function(n,r){var i=new dr(e,t);if(i.signal&&i.signal.aborted)return r(new Wn("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}o.onload=function(){var l={statusText:o.statusText,headers:EC(o.getAllResponseHeaders()||"")};i.url.indexOf("file://")===0&&(o.status<200||o.status>599)?l.status=200:l.status=o.status,l.url="responseURL"in o?o.responseURL:l.headers.get("X-Request-URL");var c="response"in o?o.response:o.responseText;setTimeout(function(){n(new zt(c,l))},0)},o.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request timed out"))},0)},o.onabort=function(){setTimeout(function(){r(new Wn("Aborted","AbortError"))},0)};function s(l){try{return l===""&&Ee.location.href?Ee.location.href:l}catch{return l}}if(o.open(i.method,s(i.url),!0),i.credentials==="include"?o.withCredentials=!0:i.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(Ie.blob?o.responseType="blob":Ie.arrayBuffer&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof he||Ee.Headers&&t.headers instanceof Ee.Headers)){var u=[];Object.getOwnPropertyNames(t.headers).forEach(function(l){u.push(Ei(l)),o.setRequestHeader(l,Ff(t.headers[l]))}),i.headers.forEach(function(l,c){u.indexOf(c)===-1&&o.setRequestHeader(c,l)})}else i.headers.forEach(function(l,c){o.setRequestHeader(c,l)});i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){o.readyState===4&&i.signal.removeEventListener("abort",a)}),o.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}Bm.polyfill=!0;Ee.fetch||(Ee.fetch=Bm,Ee.Headers=he,Ee.Request=dr,Ee.Response=zt);var xC=self.fetch.bind(self);const kC=bc(xC);var Pm={exports:{}};(function(e){(function(t,n,r){e.exports?e.exports=r():n[t]=r()})("urljoin",rr,function(){function t(n){var r=[];if(n.length===0)return"";if(typeof n[0]!="string")throw new TypeError("Url must be a string. Received "+n[0]);if(n[0].match(/^[^/:]+:\/*$/)&&n.length>1){var i=n.shift();n[0]=i+n[0]}n[0].match(/^file:\/\/\//)?n[0]=n[0].replace(/^([^/:]+):\/*/,"$1:///"):n[0]=n[0].replace(/^([^/:]+):\/*/,"$1://");for(var o=0;o0&&(a=a.replace(/^[\/]+/,"")),o0?"?":"")+u.join("&"),s}return function(){var n;return typeof arguments[0]=="object"?n=arguments[0]:n=[].slice.call(arguments),t(n)}})})(Pm);var CC=Pm.exports;const Dm=bc(CC);var bC=Object.defineProperty,pe=(e,t)=>{for(var n in t)bC(e,n,{get:t[n],enumerable:!0})},AC={};pe(AC,{API_VERSION:()=>qm,BN_FEE_TRANSACTION_VERSION_1:()=>Km,BN_FEE_TRANSACTION_VERSION_2:()=>Wm,BN_TRANSACTION_VERSION_1:()=>Kf,BN_TRANSACTION_VERSION_2:()=>Wf,BaseUrl:()=>Ym,HEX_STR_TRANSACTION_VERSION_1:()=>Vm,HEX_STR_TRANSACTION_VERSION_2:()=>Zm,IS_BROWSER:()=>Um,MASK_250:()=>Gm,MASK_251:()=>BC,NetworkName:()=>Gf,RPC_GOERLI_NODES:()=>Jm,RPC_MAINNET_NODES:()=>e1,StarknetChainId:()=>Xm,TEXT_TO_FELT_MAX_LEN:()=>Zf,TransactionHashPrefix:()=>Qm,UDC:()=>PC,ZERO:()=>ro});var TC={};pe(TC,{IS_BROWSER:()=>Um,addHexPrefix:()=>Ue,arrayBufferToString:()=>$m,atobUniversal:()=>zm,btoaUniversal:()=>Mm,buf2hex:()=>IC,calcByteLength:()=>Fm,padLeft:()=>Hm,pascalToSnake:()=>LC,removeHexPrefix:()=>xi,sanitizeBytes:()=>jm,sanitizeHex:()=>OC,stringToArrayBuffer:()=>NC,utf8ToArray:()=>Si});var Um=typeof window<"u",Vf="0";function $m(e){return new Uint8Array(e).reduce((t,n)=>t+String.fromCharCode(n),"")}function Si(e){return new TextEncoder().encode(e)}function NC(e){return Si(e)}function zm(e){return cy.decode(e)}function Mm(e){return cy.encode(new Uint8Array(e))}function IC(e){return e.reduce((t,n)=>t+n.toString(16).padStart(2,"0"),"")}function xi(e){return e.replace(/^0x/i,"")}function Ue(e){return`0x${xi(e)}`}function RC(e,t,n,r=Vf){const i=t-e.length;let o=e;return i>0&&(o=r.repeat(i)+e),o}function Hm(e,t,n=Vf){return RC(e,t,!0,n)}function Fm(e,t=8){const{length:n}=e,r=n%t;return r?(n-r)/t*t+t:n}function jm(e,t=8,n=Vf){return Hm(e,Fm(e,t),n)}function OC(e){return e=xi(e),e=jm(e,2),e&&(e=Ue(e)),e}var LC=e=>/[a-z]/.test(e)?e.split(/(?=[A-Z])/).join("_").toUpperCase():e,Zf=31,Vm="0x1",Zm="0x2",Kf=1n,Wf=2n,Km=2n**128n+Kf,Wm=2n**128n+Wf,ro=0n,Gm=2n**250n-1n,BC=2n**251n,qm=ro,Ym=(e=>(e.SN_MAIN="https://alpha-mainnet.starknet.io",e.SN_GOERLI="https://alpha4.starknet.io",e))(Ym||{}),Gf=(e=>(e.SN_MAIN="SN_MAIN",e.SN_GOERLI="SN_GOERLI",e))(Gf||{}),Xm=(e=>(e.SN_MAIN="0x534e5f4d41494e",e.SN_GOERLI="0x534e5f474f45524c49",e))(Xm||{}),Qm=(e=>(e.DECLARE="0x6465636c617265",e.DEPLOY="0x6465706c6f79",e.DEPLOY_ACCOUNT="0x6465706c6f795f6163636f756e74",e.INVOKE="0x696e766f6b65",e.L1_HANDLER="0x6c315f68616e646c6572",e))(Qm||{}),PC={ADDRESS:"0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf",ENTRYPOINT:"deployContract"},Jm=["https://starknet-testnet.public.blastapi.io/rpc/v0.5","https://limited-rpc.nethermind.io/goerli-juno/v0_5"],e1=["https://starknet-mainnet.public.blastapi.io/rpc/v0.5","https://limited-rpc.nethermind.io/mainnet-juno/v0_5"],DC={};pe(DC,{BlockStatus:()=>l1,BlockTag:()=>Xf,EntryPointType:()=>r1,Litteral:()=>Yf,RPC:()=>Me,SIMULATION_FLAG:()=>t1,Sequencer:()=>MC,TransactionExecutionStatus:()=>s1,TransactionFinalityStatus:()=>a1,TransactionStatus:()=>o1,TransactionType:()=>i1,Uint:()=>qf,ValidateType:()=>n1});var t1=(e=>(e.SKIP_VALIDATE="SKIP_VALIDATE",e.SKIP_EXECUTE="SKIP_EXECUTE",e))(t1||{}),n1=(e=>(e.DEPLOY="DEPLOY",e.CALL="CALL",e.INVOKE="INVOKE",e))(n1||{}),qf=(e=>(e.u8="core::integer::u8",e.u16="core::integer::u16",e.u32="core::integer::u32",e.u64="core::integer::u64",e.u128="core::integer::u128",e.u256="core::integer::u256",e))(qf||{}),Yf=(e=>(e.ClassHash="core::starknet::class_hash::ClassHash",e.ContractAddress="core::starknet::contract_address::ContractAddress",e))(Yf||{}),r1=(e=>(e.EXTERNAL="EXTERNAL",e.L1_HANDLER="L1_HANDLER",e.CONSTRUCTOR="CONSTRUCTOR",e))(r1||{}),i1=(e=>(e.DECLARE="DECLARE",e.DEPLOY="DEPLOY",e.DEPLOY_ACCOUNT="DEPLOY_ACCOUNT",e.INVOKE="INVOKE_FUNCTION",e))(i1||{}),o1=(e=>(e.NOT_RECEIVED="NOT_RECEIVED",e.RECEIVED="RECEIVED",e.ACCEPTED_ON_L2="ACCEPTED_ON_L2",e.ACCEPTED_ON_L1="ACCEPTED_ON_L1",e.REJECTED="REJECTED",e.REVERTED="REVERTED",e))(o1||{}),a1=(e=>(e.NOT_RECEIVED="NOT_RECEIVED",e.RECEIVED="RECEIVED",e.ACCEPTED_ON_L2="ACCEPTED_ON_L2",e.ACCEPTED_ON_L1="ACCEPTED_ON_L1",e))(a1||{}),s1=(e=>(e.REJECTED="REJECTED",e.REVERTED="REVERTED",e.SUCCEEDED="SUCCEEDED",e))(s1||{}),l1=(e=>(e.PENDING="PENDING",e.ACCEPTED_ON_L1="ACCEPTED_ON_L1",e.ACCEPTED_ON_L2="ACCEPTED_ON_L2",e.REJECTED="REJECTED",e))(l1||{}),Xf=(e=>(e.pending="pending",e.latest="latest",e))(Xf||{}),Me={};pe(Me,{EBlockTag:()=>p1,EDataAvailabilityMode:()=>g1,ESimulationFlag:()=>c1,ETransactionExecutionStatus:()=>h1,ETransactionFinalityStatus:()=>d1,ETransactionStatus:()=>f1,ETransactionType:()=>u1,Errors:()=>$C,JRPC:()=>UC,SPEC:()=>zC});var UC={},$C={},zC={},u1=(e=>(e.DECLARE="DECLARE",e.DEPLOY="DEPLOY",e.DEPLOY_ACCOUNT="DEPLOY_ACCOUNT",e.INVOKE="INVOKE",e.L1_HANDLER="L1_HANDLER",e))(u1||{}),c1=(e=>(e.SKIP_VALIDATE="SKIP_VALIDATE",e.SKIP_FEE_CHARGE="SKIP_FEE_CHARGE",e))(c1||{}),f1=(e=>(e.RECEIVED="RECEIVED",e.REJECTED="REJECTED",e.ACCEPTED_ON_L2="ACCEPTED_ON_L2",e.ACCEPTED_ON_L1="ACCEPTED_ON_L1",e))(f1||{}),d1=(e=>(e.ACCEPTED_ON_L2="ACCEPTED_ON_L2",e.ACCEPTED_ON_L1="ACCEPTED_ON_L1",e))(d1||{}),h1=(e=>(e.SUCCEEDED="SUCCEEDED",e.REVERTED="REVERTED",e))(h1||{}),p1=(e=>(e.LATEST="latest",e.PENDING="pending",e))(p1||{}),g1=(e=>(e.L1="L1",e.L2="L2",e))(g1||{}),MC={};function oe(e,t){if(!e)throw new Error(t||"Assertion failure")}var HC={};pe(HC,{assertInRange:()=>jC,bigNumberishArrayToDecimalStringArray:()=>_1,bigNumberishArrayToHexadecimalStringArray:()=>v1,cleanHex:()=>FC,getDecimalString:()=>w1,getHexString:()=>Jf,getHexStringArray:()=>ed,hexToBytes:()=>E1,hexToDecimalString:()=>m1,isBigInt:()=>il,isHex:()=>kt,isStringWholeNumber:()=>ki,toBigInt:()=>H,toCairoBool:()=>VC,toHex:()=>L,toHexString:()=>Qf,toStorageKey:()=>y1});function kt(e){return/^0x[0-9a-f]*$/i.test(e)}function H(e){return BigInt(e)}function il(e){return typeof e=="bigint"}function L(e){return Ue(H(e).toString(16))}var Qf=L;function y1(e){return Ue(H(e).toString(16).padStart(64,"0"))}function m1(e){return BigInt(Ue(e)).toString(10)}var FC=e=>e.toLowerCase().replace(/^(0x)0+/,"$1");function jC(e,t,n,r=""){const i=r===""?"invalid length":`invalid ${r} length`,o=BigInt(e),a=BigInt(t),s=BigInt(n);oe(o>=a&&o<=s,`Message not signable, ${i}.`)}function _1(e){return e.map(t=>H(t).toString(10))}function v1(e){return e.map(t=>L(t))}var ki=e=>/^\d+$/.test(e);function w1(e){if(kt(e))return m1(e);if(ki(e))return e;throw new Error(`${e} need to be hex-string or whole-number-string`)}function Jf(e){if(kt(e))return e;if(ki(e))return Qf(e);throw new Error(`${e} need to be hex-string or whole-number-string`)}function ed(e){return e.map(t=>Jf(t))}var VC=e=>(+e).toString();function E1(e){if(!kt(e))throw new Error(`${e} need to be a hex-string`);let t=xi(e);return t.length%2!==0&&(t=`0${t}`),Rn(t)}var ZC={};pe(ZC,{getSelector:()=>ol,getSelectorFromName:()=>Ct,keccakBn:()=>S1,starknetKeccak:()=>td});function S1(e){const t=xi(L(BigInt(e))),n=t.length%2===0?t:`0${t}`;return Ue(yi(E1(Ue(n))).toString(16))}function KC(e){return Ue(yi(Si(e)).toString(16))}function td(e){return BigInt(KC(e))&Gm}function Ct(e){return L(td(e))}function ol(e){return kt(e)?e:ki(e)?Qf(e):Ct(e)}var WC={};pe(WC,{decodeShortString:()=>od,encodeShortString:()=>Mn,isASCII:()=>nd,isDecimalString:()=>x1,isLongText:()=>rd,isShortString:()=>qo,isShortText:()=>GC,isText:()=>Yo,splitLongString:()=>id});function nd(e){return/^[\x00-\x7F]*$/.test(e)}function qo(e){return e.length<=Zf}function x1(e){return/^[0-9]*$/i.test(e)}function Yo(e){return typeof e=="string"&&!kt(e)&&!ki(e)}var GC=e=>Yo(e)&&qo(e),rd=e=>Yo(e)&&!qo(e);function id(e){const t=RegExp(`[^]{1,${Zf}}`,"g");return e.match(t)||[]}function Mn(e){if(!nd(e))throw new Error(`${e} is not an ASCII string`);if(!qo(e))throw new Error(`${e} is too long`);return Ue(e.replace(/./g,t=>t.charCodeAt(0).toString(16)))}function od(e){if(!nd(e))throw new Error(`${e} is not an ASCII string`);if(kt(e))return xi(e).replace(/.{2}/g,t=>String.fromCharCode(parseInt(t,16)));if(x1(e))return od("0X".concat(BigInt(e).toString(16)));throw new Error(`${e} is not Hex or decimal`)}var qC={};pe(qC,{felt:()=>Ve,getAbiContractVersion:()=>cl,getArrayType:()=>fi,isCairo1Abi:()=>A1,isCairo1Type:()=>Pn,isLen:()=>hr,isTypeArray:()=>Ln,isTypeBool:()=>ul,isTypeContractAddress:()=>QC,isTypeEnum:()=>vr,isTypeEthAddress:()=>b1,isTypeFelt:()=>ws,isTypeLitteral:()=>ud,isTypeNamedTuple:()=>C1,isTypeOption:()=>sl,isTypeResult:()=>ll,isTypeStruct:()=>Xo,isTypeTuple:()=>Hn,isTypeUint:()=>ld,isTypeUint256:()=>Bn,tuple:()=>JC,uint256:()=>cd});var YC={};pe(YC,{UINT_128_MAX:()=>ad,UINT_256_MAX:()=>k1,bnToUint256:()=>XC,isUint256:()=>sd,uint256ToBN:()=>al});var ad=(1n<<128n)-1n,k1=(1n<<256n)-1n;function al(e){return(H(e.high)<<128n)+H(e.low)}function sd(e){return H(e)<=k1}function XC(e){const t=H(e);if(!sd(t))throw new Error("Number is too large");return{low:Ue((t&ad).toString(16)),high:Ue((t>>128n).toString(16))}}var hr=e=>/_len$/.test(e),ws=e=>e==="felt"||e==="core::felt252",Ln=e=>/\*/.test(e)||e.startsWith("core::array::Array::")||e.startsWith("core::array::Span::"),Hn=e=>/^\(.*\)$/i.test(e),C1=e=>/\(.*\)/i.test(e)&&e.includes(":"),Xo=(e,t)=>e in t,vr=(e,t)=>e in t,sl=e=>e.startsWith("core::option::Option::"),ll=e=>e.startsWith("core::result::Result::"),ld=e=>Object.values(qf).includes(e),ud=e=>Object.values(Yf).includes(e),Bn=e=>e==="core::integer::u256",ul=e=>e==="core::bool",QC=e=>e==="core::starknet::contract_address::ContractAddress",b1=e=>e==="core::starknet::eth_address::EthAddress",Pn=e=>e.includes("::"),fi=e=>Pn(e)?e.substring(e.indexOf("<")+1,e.lastIndexOf(">")):e.replace("*","");function A1(e){const{cairo:t}=cl(e);if(t===void 0)throw Error("Unable to determine Cairo version");return t==="1"}function cl(e){if(e.find(r=>r.type==="interface"))return{cairo:"1",compiler:"2"};const t=e.find(r=>r.type==="function"&&(r.inputs.length||r.outputs.length));if(!t)return{cairo:void 0,compiler:void 0};const n=t.inputs.length?t.inputs:t.outputs;return Pn(n[0].type)?{cairo:"1",compiler:"1"}:{cairo:"0",compiler:"0"}}var cd=e=>{const t=BigInt(e);if(!sd(t))throw new Error("Number is too large");return{low:(t&ad).toString(10),high:(t>>128n).toString(10)}},JC=(...e)=>({...e});function Ve(e){if(il(e)||typeof e=="number"&&Number.isInteger(e))return e.toString();if(Yo(e)){if(!qo(e))throw new Error(`${e} is a long string > 31 chars, felt can store short strings, split it to array of short strings`);const t=Mn(e);return BigInt(t).toString()}if(typeof e=="string"&&kt(e))return BigInt(e).toString();if(typeof e=="string"&&ki(e))return e;if(typeof e=="boolean")return`${+e}`;throw new Error(`${e} can't be computed by felt()`)}var T1=class{constructor(e){const t=Object.values(e);if(t.length===0)throw new Error("This Enum must have a least 1 variant");if(t.filter(r=>typeof r<"u").length!==1)throw new Error("This Enum must have exactly one active variant");this.variant=e}unwrap(){const t=Object.entries(this.variant).find(n=>typeof n[1]<"u");if(!(typeof t>"u"))return t[1]}activeVariant(){const t=Object.entries(this.variant).find(n=>typeof n[1]<"u");return typeof t>"u"?"":t[0]}},N1=(e=>(e[e.Some=0]="Some",e[e.None=1]="None",e))(N1||{}),vc=class{constructor(e,t){if(!(e in N1))throw new Error("Wrong variant : should be CairoOptionVariant.Some or .None.");if(e===0){if(typeof t>"u")throw new Error('The creation of a Cairo Option with "Some" variant needs a content as input.');this.Some=t,this.None=void 0}else this.Some=void 0,this.None=!0}unwrap(){if(!this.None)return this.Some}isSome(){return!(typeof this.Some>"u")}isNone(){return this.None===!0}},I1=(e=>(e[e.Ok=0]="Ok",e[e.Err=1]="Err",e))(I1||{}),wc=class{constructor(e,t){if(!(e in I1))throw new Error("Wrong variant : should be CairoResultVariant.Ok or .Err.");e===0?(this.Ok=t,this.Err=void 0):(this.Ok=void 0,this.Err=t)}unwrap(){if(typeof this.Ok<"u")return this.Ok;if(typeof this.Err<"u")return this.Err;throw new Error("Both Result.Ok and .Err are undefined. Not authorized.")}isOk(){return!(typeof this.Ok>"u")}isErr(){return!(typeof this.Err>"u")}},ou={isBN:(e,t,n)=>{if(!il(e[n]))throw new Error(`Data and formatter mismatch on ${n}:${t[n]}, expected response data ${n}:${e[n]} to be BN instead it is ${typeof e[n]}`)},unknown:(e,t,n)=>{throw new Error(`Unhandled formatter type on ${n}:${t[n]} for data ${n}:${e[n]}`)}};function Ma(e,t,n){return Object.entries(e).reduce((r,[i,o])=>{const a=n??t[i];if(!(i in t)&&!n)return r[i]=o,r;if(a==="string"){if(Array.isArray(e[i])){const s=Ma(e[i],e[i].map(u=>a));return r[i]=Object.values(s).join(""),r}return ou.isBN(e,t,i),r[i]=od(o),r}if(a==="number")return ou.isBN(e,t,i),r[i]=Number(o),r;if(typeof a=="function")return r[i]=a(o),r;if(Array.isArray(a)){const s=Ma(e[i],a,a[0]);return r[i]=Object.values(s),r}return typeof a=="object"?(r[i]=Ma(e[i],a),r):(ou.unknown(e,t,i),r)},{})}var eb=class{constructor(e){this.abi=e}methodInputsLength(e){return e.inputs.reduce((t,n)=>hr(n.name)?t:t+1,0)}getMethod(e){return this.abi.find(t=>t.name===e)}getLegacyFormat(){return this.abi}},tb=class{constructor(e){this.abi=e}methodInputsLength(e){return e.inputs.length}getMethod(e){return this.abi.find(n=>n.type==="interface").items.find(n=>n.name===e)}getLegacyFormat(){return this.abi.flatMap(e=>e.type==="interface"?e.items:e)}};function nb(e){const t=rb(e);if(t===0||t===1)return new eb(e);if(t===2)return new tb(e);throw Error(`Unsupported ABI version ${t}`)}function rb(e){return e.find(t=>t.type==="interface")?2:A1(e)?1:0}function Vp(e,t,n){return e==="constructor"&&!n&&!t.length}function ib(e){const t=e.substring(0,e.indexOf(":")),n=e.substring(t.length+1);return{name:t,type:n}}function R1(e){if(!e.includes("("))return{subTuple:[],result:e};const t=[];let n="",r=0;for(;rn.length?o.replace(" ",n.shift()):o);return C1(e)&&(i=i.reduce((o,a)=>o.concat(ib(a)),[])),i}function ab(e){const t=e.replace(/\s/g,"").slice(1,-1),{subTuple:n,result:r}=R1(t);return r.split(",").map(o=>n.length?o.replace(" ",n.shift()):o)}function fd(e){return Pn(e)?ab(e):ob(e)}function sb(e){return Error(`Your object includes the property : ${e}, containing an Uint256 object without the 'low' and 'high' keys.`)}function lb(e,t,n,r){const i=(c,f)=>{if(Ln(f))return a(c,f);if(vr(f,r)){const p=r[f];return u(c,p)}if(Hn(f))return s(c,f);if(b1(f))return c;if(Bn(f)){const p=c;if(typeof p!="object")return p;if(!("low"in p&&"high"in p))throw sb(f);return{low:p.low,high:p.high}}if(Xo(f,n)){const p=n[f].members;return o(c,p)}return c},o=(c,f)=>f.reduce((y,m)=>{const _=w=>Object.defineProperty(y,m.name,{enumerable:!0,value:w??c[m.name]});if(c[m.name]==="undefined"&&(Pn(m.type)||!hr(m.name)))throw Error(`Your object needs a property with key : ${m.name} .`);return _(i(c[m.name],m.type)),y},{});function a(c,f){const p=fi(f);return typeof c=="string"?c:c.map(y=>i(y,p))}function s(c,f){return fd(f).reduce((m,_,w)=>{const d=Object.keys(c),h=v=>Object.defineProperty(m,w.toString(),{enumerable:!0,value:v??c[d[w]]}),g=_!=null&&_.type?_.type:_;return h(i(c[d[w]],g)),m},{})}const u=(c,f)=>{if(ll(f.name)){const _=c,w=f.name.substring(f.name.indexOf("<")+1,f.name.lastIndexOf(",")),d=f.name.substring(f.name.indexOf(",")+1,f.name.lastIndexOf(">"));return _.isOk()?new wc(0,i(c.unwrap(),w)):new wc(1,i(c.unwrap(),d))}if(sl(f.name)){const _=c,w=f.name.substring(f.name.indexOf("<")+1,f.name.lastIndexOf(">"));return _.isSome()?new vc(0,i(_.unwrap(),w)):new vc(1,{})}const p=c,m=Object.entries(p.variant).map(_=>{if(typeof _[1]>"u")return _;const w=f.type.substring(f.type.lastIndexOf("<")+1,f.type.lastIndexOf(">"));return w==="()"?_:[_[0],i(p.unwrap(),w)]});return new T1(Object.fromEntries(m))};return t.reduce((c,f)=>{const p=y=>Object.defineProperty(c,f.name,{enumerable:!0,value:y});return hr(f.name)&&!Pn(f.type)||p(i(e[f.name],f.type)),c},{})}function Es(e,t){switch(!0){case Bn(e):const n=cd(t);return[Ve(n.low),Ve(n.high)];default:return Ve(t)}}function ub(e,t){const n=fd(t),r=Object.values(e);if(r.length!==n.length)throw Error(`ParseTuple: provided and expected abi tuple size do not match. + provided: ${r} + expected: ${n}`);return n.map((i,o)=>({element:r[o],type:i.type??i}))}function Zp(e){if(typeof e=="object"){const{low:n,high:r}=e;return[Ve(n),Ve(r)]}const t=cd(e);return[Ve(t.low),Ve(t.high)]}function Rt(e,t,n,r){if(e===void 0)throw Error(`Missing parameter for type ${t}`);if(Array.isArray(e)){const i=[];i.push(Ve(e.length));const o=fi(t);return e.reduce((a,s)=>a.concat(Rt(s,o,n,r)),i)}if(n[t]&&n[t].members.length){if(Bn(t))return Zp(e);if(t==="core::starknet::eth_address::EthAddress")return Es(t,e);const{members:i}=n[t],o=e;return i.reduce((a,s)=>a.concat(Rt(o[s.name],s.type,n,r)),[])}if(Hn(t))return ub(e,t).reduce((o,a)=>{const s=Rt(a.element,a.type,n,r);return o.concat(s)},[]);if(Bn(t))return Zp(e);if(vr(t,r)){const{variants:i}=r[t];if(sl(t)){const f=e;if(f.isSome()){const p=i.find(_=>_.name==="Some");if(typeof p>"u")throw Error("Error in abi : Option has no 'Some' variant.");const y=p.type;if(y==="()")return"0";const m=Rt(f.unwrap(),y,n,r);return Array.isArray(m)?["0",...m]:["0",m]}return"1"}if(ll(t)){const f=e;if(f.isOk()){const _=i.find(h=>h.name==="Ok");if(typeof _>"u")throw Error("Error in abi : Result has no 'Ok' variant.");const w=_.type;if(w==="()")return"0";const d=Rt(f.unwrap(),w,n,r);return Array.isArray(d)?["0",...d]:["0",d]}const p=i.find(_=>_.name==="Err");if(typeof p>"u")throw Error("Error in abi : Result has no 'Err' variant.");const y=p.type;if(y==="()")return"1";const m=Rt(f.unwrap(),y,n,r);return Array.isArray(m)?["1",...m]:["1",m]}const o=e,a=o.activeVariant(),s=i.find(f=>f.name===a);if(typeof s>"u")throw Error(`Not find in abi : Enum has no '${a}' variant.`);const u=s.type,l=i.findIndex(f=>f.name===a);if(u==="()")return l.toString();const c=Rt(o.unwrap(),u,n,r);return Array.isArray(c)?[l.toString(),...c]:[l.toString(),c]}if(typeof e=="object")throw Error(`Parameter ${e} do not align with abi parameter ${t}`);return Es(t,e)}function cb(e,t,n,r){const{name:i,type:o}=t;let{value:a}=e.next();switch(!0){case Ln(o):if(!Array.isArray(a)&&!Yo(a))throw Error(`ABI expected parameter ${i} to be array or long string, got ${a}`);return typeof a=="string"&&(a=id(a)),Rt(a,t.type,n,r);case o==="core::starknet::eth_address::EthAddress":return Es(o,a);case(Xo(o,n)||Hn(o)||Bn(o)):return Rt(a,o,n,r);case vr(o,r):return Rt(a,o,n,r);default:return Es(o,a)}}function Ec(e,t){let n;switch(!0){case ul(e):return n=t.next().value,!!BigInt(n);case Bn(e):const r=t.next().value,i=t.next().value;return al({low:r,high:i});case e==="core::starknet::eth_address::EthAddress":return n=t.next().value,BigInt(n);default:return n=t.next().value,BigInt(n)}}function Kt(e,t,n,r){if(t.type==="()")return{};if(Bn(t.type)){const i=e.next().value,o=e.next().value;return al({low:i,high:o})}if(Ln(t.type)){const i=[],o={name:"",type:fi(t.type)},a=BigInt(e.next().value);for(;i.length(i[o.name]=Kt(e,o,n,r),i),{});if(r&&t.type in r&&r[t.type]){const i=Number(e.next().value),o=r[t.type].variants.reduce((s,u,l)=>l===i?(s[u.name]=Kt(e,{name:"",type:u.type},n,r),s):(s[u.name]=void 0,s),{});if(t.type.startsWith("core::option::Option")){const s=i===0?o.Some:void 0;return new vc(i,s)}if(t.type.startsWith("core::result::Result")){let s;return i===0?s=o.Ok:s=o.Err,new wc(i,s)}return new T1(o)}if(Hn(t.type))return fd(t.type).reduce((o,a,s)=>{const u=a!=null&&a.name?a.name:s,l=a!=null&&a.type?a.type:a,c={name:u,type:l};return o[u]=Kt(e,c,n,r),o},{});if(Ln(t.type)){const i=[],o={name:"",type:fi(t.type)},a=BigInt(e.next().value);for(;i.length{if(oe(typeof e=="string"||typeof e=="number"||typeof e=="bigint",`Validate: arg ${t.name} should be a felt typed as (String, Number or BigInt)`),typeof e=="string"&&!kt(e))return;const n=BigInt(e.toString(10));oe(n>=0n&&n<=2n**252n-1n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 2^252-1]`)},dd=(e,t)=>{typeof e=="number"&&oe(e<=Number.MAX_SAFE_INTEGER,"Validation: Parameter is to large to be typed as Number use (BigInt or String)"),oe(typeof e=="string"||typeof e=="number"||typeof e=="bigint"||typeof e=="object"&&"low"in e&&"high"in e,`Validate: arg ${t.name} of cairo type ${t.type} should be type (String, Number or BigInt), but is ${typeof e} ${e}.`);const n=typeof e=="object"?al(e):H(e);switch(t.type){case"core::integer::u8":oe(n>=0n&&n<=255n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0 - 255]`);break;case"core::integer::u16":oe(n>=0n&&n<=65535n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 65535]`);break;case"core::integer::u32":oe(n>=0n&&n<=4294967295n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 4294967295]`);break;case"core::integer::u64":oe(n>=0n&&n<=2n**64n-1n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 2^64-1]`);break;case"core::integer::u128":oe(n>=0n&&n<=2n**128n-1n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 2^128-1]`);break;case"core::integer::u256":oe(n>=0n&&n<=2n**256n-1n,`Validate: arg ${t.name} is ${t.type} 0 - 2^256-1`);break;case"core::starknet::class_hash::ClassHash":oe(n>=0n&&n<=2n**252n-1n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 2^252-1]`);break;case"core::starknet::contract_address::ContractAddress":oe(n>=0n&&n<=2n**252n-1n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 2^252-1]`);break}},L1=(e,t)=>{oe(typeof e=="boolean",`Validate: arg ${t.name} of cairo type ${t.type} should be type (Boolean)`)},B1=(e,t,n)=>{if(t.type==="core::integer::u256"){dd(e,t);return}if(t.type==="core::starknet::eth_address::EthAddress"){oe(typeof e!="object",`EthAdress type is waiting a BigNumberish. Got ${e}`);const r=BigInt(e.toString(10));oe(r>=0n&&r<=2n**160n-1n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 2^160-1]`);return}oe(typeof e=="object"&&!Array.isArray(e),`Validate: arg ${t.name} is cairo type struct (${t.type}), and should be defined as js object (not array)`),n[t.type].members.forEach(({name:r})=>{oe(Object.keys(e).includes(r),`Validate: arg ${t.name} should have a property ${r}`)})},P1=(e,t)=>{oe(typeof e=="object"&&!Array.isArray(e),`Validate: arg ${t.name} is cairo type Enum (${t.type}), and should be defined as js object (not array)`);const n=Object.getOwnPropertyNames(Object.getPrototypeOf(e)),r=[...Object.getOwnPropertyNames(e),...n];if(!(sl(t.type)&&r.includes("isSome")&&r.includes("isNone"))&&!(ll(t.type)&&r.includes("isOk")&&r.includes("isErr"))&&!(r.includes("variant")&&r.includes("activeVariant")))throw new Error(`Validate Enum: argument ${t.name}, type ${t.type}, value received ${e}, is not an Enum.`)},D1=(e,t)=>{oe(typeof e=="object"&&!Array.isArray(e),`Validate: arg ${t.name} should be a tuple (defined as object)`)},U1=(e,t,n,r)=>{const i=fi(t.type);if(!(ws(i)&&rd(e)))switch(oe(Array.isArray(e),`Validate: arg ${t.name} should be an Array`),!0){case ws(i):e.forEach(o=>O1(o,t));break;case Hn(i):e.forEach(o=>D1(o,{name:t.name,type:i}));break;case Ln(i):e.forEach(o=>U1(o,{name:"",type:i},n,r));break;case Xo(i,n):e.forEach(o=>B1(o,{name:t.name,type:i},n));break;case vr(i,r):e.forEach(o=>P1(o,{name:t.name,type:i}));break;case(ld(i)||ud(i)):e.forEach(o=>dd(o,t));break;case ul(i):e.forEach(o=>L1(o,t));break;default:throw new Error(`Validate Unhandled: argument ${t.name}, type ${t.type}, value ${e}`)}};function Kp(e,t,n,r){e.inputs.reduce((i,o)=>{const a=t[i];switch(!0){case hr(o.name):return i;case ws(o.type):O1(a,o);break;case(ld(o.type)||ud(o.type)):dd(a,o);break;case ul(o.type):L1(a,o);break;case Ln(o.type):U1(a,o,n,r);break;case Xo(o.type,n):B1(a,o,n);break;case vr(o.type,r):P1(a,o);break;case Hn(o.type):D1(a,o);break;default:throw new Error(`Validate Unhandled: argument ${o.name}, type ${o.type}, value ${a}`)}return i+1},0)}var ee=class{constructor(e){this.structs=ee.getAbiStruct(e),this.enums=ee.getAbiEnum(e),this.parser=nb(e),this.abi=this.parser.getLegacyFormat()}validate(e,t,n=[]){if(e!=="DEPLOY"){const o=this.abi.filter(a=>{if(a.type!=="function")return!1;const s=a.stateMutability==="view"||a.state_mutability==="view";return e==="INVOKE"?!s:s}).map(a=>a.name);oe(o.includes(t),`${e==="INVOKE"?"invocable":"viewable"} method not found in abi`)}const r=this.abi.find(o=>e==="DEPLOY"?o.name===t&&o.type==="constructor":o.name===t&&o.type==="function");if(Vp(t,n,r))return;const i=this.parser.methodInputsLength(r);if(n.length!==i)throw Error(`Invalid number of arguments, expected ${i} arguments, but got ${n.length}`);Kp(r,n,this.structs,this.enums)}compile(e,t){const n=this.abi.find(a=>a.name===e);if(Vp(e,t,n))return[];let r;if(Array.isArray(t))r=t;else{const a=lb(t,n.inputs,this.structs,this.enums);r=Object.values(a),Kp(n,r,this.structs,this.enums)}const i=r[Symbol.iterator](),o=n.inputs.reduce((a,s)=>hr(s.name)&&!Pn(s.type)?a:a.concat(cb(i,s,this.structs,this.enums)),[]);return Object.defineProperty(o,"__compiled__",{enumerable:!1,writable:!1,value:!0}),o}static compile(e){const t=r=>{const i=(a,s=".")=>{const u=Array.isArray(a)?[a.length.toString(),...a]:a;return Object.entries(u).flatMap(([l,c])=>{let f=c;rd(f)&&(f=id(f)),l==="entrypoint"&&(f=Ct(f));const p=Array.isArray(u)&&l==="0"?"$$len":l;if(il(f))return[[`${s}${p}`,Ve(f)]];if(Object(f)===f){const y=Object.getOwnPropertyNames(Object.getPrototypeOf(f)),m=[...Object.getOwnPropertyNames(f),...y];if(m.includes("isSome")&&m.includes("isNone")){const _=f,w=_.isSome()?0:1;return _.isSome()?i({0:w,1:_.unwrap()},`${s}${p}.`):[[`${s}${p}`,Ve(w)]]}if(m.includes("isOk")&&m.includes("isErr")){const _=f,w=_.isOk()?0:1;return i({0:w,1:_.unwrap()},`${s}${p}.`)}if(m.includes("variant")&&m.includes("activeVariant")){const _=f,w=_.activeVariant(),h=Object.keys(_.variant).findIndex(g=>g===w);return typeof _.unwrap()=="object"&&Object.keys(_.unwrap()).length===0?[[`${s}${p}`,Ve(h)]]:i({0:h,1:_.unwrap()},`${s}${p}.`)}return i(f,`${s}${p}.`)}return[[`${s}${p}`,Ve(f)]]})};return Object.fromEntries(i(r))};let n;if(Array.isArray(e)){const r={...e},i=t(r);n=Object.values(i)}else{const r=t(e);n=Object.values(r)}return Object.defineProperty(n,"__compiled__",{enumerable:!1,writable:!1,value:!0}),n}parse(e,t){const{outputs:n}=this.abi.find(o=>o.name===e),r=t.flat()[Symbol.iterator](),i=n.flat().reduce((o,a,s)=>{const u=a.name??s;return o[u]=Sc(r,a,this.structs,this.enums,o),o[u]&&o[`${u}_len`]&&delete o[`${u}_len`],o},{});return Object.keys(i).length===1&&0 in i?i[0]:i}format(e,t,n){const r=this.parse(e,t);return Ma(r,n)}static getAbiStruct(e){return e.filter(t=>t.type==="struct").reduce((t,n)=>({...t,[n.name]:n}),{})}static getAbiEnum(e){const t=e.filter(n=>n.type==="enum").reduce((n,r)=>({...n,[r.name]:r}),{});return delete t["core::bool"],t}static toCalldata(e=[]){return ee.compile(e)}static toHex(e=[]){return ee.compile(e).map(n=>L(n))}},$1={};pe($1,{calculateContractAddressFromHash:()=>_b,calculateDeclareTransactionHash:()=>gb,calculateDeployAccountTransactionHash:()=>yb,calculateDeployTransactionHash:()=>pb,calculateTransactionHash:()=>mb,calculateTransactionHashCommon:()=>Qo,computeCompiledClassHash:()=>Eb,computeContractClassHash:()=>xb,computeHashOnElements:()=>Le,computeLegacyContractClassHash:()=>V1,computeSierraContractClassHash:()=>Z1,default:()=>j1,feeTransactionVersion:()=>H1,feeTransactionVersion_2:()=>F1,formatSpaces:()=>Lo,getSelector:()=>ol,getSelectorFromName:()=>Ct,getVersionsByType:()=>gd,keccakBn:()=>S1,poseidon:()=>s2,starknetKeccak:()=>td,transactionVersion:()=>hd,transactionVersion_2:()=>pd});var z1={};pe(z1,{starkCurve:()=>B2,weierstrass:()=>g2});var fb={};pe(fb,{parse:()=>Dn,parseAlwaysAsBig:()=>M1,stringify:()=>St,stringifyAlwaysAsBig:()=>hb});var db=e=>{if(!Vo(e))return parseFloat(e);const t=parseInt(e,10);return Number.isSafeInteger(t)?t:BigInt(e)},Dn=e=>qy(String(e),void 0,db),M1=e=>qy(String(e),void 0,X2),St=(e,t,n,r)=>Yy(e,t,n,r),hb=St,hd=Kf,pd=Wf,H1=Km,F1=Wm;function gd(e){return e==="fee"?{v1:H1,v2:F1}:{v1:hd,v2:pd}}function Le(e){return[...e,e.length].reduce((t,n)=>el(H(t),H(n)),0).toString()}function Qo(e,t,n,r,i,o,a,s=[]){const u=Le(i),l=[e,t,n,r,u,o,a,...s];return Le(l)}function pb(e,t,n,r,i="constructor"){return Qo("0x6465706c6f79",n,e,Ct(i),t,0,r)}function gb(e,t,n,r,i,o,a){return Qo("0x6465636c617265",n,t,0,[e],r,i,[o,...a?[a]:[]])}function yb(e,t,n,r,i,o,a,s){const u=[t,r,...n];return Qo("0x6465706c6f795f6163636f756e74",i,e,0,u,o,a,[s])}function mb(e,t,n,r,i,o){return Qo("0x696e766f6b65",t,e,0,n,r,i,[o])}function _b(e,t,n,r){const i=ee.compile(n),o=Le(i),a=Ve("0x535441524b4e45545f434f4e54524143545f41444452455353");return Le([a,r,e,t,o])}function vb(e,t){return e==="attributes"||e==="accessible_scopes"?Array.isArray(t)&&t.length===0?void 0:t:e==="debug_info"?null:t===null?void 0:t}function Lo(e){let t=!1;const n=[];for(const r of e)r==='"'&&!(n.length>0&&n.slice(-1)[0]==="\\")&&(t=!t),t?n.push(r):n.push(r===":"?": ":r===","?", ":r);return n.join("")}function j1(e){const{abi:t,program:n}=e,i=Lo(St({abi:t,program:n},vb));return Ue(yi(Si(i)).toString(16))}function V1(e){const t=typeof e=="string"?Dn(e):e,n=L(qm),r=Le(t.entry_points_by_type.EXTERNAL.flatMap(l=>[l.selector,l.offset])),i=Le(t.entry_points_by_type.L1_HANDLER.flatMap(l=>[l.selector,l.offset])),o=Le(t.entry_points_by_type.CONSTRUCTOR.flatMap(l=>[l.selector,l.offset])),a=Le(t.program.builtins.map(l=>Mn(l))),s=j1(t),u=Le(t.program.data);return Le([n,r,i,o,a,s,u])}function wb(e){return On(e.flatMap(t=>BigInt(Mn(t))))}function au(e){const t=e.flatMap(n=>[BigInt(n.selector),BigInt(n.offset),wb(n.builtins)]);return On(t)}function Eb(e){const n=BigInt(Mn("COMPILED_CLASS_V1")),r=au(e.entry_points_by_type.EXTERNAL),i=au(e.entry_points_by_type.L1_HANDLER),o=au(e.entry_points_by_type.CONSTRUCTOR),a=On(e.bytecode.map(s=>BigInt(s)));return L(On([n,r,i,o,a]))}function su(e){const t=e.flatMap(n=>[BigInt(n.selector),BigInt(n.function_idx)]);return On(t)}function Sb(e){const t=Lo(St(e.abi,null));return BigInt(Ue(yi(Si(t)).toString(16)))}function Z1(e){const n=BigInt(Mn("CONTRACT_CLASS_V0.1.0")),r=su(e.entry_points_by_type.EXTERNAL),i=su(e.entry_points_by_type.L1_HANDLER),o=su(e.entry_points_by_type.CONSTRUCTOR),a=Sb(e),s=On(e.sierra_program.map(u=>BigInt(u)));return L(On([n,r,i,o,a,s]))}function xb(e){const t=typeof e=="string"?Dn(e):e;return"sierra_program"in t?Z1(t):V1(t)}var K1={};pe(K1,{compressProgram:()=>yd,decompressProgram:()=>xc,estimatedFeeToMaxFee:()=>_d,formatSignature:()=>md,makeAddress:()=>kb,randomAddress:()=>W1,signatureToDecimalArray:()=>Tr,signatureToHexArray:()=>Nr});function yd(e){const t=typeof e=="string"?e:St(e),n=cC(t);return Mm(n)}function xc(e){if(Array.isArray(e))return e;const t=$m(fC(zm(e)));return Dn(t)}function W1(){const e=zy.randomPrivateKey();return Fy(e)}function kb(e){return Ue(e).toLowerCase()}function md(e){if(!e)throw Error("formatSignature: provided signature is undefined");if(Array.isArray(e))return e.map(t=>L(t));try{const{r:t,s:n}=e;return[L(t),L(n)]}catch{throw new Error("Signature need to be weierstrass.SignatureType or an array for custom")}}function Tr(e){return _1(md(e))}function Nr(e){return v1(md(e))}function _d(e,t=.5){const n=Math.round((1+t)*100);return H(e)*H(n)/100n}function An(e){return"sierra_program"in(typeof e=="string"?Dn(e):e)}var G1=typeof window<"u"&&window.fetch||typeof global<"u"&&global.fetch||kC,Cb={};pe(Cb,{createSierraContractClass:()=>q1,parseContract:()=>Y1,wait:()=>Ss});function Ss(e){return new Promise(t=>{setTimeout(t,e)})}function q1(e){const t={...e};return delete t.sierra_program_debug_info,t.abi=Lo(St(e.abi)),t.sierra_program=Lo(St(e.sierra_program)),t.sierra_program=yd(t.sierra_program),t}function Y1(e){const t=typeof e=="string"?Dn(e):e;return An(e)?q1(t):{...t,..."program"in t&&{program:yd(t.program)}}}var bb=class{parseGetBlockResponse(e){return{timestamp:e.timestamp,block_hash:"block_hash"in e?e.block_hash:"",block_number:"block_number"in e?e.block_number:-1,new_root:"new_root"in e?e.new_root:"",parent_hash:e.parent_hash,status:"status"in e?e.status:"PENDING",transactions:e.transactions}}parseGetTransactionResponse(e){return{calldata:"calldata"in e?e.calldata:[],contract_address:"contract_address"in e?e.contract_address:"",sender_address:"sender_address"in e?e.sender_address:"",max_fee:"max_fee"in e?e.max_fee:"",nonce:"nonce"in e?e.nonce:"",signature:"signature"in e?e.signature:[],transaction_hash:e.transaction_hash,version:e.version}}parseFeeEstimateResponse(e){return{overall_fee:H(e[0].overall_fee),gas_consumed:H(e[0].gas_consumed),gas_price:H(e[0].gas_price)}}parseFeeEstimateBulkResponse(e){return e.map(t=>({overall_fee:H(t.overall_fee),gas_consumed:H(t.gas_consumed),gas_price:H(t.gas_price)}))}parseCallContractResponse(e){return{result:e}}parseSimulateTransactionResponse(e){return e.map(t=>({...t,suggestedMaxFee:_d(BigInt(t.fee_estimation.overall_fee))}))}parseContractClassResponse(e){return{...e,abi:typeof e.abi=="string"?JSON.parse(e.abi):e.abi}}};function Ab(e,t=e.constructor){const{captureStackTrace:n}=Error;n&&n(e,t)}function Tb(e,t){const{setPrototypeOf:n}=Object;n?n(e,t):e.__proto__=t}var Nb=class extends Error{constructor(e){super(e),Object.defineProperty(this,"name",{value:new.target.name,enumerable:!1,configurable:!0}),Tb(this,new.target.prototype),Ab(this)}},pr=class extends Nb{},Ib=class extends pr{constructor(e,t){super(e),this.errorCode=t}},Rb=class extends pr{constructor(e,t){super(e),this.errorCode=t}},Ob={};pe(Ob,{StarknetIdContract:()=>J1,getStarknetIdContract:()=>vd,useDecoded:()=>X1,useEncoded:()=>Q1});var Bt="abcdefghijklmnopqrstuvwxyz0123456789-",Fr=BigInt(Bt.length+1),me="这来",Wp=BigInt(Bt.length),kc=BigInt(me.length),Gp=BigInt(me.length+1);function Cc(e){let t=0;for(;e.endsWith(me[me.length-1]);)e=e.substring(0,e.length-1),t+=1;return[e,t]}function X1(e){let t="";return e.forEach(n=>{for(;n!==ro;){const o=n%Fr;if(n/=Fr,o===BigInt(Bt.length)){const a=n/Gp;if(a===ro){const s=n%Gp;n=a,s===ro?t+=Bt[0]:t+=me[Number(s)-1]}else{const s=n%kc;t+=me[Number(s)],n/=kc}}else t+=Bt[Number(o)]}const[r,i]=Cc(t);i&&(t=r+(i%2===0?me[me.length-1].repeat(i/2-1)+me[0]+Bt[1]:me[me.length-1].repeat((i-1)/2+1))),t+="."}),t&&t.concat("stark")}function Q1(e){let t=BigInt(0),n=BigInt(1);if(e.endsWith(me[0]+Bt[1])){const[r,i]=Cc(e.substring(0,e.length-2));e=r+me[me.length-1].repeat(2*(i+1))}else{const[r,i]=Cc(e);i&&(e=r+me[me.length-1].repeat(1+2*(i-1)))}for(let r=0;r(e.MAINNET="0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678",e.TESTNET="0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce",e))(J1||{});function vd(e){switch(e){case"0x534e5f4d41494e":return"0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678";case"0x534e5f474f45524c49":return"0x3bab268e932d2cecd1946f100ae67ce3dff9fd234119ea2f6da57d16d29fce";default:throw new Error("Starknet.id is not yet deployed on this network")}}async function wd(e,t,n){const r=await e.getChainId(),i=n??vd(r);try{const a=(await e.callContract({contractAddress:i,entrypoint:"address_to_domain",calldata:ee.compile({address:t})})).result.map(u=>BigInt(u)).slice(1),s=X1(a);if(!s)throw Error("Starkname not found");return s}catch(o){throw o instanceof Error&&o.message==="Starkname not found"?o:Error("Could not get stark name")}}async function Ed(e,t,n){const r=await e.getChainId(),i=n??vd(r);try{return(await e.callContract({contractAddress:i,entrypoint:"domain_to_address",calldata:ee.compile({domain:[Q1(t.replace(".stark","")).toString(10)]})})).result[0]}catch{throw Error("Could not get address from stark name")}}var Lb=Object.values(Xf),se=class{constructor(e){this.hash=null,this.number=null,this.tag=null,this.valueOf=()=>this.number,this.toString=()=>this.hash,this.setIdentifier(e)}setIdentifier(e){typeof e=="string"&&kt(e)?this.hash=e:typeof e=="bigint"?this.hash=L(e):typeof e=="number"?this.number=e:typeof e=="string"&&Lb.includes(e)?this.tag=e:this.tag="pending"}get queryIdentifier(){return this.number!==null?`blockNumber=${this.number}`:this.hash!==null?`blockHash=${this.hash}`:`blockNumber=${this.tag}`}get identifier(){return this.number!==null?{block_number:this.number}:this.hash!==null?{block_hash:this.hash}:this.tag}set identifier(e){this.setIdentifier(e)}get sequencerIdentifier(){return this.hash!==null?{blockHash:this.hash}:{blockNumber:this.number??this.tag}}},qp=(e,t=!1)=>{t||console.warn("Using default public node url, please provide nodeUrl in provider options!");const n=e==="SN_MAIN"?e1:Jm,r=Math.floor(Math.random()*n.length);return n[r]},lu={headers:{"Content-Type":"application/json"},blockIdentifier:"pending",retries:200},Ha=class{constructor(e){this.responseParser=new bb,this.getBlockHashAndNumber=this.getBlockLatestAccepted,this.getStateUpdate=this.getBlockStateUpdate,this.traceBlockTransactions=this.getBlockTransactionsTraces,this.getTransactionCount=this.getBlockTransactionCount,this.traceTransaction=this.getTransactionTrace,this.getSimulateTransaction=this.simulateTransaction;const{nodeUrl:t,retries:n,headers:r,blockIdentifier:i,chainId:o}=e||{};Object.values(Gf).includes(t)?this.nodeUrl=qp(t,e==null?void 0:e.default):t?this.nodeUrl=t:this.nodeUrl=qp(void 0,e==null?void 0:e.default),this.retries=n||lu.retries,this.headers={...lu.headers,...r},this.blockIdentifier=i||lu.blockIdentifier,this.chainId=o}fetch(e,t,n=0){const r={id:n,jsonrpc:"2.0",method:e,...t&&{params:t}};return G1(this.nodeUrl,{method:"POST",body:St(r),headers:this.headers})}errorHandler(e,t,n,r){if(n){const{code:i,message:o,data:a}=n;throw new pr(`RPC: ${e} with params ${St(t)} + ${i}: ${o}: ${St(a)}`)}if(r instanceof pr)throw r;if(r)throw Error(r.message)}async fetchEndpoint(e,t){var n;try{const r=await this.fetch(e,t),{error:i,result:o}=await r.json();return this.errorHandler(e,t,i),o}catch(r){throw this.errorHandler(e,t,(n=r==null?void 0:r.response)==null?void 0:n.data,r),r}}async getChainId(){return this.chainId??(this.chainId=await this.fetchEndpoint("starknet_chainId")),this.chainId}async getSpecVersion(){return this.fetchEndpoint("starknet_specVersion")}async getNonceForAddress(e,t=this.blockIdentifier){const n=L(e),r=new se(t).identifier;return this.fetchEndpoint("starknet_getNonce",{contract_address:n,block_id:r})}async getBlock(e=this.blockIdentifier){return this.getBlockWithTxHashes(e).then(this.responseParser.parseGetBlockResponse)}async getBlockLatestAccepted(){return this.fetchEndpoint("starknet_blockHashAndNumber")}async getBlockNumber(){return this.fetchEndpoint("starknet_blockNumber")}async getBlockWithTxHashes(e=this.blockIdentifier){const t=new se(e).identifier;return this.fetchEndpoint("starknet_getBlockWithTxHashes",{block_id:t})}async getBlockWithTxs(e=this.blockIdentifier){const t=new se(e).identifier;return this.fetchEndpoint("starknet_getBlockWithTxs",{block_id:t})}async getBlockStateUpdate(e=this.blockIdentifier){const t=new se(e).identifier;return this.fetchEndpoint("starknet_getStateUpdate",{block_id:t})}async getBlockTransactionsTraces(e=this.blockIdentifier){const t=new se(e).identifier;return this.fetchEndpoint("starknet_traceBlockTransactions",{block_id:t})}async getBlockTransactionCount(e=this.blockIdentifier){const t=new se(e).identifier;return this.fetchEndpoint("starknet_getBlockTransactionCount",{block_id:t})}async getPendingTransactions(){const{transactions:e}=await this.getBlock("pending");return Promise.all(e.map(t=>this.getTransactionByHash(t)))}async getTransaction(e){return this.getTransactionByHash(e).then(this.responseParser.parseGetTransactionResponse)}async getTransactionByHash(e){const t=L(e);return this.fetchEndpoint("starknet_getTransactionByHash",{transaction_hash:t})}async getTransactionByBlockIdAndIndex(e,t){const n=new se(e).identifier;return this.fetchEndpoint("starknet_getTransactionByBlockIdAndIndex",{block_id:n,index:t})}async getTransactionReceipt(e){const t=L(e);return this.fetchEndpoint("starknet_getTransactionReceipt",{transaction_hash:t})}async getTransactionTrace(e){const t=L(e);return this.fetchEndpoint("starknet_traceTransaction",{transaction_hash:t})}async getTransactionStatus(e){const t=L(e);return this.fetchEndpoint("starknet_getTransactionStatus",{transaction_hash:t})}async simulateTransaction(e,{blockIdentifier:t=this.blockIdentifier,skipValidate:n=!1,skipFeeCharge:r=!0}){const i=new se(t).identifier,o=[];return n&&o.push(Me.ESimulationFlag.SKIP_VALIDATE),r&&o.push(Me.ESimulationFlag.SKIP_FEE_CHARGE),this.fetchEndpoint("starknet_simulateTransactions",{block_id:i,transactions:e.map(a=>this.buildTransaction(a)),simulation_flags:o}).then(this.responseParser.parseSimulateTransactionResponse)}async waitForTransaction(e,t){const n=L(e);let{retries:r}=this,i=!1,o=!1;const a=(t==null?void 0:t.retryInterval)??5e3,s=(t==null?void 0:t.errorStates)??[Me.ETransactionStatus.REJECTED,Me.ETransactionExecutionStatus.REVERTED],u=(t==null?void 0:t.successStates)??[Me.ETransactionExecutionStatus.SUCCEEDED,Me.ETransactionStatus.ACCEPTED_ON_L2,Me.ETransactionStatus.ACCEPTED_ON_L1];let l;for(;!i;){await Ss(a);try{l=await this.getTransactionStatus(n);const f=l.execution_status,p=l.finality_status;if(!p)throw new Error("waiting for transaction status");if(u.includes(f)||u.includes(p))i=!0;else if(s.includes(f)||s.includes(p)){const y=`${f}: ${p}`,m=new Error(y);throw m.response=l,o=!0,m}}catch(f){if(f instanceof Error&&o)throw f;if(r<=0)throw new Error(`waitForTransaction timed-out with retries ${this.retries}`)}r-=1}let c=null;for(;c===null;){try{c=await this.getTransactionReceipt(n)}catch{if(r<=0)throw new Error(`waitForTransaction timed-out with retries ${this.retries}`)}r-=1,await Ss(a)}return c}async getStorageAt(e,t,n=this.blockIdentifier){const r=L(e),i=y1(t),o=new se(n).identifier;return this.fetchEndpoint("starknet_getStorageAt",{contract_address:r,key:i,block_id:o})}async getClassHashAt(e,t=this.blockIdentifier){const n=L(e),r=new se(t).identifier;return this.fetchEndpoint("starknet_getClassHashAt",{block_id:r,contract_address:n})}async getClassByHash(e){return this.getClass(e)}async getClass(e,t=this.blockIdentifier){const n=L(e),r=new se(t).identifier;return this.fetchEndpoint("starknet_getClass",{class_hash:n,block_id:r}).then(this.responseParser.parseContractClassResponse)}async getClassAt(e,t=this.blockIdentifier){const n=L(e),r=new se(t).identifier;return this.fetchEndpoint("starknet_getClassAt",{block_id:r,contract_address:n}).then(this.responseParser.parseContractClassResponse)}async getCode(e,t){throw new Error("RPC does not implement getCode function")}async getContractVersion(e,t,{blockIdentifier:n=this.blockIdentifier,compiler:r=!0}={}){let i;if(e)i=await this.getClassAt(e,n);else if(t)i=await this.getClass(t,n);else throw Error("getContractVersion require contractAddress or classHash");return An(i)?r?{cairo:"1",compiler:cl(i.abi).compiler}:{cairo:"1",compiler:void 0}:{cairo:"0",compiler:"0"}}async getEstimateFee(e,t,n=this.blockIdentifier){return this.getInvokeEstimateFee(e,t,n)}async getInvokeEstimateFee(e,t,n=this.blockIdentifier){const r=new se(n).identifier,i=this.buildTransaction({type:"INVOKE_FUNCTION",...e,...t},"fee");return this.fetchEndpoint("starknet_estimateFee",{request:[i],block_id:r}).then(this.responseParser.parseFeeEstimateResponse)}async getDeclareEstimateFee(e,t,n=this.blockIdentifier){const r=new se(n).identifier,i=this.buildTransaction({type:"DECLARE",...e,...t},"fee");return this.fetchEndpoint("starknet_estimateFee",{request:[i],block_id:r}).then(this.responseParser.parseFeeEstimateResponse)}async getDeployAccountEstimateFee(e,t,n=this.blockIdentifier){const r=new se(n).identifier,i=this.buildTransaction({type:"DEPLOY_ACCOUNT",...e,...t},"fee");return this.fetchEndpoint("starknet_estimateFee",{request:[i],block_id:r}).then(this.responseParser.parseFeeEstimateResponse)}async getEstimateFeeBulk(e,{blockIdentifier:t=this.blockIdentifier,skipValidate:n=!1}){n&&console.warn("getEstimateFeeBulk RPC does not support skipValidate");const r=new se(t).identifier;return this.fetchEndpoint("starknet_estimateFee",{request:e.map(i=>this.buildTransaction(i,"fee")),block_id:r}).then(this.responseParser.parseFeeEstimateBulkResponse)}async invokeFunction(e,t){return this.fetchEndpoint("starknet_addInvokeTransaction",{invoke_transaction:{sender_address:e.contractAddress,calldata:ee.toHex(e.calldata),type:Me.ETransactionType.INVOKE,max_fee:L(t.maxFee||0),version:"0x1",signature:Nr(e.signature),nonce:L(t.nonce)}})}async declareContract({contract:e,signature:t,senderAddress:n,compiledClassHash:r},i){return An(e)?this.fetchEndpoint("starknet_addDeclareTransaction",{declare_transaction:{type:Me.ETransactionType.DECLARE,contract_class:{sierra_program:xc(e.sierra_program),contract_class_version:e.contract_class_version,entry_points_by_type:e.entry_points_by_type,abi:e.abi},compiled_class_hash:r||"",version:Zm,max_fee:L(i.maxFee||0),signature:Nr(t),sender_address:n,nonce:L(i.nonce)}}):this.fetchEndpoint("starknet_addDeclareTransaction",{declare_transaction:{type:Me.ETransactionType.DECLARE,contract_class:{program:e.program,entry_points_by_type:e.entry_points_by_type,abi:e.abi},version:Vm,max_fee:L(i.maxFee||0),signature:Nr(t),sender_address:n,nonce:L(i.nonce)}})}async deployAccountContract({classHash:e,constructorCalldata:t,addressSalt:n,signature:r},i){return this.fetchEndpoint("starknet_addDeployAccountTransaction",{deploy_account_transaction:{constructor_calldata:ee.toHex(t||[]),class_hash:L(e),contract_address_salt:L(n||0),type:Me.ETransactionType.DEPLOY_ACCOUNT,max_fee:L(i.maxFee||0),version:L(i.version||0),signature:Nr(r),nonce:L(i.nonce)}})}async callContract(e,t=this.blockIdentifier){const n=new se(t).identifier,r=await this.fetchEndpoint("starknet_call",{request:{contract_address:e.contractAddress,entry_point_selector:Ct(e.entrypoint),calldata:ee.toHex(e.calldata)},block_id:n});return this.responseParser.parseCallContractResponse(r)}async estimateMessageFee(e,t=this.blockIdentifier){const{from_address:n,to_address:r,entry_point_selector:i,payload:o}=e,a={from_address:L(n),to_address:L(r),entry_point_selector:ol(i),payload:ed(o)},s=new se(t).identifier;return this.fetchEndpoint("starknet_estimateMessageFee",{message:a,block_id:s})}async getSyncingStats(){return this.fetchEndpoint("starknet_syncing")}async getEvents(e){return this.fetchEndpoint("starknet_getEvents",{filter:e})}async getStarkName(e,t){return wd(this,e,t)}async getAddressFromStarkName(e,t){return Ed(this,e,t)}buildTransaction(e,t){const n=gd(t),r={signature:Nr(e.signature),nonce:L(e.nonce),max_fee:L(e.maxFee||0)};if(e.type==="INVOKE_FUNCTION")return{type:Me.ETransactionType.INVOKE,sender_address:e.contractAddress,calldata:ee.toHex(e.calldata),version:L(e.version||n.v1),...r};if(e.type==="DECLARE")return An(e.contract)?{type:e.type,contract_class:{...e.contract,sierra_program:xc(e.contract.sierra_program)},compiled_class_hash:e.compiledClassHash||"",sender_address:e.senderAddress,version:L(e.version||n.v2),...r}:{type:e.type,contract_class:e.contract,sender_address:e.senderAddress,version:L(e.version||n.v1),...r};if(e.type==="DEPLOY_ACCOUNT")return{type:e.type,constructor_calldata:ee.toHex(e.constructorCalldata||[]),class_hash:L(e.classHash),contract_address_salt:L(e.addressSalt||0),version:L(e.version||n.v1),...r};throw Error("RPC buildTransaction received unknown TransactionType")}},Bb=class{},Pb=class extends Bb{parseGetBlockResponse(e){return{...e,new_root:e.state_root,parent_hash:e.parent_block_hash,transactions:Object.values(e.transactions).map(t=>"transaction_hash"in t&&t.transaction_hash).filter(Boolean)}}parseGetTransactionResponse(e){if(e.status==="NOT_RECEIVED"&&e.finality_status==="NOT_RECEIVED")throw new pr;return{...e,calldata:"calldata"in e.transaction?e.transaction.calldata:[],contract_class:"contract_class"in e.transaction?e.transaction.contract_class:void 0,entry_point_selector:"entry_point_selector"in e.transaction?e.transaction.entry_point_selector:void 0,max_fee:"max_fee"in e.transaction?e.transaction.max_fee:void 0,nonce:e.transaction.nonce,sender_address:"sender_address"in e.transaction?e.transaction.sender_address:void 0,signature:"signature"in e.transaction?e.transaction.signature:void 0,transaction_hash:"transaction_hash"in e.transaction?e.transaction.transaction_hash:void 0,version:"version"in e.transaction?e.transaction.version:void 0}}parseGetTransactionReceiptResponse(e){return{...e,messages_sent:e.l2_to_l1_messages,..."revert_error"in e&&{revert_reason:e.revert_error}}}parseFeeEstimateResponse(e){if("overall_fee"in e){let t={};try{t={gas_consumed:H(e.gas_usage),gas_price:H(e.gas_price)}}catch{}return{overall_fee:H(e.overall_fee),...t}}return{overall_fee:H(e.amount)}}parseFeeEstimateBulkResponse(e){return[].concat(e).map(t=>{if("overall_fee"in t){let n={};try{n={gas_consumed:H(t.gas_usage),gas_price:H(t.gas_price)}}catch{}return{overall_fee:H(t.overall_fee),...n}}return{overall_fee:H(t.amount)}})}parseSimulateTransactionResponse(e){const t="overall_fee"in e.fee_estimation?e.fee_estimation.overall_fee:e.fee_estimation.amount;return[{transaction_trace:e.trace,fee_estimation:e.fee_estimation,suggestedMaxFee:_d(BigInt(t))}]}parseCallContractResponse(e){return{result:e.result}}parseInvokeFunctionResponse(e){return{transaction_hash:e.transaction_hash}}parseDeployContractResponse(e){return{transaction_hash:e.transaction_hash,contract_address:e.address}}parseDeclareContractResponse(e){return{transaction_hash:e.transaction_hash,class_hash:e.class_hash}}parseGetStateUpdateResponse(e){const t=Object.entries(e.state_diff.nonces).map(([r,i])=>({contract_address:r,nonce:i})),n=Object.entries(e.state_diff.storage_diffs).map(([r,i])=>({address:r,storage_entries:i}));return{...e,state_diff:{...e.state_diff,storage_diffs:n,nonces:t}}}parseContractClassResponse(e){const t=An(e)?e:Y1(e);return{...t,abi:typeof t.abi=="string"?JSON.parse(t.abi):t.abi}}},Db=/^(?:\w+:)?\/\/(\S+)$/,Ub=/^localhost[:?\d]*(?:[^:?\d]\S*)?$/,$b=/^[^\s.]+\.\S{2,}$/;function zb(e){if(!e||typeof e!="string")return!1;const t=e.match(Db);if(!t)return!1;const n=t[1];return n?!!(Ub.test(n)||$b.test(n)):!1}function Ui(e,t,n){return zb(n)?n:Dm(e,n??t)}function Mb(e){return e===void 0||Object.keys(e).length===0||Object.keys(e).length===1&&Object.entries(e).every(([t,n])=>t==="blockIdentifier"&&n===null)}var Yp={network:"SN_GOERLI",blockIdentifier:"pending"},xs=class{constructor(e=Yp){this.responseParser=new Pb,"network"in e?(this.baseUrl=xs.getNetworkFromName(e.network),this.feederGatewayUrl=Ui(this.baseUrl,"feeder_gateway"),this.gatewayUrl=Ui(this.baseUrl,"gateway")):(this.baseUrl=e.baseUrl,this.feederGatewayUrl=Ui(this.baseUrl,"feeder_gateway",e.feederGatewayUrl),this.gatewayUrl=Ui(this.baseUrl,"gateway",e.gatewayUrl)),this.chainId=(e==null?void 0:e.chainId)??xs.getChainIdFromBaseUrl(this.baseUrl),this.headers=e.headers,this.blockIdentifier=(e==null?void 0:e.blockIdentifier)||Yp.blockIdentifier}static getNetworkFromName(e){switch(e){case"SN_MAIN":case"0x534e5f4d41494e":return"https://alpha-mainnet.starknet.io";case"SN_GOERLI":case"0x534e5f474f45524c49":return"https://alpha4.starknet.io";default:throw new Error("Could not detect base url from NetworkName")}}static getChainIdFromBaseUrl(e){try{return new URL(e).host.includes("mainnet.starknet.io")?"0x534e5f4d41494e":"0x534e5f474f45524c49"}catch{return console.error(`Could not parse baseUrl: ${e}`),"0x534e5f474f45524c49"}}getFetchUrl(e){return["add_transaction"].includes(e)?this.gatewayUrl:this.feederGatewayUrl}getFetchMethod(e){return["add_transaction","call_contract","estimate_fee","estimate_message_fee","estimate_fee_bulk","simulate_transaction"].includes(e)?"POST":"GET"}getQueryString(e){return Mb(e)?"":`?${Object.entries(e).map(([n,r])=>n==="blockIdentifier"?`${new se(r).queryIdentifier}`:`${n}=${r}`).join("&")}`}getHeaders(e){return e==="POST"?{"Content-Type":"application/json",...this.headers}:this.headers}async fetchEndpoint(e,...[t,n]){const r=this.getFetchUrl(e),i=this.getFetchMethod(e),o=this.getQueryString(t),a=Dm(r,e,o);return this.fetch(a,{method:i,body:n})}async fetch(e,t){const n=Ui(this.baseUrl,"",e),r=(t==null?void 0:t.method)??"GET",i=this.getHeaders(r),o=St(t==null?void 0:t.body);try{const a=await G1(n,{method:r,body:o,headers:i}),s=await a.text();if(!a.ok){let l;try{l=Dn(s)}catch{throw new Rb(a.statusText,a.status)}throw new Ib(l.message,l.code)}return(t!=null&&t.parseAlwaysAsBigInt?M1:Dn)(s)}catch(a){throw a instanceof Error&&!(a instanceof pr)?Error(`Could not ${r} from endpoint \`${n}\`: ${a.message}`):a}}async getChainId(){return Promise.resolve(this.chainId)}async callContract({contractAddress:e,entrypoint:t,calldata:n=[]},r=this.blockIdentifier){return this.fetchEndpoint("call_contract",{blockIdentifier:r},{contract_address:e,entry_point_selector:Ct(t),calldata:ee.compile(n)}).then(this.responseParser.parseCallContractResponse)}async getBlock(e=this.blockIdentifier){return this.fetchEndpoint("get_block",{blockIdentifier:e}).then(this.responseParser.parseGetBlockResponse)}async getNonceForAddress(e,t=this.blockIdentifier){return this.fetchEndpoint("get_nonce",{contractAddress:e,blockIdentifier:t})}async getStorageAt(e,t,n=this.blockIdentifier){const r=H(t).toString(10);return this.fetchEndpoint("get_storage_at",{blockIdentifier:n,contractAddress:e,key:r})}async getTransaction(e){const t=L(e);return this.fetchEndpoint("get_transaction",{transactionHash:t}).then(n=>{if(Object.values(n).length===1)throw new pr(n.status);return this.responseParser.parseGetTransactionResponse(n)})}async getTransactionReceipt(e){const t=L(e);return this.fetchEndpoint("get_transaction_receipt",{transactionHash:t}).then(this.responseParser.parseGetTransactionReceiptResponse)}async getClassAt(e,t=this.blockIdentifier){return this.fetchEndpoint("get_full_contract",{blockIdentifier:t,contractAddress:e}).then(this.responseParser.parseContractClassResponse)}async getClassHashAt(e,t=this.blockIdentifier){return this.fetchEndpoint("get_class_hash_at",{blockIdentifier:t,contractAddress:e})}async getClassByHash(e,t=this.blockIdentifier){return this.fetchEndpoint("get_class_by_hash",{classHash:e,blockIdentifier:t}).then(this.responseParser.parseContractClassResponse)}async getCompiledClassByClassHash(e,t=this.blockIdentifier){return this.fetchEndpoint("get_compiled_class_by_class_hash",{classHash:e,blockIdentifier:t})}async getContractVersion(e,t,{blockIdentifier:n=this.blockIdentifier,compiler:r=!0}={}){let i;if(e)i=await this.getClassAt(e,n);else if(t)i=await this.getClassByHash(t,n);else throw Error("getContractVersion require contractAddress or classHash");return An(i)?r?{cairo:"1",compiler:cl(i.abi).compiler}:{cairo:"1",compiler:void 0}:{cairo:"0",compiler:"0"}}async invokeFunction(e,t){return this.fetchEndpoint("add_transaction",void 0,{type:"INVOKE_FUNCTION",sender_address:e.contractAddress,calldata:ee.compile(e.calldata??[]),signature:Tr(e.signature),nonce:L(t.nonce),max_fee:L(t.maxFee||0),version:"0x1"}).then(this.responseParser.parseInvokeFunctionResponse)}async deployAccountContract({classHash:e,constructorCalldata:t,addressSalt:n,signature:r},i){return this.fetchEndpoint("add_transaction",void 0,{type:"DEPLOY_ACCOUNT",contract_address_salt:n??W1(),constructor_calldata:ee.compile(t??[]),class_hash:L(e),max_fee:L(i.maxFee||0),version:L(i.version||0),nonce:L(i.nonce),signature:Tr(r)}).then(this.responseParser.parseDeployContractResponse)}async declareContract({senderAddress:e,contract:t,signature:n,compiledClassHash:r},i){return An(t)?this.fetchEndpoint("add_transaction",void 0,{type:"DECLARE",sender_address:e,compiled_class_hash:r,contract_class:t,nonce:L(i.nonce),signature:Tr(n),max_fee:L(i.maxFee||0),version:L(pd)}).then(this.responseParser.parseDeclareContractResponse):this.fetchEndpoint("add_transaction",void 0,{type:"DECLARE",contract_class:t,nonce:L(i.nonce),signature:Tr(n),sender_address:e,max_fee:L(i.maxFee||0),version:L(hd)}).then(this.responseParser.parseDeclareContractResponse)}async getEstimateFee(e,t,n=this.blockIdentifier,r=!1){return this.getInvokeEstimateFee(e,t,n,r)}async getInvokeEstimateFee(e,t,n=this.blockIdentifier,r=!1){const i=this.buildTransaction({type:"INVOKE_FUNCTION",...e,...t},"fee");return this.fetchEndpoint("estimate_fee",{blockIdentifier:n,skipValidate:r},i).then(this.responseParser.parseFeeEstimateResponse)}async getDeclareEstimateFee(e,t,n=this.blockIdentifier,r=!1){const i=this.buildTransaction({type:"DECLARE",...e,...t},"fee");return this.fetchEndpoint("estimate_fee",{blockIdentifier:n,skipValidate:r},i).then(this.responseParser.parseFeeEstimateResponse)}async getDeployAccountEstimateFee(e,t,n=this.blockIdentifier,r=!1){const i=this.buildTransaction({type:"DEPLOY_ACCOUNT",...e,...t},"fee");return this.fetchEndpoint("estimate_fee",{blockIdentifier:n,skipValidate:r},i).then(this.responseParser.parseFeeEstimateResponse)}async getEstimateFeeBulk(e,{blockIdentifier:t=this.blockIdentifier,skipValidate:n=!1}){const r=e.map(i=>this.buildTransaction(i,"fee"));return this.fetchEndpoint("estimate_fee_bulk",{blockIdentifier:t,skipValidate:n},r).then(this.responseParser.parseFeeEstimateBulkResponse)}async getCode(e,t=this.blockIdentifier){return this.fetchEndpoint("get_code",{contractAddress:e,blockIdentifier:t})}async waitForTransaction(e,t){let n,r=!1,i=0;const o=(t==null?void 0:t.retryInterval)??5e3,a=(t==null?void 0:t.errorStates)??["REJECTED","NOT_RECEIVED","REVERTED"],s=(t==null?void 0:t.successStates)??["SUCCEEDED","ACCEPTED_ON_L1","ACCEPTED_ON_L2"];for(;!r;)if(await Ss(o),n=await this.getTransactionStatus(e),n.finality_status==="NOT_RECEIVED"&&i<3)i+=1;else if(s.includes(n.finality_status)||s.includes(n.execution_status))r=!0;else if(a.includes(n.finality_status)||a.includes(n.execution_status)){let l;n.tx_failure_reason?l=`${n.tx_status}: ${n.tx_failure_reason.code} +${n.tx_failure_reason.error_message}`:n.tx_revert_reason?l=`${n.tx_status}: ${n.tx_revert_reason}`:l=n.tx_status;const c=new Error(l);throw c.response=n,c}return await this.getTransactionReceipt(e)}async getTransactionStatus(e){const t=L(e);return this.fetchEndpoint("get_transaction_status",{transactionHash:t})}async getContractAddresses(){return this.fetchEndpoint("get_contract_addresses")}async getTransactionTrace(e){const t=L(e);return this.fetchEndpoint("get_transaction_trace",{transactionHash:t})}async estimateMessageFee({from_address:e,to_address:t,entry_point_selector:n,payload:r},i=this.blockIdentifier){const o={from_address:w1(e),to_address:Jf(t),entry_point_selector:ol(n),payload:ed(r)};return this.fetchEndpoint("estimate_message_fee",{blockIdentifier:i},o)}async getSimulateTransaction(e,{blockIdentifier:t=this.blockIdentifier,skipValidate:n=!1,skipExecute:r=!1}){e.length>1&&console.warn("Sequencer simulate process only first element from invocations list"),r&&console.warn("Sequencer can't skip account __execute__");const i=this.buildTransaction(e[0]);return this.fetchEndpoint("simulate_transaction",{blockIdentifier:t,skipValidate:n??!1},i).then(this.responseParser.parseSimulateTransactionResponse)}async getStateUpdate(e=this.blockIdentifier){const t=new se(e).sequencerIdentifier;return this.fetchEndpoint("get_state_update",{...t}).then(this.responseParser.parseGetStateUpdateResponse)}async getBlockTraces(e=this.blockIdentifier){const t=new se(e).sequencerIdentifier;return this.fetchEndpoint("get_block_traces",{...t})}async getStarkName(e,t){return wd(this,e,t)}async getAddressFromStarkName(e,t){return Ed(this,e,t)}buildTransaction(e,t){const n=gd(t),r={signature:Tr(e.signature),nonce:L(e.nonce)};if(e.type==="INVOKE_FUNCTION")return{type:e.type,sender_address:e.contractAddress,calldata:ee.compile(e.calldata??[]),version:L(e.version||n.v1),...r};if(e.type==="DECLARE")return An(e.contract)?{type:e.type,contract_class:e.contract,compiled_class_hash:e.compiledClassHash,sender_address:e.senderAddress,version:L(e.version||n.v2),...r}:{type:e.type,contract_class:e.contract,sender_address:e.senderAddress,version:L(e.version||n.v1),...r};if(e.type==="DEPLOY_ACCOUNT")return{type:e.type,constructor_calldata:ee.compile(e.constructorCalldata||[]),class_hash:L(e.classHash),contract_address_salt:L(e.addressSalt||0),version:L(e.version||n.v1),...r};throw Error("Sequencer buildTransaction received unknown TransactionType")}},e_=class{constructor(e){e instanceof e_?this.provider=e.provider:e instanceof Ha||e instanceof xs?this.provider=e:e&&"rpc"in e?this.provider=new Ha(e.rpc):e&&"sequencer"in e?this.provider=new xs(e.sequencer):this.provider=new Ha}async getChainId(){return this.provider.getChainId()}async getBlock(e){return this.provider.getBlock(e)}async getClassAt(e,t){return this.provider.getClassAt(e,t)}async getClassHashAt(e,t){return this.provider.getClassHashAt(e,t)}getClassByHash(e){return this.provider.getClassByHash(e)}async getEstimateFee(e,t,n){return this.provider.getEstimateFee(e,t,n)}async getInvokeEstimateFee(e,t,n,r){return this.provider.getInvokeEstimateFee(e,t,n,r)}async getEstimateFeeBulk(e,t){return this.provider.getEstimateFeeBulk(e,t)}async getNonceForAddress(e,t){return this.provider.getNonceForAddress(e,t)}async getStorageAt(e,t,n){return this.provider.getStorageAt(e,t,n)}async getTransaction(e){return this.provider.getTransaction(e)}async getTransactionReceipt(e){return this.provider.getTransactionReceipt(e)}async callContract(e,t){return this.provider.callContract(e,t)}async invokeFunction(e,t){return this.provider.invokeFunction(e,t)}async deployAccountContract(e,t){return this.provider.deployAccountContract(e,t)}async declareContract(e,t){return this.provider.declareContract(e,t)}async getDeclareEstimateFee(e,t,n,r){return this.provider.getDeclareEstimateFee(e,t,n,r)}getDeployAccountEstimateFee(e,t,n,r){return this.provider.getDeployAccountEstimateFee(e,t,n,r)}async getCode(e,t){return this.provider.getCode(e,t)}async waitForTransaction(e,t){return this.provider.waitForTransaction(e,t)}async getSimulateTransaction(e,t){return this.provider.getSimulateTransaction(e,t)}async getStateUpdate(e){return this.provider.getStateUpdate(e)}async getStarkName(e,t){return wd(this,e,t)}async getAddressFromStarkName(e,t){return Ed(this,e,t)}async getContractVersion(e,t,n){return this.provider.getContractVersion(e,t,n)}},Hb={};pe(Hb,{fromCallsToExecuteCalldata:()=>Sd,fromCallsToExecuteCalldataWithNonce:()=>Fb,fromCallsToExecuteCalldata_cairo1:()=>n_,getExecuteCalldata:()=>Vb,transformCallsToMulticallArrays:()=>t_,transformCallsToMulticallArrays_cairo1:()=>jb});var t_=e=>{const t=[],n=[];return e.forEach(r=>{const i=ee.compile(r.calldata||[]);t.push({to:H(r.contractAddress).toString(10),selector:H(Ct(r.entrypoint)).toString(10),data_offset:n.length.toString(),data_len:i.length.toString()}),n.push(...i)}),{callArray:t,calldata:ee.compile({calldata:n})}},Sd=e=>{const{callArray:t,calldata:n}=t_(e);return[...ee.compile({callArray:t}),...n]},Fb=(e,t)=>[...Sd(e),H(t).toString()],jb=e=>e.map(n=>({to:H(n.contractAddress).toString(10),selector:H(Ct(n.entrypoint)).toString(10),calldata:ee.compile(n.calldata||[])})),n_=e=>{const t=e.map(n=>({contractAddress:n.contractAddress,entrypoint:n.entrypoint,calldata:Array.isArray(n.calldata)&&"__compiled__"in n.calldata?n.calldata:ee.compile(n.calldata)}));return ee.compile({orderCalls:t})},Vb=(e,t="0")=>t==="1"?n_(e):Sd(e),Zb={};pe(Zb,{encodeData:()=>l_,encodeType:()=>a_,encodeValue:()=>kd,getDependencies:()=>xd,getMessageHash:()=>Yb,getStructHash:()=>Bo,getTypeHash:()=>s_,isMerkleTreeType:()=>o_,prepareSelector:()=>i_});var Kb={};pe(Kb,{MerkleTree:()=>Yr,proofMerklePath:()=>r_});var Yr=class{constructor(e){this.branches=[],this.leaves=e,this.root=this.build(e)}build(e){if(e.length===1)return e[0];e.length!==this.leaves.length&&this.branches.push(e);const t=[];for(let n=0;ni>=o?1:-1);return el(n,r)}getProof(e,t=this.leaves,n=[]){const r=t.indexOf(e);if(r===-1)throw new Error("leaf not found");if(t.length===1)return n;const i=r%2===0,o=(i?t[r+1]:t[r-1])??"0x0",a=[...n,o],s=this.leaves.length===t.length?-1:this.branches.findIndex(l=>l.length===t.length),u=this.branches[s+1]??[this.root];return this.getProof(Yr.hash(i?e:o,i?o:e),u,a)}};function r_(e,t,n){if(n.length===0)return e===t;const[r,...i]=n;return r_(e,Yr.hash(t,r),i)}function Wb(e){try{return L(e)}catch{if(typeof e=="string")return L(Mn(e));throw new Error(`Invalid BigNumberish: ${e}`)}}var Gb=e=>{const t=e;return!!(t.types&&t.primaryType&&t.message)};function i_(e){return kt(e)?e:Ct(e)}function o_(e){return e.type==="merkletree"}var xd=(e,t,n=[])=>(t[t.length-1]==="*"&&(t=t.slice(0,-1)),n.includes(t)||!e[t]?n:[t,...e[t].reduce((r,i)=>[...r,...xd(e,i.type,r).filter(o=>!r.includes(o))],[])]);function qb(e,t){if(t.parent&&t.key){const r=e[t.parent].find(o=>o.name===t.key);if(!o_(r))throw new Error(`${t.key} is not a merkle tree`);if(r.contains.endsWith("*"))throw new Error(`Merkle tree contain property must not be an array but was given ${t.key}`);return r.contains}return"raw"}var a_=(e,t)=>{const[n,...r]=xd(e,t);return(n?[n,...r.sort()]:[]).map(o=>`${o}(${e[o].map(a=>`${a.name}:${a.type}`)})`).join("")},s_=(e,t)=>Ct(a_(e,t)),kd=(e,t,n,r={})=>{if(e[t])return[t,Bo(e,t,n)];if(Object.keys(e).map(i=>`${i}*`).includes(t)){const i=n.map(o=>Bo(e,t.slice(0,-1),o));return[t,Le(i)]}if(t==="merkletree"){const i=qb(e,r),o=n.map(s=>kd(e,i,s)[1]),{root:a}=new Yr(o);return["felt",a]}return t==="felt*"?["felt*",Le(n)]:t==="selector"?["felt",i_(n)]:[t,Wb(n)]},l_=(e,t,n)=>{const[r,i]=e[t].reduce(([o,a],s)=>{if(n[s.name]===void 0||n[s.name]===null)throw new Error(`Cannot encode data: missing data for '${s.name}'`);const u=n[s.name],[l,c]=kd(e,s.type,u,{parent:t,key:s.name});return[[...o,l],[...a,c]]},[["felt"],[s_(e,t)]]);return[r,i]},Bo=(e,t,n)=>Le(l_(e,t,n)[1]),Yb=(e,t)=>{if(!Gb(e))throw new Error("Typed data does not match JSON schema");const n=[Mn("StarkNet Message"),Bo(e.types,"StarkNetDomain",e.domain),t,Bo(e.types,e.primaryType,e.message)];return Le(n)};new e_({rpc:{default:!0}});var Xb={};pe(Xb,{getAbiEvents:()=>Qb,parseEvents:()=>Jb});function Qb(e){return e.filter(t=>t.type==="event"&&(t.size||t.kind!=="enum")).reduce((t,n)=>{const r=n.name.slice(n.name.lastIndexOf(":")+1),i={...n};return i.name=r,{...t,[Ue(yi(Si(r)).toString(16))]:i}},{})}function Jb(e,t,n,r){return e.flat().reduce((o,a)=>{var y,m;const s=t[a.keys[0]];if(!s)return o;const u={};u[s.name]={},a.keys.shift();const l=a.keys[Symbol.iterator](),c=a.data[Symbol.iterator](),f=((y=s.members)==null?void 0:y.filter(_=>_.kind==="key"))||s.keys,p=((m=s.members)==null?void 0:m.filter(_=>_.kind==="data"))||s.data;return f.forEach(_=>{u[s.name][_.name]=Sc(l,_,n,r,u[s.name])}),p.forEach(_=>{u[s.name][_.name]=Sc(c,_,n,r,u[s.name])}),o.push(u),o},[])}const jn=window.Telegram.WebApp;new Ha({nodeUrl:"https://starknet-sepolia.public.blastapi.io/rpc/v0_7"});function eA(){const[e,t]=G.useState(!1);G.useState("");const[n,r]=G.useState(null),[i,o]=G.useState(null),{unityProvider:a,isLoaded:s,loadingProgression:u,addEventListener:l,removeEventListener:c,sendMessage:f}=So.useUnityContext({productName:"Focus Bear",productVersion:"1.0.0",companyName:"Arism Lab",loaderUrl:"assets/BuildGame.loader.js",dataUrl:"assets/BuildGame.data.unityweb",frameworkUrl:"assets/BuildGame.framework.js.unityweb",codeUrl:"assets/BuildGame.wasm.unityweb",streamingAssetsUrl:"StreamingAssets"}),[p,y]=G.useState(window.devicePixelRatio),m=()=>{const g="0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003",v=K1.randomAddress();console.log("AX_ACCOUNT_PRIVATE_KEY=",v),r(v);const S=z1.starkCurve.getStarkKey(v);console.log("AX_ACCOUNT_PUBLIC_KEY=",S);const x=ee.compile({owner:S,guardian:"0"}),E=$1.calculateContractAddressFromHash(S,g,x,0);o(E),console.log("Precalculated account address=",E)},_=G.useCallback(g=>{f("AddressLayout","SetAddress",g)},[f]),w=G.useCallback(()=>{const g={reason:"Securely store your private key using biometric authentication"};jn.BiometricManager.requestAccess(g,v=>{v?(m(),jn.BiometricManager.authenticate({reason:"Authenticate to store private key"},(S,x)=>{if(S){const E=n;jn.BiometricManager.updateBiometricToken(E,k=>{k?_(i):d("Failed to create the Address.")})}else d("Authentication failed.")}),t(!0)):(d("Access Denied. Fail to create Account"),t(!1))})},[]),d=G.useCallback(g=>{f("DialogCanvas","SetMessageText",g)},[f]),h=G.useCallback(()=>{jn.BiometricManager.authenticate({reason:"Authenticate to retrieve private key"},(g,v)=>{if(g){const S=v.toString();d(S)}else console.error("Authentication failed.")})},[d]);return G.useEffect(()=>{f("MainGameCanvas","HideMainScreen")},[e]),G.useEffect(()=>(l("OnCreateWalletButtonClicked",w),()=>{c("OnCreateWalletButtonClicked",w)}),[l,c,w]),G.useEffect(()=>(l("OnExportKeyButtonClicked",h),()=>{c("OnExportKeyButtonClicked",h)}),[l,c,h]),G.useEffect(function(){jn.ready(),jn.isClosingConfirmationEnabled=!0,jn.BiometricManager.init(()=>{})},[]),G.useEffect(()=>{const g=()=>{y(window.devicePixelRatio)},v=window.matchMedia(`screen and (resolution: ${p}dppx)`);return v.addEventListener("change",g),()=>{v.removeEventListener("change",g)}},[p]),sn.jsxs("div",{id:"unity-container",className:"unity-responsive",children:[sn.jsx(So.Unity,{unityProvider:a,style:{width:"100%",height:"100%"},devicePixelRatio:p}),!s&&sn.jsxs("div",{id:"unity-loading-bar",children:[sn.jsx("div",{id:"unity-logo"}),sn.jsx("div",{id:"unity-progress-bar-empty",children:sn.jsx("div",{id:"unity-progress-bar-full",style:{width:`${u*100}%`}})})]})]})}uu.createRoot(document.getElementById("root")).render(sn.jsx(C_.StrictMode,{children:sn.jsx(eA,{})}))});export default tA(); diff --git a/index.html b/index.html index 91cf294..4394abb 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ Focus Bear - +