@edgex-web/components 1.0.0-beta.19 → 1.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ccip-CsGbJ1jk.mjs → ccip-BSdh--0v.mjs} +2 -2
- package/dist/{ccip-CsGbJ1jk.mjs.map → ccip-BSdh--0v.mjs.map} +1 -1
- package/dist/components/shared/components/selector/index.d.ts +1 -1
- package/dist/components/shared/components/selector/index.d.ts.map +1 -1
- package/dist/components/shared/components/selector/types/index.d.ts +1 -1
- package/dist/components/shared/components/selector/types/index.d.ts.map +1 -1
- package/dist/{index-CRbiovGp.mjs → index-B7yHG6T7.mjs} +2009 -2011
- package/dist/{index-CRbiovGp.mjs.map → index-B7yHG6T7.mjs.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +60 -60
- package/dist/index.umd.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/token.d.ts +1 -0
- package/dist/types/token.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(le,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],g):(le=typeof globalThis<"u"?globalThis:le||self,g(le.EdgeXComponents={},le.React,le.ReactDOM))})(this,function(le,g,Ke){"use strict";var
|
|
1
|
+
(function(le,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],g):(le=typeof globalThis<"u"?globalThis:le||self,g(le.EdgeXComponents={},le.React,le.ReactDOM))})(this,function(le,g,Ke){"use strict";var FP=Object.defineProperty;var RP=(le,g,Ke)=>g in le?FP(le,g,{enumerable:!0,configurable:!0,writable:!0,value:Ke}):le[g]=Ke;var ms=(le,g,Ke)=>RP(le,typeof g!="symbol"?g+"":g,Ke);function eu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const U=eu(g),Qr=eu(Ke);function rb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zi={exports:{}},eo={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var tu;function
|
|
9
|
+
*/var tu;function ob(){if(tu)return eo;tu=1;var e=g,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(l,a,c){var u,d={},p=null,f=null;c!==void 0&&(p=""+c),a.key!==void 0&&(p=""+a.key),a.ref!==void 0&&(f=a.ref);for(u in a)r.call(a,u)&&!s.hasOwnProperty(u)&&(d[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)d[u]===void 0&&(d[u]=a[u]);return{$$typeof:t,type:l,key:p,ref:f,props:d,_owner:o.current}}return eo.Fragment=n,eo.jsx=i,eo.jsxs=i,eo}var to={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,62 +14,62 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var nu;function
|
|
17
|
+
*/var nu;function sb(){return nu||(nu=1,process.env.NODE_ENV!=="production"&&function(){var e=g,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),h=Symbol.iterator,m="@@iterator";function x(R){if(R===null||typeof R!="object")return null;var K=h&&R[h]||R[m];return typeof K=="function"?K:null}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(R){{for(var K=arguments.length,J=new Array(K>1?K-1:0),ie=1;ie<K;ie++)J[ie-1]=arguments[ie];P("error",R,J)}}function P(R,K,J){{var ie=T.ReactDebugCurrentFrame,ge=ie.getStackAddendum();ge!==""&&(K+="%s",J=J.concat([ge]));var Ee=J.map(function(pe){return String(pe)});Ee.unshift("Warning: "+K),Function.prototype.apply.call(console[R],console,Ee)}}var A=!1,k=!1,B=!1,F=!1,b=!1,v;v=Symbol.for("react.module.reference");function E(R){return!!(typeof R=="string"||typeof R=="function"||R===r||R===s||b||R===o||R===c||R===u||F||R===f||A||k||B||typeof R=="object"&&R!==null&&(R.$$typeof===p||R.$$typeof===d||R.$$typeof===i||R.$$typeof===l||R.$$typeof===a||R.$$typeof===v||R.getModuleId!==void 0))}function M(R,K,J){var ie=R.displayName;if(ie)return ie;var ge=K.displayName||K.name||"";return ge!==""?J+"("+ge+")":J}function $(R){return R.displayName||"Context"}function C(R){if(R==null)return null;if(typeof R.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof R=="function")return R.displayName||R.name||null;if(typeof R=="string")return R;switch(R){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof R=="object")switch(R.$$typeof){case l:var K=R;return $(K)+".Consumer";case i:var J=R;return $(J._context)+".Provider";case a:return M(R,R.render,"ForwardRef");case d:var ie=R.displayName||null;return ie!==null?ie:C(R.type)||"Memo";case p:{var ge=R,Ee=ge._payload,pe=ge._init;try{return C(pe(Ee))}catch{return null}}}return null}var D=Object.assign,y=0,O,I,S,L,j,z,W;function _(){}_.__reactDisabledLog=!0;function Z(){{if(y===0){O=console.log,I=console.info,S=console.warn,L=console.error,j=console.group,z=console.groupCollapsed,W=console.groupEnd;var R={configurable:!0,enumerable:!0,value:_,writable:!0};Object.defineProperties(console,{info:R,log:R,warn:R,error:R,group:R,groupCollapsed:R,groupEnd:R})}y++}}function q(){{if(y--,y===0){var R={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},R,{value:O}),info:D({},R,{value:I}),warn:D({},R,{value:S}),error:D({},R,{value:L}),group:D({},R,{value:j}),groupCollapsed:D({},R,{value:z}),groupEnd:D({},R,{value:W})})}y<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=T.ReactCurrentDispatcher,ee;function fe(R,K,J){{if(ee===void 0)try{throw Error()}catch(ge){var ie=ge.stack.trim().match(/\n( *(at )?)/);ee=ie&&ie[1]||""}return`
|
|
18
18
|
`+ee+R}}var me=!1,ye;{var ve=typeof WeakMap=="function"?WeakMap:Map;ye=new ve}function oe(R,K){if(!R||me)return"";{var J=ye.get(R);if(J!==void 0)return J}var ie;me=!0;var ge=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ee;Ee=H.current,H.current=null,Z();try{if(K){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ct){ie=ct}Reflect.construct(R,[],pe)}else{try{pe.call()}catch(ct){ie=ct}R.call(pe.prototype)}}else{try{throw Error()}catch(ct){ie=ct}R()}}catch(ct){if(ct&&ie&&typeof ct.stack=="string"){for(var de=ct.stack.split(`
|
|
19
19
|
`),qe=ie.stack.split(`
|
|
20
|
-
`),
|
|
21
|
-
`+de[
|
|
20
|
+
`),Ie=de.length-1,De=qe.length-1;Ie>=1&&De>=0&&de[Ie]!==qe[De];)De--;for(;Ie>=1&&De>=0;Ie--,De--)if(de[Ie]!==qe[De]){if(Ie!==1||De!==1)do if(Ie--,De--,De<0||de[Ie]!==qe[De]){var Ot=`
|
|
21
|
+
`+de[Ie].replace(" at new "," at ");return R.displayName&&Ot.includes("<anonymous>")&&(Ot=Ot.replace("<anonymous>",R.displayName)),typeof R=="function"&&ye.set(R,Ot),Ot}while(Ie>=1&&De>=0);break}}}finally{me=!1,H.current=Ee,q(),Error.prepareStackTrace=ge}var Jr=R?R.displayName||R.name:"",hr=Jr?fe(Jr):"";return typeof R=="function"&&ye.set(R,hr),hr}function V(R,K,J){return oe(R,!1)}function X(R){var K=R.prototype;return!!(K&&K.isReactComponent)}function Q(R,K,J){if(R==null)return"";if(typeof R=="function")return oe(R,X(R));if(typeof R=="string")return fe(R);switch(R){case c:return fe("Suspense");case u:return fe("SuspenseList")}if(typeof R=="object")switch(R.$$typeof){case a:return V(R.render);case d:return Q(R.type,K,J);case p:{var ie=R,ge=ie._payload,Ee=ie._init;try{return Q(Ee(ge),K,J)}catch{}}}return""}var we=Object.prototype.hasOwnProperty,Y={},se=T.ReactDebugCurrentFrame;function ue(R){if(R){var K=R._owner,J=Q(R.type,R._source,K?K.type:null);se.setExtraStackFrame(J)}else se.setExtraStackFrame(null)}function Se(R,K,J,ie,ge){{var Ee=Function.call.bind(we);for(var pe in R)if(Ee(R,pe)){var de=void 0;try{if(typeof R[pe]!="function"){var qe=Error((ie||"React class")+": "+J+" type `"+pe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof R[pe]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw qe.name="Invariant Violation",qe}de=R[pe](K,pe,ie,J,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ie){de=Ie}de&&!(de instanceof Error)&&(ue(ge),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",ie||"React class",J,pe,typeof de),ue(null)),de instanceof Error&&!(de.message in Y)&&(Y[de.message]=!0,ue(ge),w("Failed %s type: %s",J,de.message),ue(null))}}}var Me=Array.isArray;function xe(R){return Me(R)}function Ae(R){{var K=typeof Symbol=="function"&&Symbol.toStringTag,J=K&&R[Symbol.toStringTag]||R.constructor.name||"Object";return J}}function lt(R){try{return Ge(R),!1}catch{return!0}}function Ge(R){return""+R}function Vt(R){if(lt(R))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ae(R)),Ge(R)}var Vn=T.ReactCurrentOwner,Ht={key:!0,ref:!0,__self:!0,__source:!0},qm,Km;function wP(R){if(we.call(R,"ref")){var K=Object.getOwnPropertyDescriptor(R,"ref").get;if(K&&K.isReactWarning)return!1}return R.ref!==void 0}function xP(R){if(we.call(R,"key")){var K=Object.getOwnPropertyDescriptor(R,"key").get;if(K&&K.isReactWarning)return!1}return R.key!==void 0}function EP(R,K){typeof R.ref=="string"&&Vn.current}function SP(R,K){{var J=function(){qm||(qm=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};J.isReactWarning=!0,Object.defineProperty(R,"key",{get:J,configurable:!0})}}function PP(R,K){{var J=function(){Km||(Km=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};J.isReactWarning=!0,Object.defineProperty(R,"ref",{get:J,configurable:!0})}}var TP=function(R,K,J,ie,ge,Ee,pe){var de={$$typeof:t,type:R,key:K,ref:J,props:pe,_owner:Ee};return de._store={},Object.defineProperty(de._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(de,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ie}),Object.defineProperty(de,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ge}),Object.freeze&&(Object.freeze(de.props),Object.freeze(de)),de};function AP(R,K,J,ie,ge){{var Ee,pe={},de=null,qe=null;J!==void 0&&(Vt(J),de=""+J),xP(K)&&(Vt(K.key),de=""+K.key),wP(K)&&(qe=K.ref,EP(K,ge));for(Ee in K)we.call(K,Ee)&&!Ht.hasOwnProperty(Ee)&&(pe[Ee]=K[Ee]);if(R&&R.defaultProps){var Ie=R.defaultProps;for(Ee in Ie)pe[Ee]===void 0&&(pe[Ee]=Ie[Ee])}if(de||qe){var De=typeof R=="function"?R.displayName||R.name||"Unknown":R;de&&SP(pe,De),qe&&PP(pe,De)}return TP(R,de,qe,ge,ie,Vn.current,pe)}}var Kc=T.ReactCurrentOwner,Zm=T.ReactDebugCurrentFrame;function Xr(R){if(R){var K=R._owner,J=Q(R.type,R._source,K?K.type:null);Zm.setExtraStackFrame(J)}else Zm.setExtraStackFrame(null)}var Zc;Zc=!1;function Yc(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function Ym(){{if(Kc.current){var R=C(Kc.current.type);if(R)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+R+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+R+"`."}return""}}function NP(R){return""}var Xm={};function CP(R){{var K=Ym();if(!K){var J=typeof R=="string"?R:R.displayName||R.name;J&&(K=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+J+">.")}return K}}function
|
|
25
|
+
Check the top-level render call using <`+J+">.")}return K}}function Jm(R,K){{if(!R._store||R._store.validated||R.key!=null)return;R._store.validated=!0;var J=CP(K);if(Xm[J])return;Xm[J]=!0;var ie="";R&&R._owner&&R._owner!==Kc.current&&(ie=" It was passed a child from "+C(R._owner.type)+"."),Xr(R),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',J,ie),Xr(null)}}function Qm(R,K){{if(typeof R!="object")return;if(xe(R))for(var J=0;J<R.length;J++){var ie=R[J];Yc(ie)&&Jm(ie,K)}else if(Yc(R))R._store&&(R._store.validated=!0);else if(R){var ge=x(R);if(typeof ge=="function"&&ge!==R.entries)for(var Ee=ge.call(R),pe;!(pe=Ee.next()).done;)Yc(pe.value)&&Jm(pe.value,K)}}}function OP(R){{var K=R.type;if(K==null||typeof K=="string")return;var J;if(typeof K=="function")J=K.propTypes;else if(typeof K=="object"&&(K.$$typeof===a||K.$$typeof===d))J=K.propTypes;else return;if(J){var ie=C(K);Se(J,R.props,"prop",ie,R)}else if(K.PropTypes!==void 0&&!Zc){Zc=!0;var ge=C(K);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ge||"Unknown")}typeof K.getDefaultProps=="function"&&!K.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $P(R){{for(var K=Object.keys(R.props),J=0;J<K.length;J++){var ie=K[J];if(ie!=="children"&&ie!=="key"){Xr(R),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ie),Xr(null);break}}R.ref!==null&&(Xr(R),w("Invalid attribute `ref` supplied to `React.Fragment`."),Xr(null))}}var eb={};function tb(R,K,J,ie,ge,Ee){{var pe=E(R);if(!pe){var de="";(R===void 0||typeof R=="object"&&R!==null&&Object.keys(R).length===0)&&(de+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var qe=NP();qe?de+=qe:de+=Ym();var Ie;R===null?Ie="null":xe(R)?Ie="array":R!==void 0&&R.$$typeof===t?(Ie="<"+(C(R.type)||"Unknown")+" />",de=" Did you accidentally export a JSX literal instead of a component?"):Ie=typeof R,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ie,de)}var De=AP(R,K,J,ge,Ee);if(De==null)return De;if(pe){var Ot=K.children;if(Ot!==void 0)if(ie)if(xe(Ot)){for(var Jr=0;Jr<Ot.length;Jr++)Qm(Ot[Jr],R);Object.freeze&&Object.freeze(Ot)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Qm(Ot,R)}if(we.call(K,"key")){var hr=C(R),ct=Object.keys(K).filter(function(BP){return BP!=="key"}),Xc=ct.length>0?"{key: someKey, "+ct.join(": ..., ")+": ...}":"{key: someKey}";if(!eb[hr+Xc]){var LP=ct.length>0?"{"+ct.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,Xc,hr,
|
|
30
|
+
<%s key={someKey} {...props} />`,Xc,hr,LP,hr),eb[hr+Xc]=!0}}return R===r?$P(De):OP(De),De}}function MP(R,K,J){return tb(R,K,J,!0)}function IP(R,K,J){return tb(R,K,J,!1)}var DP=IP,kP=MP;to.Fragment=r,to.jsx=DP,to.jsxs=kP}()),to}process.env.NODE_ENV==="production"?zi.exports=ob():zi.exports=sb();var N=zi.exports;const ib={deposit:{title:"Einzahlen",chain:"Chain",asset:"Asset",amount:"Betrag",available:"Verfügbar",equity:"Eigenkapital",confirmDeposit:"Einzahlung bestätigen",switchNetwork:"Netzwerk wechseln",max:"Max.",fast:"Schnell",standard:"Standard",arrivalTime:"Ankunftszeit",ethCrossChainDepositInitiated:"ETH-Cross-Chain-Einzahlung initiiert. Voraussichtliche Ankunft in 2 bis 5 Minuten.",minDeposit:"Mindestbetrag der Einzahlung",minDepositParsed:"Min. {{amount}} {{token}} einzahlen",maxDeposit:"Maximaler Einzahlungsbetrag",depositTipFor25w:"Der Höchstbetrag pro Einzahlung beträgt 200.000. Wenn deine Einzahlung 200.000 übersteigt, verwende bitte die Ethereum-Chain.",depositAllTip:`Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt.
|
|
31
31
|
Wenn der Einzahlungsbetrag 200.000 übersteigt, kann es zu einer Verzögerung der Ankunftszeit kommen. Bitte hab etwas Geduld.`,maxDepositSplitTip:"Der Höchstbetrag pro Einzahlung beträgt 200.000. Falls du mehr als 200.000 einzahlen musst, teile den Betrag bitte in mehrere Einzahlungen auf.",spotDepositNotSupportedTip:"Einzahlungen werden nicht unterstützt. Bitte zahle auf das Perpetual-Konto ein und überweise den Betrag anschließend.",crossChainDepositFeeTip:`Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt.
|
|
32
|
-
Bei Chain-übergreifenden Einzahlungen musst du die Edge-Gas-Gebühr zahlen. Der gutgeschriebene Betrag wird etwas geringer sein als dein Einzahlungsbetrag.`,addressUpdatedNotice:"Hinweis: Deine Einzahlungsadresse wurde aktualisiert. Verwende die neue Adresse. Die alte Adresse funktioniert nur während der Übergangszeit und wird dann deaktiviert. Wenn sie an einem anderen Ort gespeichert wurde, aktualisiere sie umgehend.",enableSystemProWithToken:"{{token}} auf {{network}} aktivieren",enableTokenDesc:"Bei der ersten Einzahlung auf {{network}} musst du {{token}} aktivieren.",enableWithToken:"{{token}} aktivieren",arrivaltimeTooltip1:"Die Gelder kommen in etwa {{v}} Minuten an (nach Erreichen von {{v1}} Blockbestätigungen).",arrivaltimeTooltip2:"Die geschätzte Zeit wird auf der Grundlage historischer Daten berechnet und dient nur als Referenz. Eine Überlastung des Netzwerks kann zu längeren tatsächlichen Ankunftszeiten führen.",arrivalEstimated:"≈ {{v}} Minuten",feeRateTooltip:"Geschätzte Gebühr, tatsächliche Abzug maßgeblich.",availableDesc:"Der maximale Betrag, den du einzahlen kannst. Wenn das verfügbare Guthaben 0 oder negativ ist, können keine Einzahlungen vorgenommen werden.",noPrivateKeyWalletWarning:"Verwende für Einzahlungen keine schlüssellosen Wallets. Einzahlungen mit einer schlüssellosen Wallet können zu einem unwiderruflichen Verlust der Gelder führen.",layerZeroDepositTip:"Das System wird deine Einzahlung über LayerZero auf Basis der tatsächlichen Einzahlungsbedingungen abschließen.",layerZeroDepositTipExceedPool:"Da der Einzahlungsbetrag den Pool übersteigt, wird deine Einzahlung über LayerZero abgewickelt.",layerZeroDepositTipGte200k:"Da der Einzahlungsbetrag größer als oder gleich 200.000 USDT ist, wird deine Einzahlung über LayerZero abgewickelt.",layerZeroDepositButton:"Mit LayerZero einzahlen",defaultSpotNotice:"Standardeinzahlungen werden dem Spot-Konto gutgeschrieben.",defaultSpotToPerpNotice:"Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt. Standardeinzahlungen werden dem Spot-Konto gutgeschrieben. Überweise Gelder vom Spot-Konto auf das Futures-Konto, um das Futures-Konto zu finanzieren.",depositModeSwitchWarning:"Wechseln Sie den Einzahlungsmodus nicht nach Start oder während der Einzahlung, sonst ändert sich die Einzahlungsmethode.",connectedWalletTitle:"Einzahlung von einer verbundenen Wallet",connectedWalletDesc:"Verwende MetaMask, WalletConnect oder einen anderen Anbieter, um Geld von deiner Krypto-Wallet einzuzahlen",externalWalletTitle:"Einzahlung von externem Konto",externalWalletDesc:"Überweise Gelder von Binance oder anderen Börsen, Chains wie Arbitrum und anderen Wallets",or:"OR"},withdraw:{noticeDesc:"Nachdem Sie den Auszahlungsantrag gestellt haben, wird er auf Layer2 verarbeitet. Sobald die Mittel bereit sind (in der Regel innerhalb von 4 Stunden), erhalten Sie eine Benachrichtigung, um die Mittel in Ihre Wallet abzuheben.",noticeDescWithClaim:"Nachdem Sie den Auszahlungsantrag gestellt haben, wird er auf Layer2 verarbeitet. Sobald die Mittel bereit sind (in der Regel innerhalb von 4 Stunden), erhalten Sie eine Benachrichtigung, um die Mittel in Ihre Wallet abzuheben. Sie müssen die Mittel beanspruchen und Ihre Auszahlungsadresse angeben, um den Vorgang abzuschließen.",externalWalletEthNoticeDesc:"Nachdem Sie den Auszahlungsantrag gestellt haben, wird er auf Layer2 verarbeitet. Sobald die Mittel bereit sind (in der Regel innerhalb von 4 Stunden), erhalten Sie eine Benachrichtigung, um die Mittel in Ihre Wallet abzuheben. Sie sind für alle Gas-Gebühren verantwortlich, die bei Auszahlungen anfallen.",crossChainTips:"Cross-Chain-Abhebungen erfordern eine L2-Verifizierung (mittels ZK-Proofs) und dauern in der Regel 5 Minuten bis 2 Stunden.",crossChainTipsWithGas:"Cross-Chain-Abhebungen erfordern eine L2-Verifizierung (mittels ZK-Proofs) und dauern in der Regel 5 Minuten bis 2 Stunden. Sie sind für alle Gas-Gebühren verantwortlich, die bei Auszahlungen anfallen.",commonWithdraw:"FAQ zu Auszahlungen",withdraw:"Auszahlen",speed:"Geschwindigkeit",confirmWithdraw:"Auszahlung bestätigen",speedNote:"Bearbeitungszeiten:",speedNoteSpeed1:"Ca. 8 Minuten",speedNoteSpeed2:"Ca. 2-4 Stunden",speedNoteSpeed3:"Ca. 4 Stunden",receiverAddress:"Empfängeradresse",fee:"Gebühr",feeRate:"Gebührensatz",withdrawlAmount:"Auszahlungsbetrag",amountToReceive:"Zu erhaltender Betrag",minWithdraw:"Mindestauszahlungsbetrag",minWithdrawParsed:"Min. Auszahlung {{amount}} {{token}}",invalidReceiverAddress:"Die Adresse darf nicht leer sein.",availableDesc:"Der maximale Betrag, den du auszahlen kannst. Wenn das verfügbare Guthaben 0 oder negativ ist, können keine Auszahlungen vorgenommen werden.",feeCalculationTip:"Die Auszahlungsgebühren werden berechnet, indem der Auszahlungsbetrag mit dem Gebührensatz multipliziert wird. Der Mindestbetrag liegt bei 1 USDT/USDC. Der Gebührensatz kann auf Basis der tatsächlichen On-chain-Bedingungen angepasst werden.",largeWithdrawFeeTip:"Die Auszahlungsgebühr beträgt 0,015 % und wird direkt vom Auszahlungsbetrag abgezogen.",crossChainPoolBalance:"Guthaben des Cross-Chain-Pools",poolBalance:"Pool-Guthaben",poolBalanceInsufficientTip:"Da der Auszahlungsbetrag das Pool-Guthaben übersteigt, kann die Auszahlung nicht bearbeitet werden. Bitte wähle eine Option mit ausreichendem Pool-Guthaben.",connectedWalletTitle:"Auszahlung an verbundene Wallet",connectedWalletDesc:"Zahle Geld an deine verbundene Krypto-Wallet, MetaMask, WalletConnect oder einen anderen Anbieter aus",externalWalletTitle:"Auszahlung an externes Konto",externalWalletDesc:"Zahle Geld an Binance oder anderen Börsen, Chains wie Arbitrum und anderen Wallets aus"},account:{title:"Konto",perp:"Perpetual-Konto","perpetual-v1":"Perpetuals-V1-Konto","perpetual-v2":"Perpetuals-V2-Konto",spot:"Spot-Konto"}},
|
|
32
|
+
Bei Chain-übergreifenden Einzahlungen musst du die Edge-Gas-Gebühr zahlen. Der gutgeschriebene Betrag wird etwas geringer sein als dein Einzahlungsbetrag.`,addressUpdatedNotice:"Hinweis: Deine Einzahlungsadresse wurde aktualisiert. Verwende die neue Adresse. Die alte Adresse funktioniert nur während der Übergangszeit und wird dann deaktiviert. Wenn sie an einem anderen Ort gespeichert wurde, aktualisiere sie umgehend.",enableSystemProWithToken:"{{token}} auf {{network}} aktivieren",enableTokenDesc:"Bei der ersten Einzahlung auf {{network}} musst du {{token}} aktivieren.",enableWithToken:"{{token}} aktivieren",arrivaltimeTooltip1:"Die Gelder kommen in etwa {{v}} Minuten an (nach Erreichen von {{v1}} Blockbestätigungen).",arrivaltimeTooltip2:"Die geschätzte Zeit wird auf der Grundlage historischer Daten berechnet und dient nur als Referenz. Eine Überlastung des Netzwerks kann zu längeren tatsächlichen Ankunftszeiten führen.",arrivalEstimated:"≈ {{v}} Minuten",feeRateTooltip:"Geschätzte Gebühr, tatsächliche Abzug maßgeblich.",availableDesc:"Der maximale Betrag, den du einzahlen kannst. Wenn das verfügbare Guthaben 0 oder negativ ist, können keine Einzahlungen vorgenommen werden.",noPrivateKeyWalletWarning:"Verwende für Einzahlungen keine schlüssellosen Wallets. Einzahlungen mit einer schlüssellosen Wallet können zu einem unwiderruflichen Verlust der Gelder führen.",layerZeroDepositTip:"Das System wird deine Einzahlung über LayerZero auf Basis der tatsächlichen Einzahlungsbedingungen abschließen.",layerZeroDepositTipExceedPool:"Da der Einzahlungsbetrag den Pool übersteigt, wird deine Einzahlung über LayerZero abgewickelt.",layerZeroDepositTipGte200k:"Da der Einzahlungsbetrag größer als oder gleich 200.000 USDT ist, wird deine Einzahlung über LayerZero abgewickelt.",layerZeroDepositButton:"Mit LayerZero einzahlen",defaultSpotNotice:"Standardeinzahlungen werden dem Spot-Konto gutgeschrieben.",defaultSpotToPerpNotice:"Für Einzahlungen an diese Adresse wird nur {{coin}} ({{v}}) unterstützt. Standardeinzahlungen werden dem Spot-Konto gutgeschrieben. Überweise Gelder vom Spot-Konto auf das Futures-Konto, um das Futures-Konto zu finanzieren.",depositModeSwitchWarning:"Wechseln Sie den Einzahlungsmodus nicht nach Start oder während der Einzahlung, sonst ändert sich die Einzahlungsmethode.",connectedWalletTitle:"Einzahlung von einer verbundenen Wallet",connectedWalletDesc:"Verwende MetaMask, WalletConnect oder einen anderen Anbieter, um Geld von deiner Krypto-Wallet einzuzahlen",externalWalletTitle:"Einzahlung von externem Konto",externalWalletDesc:"Überweise Gelder von Binance oder anderen Börsen, Chains wie Arbitrum und anderen Wallets",or:"OR"},withdraw:{noticeDesc:"Nachdem Sie den Auszahlungsantrag gestellt haben, wird er auf Layer2 verarbeitet. Sobald die Mittel bereit sind (in der Regel innerhalb von 4 Stunden), erhalten Sie eine Benachrichtigung, um die Mittel in Ihre Wallet abzuheben.",noticeDescWithClaim:"Nachdem Sie den Auszahlungsantrag gestellt haben, wird er auf Layer2 verarbeitet. Sobald die Mittel bereit sind (in der Regel innerhalb von 4 Stunden), erhalten Sie eine Benachrichtigung, um die Mittel in Ihre Wallet abzuheben. Sie müssen die Mittel beanspruchen und Ihre Auszahlungsadresse angeben, um den Vorgang abzuschließen.",externalWalletEthNoticeDesc:"Nachdem Sie den Auszahlungsantrag gestellt haben, wird er auf Layer2 verarbeitet. Sobald die Mittel bereit sind (in der Regel innerhalb von 4 Stunden), erhalten Sie eine Benachrichtigung, um die Mittel in Ihre Wallet abzuheben. Sie sind für alle Gas-Gebühren verantwortlich, die bei Auszahlungen anfallen.",crossChainTips:"Cross-Chain-Abhebungen erfordern eine L2-Verifizierung (mittels ZK-Proofs) und dauern in der Regel 5 Minuten bis 2 Stunden.",crossChainTipsWithGas:"Cross-Chain-Abhebungen erfordern eine L2-Verifizierung (mittels ZK-Proofs) und dauern in der Regel 5 Minuten bis 2 Stunden. Sie sind für alle Gas-Gebühren verantwortlich, die bei Auszahlungen anfallen.",commonWithdraw:"FAQ zu Auszahlungen",withdraw:"Auszahlen",speed:"Geschwindigkeit",confirmWithdraw:"Auszahlung bestätigen",speedNote:"Bearbeitungszeiten:",speedNoteSpeed1:"Ca. 8 Minuten",speedNoteSpeed2:"Ca. 2-4 Stunden",speedNoteSpeed3:"Ca. 4 Stunden",receiverAddress:"Empfängeradresse",fee:"Gebühr",feeRate:"Gebührensatz",withdrawlAmount:"Auszahlungsbetrag",amountToReceive:"Zu erhaltender Betrag",minWithdraw:"Mindestauszahlungsbetrag",minWithdrawParsed:"Min. Auszahlung {{amount}} {{token}}",invalidReceiverAddress:"Die Adresse darf nicht leer sein.",availableDesc:"Der maximale Betrag, den du auszahlen kannst. Wenn das verfügbare Guthaben 0 oder negativ ist, können keine Auszahlungen vorgenommen werden.",feeCalculationTip:"Die Auszahlungsgebühren werden berechnet, indem der Auszahlungsbetrag mit dem Gebührensatz multipliziert wird. Der Mindestbetrag liegt bei 1 USDT/USDC. Der Gebührensatz kann auf Basis der tatsächlichen On-chain-Bedingungen angepasst werden.",largeWithdrawFeeTip:"Die Auszahlungsgebühr beträgt 0,015 % und wird direkt vom Auszahlungsbetrag abgezogen.",crossChainPoolBalance:"Guthaben des Cross-Chain-Pools",poolBalance:"Pool-Guthaben",poolBalanceInsufficientTip:"Da der Auszahlungsbetrag das Pool-Guthaben übersteigt, kann die Auszahlung nicht bearbeitet werden. Bitte wähle eine Option mit ausreichendem Pool-Guthaben.",connectedWalletTitle:"Auszahlung an verbundene Wallet",connectedWalletDesc:"Zahle Geld an deine verbundene Krypto-Wallet, MetaMask, WalletConnect oder einen anderen Anbieter aus",externalWalletTitle:"Auszahlung an externes Konto",externalWalletDesc:"Zahle Geld an Binance oder anderen Börsen, Chains wie Arbitrum und anderen Wallets aus"},account:{title:"Konto",perp:"Perpetual-Konto","perpetual-v1":"Perpetuals-V1-Konto","perpetual-v2":"Perpetuals-V2-Konto",spot:"Spot-Konto"}},ab={deposit:{title:"Deposit",chain:"Chain",asset:"Asset",amount:"Amount",available:"Available",equity:"Equity",confirmDeposit:"Confirm Deposit",switchNetwork:"Switch Network",max:"Max",fast:"Fast",standard:"Standard",arrivalTime:"Arrival Time",ethCrossChainDepositInitiated:"ETH cross-chain deposit initiated. Estimated arrival in 2–5 minutes.",minDeposit:"Minimum Deposit Amount",minDepositParsed:"Min. Deposit {{amount}} {{token}}",maxDeposit:"Maximum Deposit Amount",depositTipFor25w:"The maximum amount per deposit is 200,000. If your deposit exceeds 200,000, please use the Ethereum chain.",depositAllTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
|
|
33
33
|
If the deposit amount exceeds 200,000, there may be a delay in the arrival time. Please be patient.`,maxDepositSplitTip:"The maximum amount per deposit is 200,000. If you need to deposit more than 200,000, please split it into multiple deposits.",spotDepositNotSupportedTip:"Deposits aren't supported. Please deposit to perpetual account, then transfer.",crossChainDepositFeeTip:`Only {{coin}} ({{v}}) is supported for deposits to this address.
|
|
34
|
-
Cross-chain deposits require you to pay the Edge gas fee. The credited amount will be slightly less than your deposit amount.`,addressUpdatedNotice:"Notice: Your deposit address has been updated. Use the new address. The old one works only during the transition and will be disabled. If saved elsewhere, update it promptly.",enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"The funds will arrive in approximately {{v}} minutes (after reaching {{v1}} block confirmations).",arrivaltimeTooltip2:"Estimated time is calculated based on historical data and is for reference only. Network congestion may result in longer actual arrival times.",arrivalEstimated:"≈ {{v}} minutes",feeRateTooltip:"Estimated fee, subject to actual deduction.",availableDesc:"The maximum amount you can deposit. When the available balance is 0 or negative, deposits cannot be made.",noPrivateKeyWalletWarning:"Do not use keyless wallets to make deposits. Depositing with a keyless wallet may result in irreversible loss of funds.",layerZeroDepositTip:"The system will complete your deposit via LayerZero based on the actual deposit conditions.",layerZeroDepositTipExceedPool:"Since the deposit amount exceeds the pool, your deposit will be completed via LayerZero.",layerZeroDepositTipGte200k:"Since the deposit amount is greater than or equal to 200,000 USDT, your deposit will be completed via LayerZero.",layerZeroDepositButton:"Deposit with LayerZero",defaultSpotNotice:"Default deposits go to the spot account.",defaultSpotToPerpNotice:"Only {{coin}} ({{v}}) is supported for deposits to this address. Default deposits go to the spot account. To fund the futures account, transfer from the spot account to the futures account.",depositModeSwitchWarning:"Do not switch deposit mode during or after initiating a deposit, or your deposit method may change.",connectedWalletTitle:"Deposit from connected wallet",connectedWalletDesc:"Use MetaMask, WalletConnect, or another provider to deposit funds from your crypto wallet",externalWalletTitle:"Deposit from external account",externalWalletDesc:"Transfer funds from Binance or other exchanges, chains like Arbitrum, and other wallets",or:"OR"},withdraw:{noticeDesc:"After you initiate the withdrawal request, it will be processed on Layer2. Once the funds are ready (usually within 4 hours), you will receive a notification to withdraw the funds to your wallet.",noticeDescWithClaim:"After you initiate the withdrawal request, it will be processed on Layer2. Once the funds are ready (usually within 4 hours), you will receive a notification to withdraw the funds to your wallet. You must claim the funds and enter your withdrawal address to complete the process.",externalWalletEthNoticeDesc:"After you initiate the withdrawal request, it will be processed on Layer2. Once the funds are ready (usually within 4 hours), you will receive a notification to withdraw the funds to your wallet. You are responsible for all gas fees incurred during withdrawals.",crossChainTips:"Cross-chain withdrawals require L2 verification (via ZK proofs) and typically take 5 minutes to 2 hours.",crossChainTipsWithGas:"Cross-chain withdrawals require L2 verification (via ZK proofs) and typically take 5 minutes to 2 hours. You are responsible for all gas fees incurred during withdrawals.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",feeRate:"Fee Rate",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",minWithdraw:"Minimum Withdrawal Amount",minWithdrawParsed:"Min. Withdrawal {{amount}} {{token}}",invalidReceiverAddress:"Address cannot be empty",availableDesc:"The maximum amount you can withdraw. When the available balance is 0 or negative, withdrawals cannot be made.",feeCalculationTip:"Withdrawal fees are calculated by multiplying the withdrawal amount by the fee rate, with a minimum of 1 USDT/USDC. The fee rate may be adjusted based on actual on-chain conditions.",largeWithdrawFeeTip:"A withdrawal fee of 0.015% will be deducted from the withdrawal amount.",crossChainPoolBalance:"Cross-chain pool balance",poolBalance:"Pool balance",poolBalanceInsufficientTip:"The withdrawal amount exceeds the fund pool balance, and the withdrawal cannot be processed. Please select an option with a sufficient fund pool balance.",connectedWalletTitle:"Withdraw to connected wallet",connectedWalletDesc:"Withdraw funds to your connected crypto wallet, MetaMask, WalletConnect, or another provider",externalWalletTitle:"Withdraw to external account",externalWalletDesc:"Withdraw funds to Binance or other exchanges, chains like Arbitrum, and other wallets"},account:{title:"Account",perp:"Perpetual Account","perpetual-v1":"Perpetuals V1 Account","perpetual-v2":"Perpetuals V2 Account",spot:"Spot Account"}},
|
|
34
|
+
Cross-chain deposits require you to pay the Edge gas fee. The credited amount will be slightly less than your deposit amount.`,addressUpdatedNotice:"Notice: Your deposit address has been updated. Use the new address. The old one works only during the transition and will be disabled. If saved elsewhere, update it promptly.",enableSystemProWithToken:"Enable {{token}} on {{network}}",enableTokenDesc:"You must enable {{token}} the first time you deposit on {{network}}.",enableWithToken:"Enable {{token}}",arrivaltimeTooltip1:"The funds will arrive in approximately {{v}} minutes (after reaching {{v1}} block confirmations).",arrivaltimeTooltip2:"Estimated time is calculated based on historical data and is for reference only. Network congestion may result in longer actual arrival times.",arrivalEstimated:"≈ {{v}} minutes",feeRateTooltip:"Estimated fee, subject to actual deduction.",availableDesc:"The maximum amount you can deposit. When the available balance is 0 or negative, deposits cannot be made.",noPrivateKeyWalletWarning:"Do not use keyless wallets to make deposits. Depositing with a keyless wallet may result in irreversible loss of funds.",layerZeroDepositTip:"The system will complete your deposit via LayerZero based on the actual deposit conditions.",layerZeroDepositTipExceedPool:"Since the deposit amount exceeds the pool, your deposit will be completed via LayerZero.",layerZeroDepositTipGte200k:"Since the deposit amount is greater than or equal to 200,000 USDT, your deposit will be completed via LayerZero.",layerZeroDepositButton:"Deposit with LayerZero",defaultSpotNotice:"Default deposits go to the spot account.",defaultSpotToPerpNotice:"Only {{coin}} ({{v}}) is supported for deposits to this address. Default deposits go to the spot account. To fund the futures account, transfer from the spot account to the futures account.",depositModeSwitchWarning:"Do not switch deposit mode during or after initiating a deposit, or your deposit method may change.",connectedWalletTitle:"Deposit from connected wallet",connectedWalletDesc:"Use MetaMask, WalletConnect, or another provider to deposit funds from your crypto wallet",externalWalletTitle:"Deposit from external account",externalWalletDesc:"Transfer funds from Binance or other exchanges, chains like Arbitrum, and other wallets",or:"OR"},withdraw:{noticeDesc:"After you initiate the withdrawal request, it will be processed on Layer2. Once the funds are ready (usually within 4 hours), you will receive a notification to withdraw the funds to your wallet.",noticeDescWithClaim:"After you initiate the withdrawal request, it will be processed on Layer2. Once the funds are ready (usually within 4 hours), you will receive a notification to withdraw the funds to your wallet. You must claim the funds and enter your withdrawal address to complete the process.",externalWalletEthNoticeDesc:"After you initiate the withdrawal request, it will be processed on Layer2. Once the funds are ready (usually within 4 hours), you will receive a notification to withdraw the funds to your wallet. You are responsible for all gas fees incurred during withdrawals.",crossChainTips:"Cross-chain withdrawals require L2 verification (via ZK proofs) and typically take 5 minutes to 2 hours.",crossChainTipsWithGas:"Cross-chain withdrawals require L2 verification (via ZK proofs) and typically take 5 minutes to 2 hours. You are responsible for all gas fees incurred during withdrawals.",commonWithdraw:"Withdrawal FAQ",withdraw:"Withdraw",speed:"Speed",confirmWithdraw:"Confirm Withdrawal",speedNote:"Processing Times:",speedNoteSpeed1:"Approx. 8 Minutes",speedNoteSpeed2:"Approx. 2-4 Hours",speedNoteSpeed3:"Approx. 4 Hours",receiverAddress:"Receiver Address",fee:"Fee",feeRate:"Fee Rate",withdrawlAmount:"Withdrawal amount",amountToReceive:"Amount to Receive",minWithdraw:"Minimum Withdrawal Amount",minWithdrawParsed:"Min. Withdrawal {{amount}} {{token}}",invalidReceiverAddress:"Address cannot be empty",availableDesc:"The maximum amount you can withdraw. When the available balance is 0 or negative, withdrawals cannot be made.",feeCalculationTip:"Withdrawal fees are calculated by multiplying the withdrawal amount by the fee rate, with a minimum of 1 USDT/USDC. The fee rate may be adjusted based on actual on-chain conditions.",largeWithdrawFeeTip:"A withdrawal fee of 0.015% will be deducted from the withdrawal amount.",crossChainPoolBalance:"Cross-chain pool balance",poolBalance:"Pool balance",poolBalanceInsufficientTip:"The withdrawal amount exceeds the fund pool balance, and the withdrawal cannot be processed. Please select an option with a sufficient fund pool balance.",connectedWalletTitle:"Withdraw to connected wallet",connectedWalletDesc:"Withdraw funds to your connected crypto wallet, MetaMask, WalletConnect, or another provider",externalWalletTitle:"Withdraw to external account",externalWalletDesc:"Withdraw funds to Binance or other exchanges, chains like Arbitrum, and other wallets"},account:{title:"Account",perp:"Perpetual Account","perpetual-v1":"Perpetuals V1 Account","perpetual-v2":"Perpetuals V2 Account",spot:"Spot Account"}},lb={deposit:{title:"Depósito",chain:"Cadena",asset:"Activo",amount:"Monto",available:"Disponible",equity:"Capital",confirmDeposit:"Confirmar depósito",switchNetwork:"Cambiar de red",max:"Máx.",fast:"Rápido",standard:"Estándar",arrivalTime:"Hora de llegada",ethCrossChainDepositInitiated:"Se inició el depósito entre cadenas de ETH. Llegada estimada en 2 a 5 minutos.",minDeposit:"Monto mínimo de depósito",minDepositParsed:"Mín. de depósito: {{amount}} {{token}}",maxDeposit:"Monto máximo de depósito",depositTipFor25w:"El monto máximo por depósito es de 200,000. Si tu depósito supera los 200,000, usa la cadena Ethereum.",depositAllTip:`Esta dirección solo admite depósitos en {{coin}} ({{v}})
|
|
35
35
|
Si el monto del depósito supera los 200,000, puede haber un retraso en la hora de llegada. Ten paciencia.`,maxDepositSplitTip:"El monto máximo por depósito es de 200,000. Si necesitas depositar más de 200,000, divídelo en varios depósitos.",spotDepositNotSupportedTip:"No se admiten depósitos. Deposita en la cuenta de perpetuos y luego haz la transferencia.",crossChainDepositFeeTip:`Esta dirección solo admite depósitos en {{coin}} ({{v}})
|
|
36
|
-
Los depósitos entre cadenas requieren el pago de la comisión de gas de Edge. El monto acreditado será ligeramente inferior al monto depositado.`,addressUpdatedNotice:"Aviso: Se actualizó tu dirección de depósito. Usa esta nueva dirección. La anterior solo funciona durante la transición y pronto se desactivará. Si la tienes guardada en otros dispositivos, actualízala lo antes posible.",enableSystemProWithToken:"Habilitar {{token}} en {{network}}",enableTokenDesc:"Debes habilitar {{token}} la primera vez que deposites en {{network}}.",enableWithToken:"Habilitar {{token}}",arrivaltimeTooltip1:"Los fondos se acreditarán en aproximadamente {{v}} minutos (tras obtener {{v1}} confirmaciones de bloque).",arrivaltimeTooltip2:"El tiempo estimado se calcula a partir de datos históricos y es solo de referencia. La congestión de la red puede ocasionar tiempos de acreditación más largos.",arrivalEstimated:"Aprox. {{v}} minutos",feeRateTooltip:"Tarifa estimada, deducción real prevalece.",availableDesc:"Lo máximo que puedes depositar. Si el saldo disponible es 0 o negativo, los depósitos no están permitidos.",noPrivateKeyWalletWarning:"No uses billeteras sin clave para realizar depósitos. Existe el riesgo de una pérdida irreversible de los fondos.",layerZeroDepositTip:"El sistema completará tu depósito a través de LayerZero según las condiciones de depósito reales.",layerZeroDepositTipExceedPool:"Dado que el importe del depósito supera el pool, tu depósito se completará a través de LayerZero.",layerZeroDepositTipGte200k:"El depósito es de 200,000 USDT o más. Se completará a través de LayerZero.",layerZeroDepositButton:"Depositar con LayerZero",defaultSpotNotice:"Los depósitos predeterminados van a la cuenta spot.",defaultSpotToPerpNotice:"Esta dirección solo admite depósitos en {{coin}} ({{v}}) Los depósitos predeterminados van a la cuenta spot. Para agregar fondos a la cuenta de futuros, transfiere desde la cuenta spot a la cuenta de futuros.",depositModeSwitchWarning:"No cambie el modo de depósito tras iniciar o durante el depósito, o el método de depósito podría cambiar.",connectedWalletTitle:"Depósito desde una billetera conectada",connectedWalletDesc:"Usa MetaMask, WalletConnect u otro proveedor para depositar fondos desde tu billetera cripto.",externalWalletTitle:"Depósito desde una cuenta externa",externalWalletDesc:"Transfiere fondos desde Binance u otros exchanges, cadenas como Arbitrum y otras billeteras.",or:"OR"},withdraw:{noticeDesc:"Después de iniciar la solicitud de retiro, se procesará en Layer2. Una vez que los fondos estén listos (normalmente en 4 horas), recibirá una notificación para retirar los fondos a su billetera.",noticeDescWithClaim:"Después de iniciar la solicitud de retiro, se procesará en Layer2. Una vez que los fondos estén listos (normalmente en 4 horas), recibirá una notificación para retirar los fondos a su billetera. Debe reclamar los fondos e ingresar su dirección de retiro para completar el proceso.",externalWalletEthNoticeDesc:"Después de iniciar la solicitud de retiro, se procesará en Layer2. Una vez que los fondos estén listos (normalmente en 4 horas), recibirá una notificación para retirar los fondos a su billetera. Usted es responsable de todas las tarifas de Gas incurridas durante los retiros.",crossChainTips:"Los retiros cross-chain requieren verificación en L2 (mediante pruebas ZK) y normalmente tardan de 5 minutos a 2 horas.",crossChainTipsWithGas:"Los retiros cross-chain requieren verificación en L2 (mediante pruebas ZK) y normalmente tardan de 5 minutos a 2 horas. Usted es responsable de todas las tarifas de Gas incurridas durante los retiros.",commonWithdraw:"Preguntas frecuentes sobre los retiros",withdraw:"Retirar",speed:"Velocidad",confirmWithdraw:"Confirmar el retiro",speedNote:"Plazos de procesamiento:",speedNoteSpeed1:"Aprox. 8 minutos",speedNoteSpeed2:"Aprox. 2-4 horas",speedNoteSpeed3:"Aprox. 4 horas",receiverAddress:"Dirección del destinatario",fee:"Comisión",feeRate:"Tasa de comisión",withdrawlAmount:"Monto del retiro",amountToReceive:"Monto a recibir",minWithdraw:"Monto mínimo de retiro",minWithdrawParsed:"Min. de retiro: {{amount}} {{token}}",invalidReceiverAddress:"La dirección no puede estar vacía",availableDesc:"Lo máximo que puedes retirar. Si el saldo disponible es 0 o negativo, los retiros no están permitidos.",feeCalculationTip:"Las comisiones de retiro se calculan multiplicando el monto de retiro por la tasa de comisión, con un mínimo de 1 USDT/USDC. La tasa de la comisión puede modificarse en función de las condiciones reales de la cadena.",largeWithdrawFeeTip:"La comisión por retiro es del 0,015 % y se deducirá directamente del monto retirado.",crossChainPoolBalance:"Saldo del pool cross-chain",poolBalance:"Saldo del pool",poolBalanceInsufficientTip:"El monto a retirar excede el saldo del pool. El retiro no se puede procesar. Selecciona una opción con un saldo suficiente en el pool.",connectedWalletTitle:"Retiro a una billetera conectada",connectedWalletDesc:"Retira fondos a la billetera cripto que tengas conectada: MetaMask, WalletConnect u otro proveedor.",externalWalletTitle:"Retiro a una cuenta externa",externalWalletDesc:"Retira fondos a Binance u otros exchanges, cadenas como Arbitrum y otras billeteras."},account:{title:"Cuenta",perp:"Cuenta de perpetuos","perpetual-v1":"Cuenta de perpetuos V1","perpetual-v2":"Cuenta de perpetuos V2",spot:"Cuenta spot"}},
|
|
36
|
+
Los depósitos entre cadenas requieren el pago de la comisión de gas de Edge. El monto acreditado será ligeramente inferior al monto depositado.`,addressUpdatedNotice:"Aviso: Se actualizó tu dirección de depósito. Usa esta nueva dirección. La anterior solo funciona durante la transición y pronto se desactivará. Si la tienes guardada en otros dispositivos, actualízala lo antes posible.",enableSystemProWithToken:"Habilitar {{token}} en {{network}}",enableTokenDesc:"Debes habilitar {{token}} la primera vez que deposites en {{network}}.",enableWithToken:"Habilitar {{token}}",arrivaltimeTooltip1:"Los fondos se acreditarán en aproximadamente {{v}} minutos (tras obtener {{v1}} confirmaciones de bloque).",arrivaltimeTooltip2:"El tiempo estimado se calcula a partir de datos históricos y es solo de referencia. La congestión de la red puede ocasionar tiempos de acreditación más largos.",arrivalEstimated:"Aprox. {{v}} minutos",feeRateTooltip:"Tarifa estimada, deducción real prevalece.",availableDesc:"Lo máximo que puedes depositar. Si el saldo disponible es 0 o negativo, los depósitos no están permitidos.",noPrivateKeyWalletWarning:"No uses billeteras sin clave para realizar depósitos. Existe el riesgo de una pérdida irreversible de los fondos.",layerZeroDepositTip:"El sistema completará tu depósito a través de LayerZero según las condiciones de depósito reales.",layerZeroDepositTipExceedPool:"Dado que el importe del depósito supera el pool, tu depósito se completará a través de LayerZero.",layerZeroDepositTipGte200k:"El depósito es de 200,000 USDT o más. Se completará a través de LayerZero.",layerZeroDepositButton:"Depositar con LayerZero",defaultSpotNotice:"Los depósitos predeterminados van a la cuenta spot.",defaultSpotToPerpNotice:"Esta dirección solo admite depósitos en {{coin}} ({{v}}) Los depósitos predeterminados van a la cuenta spot. Para agregar fondos a la cuenta de futuros, transfiere desde la cuenta spot a la cuenta de futuros.",depositModeSwitchWarning:"No cambie el modo de depósito tras iniciar o durante el depósito, o el método de depósito podría cambiar.",connectedWalletTitle:"Depósito desde una billetera conectada",connectedWalletDesc:"Usa MetaMask, WalletConnect u otro proveedor para depositar fondos desde tu billetera cripto.",externalWalletTitle:"Depósito desde una cuenta externa",externalWalletDesc:"Transfiere fondos desde Binance u otros exchanges, cadenas como Arbitrum y otras billeteras.",or:"OR"},withdraw:{noticeDesc:"Después de iniciar la solicitud de retiro, se procesará en Layer2. Una vez que los fondos estén listos (normalmente en 4 horas), recibirá una notificación para retirar los fondos a su billetera.",noticeDescWithClaim:"Después de iniciar la solicitud de retiro, se procesará en Layer2. Una vez que los fondos estén listos (normalmente en 4 horas), recibirá una notificación para retirar los fondos a su billetera. Debe reclamar los fondos e ingresar su dirección de retiro para completar el proceso.",externalWalletEthNoticeDesc:"Después de iniciar la solicitud de retiro, se procesará en Layer2. Una vez que los fondos estén listos (normalmente en 4 horas), recibirá una notificación para retirar los fondos a su billetera. Usted es responsable de todas las tarifas de Gas incurridas durante los retiros.",crossChainTips:"Los retiros cross-chain requieren verificación en L2 (mediante pruebas ZK) y normalmente tardan de 5 minutos a 2 horas.",crossChainTipsWithGas:"Los retiros cross-chain requieren verificación en L2 (mediante pruebas ZK) y normalmente tardan de 5 minutos a 2 horas. Usted es responsable de todas las tarifas de Gas incurridas durante los retiros.",commonWithdraw:"Preguntas frecuentes sobre los retiros",withdraw:"Retirar",speed:"Velocidad",confirmWithdraw:"Confirmar el retiro",speedNote:"Plazos de procesamiento:",speedNoteSpeed1:"Aprox. 8 minutos",speedNoteSpeed2:"Aprox. 2-4 horas",speedNoteSpeed3:"Aprox. 4 horas",receiverAddress:"Dirección del destinatario",fee:"Comisión",feeRate:"Tasa de comisión",withdrawlAmount:"Monto del retiro",amountToReceive:"Monto a recibir",minWithdraw:"Monto mínimo de retiro",minWithdrawParsed:"Min. de retiro: {{amount}} {{token}}",invalidReceiverAddress:"La dirección no puede estar vacía",availableDesc:"Lo máximo que puedes retirar. Si el saldo disponible es 0 o negativo, los retiros no están permitidos.",feeCalculationTip:"Las comisiones de retiro se calculan multiplicando el monto de retiro por la tasa de comisión, con un mínimo de 1 USDT/USDC. La tasa de la comisión puede modificarse en función de las condiciones reales de la cadena.",largeWithdrawFeeTip:"La comisión por retiro es del 0,015 % y se deducirá directamente del monto retirado.",crossChainPoolBalance:"Saldo del pool cross-chain",poolBalance:"Saldo del pool",poolBalanceInsufficientTip:"El monto a retirar excede el saldo del pool. El retiro no se puede procesar. Selecciona una opción con un saldo suficiente en el pool.",connectedWalletTitle:"Retiro a una billetera conectada",connectedWalletDesc:"Retira fondos a la billetera cripto que tengas conectada: MetaMask, WalletConnect u otro proveedor.",externalWalletTitle:"Retiro a una cuenta externa",externalWalletDesc:"Retira fondos a Binance u otros exchanges, cadenas como Arbitrum y otras billeteras."},account:{title:"Cuenta",perp:"Cuenta de perpetuos","perpetual-v1":"Cuenta de perpetuos V1","perpetual-v2":"Cuenta de perpetuos V2",spot:"Cuenta spot"}},cb={deposit:{title:"Dépôt",chain:"Blockchain",asset:"Actif",amount:"Montant",available:"Disponible",equity:"Actif net",confirmDeposit:"Confirmer le dépôt",switchNetwork:"Changer de réseau",max:"Max.",fast:"Rapide",standard:"Standard",arrivalTime:"Heure d’arrivée",ethCrossChainDepositInitiated:"Dépôt ETH inter-blockchains initié. Arrivée estimée dans 2 à 5 minutes.",minDeposit:"Montant minimum de dépôt",minDepositParsed:"Dépôt min. {{amount}} {{token}}",maxDeposit:"Montant maximum de dépôt",depositTipFor25w:"Le montant maximum par dépôt est de 200 000. Si votre dépôt dépasse 200 000, utilisez la blockchain Ethereum.",depositAllTip:`Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse.
|
|
37
37
|
Si le montant du dépôt dépasse 200 000, l’heure d’arrivée peut être retardée. Merci de patienter.`,maxDepositSplitTip:"Le montant maximum par dépôt est de 200 000. Si vous devez déposer plus de 200 000, veuillez effectuer plusieurs dépôts.",spotDepositNotSupportedTip:"Les dépôts ne sont pas pris en charge. Veuillez effectuer le dépôt sur le compte perpétuel, puis transférer les fonds.",crossChainDepositFeeTip:`Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse.
|
|
38
|
-
Les dépôts inter-blockchains nécessitent le paiement des frais de gas Edge. Le montant crédité sera légèrement inférieur au montant déposé.`,addressUpdatedNotice:"Avis : Votre adresse de dépôt a été mise à jour. Utilisez la nouvelle adresse. L’ancienne ne fonctionne que pendant la transition et sera désactivée. Si vous l’avez enregistrée ailleurs, modifiez-la sans tarder.",enableSystemProWithToken:"Activer {{token}} sur {{network}}",enableTokenDesc:"Vous devez activer {{token}} lors de votre premier dépôt sur {{network}}.",enableWithToken:"Activer {{token}}",arrivaltimeTooltip1:"Les fonds arriveront dans environ {{v}} minutes (après {{v1}} confirmations de bloc).",arrivaltimeTooltip2:"La durée estimée est calculée sur la base de données historiques et n’est donnée qu’à titre indicatif. L’encombrement du réseau peut rallonger l’heure d’arrivée réelle.",arrivalEstimated:"≈ {{v}} minutes",feeRateTooltip:"Frais estimés, déduction réelle fait foi.",availableDesc:"Montant maximal que vous pouvez déposer. Lorsque le solde disponible est nul ou négatif, aucun dépôt ne peut être effectué.",noPrivateKeyWalletWarning:"N’utilisez pas de wallets sans clé pour effectuer des dépôts. Un dépôt effectué depuis un wallet sans clé peut entraîner une perte irréversible des fonds.",layerZeroDepositTip:"Le système effectuera votre dépôt via LayerZero en fonction des conditions réelles du dépôt.",layerZeroDepositTipExceedPool:"Comme le montant du dépôt est supérieur au pool, votre dépôt sera effectué via LayerZero.",layerZeroDepositTipGte200k:"Comme le montant du dépôt est supérieur ou égal à 200 000 USDT, votre dépôt sera effectué via LayerZero.",layerZeroDepositButton:"Déposer via LayerZero",defaultSpotNotice:"Par défaut, les dépôts sont crédités sur le compte spot.",defaultSpotToPerpNotice:"Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse. Par défaut, les dépôts sont crédités sur le compte spot. Pour alimenter le compte futures, transférez des fonds du compte spot vers le compte futures.",depositModeSwitchWarning:"Ne changez pas le mode de dépôt après initiation ou pendant le dépôt, sinon la méthode de dépôt changera.",connectedWalletTitle:"Dépôt depuis un wallet connecté",connectedWalletDesc:"Utilisez MetaMask, WalletConnect ou un autre fournisseur pour déposer des fonds depuis votre wallet crypto",externalWalletTitle:"Dépôt depuis un compte externe",externalWalletDesc:"Transférez des fonds depuis Binance ou d’autres plateformes, des chaînes comme Arbitrum, ou d’autres wallets",or:"OR"},withdraw:{noticeDesc:"Après avoir initié votre demande de retrait, elle sera traitée sur Layer2. Une fois les fonds prêts (généralement dans les 4 heures), vous recevrez une notification pour retirer les fonds vers votre portefeuille.",noticeDescWithClaim:"Après avoir initié votre demande de retrait, elle sera traitée sur Layer2. Une fois les fonds prêts (généralement dans les 4 heures), vous recevrez une notification pour retirer les fonds vers votre portefeuille. Vous devez réclamer les fonds et saisir votre adresse de retrait pour finaliser le processus.",externalWalletEthNoticeDesc:"Après avoir initié votre demande de retrait, elle sera traitée sur Layer2. Une fois les fonds prêts (généralement dans les 4 heures), vous recevrez une notification pour retirer les fonds vers votre portefeuille. Vous êtes responsable de tous les frais de Gas encourus lors des retraits.",crossChainTips:"Les retraits cross-chain nécessitent une vérification sur L2 (via des preuves ZK) et prennent généralement de 5 minutes à 2 heures.",crossChainTipsWithGas:"Les retraits cross-chain nécessitent une vérification sur L2 (via des preuves ZK) et prennent généralement de 5 minutes à 2 heures. Vous êtes responsable de tous les frais de Gas encourus lors des retraits.",commonWithdraw:"FAQ sur les retraits",withdraw:"Retrait",speed:"Vitesse",confirmWithdraw:"Confirmer le retrait",speedNote:"Délais de traitement :",speedNoteSpeed1:"Env. 8 minutes",speedNoteSpeed2:"Env. 2 à 4 heures",speedNoteSpeed3:"Env. 4 heures",receiverAddress:"Adresse de réception",fee:"Frais",feeRate:"Taux de frais",withdrawlAmount:"Montant du retrait",amountToReceive:"Montant à recevoir",minWithdraw:"Montant minimum de retrait",minWithdrawParsed:"Retrait min. {{amount}} {{token}}",invalidReceiverAddress:"L’adresse ne peut pas être vide",availableDesc:"Montant maximal que vous pouvez retirer. Lorsque le solde disponible est nul ou négatif, aucun retrait ne peut être effectué.",feeCalculationTip:"Les frais de retrait sont calculés en multipliant le montant du retrait par le taux de frais, avec un minimum de 1 USDT/USDC. Le taux de frais peut être ajusté en fonction des conditions réelles on-chain.",largeWithdrawFeeTip:"Les frais de retrait s'élèvent à 0,015 % et seront déduits directement du montant retiré.",crossChainPoolBalance:"Solde du pool inter-blockchains",poolBalance:"Solde du pool",poolBalanceInsufficientTip:"Le montant du retrait dépasse le solde du pool de fonds ; le retrait ne peut pas être traité. Sélectionnez une option disposant d’un solde de pool de fonds suffisant.",connectedWalletTitle:"Retrait vers un wallet connecté",connectedWalletDesc:"Retirez des fonds vers votre wallet crypto connecté, MetaMask, WalletConnect ou un autre fournisseur",externalWalletTitle:"Retrait vers un compte externe",externalWalletDesc:"Retirez des fonds vers Binance ou d’autres plateformes, des chaînes comme Arbitrum, ou d’autres wallets"},account:{title:"Compte",perp:"Compte perpétuel","perpetual-v1":"Compte Perpétuels V1","perpetual-v2":"Compte Perpétuels V2",spot:"Compte spot"}},
|
|
38
|
+
Les dépôts inter-blockchains nécessitent le paiement des frais de gas Edge. Le montant crédité sera légèrement inférieur au montant déposé.`,addressUpdatedNotice:"Avis : Votre adresse de dépôt a été mise à jour. Utilisez la nouvelle adresse. L’ancienne ne fonctionne que pendant la transition et sera désactivée. Si vous l’avez enregistrée ailleurs, modifiez-la sans tarder.",enableSystemProWithToken:"Activer {{token}} sur {{network}}",enableTokenDesc:"Vous devez activer {{token}} lors de votre premier dépôt sur {{network}}.",enableWithToken:"Activer {{token}}",arrivaltimeTooltip1:"Les fonds arriveront dans environ {{v}} minutes (après {{v1}} confirmations de bloc).",arrivaltimeTooltip2:"La durée estimée est calculée sur la base de données historiques et n’est donnée qu’à titre indicatif. L’encombrement du réseau peut rallonger l’heure d’arrivée réelle.",arrivalEstimated:"≈ {{v}} minutes",feeRateTooltip:"Frais estimés, déduction réelle fait foi.",availableDesc:"Montant maximal que vous pouvez déposer. Lorsque le solde disponible est nul ou négatif, aucun dépôt ne peut être effectué.",noPrivateKeyWalletWarning:"N’utilisez pas de wallets sans clé pour effectuer des dépôts. Un dépôt effectué depuis un wallet sans clé peut entraîner une perte irréversible des fonds.",layerZeroDepositTip:"Le système effectuera votre dépôt via LayerZero en fonction des conditions réelles du dépôt.",layerZeroDepositTipExceedPool:"Comme le montant du dépôt est supérieur au pool, votre dépôt sera effectué via LayerZero.",layerZeroDepositTipGte200k:"Comme le montant du dépôt est supérieur ou égal à 200 000 USDT, votre dépôt sera effectué via LayerZero.",layerZeroDepositButton:"Déposer via LayerZero",defaultSpotNotice:"Par défaut, les dépôts sont crédités sur le compte spot.",defaultSpotToPerpNotice:"Seuls les dépôts en {{coin}} ({{v}}) sont pris en charge pour cette adresse. Par défaut, les dépôts sont crédités sur le compte spot. Pour alimenter le compte futures, transférez des fonds du compte spot vers le compte futures.",depositModeSwitchWarning:"Ne changez pas le mode de dépôt après initiation ou pendant le dépôt, sinon la méthode de dépôt changera.",connectedWalletTitle:"Dépôt depuis un wallet connecté",connectedWalletDesc:"Utilisez MetaMask, WalletConnect ou un autre fournisseur pour déposer des fonds depuis votre wallet crypto",externalWalletTitle:"Dépôt depuis un compte externe",externalWalletDesc:"Transférez des fonds depuis Binance ou d’autres plateformes, des chaînes comme Arbitrum, ou d’autres wallets",or:"OR"},withdraw:{noticeDesc:"Après avoir initié votre demande de retrait, elle sera traitée sur Layer2. Une fois les fonds prêts (généralement dans les 4 heures), vous recevrez une notification pour retirer les fonds vers votre portefeuille.",noticeDescWithClaim:"Après avoir initié votre demande de retrait, elle sera traitée sur Layer2. Une fois les fonds prêts (généralement dans les 4 heures), vous recevrez une notification pour retirer les fonds vers votre portefeuille. Vous devez réclamer les fonds et saisir votre adresse de retrait pour finaliser le processus.",externalWalletEthNoticeDesc:"Après avoir initié votre demande de retrait, elle sera traitée sur Layer2. Une fois les fonds prêts (généralement dans les 4 heures), vous recevrez une notification pour retirer les fonds vers votre portefeuille. Vous êtes responsable de tous les frais de Gas encourus lors des retraits.",crossChainTips:"Les retraits cross-chain nécessitent une vérification sur L2 (via des preuves ZK) et prennent généralement de 5 minutes à 2 heures.",crossChainTipsWithGas:"Les retraits cross-chain nécessitent une vérification sur L2 (via des preuves ZK) et prennent généralement de 5 minutes à 2 heures. Vous êtes responsable de tous les frais de Gas encourus lors des retraits.",commonWithdraw:"FAQ sur les retraits",withdraw:"Retrait",speed:"Vitesse",confirmWithdraw:"Confirmer le retrait",speedNote:"Délais de traitement :",speedNoteSpeed1:"Env. 8 minutes",speedNoteSpeed2:"Env. 2 à 4 heures",speedNoteSpeed3:"Env. 4 heures",receiverAddress:"Adresse de réception",fee:"Frais",feeRate:"Taux de frais",withdrawlAmount:"Montant du retrait",amountToReceive:"Montant à recevoir",minWithdraw:"Montant minimum de retrait",minWithdrawParsed:"Retrait min. {{amount}} {{token}}",invalidReceiverAddress:"L’adresse ne peut pas être vide",availableDesc:"Montant maximal que vous pouvez retirer. Lorsque le solde disponible est nul ou négatif, aucun retrait ne peut être effectué.",feeCalculationTip:"Les frais de retrait sont calculés en multipliant le montant du retrait par le taux de frais, avec un minimum de 1 USDT/USDC. Le taux de frais peut être ajusté en fonction des conditions réelles on-chain.",largeWithdrawFeeTip:"Les frais de retrait s'élèvent à 0,015 % et seront déduits directement du montant retiré.",crossChainPoolBalance:"Solde du pool inter-blockchains",poolBalance:"Solde du pool",poolBalanceInsufficientTip:"Le montant du retrait dépasse le solde du pool de fonds ; le retrait ne peut pas être traité. Sélectionnez une option disposant d’un solde de pool de fonds suffisant.",connectedWalletTitle:"Retrait vers un wallet connecté",connectedWalletDesc:"Retirez des fonds vers votre wallet crypto connecté, MetaMask, WalletConnect ou un autre fournisseur",externalWalletTitle:"Retrait vers un compte externe",externalWalletDesc:"Retirez des fonds vers Binance ou d’autres plateformes, des chaînes comme Arbitrum, ou d’autres wallets"},account:{title:"Compte",perp:"Compte perpétuel","perpetual-v1":"Compte Perpétuels V1","perpetual-v2":"Compte Perpétuels V2",spot:"Compte spot"}},ub={deposit:{title:"Deposita",chain:"Blockchain",asset:"Asset",amount:"Importo",available:"Disponibile",equity:"Equity",confirmDeposit:"Conferma il deposito",switchNetwork:"Cambia rete",max:"Max",fast:"Rapido",standard:"Standard",arrivalTime:"Orario di arrivo",ethCrossChainDepositInitiated:"Deposito cross-chain di ETH avviato. Il deposito arriverà tra 2-5 minuti.",minDeposit:"Importo minimo del deposito",minDepositParsed:"Deposito min. {{amount}} {{token}}",maxDeposit:"Importo massimo del deposito",depositTipFor25w:"L'importo massimo per deposito è 200.000. Se il tuo deposito supera i 200.000, utilizza la catena Ethereum.",depositAllTip:`I depositi a questo indirizzo supportano solo {{coin}} ({{v}}).
|
|
39
39
|
Se l'importo del deposito supera i 200.000, l'orario di arrivo potrebbe subire ritardi. Sii paziente.`,maxDepositSplitTip:"L'importo massimo per deposito è 200.000. Se devi depositare più di 200.000, dividi l'importo in più depositi.",spotDepositNotSupportedTip:"I depositi non sono supportati. Prima deposita sul conto perpetuo, quindi effettua il trasferimento.",crossChainDepositFeeTip:`I depositi a questo indirizzo supportano solo {{coin}} ({{v}}).
|
|
40
|
-
Per i depositi cross-chain è necessario pagare la gas fee Edge. L'importo accreditato sarà leggermente inferiore all'importo del deposito.`,addressUpdatedNotice:"Avviso: il tuo indirizzo di deposito è stato aggiornato. Utilizza il nuovo indirizzo. L'indirizzo precedente funzionerà solo durante la transizione, quindi verrà disattivato. Se l'hai salvato altrove, aggiornarlo il prima possibile.",enableSystemProWithToken:"Abilita {{token}} su {{network}}",enableTokenDesc:"Devi abilitare {{token}} la prima volta che depositi su {{network}}.",enableWithToken:"Abilita {{token}}",arrivaltimeTooltip1:"I fondi arriveranno entro circa {{v}} minuti (dopo{{v1}} conferme di blocco).",arrivaltimeTooltip2:"Il tempo stimato è calcolato in base ai dati storici ed solo per riferimento. Se la rete è congestionata, potrebbero esserci dei ritardi.",arrivalEstimated:"≈ {{v}} minuti",feeRateTooltip:"Commissione stimata, detrazione effettiva prevalente.",availableDesc:"L'importo massimo che puoi depositare. Se il saldo disponibile è pari a 0 o negativo, non sarà possibile effettuare depositi.",noPrivateKeyWalletWarning:"Non effettuare depositi con wallet senza chiavi. Se effettui un deposito tramite un wallet senza chiave rischi di perdere i tuoi fondi per sempre.",layerZeroDepositTip:"Il sistema completerà il tuo deposito tramite LayerZero in base alle condizioni effettive di deposito.",layerZeroDepositTipExceedPool:"Poiché l'importo del deposito supera il pool, il deposito sarà completato tramite LayerZero.",layerZeroDepositTipGte200k:"Poiché l'importo del deposito è maggiore o uguale a 200.000 USDT, il deposito verrà completato tramite LayerZero.",layerZeroDepositButton:"Deposita con LayerZero",defaultSpotNotice:"I depositi predefiniti vanno sul conto spot.",defaultSpotToPerpNotice:"I depositi a questo indirizzo supportano solo {{coin}} ({{v}}). I depositi predefiniti vanno sul conto spot. Per finanziare il conto futures, effettua un trasferimento dal conto spot al conto futures.",depositModeSwitchWarning:"Non cambiare la modalità di deposito dopo l'avvio o durante il deposito, altrimenti il metodo di deposito cambierà.",connectedWalletTitle:"Deposita dal wallet collegato",connectedWalletDesc:"Usa MetaMask, WalletConnect o un altro fornitore per depositare fondi dal tuo wallet crypto",externalWalletTitle:"Deposita da account esterno",externalWalletDesc:"Trasferisci fondi da Binance o altri exchange, blockchain come Arbitrum e altri wallet",or:"OR"},withdraw:{noticeDesc:"Dopo aver avviato la richiesta di prelievo, verrà elaborata su Layer2. Una volta che i fondi saranno pronti (di solito entro 4 ore), riceverai una notifica per prelevare i fondi nel tuo wallet.",noticeDescWithClaim:"Dopo aver avviato la richiesta di prelievo, verrà elaborata su Layer2. Una volta che i fondi saranno pronti (di solito entro 4 ore), riceverai una notifica per prelevare i fondi nel tuo wallet. Per completare il processo devi richiedere i fondi e inserire l'indirizzo di prelievo.",externalWalletEthNoticeDesc:"Dopo aver avviato la richiesta di prelievo, verrà elaborata su Layer2. Una volta che i fondi saranno pronti (di solito entro 4 ore), riceverai una notifica per prelevare i fondi nel tuo wallet. Sei responsabile di tutte le commissioni Gas sostenute durante i prelievi.",crossChainTips:"I prelievi cross-chain richiedono la verifica su L2 (tramite prove ZK) e di solito richiedono da 5 minuti a 2 ore.",crossChainTipsWithGas:"I prelievi cross-chain richiedono la verifica su L2 (tramite prove ZK) e di solito richiedono da 5 minuti a 2 ore. Sei responsabile di tutte le commissioni Gas sostenute durante i prelievi.",commonWithdraw:"Domande frequenti sui prelievi",withdraw:"Preleva",speed:"Velocità",confirmWithdraw:"Conferma prelievo",speedNote:"Tempi di elaborazione:",speedNoteSpeed1:"Circa 8 minuti",speedNoteSpeed2:"Circa 2-4 ore",speedNoteSpeed3:"Circa 4 ore",receiverAddress:"Indirizzo del destinatario",fee:"Commissione",feeRate:"Tariffa",withdrawlAmount:"Importo del prelievo",amountToReceive:"Importo da ricevere",minWithdraw:"Importo minimo di prelievo",minWithdrawParsed:"Prelievo min. {{amount}} {{token}}",invalidReceiverAddress:"L'indirizzo non può essere vuoto",availableDesc:"L'importo massimo che puoi prelevare. Se il saldo disponibile è pari a 0 o negativo, non sarà possibile effettuare prelievi.",feeCalculationTip:"Le commissioni di prelievo vengono calcolate moltiplicando l'importo del prelievo per il tasso di commissione, con un minimo di 1 USDT/USDC. La tariffa può essere modificata in base alle condizioni effettive on-chain.",largeWithdrawFeeTip:"La commissione di prelievo è pari allo 0,015 % e verrà dedotta direttamente dall'importo prelevato.",crossChainPoolBalance:"Equilibrio del pool cross-chain",poolBalance:"Equilibrio della piscina",poolBalanceInsufficientTip:"L'importo del prelievo supera il saldo del fondo e il prelievo non può essere elaborato. Selezionare un'opzione con un saldo di fondi sufficiente.",connectedWalletTitle:"Preleva sul wallet collegato",connectedWalletDesc:"Preleva fondi dal wallet crypto collegato, MetaMask, WalletConnect o un altro fornitore",externalWalletTitle:"Preleva sull'account esterno",externalWalletDesc:"Preleva fondi da Binance o altri exchange, blockchain come Arbitrum e altri wallet"},account:{title:"Account",perp:"Conto perpetuo","perpetual-v1":"Conto perpetuo V1","perpetual-v2":"Conto perpetuo V2",spot:"Conto Spot"}},
|
|
40
|
+
Per i depositi cross-chain è necessario pagare la gas fee Edge. L'importo accreditato sarà leggermente inferiore all'importo del deposito.`,addressUpdatedNotice:"Avviso: il tuo indirizzo di deposito è stato aggiornato. Utilizza il nuovo indirizzo. L'indirizzo precedente funzionerà solo durante la transizione, quindi verrà disattivato. Se l'hai salvato altrove, aggiornarlo il prima possibile.",enableSystemProWithToken:"Abilita {{token}} su {{network}}",enableTokenDesc:"Devi abilitare {{token}} la prima volta che depositi su {{network}}.",enableWithToken:"Abilita {{token}}",arrivaltimeTooltip1:"I fondi arriveranno entro circa {{v}} minuti (dopo{{v1}} conferme di blocco).",arrivaltimeTooltip2:"Il tempo stimato è calcolato in base ai dati storici ed solo per riferimento. Se la rete è congestionata, potrebbero esserci dei ritardi.",arrivalEstimated:"≈ {{v}} minuti",feeRateTooltip:"Commissione stimata, detrazione effettiva prevalente.",availableDesc:"L'importo massimo che puoi depositare. Se il saldo disponibile è pari a 0 o negativo, non sarà possibile effettuare depositi.",noPrivateKeyWalletWarning:"Non effettuare depositi con wallet senza chiavi. Se effettui un deposito tramite un wallet senza chiave rischi di perdere i tuoi fondi per sempre.",layerZeroDepositTip:"Il sistema completerà il tuo deposito tramite LayerZero in base alle condizioni effettive di deposito.",layerZeroDepositTipExceedPool:"Poiché l'importo del deposito supera il pool, il deposito sarà completato tramite LayerZero.",layerZeroDepositTipGte200k:"Poiché l'importo del deposito è maggiore o uguale a 200.000 USDT, il deposito verrà completato tramite LayerZero.",layerZeroDepositButton:"Deposita con LayerZero",defaultSpotNotice:"I depositi predefiniti vanno sul conto spot.",defaultSpotToPerpNotice:"I depositi a questo indirizzo supportano solo {{coin}} ({{v}}). I depositi predefiniti vanno sul conto spot. Per finanziare il conto futures, effettua un trasferimento dal conto spot al conto futures.",depositModeSwitchWarning:"Non cambiare la modalità di deposito dopo l'avvio o durante il deposito, altrimenti il metodo di deposito cambierà.",connectedWalletTitle:"Deposita dal wallet collegato",connectedWalletDesc:"Usa MetaMask, WalletConnect o un altro fornitore per depositare fondi dal tuo wallet crypto",externalWalletTitle:"Deposita da account esterno",externalWalletDesc:"Trasferisci fondi da Binance o altri exchange, blockchain come Arbitrum e altri wallet",or:"OR"},withdraw:{noticeDesc:"Dopo aver avviato la richiesta di prelievo, verrà elaborata su Layer2. Una volta che i fondi saranno pronti (di solito entro 4 ore), riceverai una notifica per prelevare i fondi nel tuo wallet.",noticeDescWithClaim:"Dopo aver avviato la richiesta di prelievo, verrà elaborata su Layer2. Una volta che i fondi saranno pronti (di solito entro 4 ore), riceverai una notifica per prelevare i fondi nel tuo wallet. Per completare il processo devi richiedere i fondi e inserire l'indirizzo di prelievo.",externalWalletEthNoticeDesc:"Dopo aver avviato la richiesta di prelievo, verrà elaborata su Layer2. Una volta che i fondi saranno pronti (di solito entro 4 ore), riceverai una notifica per prelevare i fondi nel tuo wallet. Sei responsabile di tutte le commissioni Gas sostenute durante i prelievi.",crossChainTips:"I prelievi cross-chain richiedono la verifica su L2 (tramite prove ZK) e di solito richiedono da 5 minuti a 2 ore.",crossChainTipsWithGas:"I prelievi cross-chain richiedono la verifica su L2 (tramite prove ZK) e di solito richiedono da 5 minuti a 2 ore. Sei responsabile di tutte le commissioni Gas sostenute durante i prelievi.",commonWithdraw:"Domande frequenti sui prelievi",withdraw:"Preleva",speed:"Velocità",confirmWithdraw:"Conferma prelievo",speedNote:"Tempi di elaborazione:",speedNoteSpeed1:"Circa 8 minuti",speedNoteSpeed2:"Circa 2-4 ore",speedNoteSpeed3:"Circa 4 ore",receiverAddress:"Indirizzo del destinatario",fee:"Commissione",feeRate:"Tariffa",withdrawlAmount:"Importo del prelievo",amountToReceive:"Importo da ricevere",minWithdraw:"Importo minimo di prelievo",minWithdrawParsed:"Prelievo min. {{amount}} {{token}}",invalidReceiverAddress:"L'indirizzo non può essere vuoto",availableDesc:"L'importo massimo che puoi prelevare. Se il saldo disponibile è pari a 0 o negativo, non sarà possibile effettuare prelievi.",feeCalculationTip:"Le commissioni di prelievo vengono calcolate moltiplicando l'importo del prelievo per il tasso di commissione, con un minimo di 1 USDT/USDC. La tariffa può essere modificata in base alle condizioni effettive on-chain.",largeWithdrawFeeTip:"La commissione di prelievo è pari allo 0,015 % e verrà dedotta direttamente dall'importo prelevato.",crossChainPoolBalance:"Equilibrio del pool cross-chain",poolBalance:"Equilibrio della piscina",poolBalanceInsufficientTip:"L'importo del prelievo supera il saldo del fondo e il prelievo non può essere elaborato. Selezionare un'opzione con un saldo di fondi sufficiente.",connectedWalletTitle:"Preleva sul wallet collegato",connectedWalletDesc:"Preleva fondi dal wallet crypto collegato, MetaMask, WalletConnect o un altro fornitore",externalWalletTitle:"Preleva sull'account esterno",externalWalletDesc:"Preleva fondi da Binance o altri exchange, blockchain come Arbitrum e altri wallet"},account:{title:"Account",perp:"Conto perpetuo","perpetual-v1":"Conto perpetuo V1","perpetual-v2":"Conto perpetuo V2",spot:"Conto Spot"}},db={deposit:{title:"入金",chain:"チェーン",asset:"資産",amount:"数量",available:"利用可能",equity:"総資産",confirmDeposit:"入金確認",switchNetwork:"ネットワークを切り替え",max:"最大",fast:"高速",standard:"標準",arrivalTime:"着金予定時間",ethCrossChainDepositInitiated:"ETH のクロスチェーン入金を開始しました。到着まで約2〜5分です。",minDeposit:"最低入金額",minDepositParsed:"最低入金額 {{amount}} {{token}}",maxDeposit:"最大入金額",depositTipFor25w:"1回の入金上限額は200,000です。200,000を超える場合は、Ethereumチェーンでの入金をご利用ください。",depositAllTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
|
|
41
41
|
入金金額が 200,000 を超える場合、反映までに時間がかかることがあります。しばらくお待ちください。`,maxDepositSplitTip:"1回の入金上限は200,000です。200,000を超える金額を入金する場合は、複数回に分けて行ってください。",spotDepositNotSupportedTip:"入金非対応。先に契約アカウント入金後、振替。",crossChainDepositFeeTip:`このアドレスは{{coin}}({{v}})専用です。他通貨は送金しないでください。
|
|
42
|
-
クロスチェーン入金では Edge ネットワーク手数料はお客様負担となります。入金額はご入金額よりわずかに少なくなります。`,addressUpdatedNotice:"注意:入金アドレスが更新されました。新しいアドレスをご利用ください。旧アドレスは移行期間のみ有効で、その後無効になります。他のサービスに保存している場合は早急に更新してください。",enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"資金は約 {{v}} 分以内({{v1}} 回のブロック確認が完了後)に到账します。",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"≈ {{v}}分",feeRateTooltip:"手数料の見積もり額で、実際の控除額を基準とします。",availableDesc:"入金可能な最大金額。利用可能残高が0または負の数の場合、入金はできません。",noPrivateKeyWalletWarning:"秘密鍵のないウォレットでの入金は行わないでください。そのような入金は資金を失い、取り戻すことができません。",layerZeroDepositTip:"システムは入金資金の実際の状況に基づき、LayerZeroを通じて入金を完了します。",layerZeroDepositTipExceedPool:"入金額がプールを超えているため、LayerZero を通じて入金が完了します。",layerZeroDepositTipGte200k:"入金額が 200,000 USDT 以上のため、LayerZero を通じて入金が完了します。",layerZeroDepositButton:"LayerZeroで入金",defaultSpotNotice:"デフォルトでは現物口座に入金されます",defaultSpotToPerpNotice:"このアドレスは {{coin}} ({{v}}) 専用です。 デフォルトでは現物口座に入金されます。先物口座に入金する場合は、現物口座から先物口座へ振替してください。",depositModeSwitchWarning:"入金開始後または入金中はチャージモードを切り替えないでください。入金方法が変わる可能性があります。",connectedWalletTitle:"接続済みウォレットから入庫",connectedWalletDesc:"MetaMask、WalletConnect、またはその他のプロバイダーを使用し、暗号資産ウォレットから資産を入庫してください。",externalWalletTitle:"外部アカウントから入庫",externalWalletDesc:"バイナンスや他の取引所、Arbitrumなどのネットワーク、またはその他ウォレットから資産を入庫する",or:"OR"},withdraw:{noticeDesc:"出金リクエストを開始すると、Layer2 で処理されます。資金の準備が完了すると(通常4時間以内)、通知が届き、資金をウォレットに出金できます。",noticeDescWithClaim:"出金リクエストを開始すると、Layer2 で処理されます。資金の準備が完了すると(通常4時間以内)、通知が届き、資金をウォレットに出金できます。その後、資金を受け取る操作を行い、出金アドレスを入力することで、出金が完了します。",externalWalletEthNoticeDesc:"出金リクエストを開始すると、Layer2 で処理されます。資金の準備が完了すると(通常4時間以内)、通知が届き、資金をウォレットに出金できます。出金時に発生するすべてのGas費用はご自身で負担してください。",crossChainTips:"クロスチェーン出金には L2 での検証(ZK 証明による)が必要で、通常 5 分から 2 時間かかります。",crossChainTipsWithGas:"クロスチェーン出金には L2 での検証(ZK 証明による)が必要で、通常 5 分から 2 時間かかります。出金時に発生するすべてのGas費用はご自身で負担してください。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",feeRate:"手数料率",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",minWithdraw:"最低出金額",minWithdrawParsed:"最低出金 {{amount}} {{token}}",invalidReceiverAddress:"ウォレットアドレスは必須です",availableDesc:"引き出し可能な最大金額。利用可能残高が0または負の数の場合、引き出しはできません。",feeCalculationTip:"出金手数料は、出金金額に料率を乗じて計算され、最低1 USDT/USDCとなります。料率は、ブロックチェーンの実際の状況に基づいて調整される場合があります。",largeWithdrawFeeTip:"出金手数料は0.015%で、出金額から直接差し引かれます。",crossChainPoolBalance:"クロスチェーンプール残高",poolBalance:"プール残高",poolBalanceInsufficientTip:"出金額が資金プールの残高を上回っているため、出金は処理できません。資金プールの残高が十分にあるオプションを選択してください。",connectedWalletTitle:"接続済みウォレットへ出庫",connectedWalletDesc:"接続済み暗号資産ウォレット、MetaMask、WalletConnect、またはその他のプロバイダーへ資産を出庫する",externalWalletTitle:"外部アカウントへ出庫",externalWalletDesc:"バイナンスや他の取引所、Arbitrumなどのネットワーク、またはその他のウォレットへ資産を出庫する"},account:{title:"アカウント",perp:"パーペチュアルアカウント","perpetual-v1":"先物V1アカウント","perpetual-v2":"先物V2アカウント",spot:"スポットアカウント"}},
|
|
42
|
+
クロスチェーン入金では Edge ネットワーク手数料はお客様負担となります。入金額はご入金額よりわずかに少なくなります。`,addressUpdatedNotice:"注意:入金アドレスが更新されました。新しいアドレスをご利用ください。旧アドレスは移行期間のみ有効で、その後無効になります。他のサービスに保存している場合は早急に更新してください。",enableSystemProWithToken:"{{network}} 上で {{token}} を有効化",enableTokenDesc:"初めて {{network}} に入金する際は、{{token}} の有効化が必要です。",enableWithToken:"{{token}} を有効化",arrivaltimeTooltip1:"資金は約 {{v}} 分以内({{v1}} 回のブロック確認が完了後)に到账します。",arrivaltimeTooltip2:"着金時間は過去データに基づいた目安であり、ネットワーク状況により遅延する場合があります。",arrivalEstimated:"≈ {{v}}分",feeRateTooltip:"手数料の見積もり額で、実際の控除額を基準とします。",availableDesc:"入金可能な最大金額。利用可能残高が0または負の数の場合、入金はできません。",noPrivateKeyWalletWarning:"秘密鍵のないウォレットでの入金は行わないでください。そのような入金は資金を失い、取り戻すことができません。",layerZeroDepositTip:"システムは入金資金の実際の状況に基づき、LayerZeroを通じて入金を完了します。",layerZeroDepositTipExceedPool:"入金額がプールを超えているため、LayerZero を通じて入金が完了します。",layerZeroDepositTipGte200k:"入金額が 200,000 USDT 以上のため、LayerZero を通じて入金が完了します。",layerZeroDepositButton:"LayerZeroで入金",defaultSpotNotice:"デフォルトでは現物口座に入金されます",defaultSpotToPerpNotice:"このアドレスは {{coin}} ({{v}}) 専用です。 デフォルトでは現物口座に入金されます。先物口座に入金する場合は、現物口座から先物口座へ振替してください。",depositModeSwitchWarning:"入金開始後または入金中はチャージモードを切り替えないでください。入金方法が変わる可能性があります。",connectedWalletTitle:"接続済みウォレットから入庫",connectedWalletDesc:"MetaMask、WalletConnect、またはその他のプロバイダーを使用し、暗号資産ウォレットから資産を入庫してください。",externalWalletTitle:"外部アカウントから入庫",externalWalletDesc:"バイナンスや他の取引所、Arbitrumなどのネットワーク、またはその他ウォレットから資産を入庫する",or:"OR"},withdraw:{noticeDesc:"出金リクエストを開始すると、Layer2 で処理されます。資金の準備が完了すると(通常4時間以内)、通知が届き、資金をウォレットに出金できます。",noticeDescWithClaim:"出金リクエストを開始すると、Layer2 で処理されます。資金の準備が完了すると(通常4時間以内)、通知が届き、資金をウォレットに出金できます。その後、資金を受け取る操作を行い、出金アドレスを入力することで、出金が完了します。",externalWalletEthNoticeDesc:"出金リクエストを開始すると、Layer2 で処理されます。資金の準備が完了すると(通常4時間以内)、通知が届き、資金をウォレットに出金できます。出金時に発生するすべてのGas費用はご自身で負担してください。",crossChainTips:"クロスチェーン出金には L2 での検証(ZK 証明による)が必要で、通常 5 分から 2 時間かかります。",crossChainTipsWithGas:"クロスチェーン出金には L2 での検証(ZK 証明による)が必要で、通常 5 分から 2 時間かかります。出金時に発生するすべてのGas費用はご自身で負担してください。",commonWithdraw:"出金ガイド",withdraw:"出金",speed:"出金時間",confirmWithdraw:"出金確認",speedNote:"処理時間:",speedNoteSpeed1:"約8分",speedNoteSpeed2:"約2~4時間",speedNoteSpeed3:"約4時間",receiverAddress:"受取アドレス",fee:"手数料",feeRate:"手数料率",withdrawlAmount:"出金額",amountToReceive:"受け取り金額",minWithdraw:"最低出金額",minWithdrawParsed:"最低出金 {{amount}} {{token}}",invalidReceiverAddress:"ウォレットアドレスは必須です",availableDesc:"引き出し可能な最大金額。利用可能残高が0または負の数の場合、引き出しはできません。",feeCalculationTip:"出金手数料は、出金金額に料率を乗じて計算され、最低1 USDT/USDCとなります。料率は、ブロックチェーンの実際の状況に基づいて調整される場合があります。",largeWithdrawFeeTip:"出金手数料は0.015%で、出金額から直接差し引かれます。",crossChainPoolBalance:"クロスチェーンプール残高",poolBalance:"プール残高",poolBalanceInsufficientTip:"出金額が資金プールの残高を上回っているため、出金は処理できません。資金プールの残高が十分にあるオプションを選択してください。",connectedWalletTitle:"接続済みウォレットへ出庫",connectedWalletDesc:"接続済み暗号資産ウォレット、MetaMask、WalletConnect、またはその他のプロバイダーへ資産を出庫する",externalWalletTitle:"外部アカウントへ出庫",externalWalletDesc:"バイナンスや他の取引所、Arbitrumなどのネットワーク、またはその他のウォレットへ資産を出庫する"},account:{title:"アカウント",perp:"パーペチュアルアカウント","perpetual-v1":"先物V1アカウント","perpetual-v2":"先物V2アカウント",spot:"スポットアカウント"}},fb={deposit:{title:"Депозит",chain:"Сеть",asset:"Актив",amount:"Сумма",available:"Доступно",equity:"Капитал",confirmDeposit:"Подтвердить депозит",switchNetwork:"Сменить сеть",max:"Максимум",fast:"Быстрый",standard:"Стандартный",arrivalTime:"Время поступления",ethCrossChainDepositInitiated:"Кроссчейн‑депозит ETH запущен. Ожидаемое зачисление: 2–5 минут.",minDeposit:"Минимальная сумма депозита",minDepositParsed:"Мин. депозит {{amount}} {{token}}",maxDeposit:"Максимальная сумма депозита",depositTipFor25w:"Максимальная сумма одного пополнения — 200 000. Если сумма превышает 200 000, пожалуйста, используйте сеть Ethereum для пополнения.",depositAllTip:`На этот адрес можно внести только {{coin}} ({{v}}).
|
|
43
43
|
Если сумма депозита превышает 200 000, время поступления может быть увеличено. Пожалуйста, ожидайте.`,maxDepositSplitTip:"Максимальная сумма одного пополнения — 200 000. Если вам нужно пополнить на сумму более 200 000, выполните несколько пополнений.",spotDepositNotSupportedTip:"Пополнение недоступно. Сначала контрактный счёт, затем перевод.",crossChainDepositFeeTip:`На этот адрес можно внести только {{coin}} ({{v}}).
|
|
44
44
|
За кроссчейн‑депозит вы оплачиваете комиссию сети Edge. Зачисленная сумма будет немного меньше суммы вашего депозита.`,addressUpdatedNotice:"Внимание: ваш адрес пополнения обновлён. Используйте новый адрес. Старый действует только в переходный период и будет отключён. Если он сохранён где‑то ещё, срочно обновите.",enableSystemProWithToken:"Включить {{token}} в сети {{network}}",enableTokenDesc:"При первом депозите в сети {{network}} необходимо включить {{token}}.",enableWithToken:"Включить {{token}}",arrivaltimeTooltip1:"Средства поступят в течение примерно {{v}} минут (после достижения {{v1}} подтверждений блоков).",arrivaltimeTooltip2:"Оценка времени основана на истории и дана только для справки. Задержки сети могут увеличить фактическое время поступления.",arrivalEstimated:"≈ {{v}} минут",feeRateTooltip:"Предварительная комиссия, фактическое списание в качестве окончательного.",availableDesc:"Максимальная сумма, которую вы можете пополнить. Если доступный баланс равен 0 или отрицательный, пополнение невозможно.",noPrivateKeyWalletWarning:`Не используйте кошельки без приватных ключей для пополнения. Пополнение с такого кошелька может привести к безвозвратной потере средств.
|
|
45
45
|
|
|
46
|
-
Tangem не подключаем, это кошелек без приватного ключа`,layerZeroDepositTip:"Система завершит ваше пополнение через LayerZero в зависимости от фактических условий депозита.",layerZeroDepositTipExceedPool:"Поскольку сумма пополнения превышает пул, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositTipGte200k:"Поскольку сумма пополнения больше либо равна 200,000 USDT, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositButton:"Пополнение через LayerZero",defaultSpotNotice:"По умолчанию — на спотовый счёт",defaultSpotToPerpNotice:"На этот адрес можно внести только {{coin}} ({{v}}). Пополнение по умолчанию зачисляется на спотовый счёт. Чтобы пополнить фьючерсный счёт, переведите средства со спотового на фьючерсный.",depositModeSwitchWarning:"Не меняйте режим пополнения после начала или во время пополнения, иначе способ пополнения изменится.",connectedWalletTitle:"Депозит с подключенного кошелька",connectedWalletDesc:"Используйте MetaMask, WalletConnect или другой сервис для внесения средств с криптокошелька",externalWalletTitle:"Депозит с внешнего аккаунта",externalWalletDesc:"Переводите средства с Binance или других бирж, блокчейнов, таких как Arbitrum, и других кошельков",or:"OR"},withdraw:{noticeDesc:"После инициации запроса на вывод средства будут обработаны на Layer2. Как только средства будут готовы (обычно в течение 4 часов), вы получите уведомление для вывода средств на свой кошелёк.",noticeDescWithClaim:"После инициации запроса на вывод средства будут обработаны на Layer2. Как только средства будут готовы (обычно в течение 4 часов), вы получите уведомление для вывода средств на свой кошелёк. Вам необходимо будет подтвердить получение и указать адрес вывода для завершения операции.",externalWalletEthNoticeDesc:"После инициации запроса на вывод средства будут обработаны на Layer2. Как только средства будут готовы (обычно в течение 4 часов), вы получите уведомление для вывода средств на свой кошелёк. Вы несёте ответственность за все комиссии Gas, возникающие во время вывода средств.",crossChainTips:"Кросс-чейн выводы требуют верификации на L2 (через ZK-доказательства) и обычно занимают от 5 минут до 2 часов.",crossChainTipsWithGas:"Кросс-чейн выводы требуют верификации на L2 (через ZK-доказательства) и обычно занимают от 5 минут до 2 часов. Вы несёте ответственность за все комиссии Gas, возникающие во время вывода средств.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",feeRate:"Тариф",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",minWithdraw:"Минимальная сумма вывода",minWithdrawParsed:"Мин. вывод {{amount}} {{token}}",invalidReceiverAddress:"Укажите адрес кошелька",availableDesc:"Максимальная сумма, которую вы можете вывести. Если доступный баланс равен 0 или отрицательный, вывод средств невозможен.",feeCalculationTip:"Комиссия за вывод средств рассчитывается путем умножения суммы вывода на ставку комиссии, минимальная комиссия составляет 1 USDT/USDC. Ставка комиссии может быть скорректирована в зависимости от фактической ситуации в сети блокчейн.",largeWithdrawFeeTip:"Комиссия за вывод составляет 0,015 % и будет вычтена непосредственно из суммы вывода.",crossChainPoolBalance:"Баланс кросс-чейн пула",poolBalance:"Баланс пула",poolBalanceInsufficientTip:"Сумма вывода превышает баланс пула средств, и операция не может быть выполнена. Пожалуйста, выберите опцию с достаточным балансом пула средств.",connectedWalletTitle:"Вывод на подключенный кошелек",connectedWalletDesc:"Выведите средства на подключенный криптокошелек: MetaMask, WalletConnect или другой",externalWalletTitle:"Вывод средств на внешний аккаунт",externalWalletDesc:"Выведите средства на Binance или другие биржи, блокчейны, такие как Arbitrum, и другие кошельки"},account:{title:"Аккаунт",perp:"Перпетуальный счет","perpetual-v1":"Перпетуальный счёт V1","perpetual-v2":"Перпетуальный счёт V2",spot:"Спотовый счет"}},
|
|
46
|
+
Tangem не подключаем, это кошелек без приватного ключа`,layerZeroDepositTip:"Система завершит ваше пополнение через LayerZero в зависимости от фактических условий депозита.",layerZeroDepositTipExceedPool:"Поскольку сумма пополнения превышает пул, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositTipGte200k:"Поскольку сумма пополнения больше либо равна 200,000 USDT, ваше пополнение будет выполнено через LayerZero.",layerZeroDepositButton:"Пополнение через LayerZero",defaultSpotNotice:"По умолчанию — на спотовый счёт",defaultSpotToPerpNotice:"На этот адрес можно внести только {{coin}} ({{v}}). Пополнение по умолчанию зачисляется на спотовый счёт. Чтобы пополнить фьючерсный счёт, переведите средства со спотового на фьючерсный.",depositModeSwitchWarning:"Не меняйте режим пополнения после начала или во время пополнения, иначе способ пополнения изменится.",connectedWalletTitle:"Депозит с подключенного кошелька",connectedWalletDesc:"Используйте MetaMask, WalletConnect или другой сервис для внесения средств с криптокошелька",externalWalletTitle:"Депозит с внешнего аккаунта",externalWalletDesc:"Переводите средства с Binance или других бирж, блокчейнов, таких как Arbitrum, и других кошельков",or:"OR"},withdraw:{noticeDesc:"После инициации запроса на вывод средства будут обработаны на Layer2. Как только средства будут готовы (обычно в течение 4 часов), вы получите уведомление для вывода средств на свой кошелёк.",noticeDescWithClaim:"После инициации запроса на вывод средства будут обработаны на Layer2. Как только средства будут готовы (обычно в течение 4 часов), вы получите уведомление для вывода средств на свой кошелёк. Вам необходимо будет подтвердить получение и указать адрес вывода для завершения операции.",externalWalletEthNoticeDesc:"После инициации запроса на вывод средства будут обработаны на Layer2. Как только средства будут готовы (обычно в течение 4 часов), вы получите уведомление для вывода средств на свой кошелёк. Вы несёте ответственность за все комиссии Gas, возникающие во время вывода средств.",crossChainTips:"Кросс-чейн выводы требуют верификации на L2 (через ZK-доказательства) и обычно занимают от 5 минут до 2 часов.",crossChainTipsWithGas:"Кросс-чейн выводы требуют верификации на L2 (через ZK-доказательства) и обычно занимают от 5 минут до 2 часов. Вы несёте ответственность за все комиссии Gas, возникающие во время вывода средств.",commonWithdraw:"Часто задаваемые вопросы по выводу",withdraw:"Вывод",speed:"Скорость",confirmWithdraw:"Подтвердить вывод",speedNote:"Время обработки:",speedNoteSpeed1:"Прибл. 8 минут",speedNoteSpeed2:"Прибл. 2-4 часа",speedNoteSpeed3:"Прибл. 4 часа",receiverAddress:"Адрес получателя",fee:"Комиссия",feeRate:"Тариф",withdrawlAmount:"Сумма вывода",amountToReceive:"Сумма к получению",minWithdraw:"Минимальная сумма вывода",minWithdrawParsed:"Мин. вывод {{amount}} {{token}}",invalidReceiverAddress:"Укажите адрес кошелька",availableDesc:"Максимальная сумма, которую вы можете вывести. Если доступный баланс равен 0 или отрицательный, вывод средств невозможен.",feeCalculationTip:"Комиссия за вывод средств рассчитывается путем умножения суммы вывода на ставку комиссии, минимальная комиссия составляет 1 USDT/USDC. Ставка комиссии может быть скорректирована в зависимости от фактической ситуации в сети блокчейн.",largeWithdrawFeeTip:"Комиссия за вывод составляет 0,015 % и будет вычтена непосредственно из суммы вывода.",crossChainPoolBalance:"Баланс кросс-чейн пула",poolBalance:"Баланс пула",poolBalanceInsufficientTip:"Сумма вывода превышает баланс пула средств, и операция не может быть выполнена. Пожалуйста, выберите опцию с достаточным балансом пула средств.",connectedWalletTitle:"Вывод на подключенный кошелек",connectedWalletDesc:"Выведите средства на подключенный криптокошелек: MetaMask, WalletConnect или другой",externalWalletTitle:"Вывод средств на внешний аккаунт",externalWalletDesc:"Выведите средства на Binance или другие биржи, блокчейны, такие как Arbitrum, и другие кошельки"},account:{title:"Аккаунт",perp:"Перпетуальный счет","perpetual-v1":"Перпетуальный счёт V1","perpetual-v2":"Перпетуальный счёт V2",spot:"Спотовый счет"}},pb={deposit:{title:"充值",chain:"链",asset:"资产",amount:"数量",available:"可用",equity:"总资产",confirmDeposit:"充值确认",switchNetwork:"切换网络",max:"最大",fast:"快速",standard:"普通",arrivalTime:"到账时间",ethCrossChainDepositInitiated:"ETH 跨链充值已发起,预计 2–5 分钟到账。",minDeposit:"最小充值金额",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大充值金额",depositTipFor25w:"单笔充值金额上限为 200,000。若充值金额大于200,000,请使用Ethereum链充值。",depositAllTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
|
|
47
47
|
充值金额大于 200,000 时,到账时间存在一定延迟,请耐心等待。`,maxDepositSplitTip:"单笔充值金额上限为200,000。若需要充值金额大于200,000,请分多笔进行操作。",spotDepositNotSupportedTip:"不支持充值,请先充入合约账户再划转。",crossChainDepositFeeTip:`仅支持发送 {{coin}} ({{v}}) 资产到此地址。
|
|
48
|
-
跨链充值需由您承担 Edge 网络手续费。到账金额会略小于您的充值金额。`,addressUpdatedNotice:"注意:充值地址已更新,请改用新地址。原地址仅在过渡期可用,随后停用。若旧地址已存于其他平台,请尽快更新。",enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"资金约在 {{v}} 分钟 内 (达到 {{v1}} 个区块确认后) 到账。",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"≈ {{v}}分钟",feeRateTooltip:"预估手续费,以实际扣除为准。",availableDesc:"您可以充值的最大金额。当可用为0或负数时,无法进行充值。",noPrivateKeyWalletWarning:"请勿使用无私钥钱包进行充值,无私钥钱包充值会导致资金损失且无法追回。",layerZeroDepositTip:"系统会根据充值资金实际情况,将您的充值通过LayerZero完成。",layerZeroDepositTipExceedPool:"由于充值资金大于资金池,将通过LayerZero完成您的充值。",layerZeroDepositTipGte200k:"由于充值资金大于等于200,000 USDT,将通过LayerZero完成您的充值。",layerZeroDepositButton:"使用LayerZero充值",defaultSpotNotice:"默认充值至现货账户",defaultSpotToPerpNotice:"仅支持发送 {{coin}} ({{v}}) 资产到此地址。默认充值至现货账户。若需充入合约账户,请从现货账户划转至合约账户。",depositModeSwitchWarning:"当您发起充值后或正在充值中时请勿切换充值模式,以免导致您的充值方式发生变更",connectedWalletTitle:"从已连接钱包充值",connectedWalletDesc:"使用 MetaMask、WalletConnect 或其他钱包进行充值",externalWalletTitle:"从外部钱包充值",externalWalletDesc:"从 Binance 或其他交易所、Arbitrum 等链或其他钱包转账",or:"或"},withdraw:{noticeDesc:"在您发起提现请求后,将在 Layer2 上进行处理。资金准备就绪后(通常在 4 小时内),您将收到通知,将资金提现至您的钱包。",noticeDescWithClaim:"在您发起提现请求后,将在 Layer2 上进行处理。资金准备就绪后(通常在 4 小时内),您将收到通知,将资金提现至您的钱包。您需进行领取操作并填入提现地址来完成提现。",externalWalletEthNoticeDesc:"在您发起提现请求后,将在 Layer2 上进行处理。资金准备就绪后(通常在 4 小时内),您将收到通知,将资金提现至您的钱包。您需自行承担提现过程中产生的所有 Gas 费用。",crossChainTips:"跨链提现需要 L2 验证(通过 ZK 证明),通常需要 5 分钟至 2 小时。",crossChainTipsWithGas:"跨链提现需要 L2 验证(通过 ZK 证明),通常需要 5 分钟至 2 小时。您需自行承担提现过程中产生的所有 Gas 费用。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址",fee:"手续费",feeRate:"费率",withdrawlAmount:"提现金额",amountToReceive:"到账金额",minWithdraw:"最小提现金额",minWithdrawParsed:"最小提现 {{amount}} {{token}}",invalidReceiverAddress:"接收地址不能为空",availableDesc:"您可以提现的最大金额。当可用为0或负数时,无法进行提现。",feeCalculationTip:"提现手续费按照提现金额乘以费率计算,最低为1 USDT/USDC。费率会根据链上实际情况进行调整。",largeWithdrawFeeTip:"提现手续费为0.015%,将从提现金额中扣除。",crossChainPoolBalance:"跨链资金池余额",poolBalance:"资金池余额",poolBalanceInsufficientTip:"提现金额大于资金池余额,无法进行提现。请选择资金池余额充足的选项。",connectedWalletTitle:"提现至已连接钱包",connectedWalletDesc:"将资金提现至您已连接的加密钱包、MetaMask、WalletConnect 或其他提供商",externalWalletTitle:"提现至外部账户",externalWalletDesc:"将资金提现至 Binance 或其他交易所、Arbitrum 等链及其他钱包"},account:{title:"账户",perp:"合约账户","perpetual-v1":"合约V1账户","perpetual-v2":"合约V2账户",spot:"现货账户"}},
|
|
48
|
+
跨链充值需由您承担 Edge 网络手续费。到账金额会略小于您的充值金额。`,addressUpdatedNotice:"注意:充值地址已更新,请改用新地址。原地址仅在过渡期可用,随后停用。若旧地址已存于其他平台,请尽快更新。",enableSystemProWithToken:"在{{network}}上启用{{token}}",enableTokenDesc:"您首次在{{network}}上存款时必须启用{{token}}。",enableWithToken:"启用 {{token}}",arrivaltimeTooltip1:"资金约在 {{v}} 分钟 内 (达到 {{v1}} 个区块确认后) 到账。",arrivaltimeTooltip2:"预计时间是根据历史数据计算所得,仅供参考。网络拥堵可能会导致实际到账时间变长。",arrivalEstimated:"≈ {{v}}分钟",feeRateTooltip:"预估手续费,以实际扣除为准。",availableDesc:"您可以充值的最大金额。当可用为0或负数时,无法进行充值。",noPrivateKeyWalletWarning:"请勿使用无私钥钱包进行充值,无私钥钱包充值会导致资金损失且无法追回。",layerZeroDepositTip:"系统会根据充值资金实际情况,将您的充值通过LayerZero完成。",layerZeroDepositTipExceedPool:"由于充值资金大于资金池,将通过LayerZero完成您的充值。",layerZeroDepositTipGte200k:"由于充值资金大于等于200,000 USDT,将通过LayerZero完成您的充值。",layerZeroDepositButton:"使用LayerZero充值",defaultSpotNotice:"默认充值至现货账户",defaultSpotToPerpNotice:"仅支持发送 {{coin}} ({{v}}) 资产到此地址。默认充值至现货账户。若需充入合约账户,请从现货账户划转至合约账户。",depositModeSwitchWarning:"当您发起充值后或正在充值中时请勿切换充值模式,以免导致您的充值方式发生变更",connectedWalletTitle:"从已连接钱包充值",connectedWalletDesc:"使用 MetaMask、WalletConnect 或其他钱包进行充值",externalWalletTitle:"从外部钱包充值",externalWalletDesc:"从 Binance 或其他交易所、Arbitrum 等链或其他钱包转账",or:"或"},withdraw:{noticeDesc:"在您发起提现请求后,将在 Layer2 上进行处理。资金准备就绪后(通常在 4 小时内),您将收到通知,将资金提现至您的钱包。",noticeDescWithClaim:"在您发起提现请求后,将在 Layer2 上进行处理。资金准备就绪后(通常在 4 小时内),您将收到通知,将资金提现至您的钱包。您需进行领取操作并填入提现地址来完成提现。",externalWalletEthNoticeDesc:"在您发起提现请求后,将在 Layer2 上进行处理。资金准备就绪后(通常在 4 小时内),您将收到通知,将资金提现至您的钱包。您需自行承担提现过程中产生的所有 Gas 费用。",crossChainTips:"跨链提现需要 L2 验证(通过 ZK 证明),通常需要 5 分钟至 2 小时。",crossChainTipsWithGas:"跨链提现需要 L2 验证(通过 ZK 证明),通常需要 5 分钟至 2 小时。您需自行承担提现过程中产生的所有 Gas 费用。",commonWithdraw:"提现说明",withdraw:"提现",speed:"速度",confirmWithdraw:"提现确认",speedNote:"处理时间:",speedNoteSpeed1:"用时约8分钟",speedNoteSpeed2:"用时约 2-4 小时",speedNoteSpeed3:"用时约4小时",receiverAddress:"接收地址",fee:"手续费",feeRate:"费率",withdrawlAmount:"提现金额",amountToReceive:"到账金额",minWithdraw:"最小提现金额",minWithdrawParsed:"最小提现 {{amount}} {{token}}",invalidReceiverAddress:"接收地址不能为空",availableDesc:"您可以提现的最大金额。当可用为0或负数时,无法进行提现。",feeCalculationTip:"提现手续费按照提现金额乘以费率计算,最低为1 USDT/USDC。费率会根据链上实际情况进行调整。",largeWithdrawFeeTip:"提现手续费为0.015%,将从提现金额中扣除。",crossChainPoolBalance:"跨链资金池余额",poolBalance:"资金池余额",poolBalanceInsufficientTip:"提现金额大于资金池余额,无法进行提现。请选择资金池余额充足的选项。",connectedWalletTitle:"提现至已连接钱包",connectedWalletDesc:"将资金提现至您已连接的加密钱包、MetaMask、WalletConnect 或其他提供商",externalWalletTitle:"提现至外部账户",externalWalletDesc:"将资金提现至 Binance 或其他交易所、Arbitrum 等链及其他钱包"},account:{title:"账户",perp:"合约账户","perpetual-v1":"合约V1账户","perpetual-v2":"合约V2账户",spot:"现货账户"}},hb={deposit:{title:"充值",chain:"鏈",asset:"資產",amount:"數量",available:"可用",equity:"總資產",confirmDeposit:"充值確認",switchNetwork:"切換網絡",max:"最大",fast:"快速",standard:"普通",arrivalTime:"到帳時間",ethCrossChainDepositInitiated:"ETH 跨鏈充值已發起 ,預計 2–5 分鐘到賬。",minDeposit:"最小儲值金額",minDepositParsed:"最少充值 {{amount}} {{token}}",maxDeposit:"最大儲值金額",depositTipFor25w:"單筆充值金額上限為 200,000。若充值金額大於 200,000,請使用 Ethereum 鏈充值。",depositAllTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
|
|
49
49
|
充值金額大於 200,000 時,到账時間可能會有延遲,請耐心等待。`,maxDepositSplitTip:"單筆充值金額上限為 200,000。若需要充值金額大於 200,000,請分多筆進行操作。",spotDepositNotSupportedTip:"不支援充值,請先充入合約帳戶再劃轉。",crossChainDepositFeeTip:`僅支援發送 {{coin}} ({{v}}) 資產到此位址。
|
|
50
|
-
跨鏈充值需由您承擔 Edge 網路手續費。到帳金額會略小於您的充值金額。`,addressUpdatedNotice:"注意:充值地址已更新,請改用新地址。原地址僅在過渡期內有效,之後將停用。若已在其他平台儲存,請儘速更新。",enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"資金約在 {{v}} 分鐘內(達到 {{v1}} 個區塊確認後)到賬。",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"≈ {{v}}分鐘",feeRateTooltip:"預估手續費,以實際扣除為準。",availableDesc:"您可以充值的最大金額。當可用餘額為0或負數時,無法進行充值。",noPrivateKeyWalletWarning:"請勿使用無私鑰錢包進行充值,無私鑰錢包充值會導致資金損失且無法追回。",layerZeroDepositTip:"系統會根據充值資金的實際情況,通過 LayerZero 完成您的充值。",layerZeroDepositTipExceedPool:"由於充值資金大於資金池,將透過 LayerZero 完成您的充值。",layerZeroDepositTipGte200k:"由於充值資金大於等於 200,000 USDT,將透過 LayerZero 完成您的充值。",layerZeroDepositButton:"使用LayerZero充值",defaultSpotNotice:"預設充值至現貨帳戶",defaultSpotToPerpNotice:"僅支援發送 {{coin}} ({{v}}) 資產到此位址。預設充值至現貨帳戶。若需充入合約帳戶,請自現貨帳戶劃轉至合約帳戶。",depositModeSwitchWarning:"當您發起充值後或正在充值中時請勿切換充值模式,以免導致您的充值方式發生變更",connectedWalletTitle:"從已連接錢包充值",connectedWalletDesc:"使用 MetaMask、WalletConnect 或其他錢包進行充值",externalWalletTitle:"從外部錢包充值",externalWalletDesc:"從 Binance 或其他交易所、Arbitrum 等鏈或其他錢包轉帳",or:"或"},withdraw:{noticeDesc:"在您發起提領請求後,將於 Layer2 進行處理。資金準備就緒後(通常在 4 小時內),您將收到通知,將資金提領至您的錢包。",noticeDescWithClaim:"在您發起提領請求後,將於 Layer2 進行處理。資金準備就緒後(通常在 4 小時內),您將收到通知,將資金提領至您的錢包。您需進行領取操作並填寫提現地址,以完成整個提現流程。",externalWalletEthNoticeDesc:"在您發起提領請求後,將於 Layer2 進行處理。資金準備就緒後(通常在 4 小時內),您將收到通知,將資金提領至您的錢包。您需自行承擔提現過程中產生的所有 Gas 費用。",crossChainTips:"跨鏈提現需要 L2 驗證(透過 ZK 證明),通常需要 5 分鐘至 2 小時。",crossChainTipsWithGas:"跨鏈提現需要 L2 驗證(透過 ZK 證明),通常需要 5 分鐘至 2 小時。您需自行承擔提現過程中產生的所有 Gas 費用。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",feeRate:"費率",withdrawlAmount:"提現金額",amountToReceive:"到账金額",minWithdraw:"最小提現金額",minWithdrawParsed:"最小提現 {{amount}} {{token}}",invalidReceiverAddress:"接收地址不能為空",availableDesc:"您可以提現的最大金額。當可用餘額為0或負數時,無法進行提現。",feeCalculationTip:"提現手續費按照提現金額乘以費率計算,最低為 1 USDT/USDC。費率會根據鏈上實際情況進行調整。",largeWithdrawFeeTip:"提現手續費為0.015%,將從提現金額中扣除。",crossChainPoolBalance:"跨鏈資金池餘額",poolBalance:"資金池餘額",poolBalanceInsufficientTip:"提現金額大於資金池餘額,無法進行提現。請選擇資金池餘額充足的選項。",connectedWalletTitle:"提現至已連接錢包",connectedWalletDesc:"將資金提現至您已連接的加密錢包、MetaMask、WalletConnect 或其他提供商",externalWalletTitle:"提現至外部帳戶",externalWalletDesc:"將資金提現至 Binance 或其他交易所、Arbitrum 等鏈及其他錢包"},account:{title:"帳戶",perp:"合約帳戶","perpetual-v1":"合約V1賬戶","perpetual-v2":"合約V2賬戶",spot:"現貨帳戶"}},Ui=["en-US","ja-JP","ru-RU","zh-CN","zh-TW","de-DE","es-LA","fr-FR","it-IT"],ru={"en-US":ib,"ja-JP":ub,"ru-RU":db,"zh-CN":fb,"zh-TW":pb,"de-DE":sb,"es-LA":ab,"fr-FR":lb,"it-IT":cb},bs="en-US",hb={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский","de-DE":"Deutsch","es-LA":"Español (Latinoamérica)","fr-FR":"Français","it-IT":"Italiano"},mb=e=>Ui.includes(e)?ru[e]:ru[bs],bb=e=>Ui.includes(e),ou=g.createContext(null),gb=({config:e,children:t})=>{const n=g.useMemo(()=>{const r=e.locale||bs,o=bb(r)?r:bs,s=mb(o);return{...e,currentLocale:o,translations:s}},[e]);return N.jsx(ou.Provider,{value:n,children:t})},su=()=>{const e=g.useContext(ou);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var yb=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Wi=Math.ceil,mt=Math.floor,Ze="[BigNumber Error] ",iu=Ze+"Number primitive has more than 15 significant digits: ",$t=1e14,ae=14,_i=9007199254740991,Vi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],An=1e7,Fe=1e9;function au(e){var t,n,r,o=w.prototype={constructor:w,toString:null,valueOf:null},s=new w(1),i=20,l=4,a=-7,c=21,u=-1e7,d=1e7,p=!1,f=1,h=0,m={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},x="0123456789abcdefghijklmnopqrstuvwxyz",T=!0;function w(b,v){var E,I,$,C,D,y,O,M,S=this;if(!(S instanceof w))return new w(b,v);if(v==null){if(b&&b._isBigNumber===!0){S.s=b.s,!b.c||b.e>d?S.c=S.e=null:b.e<u?S.c=[S.e=0]:(S.e=b.e,S.c=b.c.slice());return}if((y=typeof b=="number")&&b*0==0){if(S.s=1/b<0?(b=-b,-1):1,b===~~b){for(C=0,D=b;D>=10;D/=10,C++);C>d?S.c=S.e=null:(S.e=C,S.c=[b]);return}M=String(b)}else{if(!yb.test(M=String(b)))return r(S,M,y);S.s=M.charCodeAt(0)==45?(M=M.slice(1),-1):1}(C=M.indexOf("."))>-1&&(M=M.replace(".","")),(D=M.search(/e/i))>0?(C<0&&(C=D),C+=+M.slice(D+1),M=M.substring(0,D)):C<0&&(C=M.length)}else{if(Pe(v,2,x.length,"Base"),v==10&&T)return S=new w(b),B(S,i+S.e+1,l);if(M=String(b),y=typeof b=="number"){if(b*0!=0)return r(S,M,y,v);if(S.s=1/b<0?(M=M.slice(1),-1):1,w.DEBUG&&M.replace(/^0\.0*|\./,"").length>15)throw Error(iu+b)}else S.s=M.charCodeAt(0)===45?(M=M.slice(1),-1):1;for(E=x.slice(0,v),C=D=0,O=M.length;D<O;D++)if(E.indexOf(I=M.charAt(D))<0){if(I=="."){if(D>C){C=O;continue}}else if(!$&&(M==M.toUpperCase()&&(M=M.toLowerCase())||M==M.toLowerCase()&&(M=M.toUpperCase()))){$=!0,D=-1,C=0;continue}return r(S,String(b),y,v)}y=!1,M=n(M,v,10,S.s),(C=M.indexOf("."))>-1?M=M.replace(".",""):C=M.length}for(D=0;M.charCodeAt(D)===48;D++);for(O=M.length;M.charCodeAt(--O)===48;);if(M=M.slice(D,++O)){if(O-=D,y&&w.DEBUG&&O>15&&(b>_i||b!==mt(b)))throw Error(iu+S.s*b);if((C=C-D-1)>d)S.c=S.e=null;else if(C<u)S.c=[S.e=0];else{if(S.e=C,S.c=[],D=(C+1)%ae,C<0&&(D+=ae),D<O){for(D&&S.c.push(+M.slice(0,D)),O-=ae;D<O;)S.c.push(+M.slice(D,D+=ae));D=ae-(M=M.slice(D)).length}else D-=O;for(;D--;M+="0");S.c.push(+M)}}else S.c=[S.e=0]}w.clone=au,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(b){var v,E;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(v="DECIMAL_PLACES")&&(E=b[v],Pe(E,0,Fe,v),i=E),b.hasOwnProperty(v="ROUNDING_MODE")&&(E=b[v],Pe(E,0,8,v),l=E),b.hasOwnProperty(v="EXPONENTIAL_AT")&&(E=b[v],E&&E.pop?(Pe(E[0],-Fe,0,v),Pe(E[1],0,Fe,v),a=E[0],c=E[1]):(Pe(E,-Fe,Fe,v),a=-(c=E<0?-E:E))),b.hasOwnProperty(v="RANGE"))if(E=b[v],E&&E.pop)Pe(E[0],-Fe,-1,v),Pe(E[1],1,Fe,v),u=E[0],d=E[1];else if(Pe(E,-Fe,Fe,v),E)u=-(d=E<0?-E:E);else throw Error(Ze+v+" cannot be zero: "+E);if(b.hasOwnProperty(v="CRYPTO"))if(E=b[v],E===!!E)if(E)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=E;else throw p=!E,Error(Ze+"crypto unavailable");else p=E;else throw Error(Ze+v+" not true or false: "+E);if(b.hasOwnProperty(v="MODULO_MODE")&&(E=b[v],Pe(E,0,9,v),f=E),b.hasOwnProperty(v="POW_PRECISION")&&(E=b[v],Pe(E,0,Fe,v),h=E),b.hasOwnProperty(v="FORMAT"))if(E=b[v],typeof E=="object")m=E;else throw Error(Ze+v+" not an object: "+E);if(b.hasOwnProperty(v="ALPHABET"))if(E=b[v],typeof E=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(E))T=E.slice(0,10)=="0123456789",x=E;else throw Error(Ze+v+" invalid: "+E)}else throw Error(Ze+"Object expected: "+b);return{DECIMAL_PLACES:i,ROUNDING_MODE:l,EXPONENTIAL_AT:[a,c],RANGE:[u,d],CRYPTO:p,MODULO_MODE:f,POW_PRECISION:h,FORMAT:m,ALPHABET:x}},w.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var v,E,I=b.c,$=b.e,C=b.s;e:if({}.toString.call(I)=="[object Array]"){if((C===1||C===-1)&&$>=-Fe&&$<=Fe&&$===mt($)){if(I[0]===0){if($===0&&I.length===1)return!0;break e}if(v=($+1)%ae,v<1&&(v+=ae),String(I[0]).length==v){for(v=0;v<I.length;v++)if(E=I[v],E<0||E>=$t||E!==mt(E))break e;if(E!==0)return!0}}}else if(I===null&&$===null&&(C===null||C===1||C===-1))return!0;throw Error(Ze+"Invalid BigNumber: "+b)},w.maximum=w.max=function(){return A(arguments,-1)},w.minimum=w.min=function(){return A(arguments,1)},w.random=function(){var b=9007199254740992,v=Math.random()*b&2097151?function(){return mt(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(E){var I,$,C,D,y,O=0,M=[],S=new w(s);if(E==null?E=i:Pe(E,0,Fe),D=Wi(E/ae),p)if(crypto.getRandomValues){for(I=crypto.getRandomValues(new Uint32Array(D*=2));O<D;)y=I[O]*131072+(I[O+1]>>>11),y>=9e15?($=crypto.getRandomValues(new Uint32Array(2)),I[O]=$[0],I[O+1]=$[1]):(M.push(y%1e14),O+=2);O=D/2}else if(crypto.randomBytes){for(I=crypto.randomBytes(D*=7);O<D;)y=(I[O]&31)*281474976710656+I[O+1]*1099511627776+I[O+2]*4294967296+I[O+3]*16777216+(I[O+4]<<16)+(I[O+5]<<8)+I[O+6],y>=9e15?crypto.randomBytes(7).copy(I,O):(M.push(y%1e14),O+=7);O=D/7}else throw p=!1,Error(Ze+"crypto unavailable");if(!p)for(;O<D;)y=v(),y<9e15&&(M[O++]=y%1e14);for(D=M[--O],E%=ae,D&&E&&(y=Vi[ae-E],M[O]=mt(D/y)*y);M[O]===0;M.pop(),O--);if(O<0)M=[C=0];else{for(C=-1;M[0]===0;M.splice(0,1),C-=ae);for(O=1,y=M[0];y>=10;y/=10,O++);O<ae&&(C-=ae-O)}return S.e=C,S.c=M,S}}(),w.sum=function(){for(var b=1,v=arguments,E=new w(v[0]);b<v.length;)E=E.plus(v[b++]);return E},n=function(){var b="0123456789";function v(E,I,$,C){for(var D,y=[0],O,M=0,S=E.length;M<S;){for(O=y.length;O--;y[O]*=I);for(y[0]+=C.indexOf(E.charAt(M++)),D=0;D<y.length;D++)y[D]>$-1&&(y[D+1]==null&&(y[D+1]=0),y[D+1]+=y[D]/$|0,y[D]%=$)}return y.reverse()}return function(E,I,$,C,D){var y,O,M,S,L,j,z,W,_=E.indexOf("."),Z=i,q=l;for(_>=0&&(S=h,h=0,E=E.replace(".",""),W=new w(I),j=W.pow(E.length-_),h=S,W.c=v(on(gt(j.c),j.e,"0"),10,$,b),W.e=W.c.length),z=v(E,I,$,D?(y=x,b):(y=b,x)),M=S=z.length;z[--S]==0;z.pop());if(!z[0])return y.charAt(0);if(_<0?--M:(j.c=z,j.e=M,j.s=C,j=t(j,W,Z,q,$),z=j.c,L=j.r,M=j.e),O=M+Z+1,_=z[O],S=$/2,L=L||O<0||z[O+1]!=null,L=q<4?(_!=null||L)&&(q==0||q==(j.s<0?3:2)):_>S||_==S&&(q==4||L||q==6&&z[O-1]&1||q==(j.s<0?8:7)),O<1||!z[0])E=L?on(y.charAt(1),-Z,y.charAt(0)):y.charAt(0);else{if(z.length=O,L)for(--$;++z[--O]>$;)z[O]=0,O||(++M,z=[1].concat(z));for(S=z.length;!z[--S];);for(_=0,E="";_<=S;E+=y.charAt(z[_++]));E=on(E,M,y.charAt(0))}return E}}(),t=function(){function b(I,$,C){var D,y,O,M,S=0,L=I.length,j=$%An,z=$/An|0;for(I=I.slice();L--;)O=I[L]%An,M=I[L]/An|0,D=z*O+M*j,y=j*O+D%An*An+S,S=(y/C|0)+(D/An|0)+z*M,I[L]=y%C;return S&&(I=[S].concat(I)),I}function v(I,$,C,D){var y,O;if(C!=D)O=C>D?1:-1;else for(y=O=0;y<C;y++)if(I[y]!=$[y]){O=I[y]>$[y]?1:-1;break}return O}function E(I,$,C,D){for(var y=0;C--;)I[C]-=y,y=I[C]<$[C]?1:0,I[C]=y*D+I[C]-$[C];for(;!I[0]&&I.length>1;I.splice(0,1));}return function(I,$,C,D,y){var O,M,S,L,j,z,W,_,Z,q,H,ee,fe,me,ye,ve,oe,V=I.s==$.s?1:-1,X=I.c,Q=$.c;if(!X||!X[0]||!Q||!Q[0])return new w(!I.s||!$.s||(X?Q&&X[0]==Q[0]:!Q)?NaN:X&&X[0]==0||!Q?V*0:V/0);for(_=new w(V),Z=_.c=[],M=I.e-$.e,V=C+M+1,y||(y=$t,M=bt(I.e/ae)-bt($.e/ae),V=V/ae|0),S=0;Q[S]==(X[S]||0);S++);if(Q[S]>(X[S]||0)&&M--,V<0)Z.push(1),L=!0;else{for(me=X.length,ve=Q.length,S=0,V+=2,j=mt(y/(Q[0]+1)),j>1&&(Q=b(Q,j,y),X=b(X,j,y),ve=Q.length,me=X.length),fe=ve,q=X.slice(0,ve),H=q.length;H<ve;q[H++]=0);oe=Q.slice(),oe=[0].concat(oe),ye=Q[0],Q[1]>=y/2&&ye++;do{if(j=0,O=v(Q,q,ve,H),O<0){if(ee=q[0],ve!=H&&(ee=ee*y+(q[1]||0)),j=mt(ee/ye),j>1)for(j>=y&&(j=y-1),z=b(Q,j,y),W=z.length,H=q.length;v(z,q,W,H)==1;)j--,E(z,ve<W?oe:Q,W,y),W=z.length,O=1;else j==0&&(O=j=1),z=Q.slice(),W=z.length;if(W<H&&(z=[0].concat(z)),E(q,z,H,y),H=q.length,O==-1)for(;v(Q,q,ve,H)<1;)j++,E(q,ve<H?oe:Q,H,y),H=q.length}else O===0&&(j++,q=[0]);Z[S++]=j,q[0]?q[H++]=X[fe]||0:(q=[X[fe]],H=1)}while((fe++<me||q[0]!=null)&&V--);L=q[0]!=null,Z[0]||Z.splice(0,1)}if(y==$t){for(S=1,V=Z[0];V>=10;V/=10,S++);B(_,C+(_.e=S+M*ae-1)+1,D,L)}else _.e=M,_.r=+L;return _}}();function P(b,v,E,I){var $,C,D,y,O;if(E==null?E=l:Pe(E,0,8),!b.c)return b.toString();if($=b.c[0],D=b.e,v==null)O=gt(b.c),O=I==1||I==2&&(D<=a||D>=c)?ys(O,D):on(O,D,"0");else if(b=B(new w(b),v,E),C=b.e,O=gt(b.c),y=O.length,I==1||I==2&&(v<=C||C<=a)){for(;y<v;O+="0",y++);O=ys(O,C)}else if(v-=D+(I===2&&C>D),O=on(O,C,"0"),C+1>y){if(--v>0)for(O+=".";v--;O+="0");}else if(v+=C-y,v>0)for(C+1==y&&(O+=".");v--;O+="0");return b.s<0&&$?"-"+O:O}function A(b,v){for(var E,I,$=1,C=new w(b[0]);$<b.length;$++)I=new w(b[$]),(!I.s||(E=Hn(C,I))===v||E===0&&C.s===v)&&(C=I);return C}function k(b,v,E){for(var I=1,$=v.length;!v[--$];v.pop());for($=v[0];$>=10;$/=10,I++);return(E=I+E*ae-1)>d?b.c=b.e=null:E<u?b.c=[b.e=0]:(b.e=E,b.c=v),b}r=function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,v=/^([^.]+)\.$/,E=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,$=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(C,D,y,O){var M,S=y?D:D.replace($,"");if(I.test(S))C.s=isNaN(S)?null:S<0?-1:1;else{if(!y&&(S=S.replace(b,function(L,j,z){return M=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!O||O==M?j:L}),O&&(M=O,S=S.replace(v,"$1").replace(E,"0.$1")),D!=S))return new w(S,M);if(w.DEBUG)throw Error(Ze+"Not a"+(O?" base "+O:"")+" number: "+D);C.s=null}C.c=C.e=null}}();function B(b,v,E,I){var $,C,D,y,O,M,S,L=b.c,j=Vi;if(L){e:{for($=1,y=L[0];y>=10;y/=10,$++);if(C=v-$,C<0)C+=ae,D=v,O=L[M=0],S=mt(O/j[$-D-1]%10);else if(M=Wi((C+1)/ae),M>=L.length)if(I){for(;L.length<=M;L.push(0));O=S=0,$=1,C%=ae,D=C-ae+1}else break e;else{for(O=y=L[M],$=1;y>=10;y/=10,$++);C%=ae,D=C-ae+$,S=D<0?0:mt(O/j[$-D-1]%10)}if(I=I||v<0||L[M+1]!=null||(D<0?O:O%j[$-D-1]),I=E<4?(S||I)&&(E==0||E==(b.s<0?3:2)):S>5||S==5&&(E==4||I||E==6&&(C>0?D>0?O/j[$-D]:0:L[M-1])%10&1||E==(b.s<0?8:7)),v<1||!L[0])return L.length=0,I?(v-=b.e+1,L[0]=j[(ae-v%ae)%ae],b.e=-v||0):L[0]=b.e=0,b;if(C==0?(L.length=M,y=1,M--):(L.length=M+1,y=j[ae-C],L[M]=D>0?mt(O/j[$-D]%j[D])*y:0),I)for(;;)if(M==0){for(C=1,D=L[0];D>=10;D/=10,C++);for(D=L[0]+=y,y=1;D>=10;D/=10,y++);C!=y&&(b.e++,L[0]==$t&&(L[0]=1));break}else{if(L[M]+=y,L[M]!=$t)break;L[M--]=0,y=1}for(C=L.length;L[--C]===0;L.pop());}b.e>d?b.c=b.e=null:b.e<u&&(b.c=[b.e=0])}return b}function F(b){var v,E=b.e;return E===null?b.toString():(v=gt(b.c),v=E<=a||E>=c?ys(v,E):on(v,E,"0"),b.s<0?"-"+v:v)}return o.absoluteValue=o.abs=function(){var b=new w(this);return b.s<0&&(b.s=1),b},o.comparedTo=function(b,v){return Hn(this,new w(b,v))},o.decimalPlaces=o.dp=function(b,v){var E,I,$,C=this;if(b!=null)return Pe(b,0,Fe),v==null?v=l:Pe(v,0,8),B(new w(C),b+C.e+1,v);if(!(E=C.c))return null;if(I=(($=E.length-1)-bt(this.e/ae))*ae,$=E[$])for(;$%10==0;$/=10,I--);return I<0&&(I=0),I},o.dividedBy=o.div=function(b,v){return t(this,new w(b,v),i,l)},o.dividedToIntegerBy=o.idiv=function(b,v){return t(this,new w(b,v),0,1)},o.exponentiatedBy=o.pow=function(b,v){var E,I,$,C,D,y,O,M,S,L=this;if(b=new w(b),b.c&&!b.isInteger())throw Error(Ze+"Exponent not an integer: "+F(b));if(v!=null&&(v=new w(v)),y=b.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!b.c||!b.c[0])return S=new w(Math.pow(+F(L),y?b.s*(2-gs(b)):+F(b))),v?S.mod(v):S;if(O=b.s<0,v){if(v.c?!v.c[0]:!v.s)return new w(NaN);I=!O&&L.isInteger()&&v.isInteger(),I&&(L=L.mod(v))}else{if(b.e>9&&(L.e>0||L.e<-1||(L.e==0?L.c[0]>1||y&&L.c[1]>=24e7:L.c[0]<8e13||y&&L.c[0]<=9999975e7)))return C=L.s<0&&gs(b)?-0:0,L.e>-1&&(C=1/C),new w(O?1/C:C);h&&(C=Wi(h/ae+2))}for(y?(E=new w(.5),O&&(b.s=1),M=gs(b)):($=Math.abs(+F(b)),M=$%2),S=new w(s);;){if(M){if(S=S.times(L),!S.c)break;C?S.c.length>C&&(S.c.length=C):I&&(S=S.mod(v))}if($){if($=mt($/2),$===0)break;M=$%2}else if(b=b.times(E),B(b,b.e+1,1),b.e>14)M=gs(b);else{if($=+F(b),$===0)break;M=$%2}L=L.times(L),C?L.c&&L.c.length>C&&(L.c.length=C):I&&(L=L.mod(v))}return I?S:(O&&(S=s.div(S)),v?S.mod(v):C?B(S,h,l,D):S)},o.integerValue=function(b){var v=new w(this);return b==null?b=l:Pe(b,0,8),B(v,v.e+1,b)},o.isEqualTo=o.eq=function(b,v){return Hn(this,new w(b,v))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(b,v){return Hn(this,new w(b,v))>0},o.isGreaterThanOrEqualTo=o.gte=function(b,v){return(v=Hn(this,new w(b,v)))===1||v===0},o.isInteger=function(){return!!this.c&&bt(this.e/ae)>this.c.length-2},o.isLessThan=o.lt=function(b,v){return Hn(this,new w(b,v))<0},o.isLessThanOrEqualTo=o.lte=function(b,v){return(v=Hn(this,new w(b,v)))===-1||v===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(b,v){var E,I,$,C,D=this,y=D.s;if(b=new w(b,v),v=b.s,!y||!v)return new w(NaN);if(y!=v)return b.s=-v,D.plus(b);var O=D.e/ae,M=b.e/ae,S=D.c,L=b.c;if(!O||!M){if(!S||!L)return S?(b.s=-v,b):new w(L?D:NaN);if(!S[0]||!L[0])return L[0]?(b.s=-v,b):new w(S[0]?D:l==3?-0:0)}if(O=bt(O),M=bt(M),S=S.slice(),y=O-M){for((C=y<0)?(y=-y,$=S):(M=O,$=L),$.reverse(),v=y;v--;$.push(0));$.reverse()}else for(I=(C=(y=S.length)<(v=L.length))?y:v,y=v=0;v<I;v++)if(S[v]!=L[v]){C=S[v]<L[v];break}if(C&&($=S,S=L,L=$,b.s=-b.s),v=(I=L.length)-(E=S.length),v>0)for(;v--;S[E++]=0);for(v=$t-1;I>y;){if(S[--I]<L[I]){for(E=I;E&&!S[--E];S[E]=v);--S[E],S[I]+=$t}S[I]-=L[I]}for(;S[0]==0;S.splice(0,1),--M);return S[0]?k(b,S,M):(b.s=l==3?-1:1,b.c=[b.e=0],b)},o.modulo=o.mod=function(b,v){var E,I,$=this;return b=new w(b,v),!$.c||!b.s||b.c&&!b.c[0]?new w(NaN):!b.c||$.c&&!$.c[0]?new w($):(f==9?(I=b.s,b.s=1,E=t($,b,0,3),b.s=I,E.s*=I):E=t($,b,0,f),b=$.minus(E.times(b)),!b.c[0]&&f==1&&(b.s=$.s),b)},o.multipliedBy=o.times=function(b,v){var E,I,$,C,D,y,O,M,S,L,j,z,W,_,Z,q=this,H=q.c,ee=(b=new w(b,v)).c;if(!H||!ee||!H[0]||!ee[0])return!q.s||!b.s||H&&!H[0]&&!ee||ee&&!ee[0]&&!H?b.c=b.e=b.s=null:(b.s*=q.s,!H||!ee?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(I=bt(q.e/ae)+bt(b.e/ae),b.s*=q.s,O=H.length,L=ee.length,O<L&&(W=H,H=ee,ee=W,$=O,O=L,L=$),$=O+L,W=[];$--;W.push(0));for(_=$t,Z=An,$=L;--$>=0;){for(E=0,j=ee[$]%Z,z=ee[$]/Z|0,D=O,C=$+D;C>$;)M=H[--D]%Z,S=H[D]/Z|0,y=z*M+S*j,M=j*M+y%Z*Z+W[C]+E,E=(M/_|0)+(y/Z|0)+z*S,W[C--]=M%_;W[C]=E}return E?++I:W.splice(0,1),k(b,W,I)},o.negated=function(){var b=new w(this);return b.s=-b.s||null,b},o.plus=function(b,v){var E,I=this,$=I.s;if(b=new w(b,v),v=b.s,!$||!v)return new w(NaN);if($!=v)return b.s=-v,I.minus(b);var C=I.e/ae,D=b.e/ae,y=I.c,O=b.c;if(!C||!D){if(!y||!O)return new w($/0);if(!y[0]||!O[0])return O[0]?b:new w(y[0]?I:$*0)}if(C=bt(C),D=bt(D),y=y.slice(),$=C-D){for($>0?(D=C,E=O):($=-$,E=y),E.reverse();$--;E.push(0));E.reverse()}for($=y.length,v=O.length,$-v<0&&(E=O,O=y,y=E,v=$),$=0;v;)$=(y[--v]=y[v]+O[v]+$)/$t|0,y[v]=$t===y[v]?0:y[v]%$t;return $&&(y=[$].concat(y),++D),k(b,y,D)},o.precision=o.sd=function(b,v){var E,I,$,C=this;if(b!=null&&b!==!!b)return Pe(b,1,Fe),v==null?v=l:Pe(v,0,8),B(new w(C),b,v);if(!(E=C.c))return null;if($=E.length-1,I=$*ae+1,$=E[$]){for(;$%10==0;$/=10,I--);for($=E[0];$>=10;$/=10,I++);}return b&&C.e+1>I&&(I=C.e+1),I},o.shiftedBy=function(b){return Pe(b,-_i,_i),this.times("1e"+b)},o.squareRoot=o.sqrt=function(){var b,v,E,I,$,C=this,D=C.c,y=C.s,O=C.e,M=i+4,S=new w("0.5");if(y!==1||!D||!D[0])return new w(!y||y<0&&(!D||D[0])?NaN:D?C:1/0);if(y=Math.sqrt(+F(C)),y==0||y==1/0?(v=gt(D),(v.length+O)%2==0&&(v+="0"),y=Math.sqrt(+v),O=bt((O+1)/2)-(O<0||O%2),y==1/0?v="5e"+O:(v=y.toExponential(),v=v.slice(0,v.indexOf("e")+1)+O),E=new w(v)):E=new w(y+""),E.c[0]){for(O=E.e,y=O+M,y<3&&(y=0);;)if($=E,E=S.times($.plus(t(C,$,M,1))),gt($.c).slice(0,y)===(v=gt(E.c)).slice(0,y))if(E.e<O&&--y,v=v.slice(y-3,y+1),v=="9999"||!I&&v=="4999"){if(!I&&(B($,$.e+i+2,0),$.times($).eq(C))){E=$;break}M+=4,y+=4,I=1}else{(!+v||!+v.slice(1)&&v.charAt(0)=="5")&&(B(E,E.e+i+2,1),b=!E.times(E).eq(C));break}}return B(E,E.e+i+1,l,b)},o.toExponential=function(b,v){return b!=null&&(Pe(b,0,Fe),b++),P(this,b,v,1)},o.toFixed=function(b,v){return b!=null&&(Pe(b,0,Fe),b=b+this.e+1),P(this,b,v)},o.toFormat=function(b,v,E){var I,$=this;if(E==null)b!=null&&v&&typeof v=="object"?(E=v,v=null):b&&typeof b=="object"?(E=b,b=v=null):E=m;else if(typeof E!="object")throw Error(Ze+"Argument not an object: "+E);if(I=$.toFixed(b,v),$.c){var C,D=I.split("."),y=+E.groupSize,O=+E.secondaryGroupSize,M=E.groupSeparator||"",S=D[0],L=D[1],j=$.s<0,z=j?S.slice(1):S,W=z.length;if(O&&(C=y,y=O,O=C,W-=C),y>0&&W>0){for(C=W%y||y,S=z.substr(0,C);C<W;C+=y)S+=M+z.substr(C,y);O>0&&(S+=M+z.slice(C)),j&&(S="-"+S)}I=L?S+(E.decimalSeparator||"")+((O=+E.fractionGroupSize)?L.replace(new RegExp("\\d{"+O+"}\\B","g"),"$&"+(E.fractionGroupSeparator||"")):L):S}return(E.prefix||"")+I+(E.suffix||"")},o.toFraction=function(b){var v,E,I,$,C,D,y,O,M,S,L,j,z=this,W=z.c;if(b!=null&&(y=new w(b),!y.isInteger()&&(y.c||y.s!==1)||y.lt(s)))throw Error(Ze+"Argument "+(y.isInteger()?"out of range: ":"not an integer: ")+F(y));if(!W)return new w(z);for(v=new w(s),M=E=new w(s),I=O=new w(s),j=gt(W),C=v.e=j.length-z.e-1,v.c[0]=Vi[(D=C%ae)<0?ae+D:D],b=!b||y.comparedTo(v)>0?C>0?v:M:y,D=d,d=1/0,y=new w(j),O.c[0]=0;S=t(y,v,0,1),$=E.plus(S.times(I)),$.comparedTo(b)!=1;)E=I,I=$,M=O.plus(S.times($=M)),O=$,v=y.minus(S.times($=v)),y=$;return $=t(b.minus(E),I,0,1),O=O.plus($.times(M)),E=E.plus($.times(I)),O.s=M.s=z.s,C=C*2,L=t(M,I,C,l).minus(z).abs().comparedTo(t(O,E,C,l).minus(z).abs())<1?[M,I]:[O,E],d=D,L},o.toNumber=function(){return+F(this)},o.toPrecision=function(b,v){return b!=null&&Pe(b,1,Fe),P(this,b,v,2)},o.toString=function(b){var v,E=this,I=E.s,$=E.e;return $===null?I?(v="Infinity",I<0&&(v="-"+v)):v="NaN":(b==null?v=$<=a||$>=c?ys(gt(E.c),$):on(gt(E.c),$,"0"):b===10&&T?(E=B(new w(E),i+$+1,l),v=on(gt(E.c),E.e,"0")):(Pe(b,2,x.length,"Base"),v=n(on(gt(E.c),$,"0"),10,b,I,!0)),I<0&&E.c[0]&&(v="-"+v)),v},o.valueOf=o.toJSON=function(){return F(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&w.set(e),w}function bt(e){var t=e|0;return e>0||e===t?t:t-1}function gt(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=ae-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function Hn(e,t){var n,r,o=e.c,s=t.c,i=e.s,l=t.s,a=e.e,c=t.e;if(!i||!l)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-l:i;if(i!=l)return i;if(n=i<0,r=a==c,!o||!s)return r?0:!o^n?1:-1;if(!r)return a>c^n?1:-1;for(l=(a=o.length)<(c=s.length)?a:c,i=0;i<l;i++)if(o[i]!=s[i])return o[i]>s[i]^n?1:-1;return a==c?0:a>c^n?1:-1}function Pe(e,t,n,r){if(e<t||e>n||e!==mt(e))throw Error(Ze+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function gs(e){var t=e.c.length-1;return bt(e.e/ae)==t&&e.c[t]%2!=0}function ys(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function on(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var ke=au();const vb=(e,t=6)=>{try{const n=new ke(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,ke.ROUND_DOWN),[o,s=""]=r.toString().split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const l=(s||"").padEnd(t,"0");return`${i}.${l}`}return i}catch(n){return console.warn("formatThousands error:",n),"0"}},It=()=>{const{translations:e,currentLocale:t}=su();return{t:(s,i)=>{try{const l=s.split(".");let a=e;for(const u of l)if(a&&typeof a=="object"&&u in a)a=a[u];else return s;let c=typeof a=="string"?a:s;return i&&typeof c=="string"&&Object.keys(i).forEach(u=>{const d=`{{${u}}}`;c=c.replace(new RegExp(d,"g"),String(i[u]))}),c}catch(l){return console.warn(`Translation error for key "${s}":`,l),s}},translations:e,locale:t,getTranslationObject:s=>{try{const i=s.split(".");let l=e;for(const a of i)if(l&&typeof l=="object"&&a in l)l=l[a];else return{};return typeof l=="object"?l:{}}catch(i){return console.warn(`Translation object error for key "${s}":`,i),{}}},hasTranslation:s=>{try{const i=s.split(".");let l=e;for(const a of i)if(l&&typeof l=="object"&&a in l)l=l[a];else return!1;return typeof l=="string"}catch{return!1}}}},wb="1.2.3";let Ye=class Jc extends Error{constructor(t,n={}){var i;const r=n.cause instanceof Jc?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,o=n.cause instanceof Jc&&n.cause.docsPath||n.docsPath,s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${wb}`].join(`
|
|
51
|
-
`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.shortMessage=t}};function sn(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const lu=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,cu=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,uu=/^\(.+?\).*?$/,du=/^tuple(?<array>(\[(\d*)\])*)$/;function Hi(e){let t=e.type;if(du.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let o=0;o<n;o++){const s=e.components[o];t+=Hi(s),o<n-1&&(t+=", ")}const r=sn(du,e.type);return t+=`)${(r==null?void 0:r.array)||""}`,Hi({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function mr(e){let t="";const n=e.length;for(let r=0;r<n;r++){const o=e[r];t+=Hi(o),r!==n-1&&(t+=", ")}return t}function vs(e){var t;return e.type==="function"?`function ${e.name}(${mr(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${mr(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${mr(e.inputs)})`:e.type==="error"?`error ${e.name}(${mr(e.inputs)})`:e.type==="constructor"?`constructor(${mr(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const fu=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function xb(e){return fu.test(e)}function Eb(e){return sn(fu,e)}const pu=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Sb(e){return pu.test(e)}function Pb(e){return sn(pu,e)}const hu=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function Tb(e){return hu.test(e)}function Ab(e){return sn(hu,e)}const mu=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function ws(e){return mu.test(e)}function Nb(e){return sn(mu,e)}const bu=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function Cb(e){return bu.test(e)}function Ob(e){return sn(bu,e)}const gu=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function $b(e){return gu.test(e)}function Ib(e){return sn(gu,e)}const Mb=/^receive\(\) external payable$/;function Db(e){return Mb.test(e)}const yu=new Set(["memory","indexed","storage","calldata"]),kb=new Set(["indexed"]),Gi=new Set(["calldata","memory","storage"]);class Lb extends Ye{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class Bb extends Ye{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Fb extends Ye{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Rb extends Ye{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class jb extends Ye{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class zb extends Ye{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Ub extends Ye{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Wb extends Ye{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class _b extends Ye{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class br extends Ye{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Vb extends Ye{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Hb extends Ye{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class Gb extends Ye{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class qb extends Ye{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function Kb(e,t,n){let r="";if(n)for(const o of Object.entries(n)){if(!o)continue;let s="";for(const i of o[1])s+=`[${i.type}${i.name?`:${i.name}`:""}]`;r+=`(${o[0]}{${s}})`}return t?`${t}:${e}${r}`:`${e}${r}`}const qi=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Ki(e,t={}){if(Tb(e))return Zb(e,t);if(Sb(e))return Yb(e,t);if(xb(e))return Xb(e,t);if(Cb(e))return Jb(e,t);if($b(e))return Qb(e);if(Db(e))return{type:"receive",stateMutability:"payable"};throw new Vb({signature:e})}function Zb(e,t={}){const n=Ab(e);if(!n)throw new br({signature:e,type:"function"});const r=ut(n.parameters),o=[],s=r.length;for(let l=0;l<s;l++)o.push(an(r[l],{modifiers:Gi,structs:t,type:"function"}));const i=[];if(n.returns){const l=ut(n.returns),a=l.length;for(let c=0;c<a;c++)i.push(an(l[c],{modifiers:Gi,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}function Yb(e,t={}){const n=Pb(e);if(!n)throw new br({signature:e,type:"event"});const r=ut(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(an(r[i],{modifiers:kb,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function Xb(e,t={}){const n=Eb(e);if(!n)throw new br({signature:e,type:"error"});const r=ut(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(an(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function Jb(e,t={}){const n=Ob(e);if(!n)throw new br({signature:e,type:"constructor"});const r=ut(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(an(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function Qb(e){const t=Ib(e);if(!t)throw new br({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const eg=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,tg=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,ng=/^u?int$/;function an(e,t){var d,p;const n=Kb(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(qi.has(n))return qi.get(n);const r=uu.test(e),o=sn(r?tg:eg,e);if(!o)throw new jb({param:e});if(o.name&&og(o.name))throw new zb({param:e,name:o.name});const s=o.name?{name:o.name}:{},i=o.modifier==="indexed"?{indexed:!0}:{},l=(t==null?void 0:t.structs)??{};let a,c={};if(r){a="tuple";const f=ut(o.type),h=[],m=f.length;for(let x=0;x<m;x++)h.push(an(f[x],{structs:l}));c={components:h}}else if(o.type in l)a="tuple",c={components:l[o.type]};else if(ng.test(o.type))a=`${o.type}256`;else if(o.type==="address payable")a="address";else if(a=o.type,(t==null?void 0:t.type)!=="struct"&&!vu(a))throw new Fb({type:a});if(o.modifier){if(!((p=(d=t==null?void 0:t.modifiers)==null?void 0:d.has)!=null&&p.call(d,o.modifier)))throw new Ub({param:e,type:t==null?void 0:t.type,modifier:o.modifier});if(Gi.has(o.modifier)&&!sg(a,!!o.array))throw new Wb({param:e,type:t==null?void 0:t.type,modifier:o.modifier})}const u={type:`${a}${o.array??""}`,...s,...i,...c};return qi.set(n,u),u}function ut(e,t=[],n="",r=0){const o=e.trim().length;for(let s=0;s<o;s++){const i=e[s],l=e.slice(s+1);switch(i){case",":return r===0?ut(l,[...t,n.trim()]):ut(l,t,`${n}${i}`,r);case"(":return ut(l,t,`${n}${i}`,r+1);case")":return ut(l,t,`${n}${i}`,r-1);default:return ut(l,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new qb({current:n,depth:r});return t.push(n.trim()),t}function vu(e){return e==="address"||e==="bool"||e==="function"||e==="string"||lu.test(e)||cu.test(e)}const rg=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function og(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||lu.test(e)||cu.test(e)||rg.test(e)}function sg(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Zi(e){const t={},n=e.length;for(let i=0;i<n;i++){const l=e[i];if(!ws(l))continue;const a=Nb(l);if(!a)throw new br({signature:l,type:"struct"});const c=a.properties.split(";"),u=[],d=c.length;for(let p=0;p<d;p++){const h=c[p].trim();if(!h)continue;const m=an(h,{type:"struct"});u.push(m)}if(!u.length)throw new Hb({signature:l});t[a.name]=u}const r={},o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[l,a]=o[i];r[l]=wu(a,t)}return r}const ig=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function wu(e=[],t={},n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(uu.test(i.type))r.push(i);else{const a=sn(ig,i.type);if(!(a!=null&&a.type))throw new _b({abiParameter:i});const{array:c,type:u}=a;if(u in t){if(n.has(u))throw new Gb({type:u});r.push({...i,type:`tuple${c??""}`,components:wu(t[u],t,new Set([...n,u]))})}else if(vu(u))r.push(i);else throw new Bb({type:u})}}return r}function xu(e){const t=Zi(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];ws(s)||n.push(Ki(s,t))}return n}function Eu(e){let t;if(typeof e=="string")t=Ki(e);else{const n=Zi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(!ws(s)){t=Ki(s,n);break}}}if(!t)throw new Lb({signature:e});return t}function Su(e){const t=[];if(typeof e=="string"){const n=ut(e),r=n.length;for(let o=0;o<r;o++)t.push(an(n[o],{modifiers:yu}))}else{const n=Zi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(ws(s))continue;const i=ut(s),l=i.length;for(let a=0;a<l;a++)t.push(an(i[a],{modifiers:yu,structs:n}))}}if(t.length===0)throw new Rb({params:e});return t}function te(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const o=e[n];return typeof o=="function"?o:s=>t(e,s)}function Mt(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new wg(e.type);return`${e.name}(${xs(e.inputs,{includeName:t})})`}function xs(e,{includeName:t=!1}={}){return e?e.map(n=>ag(n,{includeName:t})).join(t?", ":","):""}function ag(e,{includeName:t}){return e.type.startsWith("tuple")?`(${xs(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Dt(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Te(e){return Dt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Pu="2.47.2";let no={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Pu}`},G=class Qc extends Error{constructor(t,n={}){var l;const r=(()=>{var a;return n.cause instanceof Qc?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof Qc&&n.cause.docsPath||n.docsPath,s=(l=no.getDocsUrl)==null?void 0:l.call(no,{...n,docsPath:o}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...no.version?[`Version: ${no.version}`]:[]].join(`
|
|
52
|
-
`);super(i,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Pu}walk(t){return Tu(this,t)}};function Tu(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Tu(e.cause,t):t?null:e}class
|
|
50
|
+
跨鏈充值需由您承擔 Edge 網路手續費。到帳金額會略小於您的充值金額。`,addressUpdatedNotice:"注意:充值地址已更新,請改用新地址。原地址僅在過渡期內有效,之後將停用。若已在其他平台儲存,請儘速更新。",enableSystemProWithToken:"在{{network}}上啓用{{token}}",enableTokenDesc:"您首次在{{network}}上存款時必須啓用{{token}}。",enableWithToken:"啓用 {{token}}",arrivaltimeTooltip1:"資金約在 {{v}} 分鐘內(達到 {{v1}} 個區塊確認後)到賬。",arrivaltimeTooltip2:"預計時間是根據歷史資料計算所得,僅供參考。網路壅塞可能會導致實際到帳時間變長。",arrivalEstimated:"≈ {{v}}分鐘",feeRateTooltip:"預估手續費,以實際扣除為準。",availableDesc:"您可以充值的最大金額。當可用餘額為0或負數時,無法進行充值。",noPrivateKeyWalletWarning:"請勿使用無私鑰錢包進行充值,無私鑰錢包充值會導致資金損失且無法追回。",layerZeroDepositTip:"系統會根據充值資金的實際情況,通過 LayerZero 完成您的充值。",layerZeroDepositTipExceedPool:"由於充值資金大於資金池,將透過 LayerZero 完成您的充值。",layerZeroDepositTipGte200k:"由於充值資金大於等於 200,000 USDT,將透過 LayerZero 完成您的充值。",layerZeroDepositButton:"使用LayerZero充值",defaultSpotNotice:"預設充值至現貨帳戶",defaultSpotToPerpNotice:"僅支援發送 {{coin}} ({{v}}) 資產到此位址。預設充值至現貨帳戶。若需充入合約帳戶,請自現貨帳戶劃轉至合約帳戶。",depositModeSwitchWarning:"當您發起充值後或正在充值中時請勿切換充值模式,以免導致您的充值方式發生變更",connectedWalletTitle:"從已連接錢包充值",connectedWalletDesc:"使用 MetaMask、WalletConnect 或其他錢包進行充值",externalWalletTitle:"從外部錢包充值",externalWalletDesc:"從 Binance 或其他交易所、Arbitrum 等鏈或其他錢包轉帳",or:"或"},withdraw:{noticeDesc:"在您發起提領請求後,將於 Layer2 進行處理。資金準備就緒後(通常在 4 小時內),您將收到通知,將資金提領至您的錢包。",noticeDescWithClaim:"在您發起提領請求後,將於 Layer2 進行處理。資金準備就緒後(通常在 4 小時內),您將收到通知,將資金提領至您的錢包。您需進行領取操作並填寫提現地址,以完成整個提現流程。",externalWalletEthNoticeDesc:"在您發起提領請求後,將於 Layer2 進行處理。資金準備就緒後(通常在 4 小時內),您將收到通知,將資金提領至您的錢包。您需自行承擔提現過程中產生的所有 Gas 費用。",crossChainTips:"跨鏈提現需要 L2 驗證(透過 ZK 證明),通常需要 5 分鐘至 2 小時。",crossChainTipsWithGas:"跨鏈提現需要 L2 驗證(透過 ZK 證明),通常需要 5 分鐘至 2 小時。您需自行承擔提現過程中產生的所有 Gas 費用。",commonWithdraw:"提現說明",withdraw:"提現",speed:"速度",confirmWithdraw:"提現確認",speedNote:"處理時間:",speedNoteSpeed1:"用時約8分鐘",speedNoteSpeed2:"用時約 2-4 小時",speedNoteSpeed3:"用時約4小時",receiverAddress:"接收地址",fee:"手續費",feeRate:"費率",withdrawlAmount:"提現金額",amountToReceive:"到账金額",minWithdraw:"最小提現金額",minWithdrawParsed:"最小提現 {{amount}} {{token}}",invalidReceiverAddress:"接收地址不能為空",availableDesc:"您可以提現的最大金額。當可用餘額為0或負數時,無法進行提現。",feeCalculationTip:"提現手續費按照提現金額乘以費率計算,最低為 1 USDT/USDC。費率會根據鏈上實際情況進行調整。",largeWithdrawFeeTip:"提現手續費為0.015%,將從提現金額中扣除。",crossChainPoolBalance:"跨鏈資金池餘額",poolBalance:"資金池餘額",poolBalanceInsufficientTip:"提現金額大於資金池餘額,無法進行提現。請選擇資金池餘額充足的選項。",connectedWalletTitle:"提現至已連接錢包",connectedWalletDesc:"將資金提現至您已連接的加密錢包、MetaMask、WalletConnect 或其他提供商",externalWalletTitle:"提現至外部帳戶",externalWalletDesc:"將資金提現至 Binance 或其他交易所、Arbitrum 等鏈及其他錢包"},account:{title:"帳戶",perp:"合約帳戶","perpetual-v1":"合約V1賬戶","perpetual-v2":"合約V2賬戶",spot:"現貨帳戶"}},Ui=["en-US","ja-JP","ru-RU","zh-CN","zh-TW","de-DE","es-LA","fr-FR","it-IT"],ru={"en-US":ab,"ja-JP":db,"ru-RU":fb,"zh-CN":pb,"zh-TW":hb,"de-DE":ib,"es-LA":lb,"fr-FR":cb,"it-IT":ub},bs="en-US",mb={"en-US":"English","zh-CN":"简体中文","zh-TW":"繁體中文","ja-JP":"日本語","ru-RU":"Русский","de-DE":"Deutsch","es-LA":"Español (Latinoamérica)","fr-FR":"Français","it-IT":"Italiano"},bb=e=>Ui.includes(e)?ru[e]:ru[bs],gb=e=>Ui.includes(e),ou=g.createContext(null),yb=({config:e,children:t})=>{const n=g.useMemo(()=>{const r=e.locale||bs,o=gb(r)?r:bs,s=bb(o);return{...e,currentLocale:o,translations:s}},[e]);return N.jsx(ou.Provider,{value:n,children:t})},su=()=>{const e=g.useContext(ou);if(!e)throw new Error("useComponentConfig must be used within ComponentProvider");return e};var vb=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Wi=Math.ceil,mt=Math.floor,Ze="[BigNumber Error] ",iu=Ze+"Number primitive has more than 15 significant digits: ",$t=1e14,ae=14,_i=9007199254740991,Vi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],An=1e7,Fe=1e9;function au(e){var t,n,r,o=w.prototype={constructor:w,toString:null,valueOf:null},s=new w(1),i=20,l=4,a=-7,c=21,u=-1e7,d=1e7,p=!1,f=1,h=0,m={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},x="0123456789abcdefghijklmnopqrstuvwxyz",T=!0;function w(b,v){var E,M,$,C,D,y,O,I,S=this;if(!(S instanceof w))return new w(b,v);if(v==null){if(b&&b._isBigNumber===!0){S.s=b.s,!b.c||b.e>d?S.c=S.e=null:b.e<u?S.c=[S.e=0]:(S.e=b.e,S.c=b.c.slice());return}if((y=typeof b=="number")&&b*0==0){if(S.s=1/b<0?(b=-b,-1):1,b===~~b){for(C=0,D=b;D>=10;D/=10,C++);C>d?S.c=S.e=null:(S.e=C,S.c=[b]);return}I=String(b)}else{if(!vb.test(I=String(b)))return r(S,I,y);S.s=I.charCodeAt(0)==45?(I=I.slice(1),-1):1}(C=I.indexOf("."))>-1&&(I=I.replace(".","")),(D=I.search(/e/i))>0?(C<0&&(C=D),C+=+I.slice(D+1),I=I.substring(0,D)):C<0&&(C=I.length)}else{if(Pe(v,2,x.length,"Base"),v==10&&T)return S=new w(b),B(S,i+S.e+1,l);if(I=String(b),y=typeof b=="number"){if(b*0!=0)return r(S,I,y,v);if(S.s=1/b<0?(I=I.slice(1),-1):1,w.DEBUG&&I.replace(/^0\.0*|\./,"").length>15)throw Error(iu+b)}else S.s=I.charCodeAt(0)===45?(I=I.slice(1),-1):1;for(E=x.slice(0,v),C=D=0,O=I.length;D<O;D++)if(E.indexOf(M=I.charAt(D))<0){if(M=="."){if(D>C){C=O;continue}}else if(!$&&(I==I.toUpperCase()&&(I=I.toLowerCase())||I==I.toLowerCase()&&(I=I.toUpperCase()))){$=!0,D=-1,C=0;continue}return r(S,String(b),y,v)}y=!1,I=n(I,v,10,S.s),(C=I.indexOf("."))>-1?I=I.replace(".",""):C=I.length}for(D=0;I.charCodeAt(D)===48;D++);for(O=I.length;I.charCodeAt(--O)===48;);if(I=I.slice(D,++O)){if(O-=D,y&&w.DEBUG&&O>15&&(b>_i||b!==mt(b)))throw Error(iu+S.s*b);if((C=C-D-1)>d)S.c=S.e=null;else if(C<u)S.c=[S.e=0];else{if(S.e=C,S.c=[],D=(C+1)%ae,C<0&&(D+=ae),D<O){for(D&&S.c.push(+I.slice(0,D)),O-=ae;D<O;)S.c.push(+I.slice(D,D+=ae));D=ae-(I=I.slice(D)).length}else D-=O;for(;D--;I+="0");S.c.push(+I)}}else S.c=[S.e=0]}w.clone=au,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(b){var v,E;if(b!=null)if(typeof b=="object"){if(b.hasOwnProperty(v="DECIMAL_PLACES")&&(E=b[v],Pe(E,0,Fe,v),i=E),b.hasOwnProperty(v="ROUNDING_MODE")&&(E=b[v],Pe(E,0,8,v),l=E),b.hasOwnProperty(v="EXPONENTIAL_AT")&&(E=b[v],E&&E.pop?(Pe(E[0],-Fe,0,v),Pe(E[1],0,Fe,v),a=E[0],c=E[1]):(Pe(E,-Fe,Fe,v),a=-(c=E<0?-E:E))),b.hasOwnProperty(v="RANGE"))if(E=b[v],E&&E.pop)Pe(E[0],-Fe,-1,v),Pe(E[1],1,Fe,v),u=E[0],d=E[1];else if(Pe(E,-Fe,Fe,v),E)u=-(d=E<0?-E:E);else throw Error(Ze+v+" cannot be zero: "+E);if(b.hasOwnProperty(v="CRYPTO"))if(E=b[v],E===!!E)if(E)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))p=E;else throw p=!E,Error(Ze+"crypto unavailable");else p=E;else throw Error(Ze+v+" not true or false: "+E);if(b.hasOwnProperty(v="MODULO_MODE")&&(E=b[v],Pe(E,0,9,v),f=E),b.hasOwnProperty(v="POW_PRECISION")&&(E=b[v],Pe(E,0,Fe,v),h=E),b.hasOwnProperty(v="FORMAT"))if(E=b[v],typeof E=="object")m=E;else throw Error(Ze+v+" not an object: "+E);if(b.hasOwnProperty(v="ALPHABET"))if(E=b[v],typeof E=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(E))T=E.slice(0,10)=="0123456789",x=E;else throw Error(Ze+v+" invalid: "+E)}else throw Error(Ze+"Object expected: "+b);return{DECIMAL_PLACES:i,ROUNDING_MODE:l,EXPONENTIAL_AT:[a,c],RANGE:[u,d],CRYPTO:p,MODULO_MODE:f,POW_PRECISION:h,FORMAT:m,ALPHABET:x}},w.isBigNumber=function(b){if(!b||b._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var v,E,M=b.c,$=b.e,C=b.s;e:if({}.toString.call(M)=="[object Array]"){if((C===1||C===-1)&&$>=-Fe&&$<=Fe&&$===mt($)){if(M[0]===0){if($===0&&M.length===1)return!0;break e}if(v=($+1)%ae,v<1&&(v+=ae),String(M[0]).length==v){for(v=0;v<M.length;v++)if(E=M[v],E<0||E>=$t||E!==mt(E))break e;if(E!==0)return!0}}}else if(M===null&&$===null&&(C===null||C===1||C===-1))return!0;throw Error(Ze+"Invalid BigNumber: "+b)},w.maximum=w.max=function(){return A(arguments,-1)},w.minimum=w.min=function(){return A(arguments,1)},w.random=function(){var b=9007199254740992,v=Math.random()*b&2097151?function(){return mt(Math.random()*b)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(E){var M,$,C,D,y,O=0,I=[],S=new w(s);if(E==null?E=i:Pe(E,0,Fe),D=Wi(E/ae),p)if(crypto.getRandomValues){for(M=crypto.getRandomValues(new Uint32Array(D*=2));O<D;)y=M[O]*131072+(M[O+1]>>>11),y>=9e15?($=crypto.getRandomValues(new Uint32Array(2)),M[O]=$[0],M[O+1]=$[1]):(I.push(y%1e14),O+=2);O=D/2}else if(crypto.randomBytes){for(M=crypto.randomBytes(D*=7);O<D;)y=(M[O]&31)*281474976710656+M[O+1]*1099511627776+M[O+2]*4294967296+M[O+3]*16777216+(M[O+4]<<16)+(M[O+5]<<8)+M[O+6],y>=9e15?crypto.randomBytes(7).copy(M,O):(I.push(y%1e14),O+=7);O=D/7}else throw p=!1,Error(Ze+"crypto unavailable");if(!p)for(;O<D;)y=v(),y<9e15&&(I[O++]=y%1e14);for(D=I[--O],E%=ae,D&&E&&(y=Vi[ae-E],I[O]=mt(D/y)*y);I[O]===0;I.pop(),O--);if(O<0)I=[C=0];else{for(C=-1;I[0]===0;I.splice(0,1),C-=ae);for(O=1,y=I[0];y>=10;y/=10,O++);O<ae&&(C-=ae-O)}return S.e=C,S.c=I,S}}(),w.sum=function(){for(var b=1,v=arguments,E=new w(v[0]);b<v.length;)E=E.plus(v[b++]);return E},n=function(){var b="0123456789";function v(E,M,$,C){for(var D,y=[0],O,I=0,S=E.length;I<S;){for(O=y.length;O--;y[O]*=M);for(y[0]+=C.indexOf(E.charAt(I++)),D=0;D<y.length;D++)y[D]>$-1&&(y[D+1]==null&&(y[D+1]=0),y[D+1]+=y[D]/$|0,y[D]%=$)}return y.reverse()}return function(E,M,$,C,D){var y,O,I,S,L,j,z,W,_=E.indexOf("."),Z=i,q=l;for(_>=0&&(S=h,h=0,E=E.replace(".",""),W=new w(M),j=W.pow(E.length-_),h=S,W.c=v(on(gt(j.c),j.e,"0"),10,$,b),W.e=W.c.length),z=v(E,M,$,D?(y=x,b):(y=b,x)),I=S=z.length;z[--S]==0;z.pop());if(!z[0])return y.charAt(0);if(_<0?--I:(j.c=z,j.e=I,j.s=C,j=t(j,W,Z,q,$),z=j.c,L=j.r,I=j.e),O=I+Z+1,_=z[O],S=$/2,L=L||O<0||z[O+1]!=null,L=q<4?(_!=null||L)&&(q==0||q==(j.s<0?3:2)):_>S||_==S&&(q==4||L||q==6&&z[O-1]&1||q==(j.s<0?8:7)),O<1||!z[0])E=L?on(y.charAt(1),-Z,y.charAt(0)):y.charAt(0);else{if(z.length=O,L)for(--$;++z[--O]>$;)z[O]=0,O||(++I,z=[1].concat(z));for(S=z.length;!z[--S];);for(_=0,E="";_<=S;E+=y.charAt(z[_++]));E=on(E,I,y.charAt(0))}return E}}(),t=function(){function b(M,$,C){var D,y,O,I,S=0,L=M.length,j=$%An,z=$/An|0;for(M=M.slice();L--;)O=M[L]%An,I=M[L]/An|0,D=z*O+I*j,y=j*O+D%An*An+S,S=(y/C|0)+(D/An|0)+z*I,M[L]=y%C;return S&&(M=[S].concat(M)),M}function v(M,$,C,D){var y,O;if(C!=D)O=C>D?1:-1;else for(y=O=0;y<C;y++)if(M[y]!=$[y]){O=M[y]>$[y]?1:-1;break}return O}function E(M,$,C,D){for(var y=0;C--;)M[C]-=y,y=M[C]<$[C]?1:0,M[C]=y*D+M[C]-$[C];for(;!M[0]&&M.length>1;M.splice(0,1));}return function(M,$,C,D,y){var O,I,S,L,j,z,W,_,Z,q,H,ee,fe,me,ye,ve,oe,V=M.s==$.s?1:-1,X=M.c,Q=$.c;if(!X||!X[0]||!Q||!Q[0])return new w(!M.s||!$.s||(X?Q&&X[0]==Q[0]:!Q)?NaN:X&&X[0]==0||!Q?V*0:V/0);for(_=new w(V),Z=_.c=[],I=M.e-$.e,V=C+I+1,y||(y=$t,I=bt(M.e/ae)-bt($.e/ae),V=V/ae|0),S=0;Q[S]==(X[S]||0);S++);if(Q[S]>(X[S]||0)&&I--,V<0)Z.push(1),L=!0;else{for(me=X.length,ve=Q.length,S=0,V+=2,j=mt(y/(Q[0]+1)),j>1&&(Q=b(Q,j,y),X=b(X,j,y),ve=Q.length,me=X.length),fe=ve,q=X.slice(0,ve),H=q.length;H<ve;q[H++]=0);oe=Q.slice(),oe=[0].concat(oe),ye=Q[0],Q[1]>=y/2&&ye++;do{if(j=0,O=v(Q,q,ve,H),O<0){if(ee=q[0],ve!=H&&(ee=ee*y+(q[1]||0)),j=mt(ee/ye),j>1)for(j>=y&&(j=y-1),z=b(Q,j,y),W=z.length,H=q.length;v(z,q,W,H)==1;)j--,E(z,ve<W?oe:Q,W,y),W=z.length,O=1;else j==0&&(O=j=1),z=Q.slice(),W=z.length;if(W<H&&(z=[0].concat(z)),E(q,z,H,y),H=q.length,O==-1)for(;v(Q,q,ve,H)<1;)j++,E(q,ve<H?oe:Q,H,y),H=q.length}else O===0&&(j++,q=[0]);Z[S++]=j,q[0]?q[H++]=X[fe]||0:(q=[X[fe]],H=1)}while((fe++<me||q[0]!=null)&&V--);L=q[0]!=null,Z[0]||Z.splice(0,1)}if(y==$t){for(S=1,V=Z[0];V>=10;V/=10,S++);B(_,C+(_.e=S+I*ae-1)+1,D,L)}else _.e=I,_.r=+L;return _}}();function P(b,v,E,M){var $,C,D,y,O;if(E==null?E=l:Pe(E,0,8),!b.c)return b.toString();if($=b.c[0],D=b.e,v==null)O=gt(b.c),O=M==1||M==2&&(D<=a||D>=c)?ys(O,D):on(O,D,"0");else if(b=B(new w(b),v,E),C=b.e,O=gt(b.c),y=O.length,M==1||M==2&&(v<=C||C<=a)){for(;y<v;O+="0",y++);O=ys(O,C)}else if(v-=D+(M===2&&C>D),O=on(O,C,"0"),C+1>y){if(--v>0)for(O+=".";v--;O+="0");}else if(v+=C-y,v>0)for(C+1==y&&(O+=".");v--;O+="0");return b.s<0&&$?"-"+O:O}function A(b,v){for(var E,M,$=1,C=new w(b[0]);$<b.length;$++)M=new w(b[$]),(!M.s||(E=Hn(C,M))===v||E===0&&C.s===v)&&(C=M);return C}function k(b,v,E){for(var M=1,$=v.length;!v[--$];v.pop());for($=v[0];$>=10;$/=10,M++);return(E=M+E*ae-1)>d?b.c=b.e=null:E<u?b.c=[b.e=0]:(b.e=E,b.c=v),b}r=function(){var b=/^(-?)0([xbo])(?=\w[\w.]*$)/i,v=/^([^.]+)\.$/,E=/^\.([^.]+)$/,M=/^-?(Infinity|NaN)$/,$=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(C,D,y,O){var I,S=y?D:D.replace($,"");if(M.test(S))C.s=isNaN(S)?null:S<0?-1:1;else{if(!y&&(S=S.replace(b,function(L,j,z){return I=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!O||O==I?j:L}),O&&(I=O,S=S.replace(v,"$1").replace(E,"0.$1")),D!=S))return new w(S,I);if(w.DEBUG)throw Error(Ze+"Not a"+(O?" base "+O:"")+" number: "+D);C.s=null}C.c=C.e=null}}();function B(b,v,E,M){var $,C,D,y,O,I,S,L=b.c,j=Vi;if(L){e:{for($=1,y=L[0];y>=10;y/=10,$++);if(C=v-$,C<0)C+=ae,D=v,O=L[I=0],S=mt(O/j[$-D-1]%10);else if(I=Wi((C+1)/ae),I>=L.length)if(M){for(;L.length<=I;L.push(0));O=S=0,$=1,C%=ae,D=C-ae+1}else break e;else{for(O=y=L[I],$=1;y>=10;y/=10,$++);C%=ae,D=C-ae+$,S=D<0?0:mt(O/j[$-D-1]%10)}if(M=M||v<0||L[I+1]!=null||(D<0?O:O%j[$-D-1]),M=E<4?(S||M)&&(E==0||E==(b.s<0?3:2)):S>5||S==5&&(E==4||M||E==6&&(C>0?D>0?O/j[$-D]:0:L[I-1])%10&1||E==(b.s<0?8:7)),v<1||!L[0])return L.length=0,M?(v-=b.e+1,L[0]=j[(ae-v%ae)%ae],b.e=-v||0):L[0]=b.e=0,b;if(C==0?(L.length=I,y=1,I--):(L.length=I+1,y=j[ae-C],L[I]=D>0?mt(O/j[$-D]%j[D])*y:0),M)for(;;)if(I==0){for(C=1,D=L[0];D>=10;D/=10,C++);for(D=L[0]+=y,y=1;D>=10;D/=10,y++);C!=y&&(b.e++,L[0]==$t&&(L[0]=1));break}else{if(L[I]+=y,L[I]!=$t)break;L[I--]=0,y=1}for(C=L.length;L[--C]===0;L.pop());}b.e>d?b.c=b.e=null:b.e<u&&(b.c=[b.e=0])}return b}function F(b){var v,E=b.e;return E===null?b.toString():(v=gt(b.c),v=E<=a||E>=c?ys(v,E):on(v,E,"0"),b.s<0?"-"+v:v)}return o.absoluteValue=o.abs=function(){var b=new w(this);return b.s<0&&(b.s=1),b},o.comparedTo=function(b,v){return Hn(this,new w(b,v))},o.decimalPlaces=o.dp=function(b,v){var E,M,$,C=this;if(b!=null)return Pe(b,0,Fe),v==null?v=l:Pe(v,0,8),B(new w(C),b+C.e+1,v);if(!(E=C.c))return null;if(M=(($=E.length-1)-bt(this.e/ae))*ae,$=E[$])for(;$%10==0;$/=10,M--);return M<0&&(M=0),M},o.dividedBy=o.div=function(b,v){return t(this,new w(b,v),i,l)},o.dividedToIntegerBy=o.idiv=function(b,v){return t(this,new w(b,v),0,1)},o.exponentiatedBy=o.pow=function(b,v){var E,M,$,C,D,y,O,I,S,L=this;if(b=new w(b),b.c&&!b.isInteger())throw Error(Ze+"Exponent not an integer: "+F(b));if(v!=null&&(v=new w(v)),y=b.e>14,!L.c||!L.c[0]||L.c[0]==1&&!L.e&&L.c.length==1||!b.c||!b.c[0])return S=new w(Math.pow(+F(L),y?b.s*(2-gs(b)):+F(b))),v?S.mod(v):S;if(O=b.s<0,v){if(v.c?!v.c[0]:!v.s)return new w(NaN);M=!O&&L.isInteger()&&v.isInteger(),M&&(L=L.mod(v))}else{if(b.e>9&&(L.e>0||L.e<-1||(L.e==0?L.c[0]>1||y&&L.c[1]>=24e7:L.c[0]<8e13||y&&L.c[0]<=9999975e7)))return C=L.s<0&&gs(b)?-0:0,L.e>-1&&(C=1/C),new w(O?1/C:C);h&&(C=Wi(h/ae+2))}for(y?(E=new w(.5),O&&(b.s=1),I=gs(b)):($=Math.abs(+F(b)),I=$%2),S=new w(s);;){if(I){if(S=S.times(L),!S.c)break;C?S.c.length>C&&(S.c.length=C):M&&(S=S.mod(v))}if($){if($=mt($/2),$===0)break;I=$%2}else if(b=b.times(E),B(b,b.e+1,1),b.e>14)I=gs(b);else{if($=+F(b),$===0)break;I=$%2}L=L.times(L),C?L.c&&L.c.length>C&&(L.c.length=C):M&&(L=L.mod(v))}return M?S:(O&&(S=s.div(S)),v?S.mod(v):C?B(S,h,l,D):S)},o.integerValue=function(b){var v=new w(this);return b==null?b=l:Pe(b,0,8),B(v,v.e+1,b)},o.isEqualTo=o.eq=function(b,v){return Hn(this,new w(b,v))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(b,v){return Hn(this,new w(b,v))>0},o.isGreaterThanOrEqualTo=o.gte=function(b,v){return(v=Hn(this,new w(b,v)))===1||v===0},o.isInteger=function(){return!!this.c&&bt(this.e/ae)>this.c.length-2},o.isLessThan=o.lt=function(b,v){return Hn(this,new w(b,v))<0},o.isLessThanOrEqualTo=o.lte=function(b,v){return(v=Hn(this,new w(b,v)))===-1||v===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(b,v){var E,M,$,C,D=this,y=D.s;if(b=new w(b,v),v=b.s,!y||!v)return new w(NaN);if(y!=v)return b.s=-v,D.plus(b);var O=D.e/ae,I=b.e/ae,S=D.c,L=b.c;if(!O||!I){if(!S||!L)return S?(b.s=-v,b):new w(L?D:NaN);if(!S[0]||!L[0])return L[0]?(b.s=-v,b):new w(S[0]?D:l==3?-0:0)}if(O=bt(O),I=bt(I),S=S.slice(),y=O-I){for((C=y<0)?(y=-y,$=S):(I=O,$=L),$.reverse(),v=y;v--;$.push(0));$.reverse()}else for(M=(C=(y=S.length)<(v=L.length))?y:v,y=v=0;v<M;v++)if(S[v]!=L[v]){C=S[v]<L[v];break}if(C&&($=S,S=L,L=$,b.s=-b.s),v=(M=L.length)-(E=S.length),v>0)for(;v--;S[E++]=0);for(v=$t-1;M>y;){if(S[--M]<L[M]){for(E=M;E&&!S[--E];S[E]=v);--S[E],S[M]+=$t}S[M]-=L[M]}for(;S[0]==0;S.splice(0,1),--I);return S[0]?k(b,S,I):(b.s=l==3?-1:1,b.c=[b.e=0],b)},o.modulo=o.mod=function(b,v){var E,M,$=this;return b=new w(b,v),!$.c||!b.s||b.c&&!b.c[0]?new w(NaN):!b.c||$.c&&!$.c[0]?new w($):(f==9?(M=b.s,b.s=1,E=t($,b,0,3),b.s=M,E.s*=M):E=t($,b,0,f),b=$.minus(E.times(b)),!b.c[0]&&f==1&&(b.s=$.s),b)},o.multipliedBy=o.times=function(b,v){var E,M,$,C,D,y,O,I,S,L,j,z,W,_,Z,q=this,H=q.c,ee=(b=new w(b,v)).c;if(!H||!ee||!H[0]||!ee[0])return!q.s||!b.s||H&&!H[0]&&!ee||ee&&!ee[0]&&!H?b.c=b.e=b.s=null:(b.s*=q.s,!H||!ee?b.c=b.e=null:(b.c=[0],b.e=0)),b;for(M=bt(q.e/ae)+bt(b.e/ae),b.s*=q.s,O=H.length,L=ee.length,O<L&&(W=H,H=ee,ee=W,$=O,O=L,L=$),$=O+L,W=[];$--;W.push(0));for(_=$t,Z=An,$=L;--$>=0;){for(E=0,j=ee[$]%Z,z=ee[$]/Z|0,D=O,C=$+D;C>$;)I=H[--D]%Z,S=H[D]/Z|0,y=z*I+S*j,I=j*I+y%Z*Z+W[C]+E,E=(I/_|0)+(y/Z|0)+z*S,W[C--]=I%_;W[C]=E}return E?++M:W.splice(0,1),k(b,W,M)},o.negated=function(){var b=new w(this);return b.s=-b.s||null,b},o.plus=function(b,v){var E,M=this,$=M.s;if(b=new w(b,v),v=b.s,!$||!v)return new w(NaN);if($!=v)return b.s=-v,M.minus(b);var C=M.e/ae,D=b.e/ae,y=M.c,O=b.c;if(!C||!D){if(!y||!O)return new w($/0);if(!y[0]||!O[0])return O[0]?b:new w(y[0]?M:$*0)}if(C=bt(C),D=bt(D),y=y.slice(),$=C-D){for($>0?(D=C,E=O):($=-$,E=y),E.reverse();$--;E.push(0));E.reverse()}for($=y.length,v=O.length,$-v<0&&(E=O,O=y,y=E,v=$),$=0;v;)$=(y[--v]=y[v]+O[v]+$)/$t|0,y[v]=$t===y[v]?0:y[v]%$t;return $&&(y=[$].concat(y),++D),k(b,y,D)},o.precision=o.sd=function(b,v){var E,M,$,C=this;if(b!=null&&b!==!!b)return Pe(b,1,Fe),v==null?v=l:Pe(v,0,8),B(new w(C),b,v);if(!(E=C.c))return null;if($=E.length-1,M=$*ae+1,$=E[$]){for(;$%10==0;$/=10,M--);for($=E[0];$>=10;$/=10,M++);}return b&&C.e+1>M&&(M=C.e+1),M},o.shiftedBy=function(b){return Pe(b,-_i,_i),this.times("1e"+b)},o.squareRoot=o.sqrt=function(){var b,v,E,M,$,C=this,D=C.c,y=C.s,O=C.e,I=i+4,S=new w("0.5");if(y!==1||!D||!D[0])return new w(!y||y<0&&(!D||D[0])?NaN:D?C:1/0);if(y=Math.sqrt(+F(C)),y==0||y==1/0?(v=gt(D),(v.length+O)%2==0&&(v+="0"),y=Math.sqrt(+v),O=bt((O+1)/2)-(O<0||O%2),y==1/0?v="5e"+O:(v=y.toExponential(),v=v.slice(0,v.indexOf("e")+1)+O),E=new w(v)):E=new w(y+""),E.c[0]){for(O=E.e,y=O+I,y<3&&(y=0);;)if($=E,E=S.times($.plus(t(C,$,I,1))),gt($.c).slice(0,y)===(v=gt(E.c)).slice(0,y))if(E.e<O&&--y,v=v.slice(y-3,y+1),v=="9999"||!M&&v=="4999"){if(!M&&(B($,$.e+i+2,0),$.times($).eq(C))){E=$;break}I+=4,y+=4,M=1}else{(!+v||!+v.slice(1)&&v.charAt(0)=="5")&&(B(E,E.e+i+2,1),b=!E.times(E).eq(C));break}}return B(E,E.e+i+1,l,b)},o.toExponential=function(b,v){return b!=null&&(Pe(b,0,Fe),b++),P(this,b,v,1)},o.toFixed=function(b,v){return b!=null&&(Pe(b,0,Fe),b=b+this.e+1),P(this,b,v)},o.toFormat=function(b,v,E){var M,$=this;if(E==null)b!=null&&v&&typeof v=="object"?(E=v,v=null):b&&typeof b=="object"?(E=b,b=v=null):E=m;else if(typeof E!="object")throw Error(Ze+"Argument not an object: "+E);if(M=$.toFixed(b,v),$.c){var C,D=M.split("."),y=+E.groupSize,O=+E.secondaryGroupSize,I=E.groupSeparator||"",S=D[0],L=D[1],j=$.s<0,z=j?S.slice(1):S,W=z.length;if(O&&(C=y,y=O,O=C,W-=C),y>0&&W>0){for(C=W%y||y,S=z.substr(0,C);C<W;C+=y)S+=I+z.substr(C,y);O>0&&(S+=I+z.slice(C)),j&&(S="-"+S)}M=L?S+(E.decimalSeparator||"")+((O=+E.fractionGroupSize)?L.replace(new RegExp("\\d{"+O+"}\\B","g"),"$&"+(E.fractionGroupSeparator||"")):L):S}return(E.prefix||"")+M+(E.suffix||"")},o.toFraction=function(b){var v,E,M,$,C,D,y,O,I,S,L,j,z=this,W=z.c;if(b!=null&&(y=new w(b),!y.isInteger()&&(y.c||y.s!==1)||y.lt(s)))throw Error(Ze+"Argument "+(y.isInteger()?"out of range: ":"not an integer: ")+F(y));if(!W)return new w(z);for(v=new w(s),I=E=new w(s),M=O=new w(s),j=gt(W),C=v.e=j.length-z.e-1,v.c[0]=Vi[(D=C%ae)<0?ae+D:D],b=!b||y.comparedTo(v)>0?C>0?v:I:y,D=d,d=1/0,y=new w(j),O.c[0]=0;S=t(y,v,0,1),$=E.plus(S.times(M)),$.comparedTo(b)!=1;)E=M,M=$,I=O.plus(S.times($=I)),O=$,v=y.minus(S.times($=v)),y=$;return $=t(b.minus(E),M,0,1),O=O.plus($.times(I)),E=E.plus($.times(M)),O.s=I.s=z.s,C=C*2,L=t(I,M,C,l).minus(z).abs().comparedTo(t(O,E,C,l).minus(z).abs())<1?[I,M]:[O,E],d=D,L},o.toNumber=function(){return+F(this)},o.toPrecision=function(b,v){return b!=null&&Pe(b,1,Fe),P(this,b,v,2)},o.toString=function(b){var v,E=this,M=E.s,$=E.e;return $===null?M?(v="Infinity",M<0&&(v="-"+v)):v="NaN":(b==null?v=$<=a||$>=c?ys(gt(E.c),$):on(gt(E.c),$,"0"):b===10&&T?(E=B(new w(E),i+$+1,l),v=on(gt(E.c),E.e,"0")):(Pe(b,2,x.length,"Base"),v=n(on(gt(E.c),$,"0"),10,b,M,!0)),M<0&&E.c[0]&&(v="-"+v)),v},o.valueOf=o.toJSON=function(){return F(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&w.set(e),w}function bt(e){var t=e|0;return e>0||e===t?t:t-1}function gt(e){for(var t,n,r=1,o=e.length,s=e[0]+"";r<o;){for(t=e[r++]+"",n=ae-t.length;n--;t="0"+t);s+=t}for(o=s.length;s.charCodeAt(--o)===48;);return s.slice(0,o+1||1)}function Hn(e,t){var n,r,o=e.c,s=t.c,i=e.s,l=t.s,a=e.e,c=t.e;if(!i||!l)return null;if(n=o&&!o[0],r=s&&!s[0],n||r)return n?r?0:-l:i;if(i!=l)return i;if(n=i<0,r=a==c,!o||!s)return r?0:!o^n?1:-1;if(!r)return a>c^n?1:-1;for(l=(a=o.length)<(c=s.length)?a:c,i=0;i<l;i++)if(o[i]!=s[i])return o[i]>s[i]^n?1:-1;return a==c?0:a>c^n?1:-1}function Pe(e,t,n,r){if(e<t||e>n||e!==mt(e))throw Error(Ze+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function gs(e){var t=e.c.length-1;return bt(e.e/ae)==t&&e.c[t]%2!=0}function ys(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function on(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var ke=au();const wb=(e,t=6)=>{try{const n=new ke(e||"0");if(n.isNaN())return"0";const r=n.decimalPlaces(t,ke.ROUND_DOWN),[o,s=""]=r.toString().split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,",");if(t>0){const l=(s||"").padEnd(t,"0");return`${i}.${l}`}return i}catch(n){return console.warn("formatThousands error:",n),"0"}},Mt=()=>{const{translations:e,currentLocale:t}=su();return{t:(s,i)=>{try{const l=s.split(".");let a=e;for(const u of l)if(a&&typeof a=="object"&&u in a)a=a[u];else return s;let c=typeof a=="string"?a:s;return i&&typeof c=="string"&&Object.keys(i).forEach(u=>{const d=`{{${u}}}`;c=c.replace(new RegExp(d,"g"),String(i[u]))}),c}catch(l){return console.warn(`Translation error for key "${s}":`,l),s}},translations:e,locale:t,getTranslationObject:s=>{try{const i=s.split(".");let l=e;for(const a of i)if(l&&typeof l=="object"&&a in l)l=l[a];else return{};return typeof l=="object"?l:{}}catch(i){return console.warn(`Translation object error for key "${s}":`,i),{}}},hasTranslation:s=>{try{const i=s.split(".");let l=e;for(const a of i)if(l&&typeof l=="object"&&a in l)l=l[a];else return!1;return typeof l=="string"}catch{return!1}}}},xb="1.2.3";let Ye=class Jc extends Error{constructor(t,n={}){var i;const r=n.cause instanceof Jc?n.cause.details:(i=n.cause)!=null&&i.message?n.cause.message:n.details,o=n.cause instanceof Jc&&n.cause.docsPath||n.docsPath,s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...r?[`Details: ${r}`]:[],`Version: abitype@${xb}`].join(`
|
|
51
|
+
`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.shortMessage=t}};function sn(e,t){const n=e.exec(t);return n==null?void 0:n.groups}const lu=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,cu=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,uu=/^\(.+?\).*?$/,du=/^tuple(?<array>(\[(\d*)\])*)$/;function Hi(e){let t=e.type;if(du.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let o=0;o<n;o++){const s=e.components[o];t+=Hi(s),o<n-1&&(t+=", ")}const r=sn(du,e.type);return t+=`)${(r==null?void 0:r.array)||""}`,Hi({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function mr(e){let t="";const n=e.length;for(let r=0;r<n;r++){const o=e[r];t+=Hi(o),r!==n-1&&(t+=", ")}return t}function vs(e){var t;return e.type==="function"?`function ${e.name}(${mr(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${(t=e.outputs)!=null&&t.length?` returns (${mr(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${mr(e.inputs)})`:e.type==="error"?`error ${e.name}(${mr(e.inputs)})`:e.type==="constructor"?`constructor(${mr(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const fu=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Eb(e){return fu.test(e)}function Sb(e){return sn(fu,e)}const pu=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Pb(e){return pu.test(e)}function Tb(e){return sn(pu,e)}const hu=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function Ab(e){return hu.test(e)}function Nb(e){return sn(hu,e)}const mu=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function ws(e){return mu.test(e)}function Cb(e){return sn(mu,e)}const bu=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function Ob(e){return bu.test(e)}function $b(e){return sn(bu,e)}const gu=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Mb(e){return gu.test(e)}function Ib(e){return sn(gu,e)}const Db=/^receive\(\) external payable$/;function kb(e){return Db.test(e)}const yu=new Set(["memory","indexed","storage","calldata"]),Lb=new Set(["indexed"]),Gi=new Set(["calldata","memory","storage"]);class Bb extends Ye{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class Fb extends Ye{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Rb extends Ye{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class jb extends Ye{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class zb extends Ye{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Ub extends Ye{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Wb extends Ye{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class _b extends Ye{constructor({param:t,type:n,modifier:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${r}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class Vb extends Ye{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class br extends Ye{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Hb extends Ye{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Gb extends Ye{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class qb extends Ye{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class Kb extends Ye{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function Zb(e,t,n){let r="";if(n)for(const o of Object.entries(n)){if(!o)continue;let s="";for(const i of o[1])s+=`[${i.type}${i.name?`:${i.name}`:""}]`;r+=`(${o[0]}{${s}})`}return t?`${t}:${e}${r}`:`${e}${r}`}const qi=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Ki(e,t={}){if(Ab(e))return Yb(e,t);if(Pb(e))return Xb(e,t);if(Eb(e))return Jb(e,t);if(Ob(e))return Qb(e,t);if(Mb(e))return eg(e);if(kb(e))return{type:"receive",stateMutability:"payable"};throw new Hb({signature:e})}function Yb(e,t={}){const n=Nb(e);if(!n)throw new br({signature:e,type:"function"});const r=ut(n.parameters),o=[],s=r.length;for(let l=0;l<s;l++)o.push(an(r[l],{modifiers:Gi,structs:t,type:"function"}));const i=[];if(n.returns){const l=ut(n.returns),a=l.length;for(let c=0;c<a;c++)i.push(an(l[c],{modifiers:Gi,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:o,outputs:i}}function Xb(e,t={}){const n=Tb(e);if(!n)throw new br({signature:e,type:"event"});const r=ut(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(an(r[i],{modifiers:Lb,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:o}}function Jb(e,t={}){const n=Sb(e);if(!n)throw new br({signature:e,type:"error"});const r=ut(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(an(r[i],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:o}}function Qb(e,t={}){const n=$b(e);if(!n)throw new br({signature:e,type:"constructor"});const r=ut(n.parameters),o=[],s=r.length;for(let i=0;i<s;i++)o.push(an(r[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:o}}function eg(e){const t=Ib(e);if(!t)throw new br({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const tg=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,ng=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,rg=/^u?int$/;function an(e,t){var d,p;const n=Zb(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(qi.has(n))return qi.get(n);const r=uu.test(e),o=sn(r?ng:tg,e);if(!o)throw new zb({param:e});if(o.name&&sg(o.name))throw new Ub({param:e,name:o.name});const s=o.name?{name:o.name}:{},i=o.modifier==="indexed"?{indexed:!0}:{},l=(t==null?void 0:t.structs)??{};let a,c={};if(r){a="tuple";const f=ut(o.type),h=[],m=f.length;for(let x=0;x<m;x++)h.push(an(f[x],{structs:l}));c={components:h}}else if(o.type in l)a="tuple",c={components:l[o.type]};else if(rg.test(o.type))a=`${o.type}256`;else if(o.type==="address payable")a="address";else if(a=o.type,(t==null?void 0:t.type)!=="struct"&&!vu(a))throw new Rb({type:a});if(o.modifier){if(!((p=(d=t==null?void 0:t.modifiers)==null?void 0:d.has)!=null&&p.call(d,o.modifier)))throw new Wb({param:e,type:t==null?void 0:t.type,modifier:o.modifier});if(Gi.has(o.modifier)&&!ig(a,!!o.array))throw new _b({param:e,type:t==null?void 0:t.type,modifier:o.modifier})}const u={type:`${a}${o.array??""}`,...s,...i,...c};return qi.set(n,u),u}function ut(e,t=[],n="",r=0){const o=e.trim().length;for(let s=0;s<o;s++){const i=e[s],l=e.slice(s+1);switch(i){case",":return r===0?ut(l,[...t,n.trim()]):ut(l,t,`${n}${i}`,r);case"(":return ut(l,t,`${n}${i}`,r+1);case")":return ut(l,t,`${n}${i}`,r-1);default:return ut(l,t,`${n}${i}`,r)}}if(n==="")return t;if(r!==0)throw new Kb({current:n,depth:r});return t.push(n.trim()),t}function vu(e){return e==="address"||e==="bool"||e==="function"||e==="string"||lu.test(e)||cu.test(e)}const og=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function sg(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||lu.test(e)||cu.test(e)||og.test(e)}function ig(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function Zi(e){const t={},n=e.length;for(let i=0;i<n;i++){const l=e[i];if(!ws(l))continue;const a=Cb(l);if(!a)throw new br({signature:l,type:"struct"});const c=a.properties.split(";"),u=[],d=c.length;for(let p=0;p<d;p++){const h=c[p].trim();if(!h)continue;const m=an(h,{type:"struct"});u.push(m)}if(!u.length)throw new Gb({signature:l});t[a.name]=u}const r={},o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){const[l,a]=o[i];r[l]=wu(a,t)}return r}const ag=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function wu(e=[],t={},n=new Set){const r=[],o=e.length;for(let s=0;s<o;s++){const i=e[s];if(uu.test(i.type))r.push(i);else{const a=sn(ag,i.type);if(!(a!=null&&a.type))throw new Vb({abiParameter:i});const{array:c,type:u}=a;if(u in t){if(n.has(u))throw new qb({type:u});r.push({...i,type:`tuple${c??""}`,components:wu(t[u],t,new Set([...n,u]))})}else if(vu(u))r.push(i);else throw new Fb({type:u})}}return r}function xu(e){const t=Zi(e),n=[],r=e.length;for(let o=0;o<r;o++){const s=e[o];ws(s)||n.push(Ki(s,t))}return n}function Eu(e){let t;if(typeof e=="string")t=Ki(e);else{const n=Zi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(!ws(s)){t=Ki(s,n);break}}}if(!t)throw new Bb({signature:e});return t}function Su(e){const t=[];if(typeof e=="string"){const n=ut(e),r=n.length;for(let o=0;o<r;o++)t.push(an(n[o],{modifiers:yu}))}else{const n=Zi(e),r=e.length;for(let o=0;o<r;o++){const s=e[o];if(ws(s))continue;const i=ut(s),l=i.length;for(let a=0;a<l;a++)t.push(an(i[a],{modifiers:yu,structs:n}))}}if(t.length===0)throw new jb({params:e});return t}function te(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const o=e[n];return typeof o=="function"?o:s=>t(e,s)}function It(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new xg(e.type);return`${e.name}(${xs(e.inputs,{includeName:t})})`}function xs(e,{includeName:t=!1}={}){return e?e.map(n=>lg(n,{includeName:t})).join(t?", ":","):""}function lg(e,{includeName:t}){return e.type.startsWith("tuple")?`(${xs(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Dt(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Te(e){return Dt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Pu="2.47.2";let no={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Pu}`},G=class Qc extends Error{constructor(t,n={}){var l;const r=(()=>{var a;return n.cause instanceof Qc?n.cause.details:(a=n.cause)!=null&&a.message?n.cause.message:n.details})(),o=n.cause instanceof Qc&&n.cause.docsPath||n.docsPath,s=(l=no.getDocsUrl)==null?void 0:l.call(no,{...n,docsPath:o}),i=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...r?[`Details: ${r}`]:[],...no.version?[`Version: ${no.version}`]:[]].join(`
|
|
52
|
+
`);super(i,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Pu}walk(t){return Tu(this,t)}};function Tu(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Tu(e.cause,t):t?null:e}class cg extends G{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
|
|
53
53
|
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class Au extends G{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
|
|
54
54
|
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class Nu extends G{constructor({data:t,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(`
|
|
55
|
-
`),{metaMessages:[`Params: (${xs(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class ro extends G{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class
|
|
56
|
-
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class
|
|
57
|
-
`),{name:"AbiEncodingLengthMismatchError"})}}class
|
|
55
|
+
`),{metaMessages:[`Params: (${xs(n,{includeName:!0})})`,`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=r}}class ro extends G{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class ug extends G{constructor({expectedLength:t,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
|
|
56
|
+
`),{name:"AbiEncodingArrayLengthMismatchError"})}}class dg extends G{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${Te(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class fg extends G{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
|
|
57
|
+
`),{name:"AbiEncodingLengthMismatchError"})}}class pg extends G{constructor(t,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
|
|
58
58
|
`),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class Cu extends G{constructor(t,{docsPath:n}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
|
|
59
59
|
`),{docsPath:n,name:"AbiErrorNotFoundError"})}}class Ou extends G{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
|
|
60
|
-
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class
|
|
60
|
+
`),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class hg extends G{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class mg extends G{constructor(t,{docsPath:n}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
|
|
61
61
|
`),{docsPath:n,name:"AbiEventSignatureNotFoundError"})}}class $u extends G{constructor(t,{docsPath:n}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
|
|
62
62
|
`),{docsPath:n,name:"AbiEventNotFoundError"})}}class gr extends G{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
63
|
-
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class
|
|
64
|
-
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class
|
|
65
|
-
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class
|
|
66
|
-
`),{metaMessages:[`Params: (${xs(r,{includeName:!0})})`,`Data: ${n} (${o} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=o}}class Yi extends G{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${
|
|
67
|
-
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class
|
|
68
|
-
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class
|
|
69
|
-
`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let
|
|
70
|
-
`),{name:"InvalidArrayError"})}};class
|
|
71
|
-
`),{name:"InvalidDefinitionTypeError"})}}class xg extends G{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let Du=class extends G{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},ku=class extends G{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class Lu extends G{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function yr(e,{dir:t,size:n=32}={}){return typeof e=="string"?Nn(e,{dir:t,size:n}):Eg(e,{dir:t,size:n})}function Nn(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new ku({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Eg(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new ku({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let o=0;o<n;o++){const s=t==="right";r[s?o:n-o-1]=e[s?o:e.length-o-1]}return r}let Xi=class extends G{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number "${s}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},Sg=class extends G{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class Pg extends G{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let Tg=class extends G{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function Gn(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function kt(e,{size:t}){if(Te(e)>t)throw new Tg({givenSize:Te(e),maxSize:t})}function Gt(e,t={}){const{signed:n}=t;t.size&&kt(e,{size:t.size});const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function Ag(e,t={}){let n=e;if(t.size&&(kt(n,{size:t.size}),n=Gn(n)),Gn(n)==="0x00")return!1;if(Gn(n)==="0x01")return!0;throw new Pg(n)}function ln(e,t={}){const n=Gt(e,t),r=Number(n);if(!Number.isSafeInteger(r))throw new Xi({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return r}const Ng=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Cn(e,t={}){return typeof e=="number"||typeof e=="bigint"?ne(e,t):typeof e=="string"?oo(e,t):typeof e=="boolean"?Bu(e,t):Le(e,t)}function Bu(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(kt(n,{size:t.size}),yr(n,{size:t.size})):n}function Le(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=Ng[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(kt(r,{size:t.size}),yr(r,{dir:"right",size:t.size})):r}function ne(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const a=typeof e=="bigint"?"n":"";throw new Xi({max:s?`${s}${a}`:void 0,min:`${i}${a}`,signed:n,size:r,value:`${e}${a}`})}const l=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?yr(l,{size:r}):l}const Cg=new TextEncoder;function oo(e,t={}){const n=Cg.encode(e);return Le(n,t)}const Og=new TextEncoder;function vr(e,t={}){return typeof e=="number"||typeof e=="bigint"?Ig(e,t):typeof e=="boolean"?$g(e,t):Dt(e)?qt(e,t):qn(e,t)}function $g(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(kt(n,{size:t.size}),yr(n,{size:t.size})):n}const cn={zero:48,nine:57,A:65,F:70,a:97,f:102};function Fu(e){if(e>=cn.zero&&e<=cn.nine)return e-cn.zero;if(e>=cn.A&&e<=cn.F)return e-(cn.A-10);if(e>=cn.a&&e<=cn.f)return e-(cn.a-10)}function qt(e,t={}){let n=e;t.size&&(kt(n,{size:t.size}),n=yr(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const o=r.length/2,s=new Uint8Array(o);for(let i=0,l=0;i<o;i++){const a=Fu(r.charCodeAt(l++)),c=Fu(r.charCodeAt(l++));if(a===void 0||c===void 0)throw new G(`Invalid byte sequence ("${r[l-2]}${r[l-1]}" in "${r}").`);s[i]=a*16+c}return s}function Ig(e,t){const n=ne(e,t);return qt(n)}function qn(e,t={}){const n=Og.encode(e);return typeof t.size=="number"?(kt(n,{size:t.size}),yr(n,{dir:"right",size:t.size})):n}const Ss=BigInt(2**32-1),Ru=BigInt(32);function Mg(e,t=!1){return t?{h:Number(e&Ss),l:Number(e>>Ru&Ss)}:{h:Number(e>>Ru&Ss)|0,l:Number(e&Ss)|0}}function Dg(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let s=0;s<n;s++){const{h:i,l}=Mg(e[s],t);[r[s],o[s]]=[i,l]}return[r,o]}const kg=(e,t,n)=>e<<n|t>>>32-n,Lg=(e,t,n)=>t<<n|e>>>32-n,Bg=(e,t,n)=>t<<n-32|e>>>64-n,Fg=(e,t,n)=>e<<n-32|t>>>64-n,wr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Rg(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function so(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Kn(e,...t){if(!Rg(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function jg(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");so(e.outputLen),so(e.blockLen)}function xr(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 ju(e,t){Kn(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function zg(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Er(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ji(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Kt(e,t){return e<<32-t|e>>>t}const Ug=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Wg(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function _g(e){for(let t=0;t<e.length;t++)e[t]=Wg(e[t]);return e}const zu=Ug?e=>e:_g;function Vg(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Ps(e){return typeof e=="string"&&(e=Vg(e)),Kn(e),e}function Hg(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];Kn(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}class Qi{}function Uu(e){const t=r=>e().update(Ps(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Gg(e=32){if(wr&&typeof wr.getRandomValues=="function")return wr.getRandomValues(new Uint8Array(e));if(wr&&typeof wr.randomBytes=="function")return Uint8Array.from(wr.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const qg=BigInt(0),io=BigInt(1),Kg=BigInt(2),Zg=BigInt(7),Yg=BigInt(256),Xg=BigInt(113),Wu=[],_u=[],Vu=[];for(let e=0,t=io,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Wu.push(2*(5*r+n)),_u.push((e+1)*(e+2)/2%64);let o=qg;for(let s=0;s<7;s++)t=(t<<io^(t>>Zg)*Xg)%Yg,t&Kg&&(o^=io<<(io<<BigInt(s))-io);Vu.push(o)}const Hu=Dg(Vu,!0),Jg=Hu[0],Qg=Hu[1],Gu=(e,t,n)=>n>32?Bg(e,t,n):kg(e,t,n),qu=(e,t,n)=>n>32?Fg(e,t,n):Lg(e,t,n);function e1(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const l=(i+8)%10,a=(i+2)%10,c=n[a],u=n[a+1],d=Gu(c,u,1)^n[l],p=qu(c,u,1)^n[l+1];for(let f=0;f<50;f+=10)e[i+f]^=d,e[i+f+1]^=p}let o=e[2],s=e[3];for(let i=0;i<24;i++){const l=_u[i],a=Gu(o,s,l),c=qu(o,s,l),u=Wu[i];o=e[u],s=e[u+1],e[u]=a,e[u+1]=c}for(let i=0;i<50;i+=10){for(let l=0;l<10;l++)n[l]=e[i+l];for(let l=0;l<10;l++)e[i+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=Jg[r],e[1]^=Qg[r]}Er(n)}class ea extends Qi{constructor(t,n,r,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=s,so(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=zg(this.state)}clone(){return this._cloneInto()}keccak(){zu(this.state32),e1(this.state32,this.rounds),zu(this.state32),this.posOut=0,this.pos=0}update(t){xr(this),t=Ps(t),Kn(t);const{blockLen:n,state:r}=this,o=t.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);for(let l=0;l<i;l++)r[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){xr(this,!1),Kn(t),this.finish();const n=this.state,{blockLen:r}=this;for(let o=0,s=t.length;o<s;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,s-o);t.set(n.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return so(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ju(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,Er(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new ea(n,r,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}}const t1=(e,t,n)=>Uu(()=>new ea(t,e,n)),Ku=t1(1,136,256/8);function ze(e,t){const n=t||"hex",r=Ku(Dt(e,{strict:!1})?vr(e):e);return n==="bytes"?r:Cn(r)}const n1=e=>ze(vr(e));function r1(e){return n1(e)}function o1(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const l=e[i];if(["(",")",","].includes(l)&&(t=!0),l==="("&&r++,l===")"&&r--,!!t){if(r===0){if(l===" "&&["event","function",""].includes(o))o="";else if(o+=l,l===")"){s=!0;break}continue}if(l===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=l,n+=l}}if(!s)throw new G("Unable to normalize signature.");return o}const s1=e=>{const t=typeof e=="string"?e:vs(e);return o1(t)};function Zu(e){return r1(s1(e))}const Ts=Zu;let On=class extends G{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},As=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const ta=new As(8192);function Ns(e,t){if(ta.has(`${e}.${t}`))return ta.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=ze(qn(n),"bytes"),o=n.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&o[i]&&(o[i]=o[i].toUpperCase()),(r[i>>1]&15)>=8&&o[i+1]&&(o[i+1]=o[i+1].toUpperCase());const s=`0x${o.join("")}`;return ta.set(`${e}.${t}`,s),s}function un(e,t){if(!yt(e,{strict:!1}))throw new On({address:e});return Ns(e,t)}const i1=/^0x[a-fA-F0-9]{40}$/,na=new As(8192);function yt(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(na.has(r))return na.get(r);const o=i1.test(e)?e.toLowerCase()===e?!0:n?Ns(e)===e:!0:!1;return na.set(r,o),o}function Lt(e){return typeof e[0]=="string"?Sr(e):a1(e)}function a1(e){let t=0;for(const o of e)t+=o.length;const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function Sr(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Zn(e,t,n,{strict:r}={}){return Dt(e,{strict:!1})?l1(e,t,n,{strict:r}):Ju(e,t,n,{strict:r})}function Yu(e,t){if(typeof t=="number"&&t>0&&t>Te(e)-1)throw new Du({offset:t,position:"start",size:Te(e)})}function Xu(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Te(e)!==n-t)throw new Du({offset:n,position:"end",size:Te(e)})}function Ju(e,t,n,{strict:r}={}){Yu(e,t);const o=e.slice(t,n);return r&&Xu(o,t,n),o}function l1(e,t,n,{strict:r}={}){Yu(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Xu(o,t,n),o}const c1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Qu=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function $n(e,t){if(e.length!==t.length)throw new dg({expectedLength:e.length,givenLength:t.length});const n=u1({params:e,values:t}),r=oa(n);return r.length===0?"0x":r}function u1({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(ra({param:e[r],value:t[r]}));return n}function ra({param:e,value:t}){const n=sa(e.type);if(n){const[r,o]=n;return f1(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return g1(t,{param:e});if(e.type==="address")return d1(t);if(e.type==="bool")return h1(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,o="256"]=Qu.exec(e.type)??[];return m1(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return p1(t,{param:e});if(e.type==="string")return b1(t);throw new yg(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function oa(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:l}=e[s];i?t+=32:t+=Te(l)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:l}=e[s];i?(n.push(ne(t+o,{size:32})),r.push(l),o+=Te(l)):n.push(l)}return Lt([...n,...r])}function d1(e){if(!yt(e))throw new On({address:e});return{dynamic:!1,encoded:Nn(e.toLowerCase())}}function f1(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Mu(e);if(!r&&e.length!==t)throw new cg({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1;const s=[];for(let i=0;i<e.length;i++){const l=ra({param:n,value:e[i]});l.dynamic&&(o=!0),s.push(l)}if(r||o){const i=oa(s);if(r){const l=ne(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?Lt([l,i]):l}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:Lt(s.map(({encoded:i})=>i))}}function p1(e,{param:t}){const[,n]=t.type.split("bytes"),r=Te(e);if(!n){let o=e;return r%32!==0&&(o=Nn(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Lt([Nn(ne(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new ug({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:Nn(e,{dir:"right"})}}function h1(e){if(typeof e!="boolean")throw new G(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Nn(Bu(e))}}function m1(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new Xi({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:ne(e,{size:32,signed:t})}}function b1(e){const t=oo(e),n=Math.ceil(Te(t)/32),r=[];for(let o=0;o<n;o++)r.push(Nn(Zn(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Lt([Nn(ne(Te(t),{size:32})),...r])}}function g1(e,{param:t}){let n=!1;const r=[];for(let o=0;o<t.components.length;o++){const s=t.components[o],i=Array.isArray(e)?o:s.name,l=ra({param:s,value:e[i]});r.push(l),l.dynamic&&(n=!0)}return{dynamic:n,encoded:n?oa(r):Lt(r.map(({encoded:o})=>o))}}function sa(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const ao=e=>Zn(Zu(e),0,4);function Yn(e){const{abi:t,args:n=[],name:r}=e,o=Dt(r,{strict:!1}),s=t.filter(l=>o?l.type==="function"?ao(l)===r:l.type==="event"?Ts(l)===r:!1:"name"in l&&l.name===r);if(s.length===0)return;if(s.length===1)return s[0];let i;for(const l of s){if(!("inputs"in l))continue;if(!n||n.length===0){if(!l.inputs||l.inputs.length===0)return l;continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==n.length)continue;if(n.every((c,u)=>{const d="inputs"in l&&l.inputs[u];return d?ia(c,d):!1})){if(i&&"inputs"in i&&i.inputs){const c=ed(l.inputs,i.inputs,n);if(c)throw new bg({abiItem:l,type:c[0]},{abiItem:i,type:c[1]})}i=l}}return i||s[0]}function ia(e,t){const n=typeof e,r=t.type;switch(r){case"address":return yt(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>n==="object"&&ia(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>ia(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function ed(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return ed(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?yt(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?yt(n[r],{strict:!1}):!1)return i}}const td="/docs/contract/encodeEventTopics";function lo(e){var a;const{abi:t,eventName:n,args:r}=e;let o=t[0];if(n){const c=Yn({abi:t,name:n});if(!c)throw new $u(n,{docsPath:td});o=c}if(o.type!=="event")throw new $u(void 0,{docsPath:td});const s=Mt(o),i=Ts(s);let l=[];if(r&&"inputs"in o){const c=(a=o.inputs)==null?void 0:a.filter(d=>"indexed"in d&&d.indexed),u=Array.isArray(r)?r:Object.values(r).length>0?(c==null?void 0:c.map(d=>r[d.name]))??[]:[];u.length>0&&(l=(c==null?void 0:c.map((d,p)=>Array.isArray(u[p])?u[p].map((f,h)=>nd({param:d,value:u[p][h]})):typeof u[p]<"u"&&u[p]!==null?nd({param:d,value:u[p]}):null))??[])}return[i,...l]}function nd({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return ze(vr(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new xg(e.type);return $n([e],[t])}function Cs(e,{method:t}){var r,o;const n={};return e.transport.type==="fallback"&&((o=(r=e.transport).onResponse)==null||o.call(r,({method:s,response:i,status:l,transport:a})=>{l==="success"&&t===s&&(n[i]=a.request)})),s=>n[s]||e.request}async function rd(e,t){const{address:n,abi:r,args:o,eventName:s,fromBlock:i,strict:l,toBlock:a}=t,c=Cs(e,{method:"eth_newFilter"}),u=s?lo({abi:r,args:o,eventName:s}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?ne(i):i,toBlock:typeof a=="bigint"?ne(a):a,topics:u}]});return{abi:r,args:o,eventName:s,id:d,request:c(d),strict:!!l,type:"event"}}function dt(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const od="/docs/contract/encodeFunctionData";function y1(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=Yn({abi:t,args:n,name:r});if(!s)throw new gr(r,{docsPath:od});o=s}if(o.type!=="function")throw new gr(void 0,{docsPath:od});return{abi:[o],functionName:ao(Mt(o))}}function vt(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var l;return e.abi.length===1&&((l=e.functionName)!=null&&l.startsWith("0x"))?e:y1(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?$n(o.inputs,t??[]):void 0;return Sr([s,i??"0x"])}const v1={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},sd={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},w1={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let id=class extends G{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},ad=class extends G{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},x1=class extends G{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const E1={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new x1({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new ad({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new id({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new id({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function aa(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(E1);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function S1(e,t={}){typeof t.size<"u"&&kt(e,{size:t.size});const n=Le(e,t);return Gt(n,t)}function P1(e,t={}){let n=e;if(typeof t.size<"u"&&(kt(n,{size:t.size}),n=Gn(n)),n.length>1||n[0]>1)throw new Sg(n);return!!n[0]}function dn(e,t={}){typeof t.size<"u"&&kt(e,{size:t.size});const n=Le(e,t);return ln(n,t)}function T1(e,t={}){let n=e;return typeof t.size<"u"&&(kt(n,{size:t.size}),n=Gn(n,{dir:"right"})),new TextDecoder().decode(n)}function co(e,t){const n=typeof t=="string"?qt(t):t,r=aa(n);if(Te(n)===0&&e.length>0)throw new ro;if(Te(t)&&Te(t)<32)throw new Nu({data:typeof t=="string"?t:Le(t),params:e,size:Te(t)});let o=0;const s=[];for(let i=0;i<e.length;++i){const l=e[i];r.setPosition(o);const[a,c]=Pr(r,l,{staticPosition:0});o+=c,s.push(a)}return s}function Pr(e,t,{staticPosition:n}){const r=sa(t.type);if(r){const[o,s]=r;return N1(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return I1(e,t,{staticPosition:n});if(t.type==="address")return A1(e);if(t.type==="bool")return C1(e);if(t.type.startsWith("bytes"))return O1(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return $1(e,t);if(t.type==="string")return M1(e,{staticPosition:n});throw new vg(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ld=32,la=32;function A1(e){const t=e.readBytes(32);return[Ns(Le(Ju(t,-20))),32]}function N1(e,t,{length:n,staticPosition:r}){if(!n){const i=dn(e.readBytes(la)),l=r+i,a=l+ld;e.setPosition(l);const c=dn(e.readBytes(ld)),u=uo(t);let d=0;const p=[];for(let f=0;f<c;++f){e.setPosition(a+(u?f*32:d));const[h,m]=Pr(e,t,{staticPosition:a});d+=m,p.push(h)}return e.setPosition(r+32),[p,32]}if(uo(t)){const i=dn(e.readBytes(la)),l=r+i,a=[];for(let c=0;c<n;++c){e.setPosition(l+c*32);const[u]=Pr(e,t,{staticPosition:l});a.push(u)}return e.setPosition(r+32),[a,32]}let o=0;const s=[];for(let i=0;i<n;++i){const[l,a]=Pr(e,t,{staticPosition:r+o});o+=a,s.push(l)}return[s,o]}function C1(e){return[P1(e.readBytes(32),{size:32}),32]}function O1(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=dn(e.readBytes(32));e.setPosition(n+i);const l=dn(e.readBytes(32));if(l===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(l);return e.setPosition(n+32),[Le(a),32]}return[Le(e.readBytes(Number.parseInt(o,10),32)),32]}function $1(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?S1(o,{signed:n}):dn(o,{signed:n}),32]}function I1(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(uo(t)){const i=dn(e.readBytes(la)),l=n+i;for(let a=0;a<t.components.length;++a){const c=t.components[a];e.setPosition(l+s);const[u,d]=Pr(e,c,{staticPosition:l});s+=d,o[r?a:c==null?void 0:c.name]=u}return e.setPosition(n+32),[o,32]}for(let i=0;i<t.components.length;++i){const l=t.components[i],[a,c]=Pr(e,l,{staticPosition:n});o[r?i:l==null?void 0:l.name]=a,s+=c}return[o,s]}function M1(e,{staticPosition:t}){const n=dn(e.readBytes(32)),r=t+n;e.setPosition(r);const o=dn(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=T1(Gn(s));return e.setPosition(t+32),[i,32]}function uo(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(uo);const n=sa(e.type);return!!(n&&uo({...e,type:n[1]}))}function cd(e){const{abi:t,data:n}=e,r=Zn(n,0,4);if(r==="0x")throw new ro;const s=[...t||[],sd,w1].find(i=>i.type==="error"&&r===ao(Mt(i)));if(!s)throw new Ou(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?co(s.inputs,Zn(n,4)):void 0,errorName:s.name}}const Be=(e,t,n)=>JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o,n);function ud({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((o,s)=>`${r&&o.name?`${o.name}: `:""}${typeof t[s]=="object"?Be(t[s]):t[s]}`).join(", ")})`}const D1={gwei:9,wei:18},k1={ether:-9,wei:9};function ca(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${s?`.${s}`:""}`}function ua(e,t="wei"){return ca(e,D1[t])}function Xe(e,t="wei"){return ca(e,k1[t])}class L1 extends G{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class B1 extends G{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function dd(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
|
|
72
|
-
`,"")}function
|
|
63
|
+
`),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class Mu extends G{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
|
|
64
|
+
`),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class bg extends G{constructor(t,{docsPath:n}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
|
|
65
|
+
`),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class gg extends G{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${It(t.abiItem)}\`, and`,`\`${n.type}\` in \`${It(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let yg=class extends G{constructor({expectedSize:t,givenSize:n}){super(`Expected bytes${t}, got bytes${n}.`,{name:"BytesSizeMismatchError"})}};class Es extends G{constructor({abiItem:t,data:n,params:r,size:o}){super([`Data size of ${o} bytes is too small for non-indexed event parameters.`].join(`
|
|
66
|
+
`),{metaMessages:[`Params: (${xs(r,{includeName:!0})})`,`Data: ${n} (${o} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=n,this.params=r,this.size=o}}class Yi extends G{constructor({abiItem:t,param:n}){super([`Expected a topic for indexed event parameter${n.name?` "${n.name}"`:""} on event "${It(t,{includeName:!0})}".`].join(`
|
|
67
|
+
`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class vg extends G{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
|
|
68
|
+
`),{docsPath:n,name:"InvalidAbiEncodingType"})}}class wg extends G{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
|
|
69
|
+
`),{docsPath:n,name:"InvalidAbiDecodingType"})}}let Iu=class extends G{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
|
|
70
|
+
`),{name:"InvalidArrayError"})}};class xg extends G{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
|
|
71
|
+
`),{name:"InvalidDefinitionTypeError"})}}class Eg extends G{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let Du=class extends G{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}},ku=class extends G{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class Lu extends G{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${t} ${r} long.`,{name:"InvalidBytesLengthError"})}}function yr(e,{dir:t,size:n=32}={}){return typeof e=="string"?Nn(e,{dir:t,size:n}):Sg(e,{dir:t,size:n})}function Nn(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new ku({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Sg(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new ku({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let o=0;o<n;o++){const s=t==="right";r[s?o:n-o-1]=e[s?o:e.length-o-1]}return r}let Xi=class extends G{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number "${s}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},Pg=class extends G{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class Tg extends G{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let Ag=class extends G{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}};function Gn(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,r=0;for(let o=0;o<n.length-1&&n[t==="left"?o:n.length-o-1].toString()==="0";o++)r++;return n=t==="left"?n.slice(r):n.slice(0,n.length-r),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function kt(e,{size:t}){if(Te(e)>t)throw new Ag({givenSize:Te(e),maxSize:t})}function Gt(e,t={}){const{signed:n}=t;t.size&&kt(e,{size:t.size});const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n-1n)-1n;return r<=s?r:r-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function Ng(e,t={}){let n=e;if(t.size&&(kt(n,{size:t.size}),n=Gn(n)),Gn(n)==="0x00")return!1;if(Gn(n)==="0x01")return!0;throw new Tg(n)}function ln(e,t={}){const n=Gt(e,t),r=Number(n);if(!Number.isSafeInteger(r))throw new Xi({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return r}const Cg=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Cn(e,t={}){return typeof e=="number"||typeof e=="bigint"?ne(e,t):typeof e=="string"?oo(e,t):typeof e=="boolean"?Bu(e,t):Le(e,t)}function Bu(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(kt(n,{size:t.size}),yr(n,{size:t.size})):n}function Le(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=Cg[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(kt(r,{size:t.size}),yr(r,{dir:"right",size:t.size})):r}function ne(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const a=typeof e=="bigint"?"n":"";throw new Xi({max:s?`${s}${a}`:void 0,min:`${i}${a}`,signed:n,size:r,value:`${e}${a}`})}const l=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?yr(l,{size:r}):l}const Og=new TextEncoder;function oo(e,t={}){const n=Og.encode(e);return Le(n,t)}const $g=new TextEncoder;function vr(e,t={}){return typeof e=="number"||typeof e=="bigint"?Ig(e,t):typeof e=="boolean"?Mg(e,t):Dt(e)?qt(e,t):qn(e,t)}function Mg(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(kt(n,{size:t.size}),yr(n,{size:t.size})):n}const cn={zero:48,nine:57,A:65,F:70,a:97,f:102};function Fu(e){if(e>=cn.zero&&e<=cn.nine)return e-cn.zero;if(e>=cn.A&&e<=cn.F)return e-(cn.A-10);if(e>=cn.a&&e<=cn.f)return e-(cn.a-10)}function qt(e,t={}){let n=e;t.size&&(kt(n,{size:t.size}),n=yr(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const o=r.length/2,s=new Uint8Array(o);for(let i=0,l=0;i<o;i++){const a=Fu(r.charCodeAt(l++)),c=Fu(r.charCodeAt(l++));if(a===void 0||c===void 0)throw new G(`Invalid byte sequence ("${r[l-2]}${r[l-1]}" in "${r}").`);s[i]=a*16+c}return s}function Ig(e,t){const n=ne(e,t);return qt(n)}function qn(e,t={}){const n=$g.encode(e);return typeof t.size=="number"?(kt(n,{size:t.size}),yr(n,{dir:"right",size:t.size})):n}const Ss=BigInt(2**32-1),Ru=BigInt(32);function Dg(e,t=!1){return t?{h:Number(e&Ss),l:Number(e>>Ru&Ss)}:{h:Number(e>>Ru&Ss)|0,l:Number(e&Ss)|0}}function kg(e,t=!1){const n=e.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let s=0;s<n;s++){const{h:i,l}=Dg(e[s],t);[r[s],o[s]]=[i,l]}return[r,o]}const Lg=(e,t,n)=>e<<n|t>>>32-n,Bg=(e,t,n)=>t<<n|e>>>32-n,Fg=(e,t,n)=>t<<n-32|e>>>64-n,Rg=(e,t,n)=>e<<n-32|t>>>64-n,wr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function jg(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function so(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Kn(e,...t){if(!jg(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function zg(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");so(e.outputLen),so(e.blockLen)}function xr(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 ju(e,t){Kn(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function Ug(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Er(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ji(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Kt(e,t){return e<<32-t|e>>>t}const Wg=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function _g(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Vg(e){for(let t=0;t<e.length;t++)e[t]=_g(e[t]);return e}const zu=Wg?e=>e:Vg;function Hg(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Ps(e){return typeof e=="string"&&(e=Hg(e)),Kn(e),e}function Gg(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];Kn(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}class Qi{}function Uu(e){const t=r=>e().update(Ps(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function qg(e=32){if(wr&&typeof wr.getRandomValues=="function")return wr.getRandomValues(new Uint8Array(e));if(wr&&typeof wr.randomBytes=="function")return Uint8Array.from(wr.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const Kg=BigInt(0),io=BigInt(1),Zg=BigInt(2),Yg=BigInt(7),Xg=BigInt(256),Jg=BigInt(113),Wu=[],_u=[],Vu=[];for(let e=0,t=io,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],Wu.push(2*(5*r+n)),_u.push((e+1)*(e+2)/2%64);let o=Kg;for(let s=0;s<7;s++)t=(t<<io^(t>>Yg)*Jg)%Xg,t&Zg&&(o^=io<<(io<<BigInt(s))-io);Vu.push(o)}const Hu=kg(Vu,!0),Qg=Hu[0],e1=Hu[1],Gu=(e,t,n)=>n>32?Fg(e,t,n):Lg(e,t,n),qu=(e,t,n)=>n>32?Rg(e,t,n):Bg(e,t,n);function t1(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let i=0;i<10;i++)n[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){const l=(i+8)%10,a=(i+2)%10,c=n[a],u=n[a+1],d=Gu(c,u,1)^n[l],p=qu(c,u,1)^n[l+1];for(let f=0;f<50;f+=10)e[i+f]^=d,e[i+f+1]^=p}let o=e[2],s=e[3];for(let i=0;i<24;i++){const l=_u[i],a=Gu(o,s,l),c=qu(o,s,l),u=Wu[i];o=e[u],s=e[u+1],e[u]=a,e[u+1]=c}for(let i=0;i<50;i+=10){for(let l=0;l<10;l++)n[l]=e[i+l];for(let l=0;l<10;l++)e[i+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=Qg[r],e[1]^=e1[r]}Er(n)}class ea extends Qi{constructor(t,n,r,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=s,so(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Ug(this.state)}clone(){return this._cloneInto()}keccak(){zu(this.state32),t1(this.state32,this.rounds),zu(this.state32),this.posOut=0,this.pos=0}update(t){xr(this),t=Ps(t),Kn(t);const{blockLen:n,state:r}=this,o=t.length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);for(let l=0;l<i;l++)r[this.pos++]^=t[s++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){xr(this,!1),Kn(t),this.finish();const n=this.state,{blockLen:r}=this;for(let o=0,s=t.length;o<s;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,s-o);t.set(n.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return so(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ju(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,Er(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new ea(n,r,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=r,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}}const n1=(e,t,n)=>Uu(()=>new ea(t,e,n)),Ku=n1(1,136,256/8);function ze(e,t){const n=t||"hex",r=Ku(Dt(e,{strict:!1})?vr(e):e);return n==="bytes"?r:Cn(r)}const r1=e=>ze(vr(e));function o1(e){return r1(e)}function s1(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const l=e[i];if(["(",")",","].includes(l)&&(t=!0),l==="("&&r++,l===")"&&r--,!!t){if(r===0){if(l===" "&&["event","function",""].includes(o))o="";else if(o+=l,l===")"){s=!0;break}continue}if(l===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=l,n+=l}}if(!s)throw new G("Unable to normalize signature.");return o}const i1=e=>{const t=typeof e=="string"?e:vs(e);return s1(t)};function Zu(e){return o1(i1(e))}const Ts=Zu;let On=class extends G{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},As=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const ta=new As(8192);function Ns(e,t){if(ta.has(`${e}.${t}`))return ta.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=ze(qn(n),"bytes"),o=n.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&o[i]&&(o[i]=o[i].toUpperCase()),(r[i>>1]&15)>=8&&o[i+1]&&(o[i+1]=o[i+1].toUpperCase());const s=`0x${o.join("")}`;return ta.set(`${e}.${t}`,s),s}function un(e,t){if(!yt(e,{strict:!1}))throw new On({address:e});return Ns(e,t)}const a1=/^0x[a-fA-F0-9]{40}$/,na=new As(8192);function yt(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(na.has(r))return na.get(r);const o=a1.test(e)?e.toLowerCase()===e?!0:n?Ns(e)===e:!0:!1;return na.set(r,o),o}function Lt(e){return typeof e[0]=="string"?Sr(e):l1(e)}function l1(e){let t=0;for(const o of e)t+=o.length;const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}function Sr(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Zn(e,t,n,{strict:r}={}){return Dt(e,{strict:!1})?c1(e,t,n,{strict:r}):Ju(e,t,n,{strict:r})}function Yu(e,t){if(typeof t=="number"&&t>0&&t>Te(e)-1)throw new Du({offset:t,position:"start",size:Te(e)})}function Xu(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Te(e)!==n-t)throw new Du({offset:n,position:"end",size:Te(e)})}function Ju(e,t,n,{strict:r}={}){Yu(e,t);const o=e.slice(t,n);return r&&Xu(o,t,n),o}function c1(e,t,n,{strict:r}={}){Yu(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&Xu(o,t,n),o}const u1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Qu=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function $n(e,t){if(e.length!==t.length)throw new fg({expectedLength:e.length,givenLength:t.length});const n=d1({params:e,values:t}),r=oa(n);return r.length===0?"0x":r}function d1({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(ra({param:e[r],value:t[r]}));return n}function ra({param:e,value:t}){const n=sa(e.type);if(n){const[r,o]=n;return p1(t,{length:r,param:{...e,type:o}})}if(e.type==="tuple")return y1(t,{param:e});if(e.type==="address")return f1(t);if(e.type==="bool")return m1(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,o="256"]=Qu.exec(e.type)??[];return b1(t,{signed:r,size:Number(o)})}if(e.type.startsWith("bytes"))return h1(t,{param:e});if(e.type==="string")return g1(t);throw new vg(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function oa(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:l}=e[s];i?t+=32:t+=Te(l)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:l}=e[s];i?(n.push(ne(t+o,{size:32})),r.push(l),o+=Te(l)):n.push(l)}return Lt([...n,...r])}function f1(e){if(!yt(e))throw new On({address:e});return{dynamic:!1,encoded:Nn(e.toLowerCase())}}function p1(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new Iu(e);if(!r&&e.length!==t)throw new ug({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let o=!1;const s=[];for(let i=0;i<e.length;i++){const l=ra({param:n,value:e[i]});l.dynamic&&(o=!0),s.push(l)}if(r||o){const i=oa(s);if(r){const l=ne(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?Lt([l,i]):l}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:Lt(s.map(({encoded:i})=>i))}}function h1(e,{param:t}){const[,n]=t.type.split("bytes"),r=Te(e);if(!n){let o=e;return r%32!==0&&(o=Nn(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Lt([Nn(ne(r,{size:32})),o])}}if(r!==Number.parseInt(n,10))throw new dg({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:Nn(e,{dir:"right"})}}function m1(e){if(typeof e!="boolean")throw new G(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Nn(Bu(e))}}function b1(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new Xi({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:ne(e,{size:32,signed:t})}}function g1(e){const t=oo(e),n=Math.ceil(Te(t)/32),r=[];for(let o=0;o<n;o++)r.push(Nn(Zn(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Lt([Nn(ne(Te(t),{size:32})),...r])}}function y1(e,{param:t}){let n=!1;const r=[];for(let o=0;o<t.components.length;o++){const s=t.components[o],i=Array.isArray(e)?o:s.name,l=ra({param:s,value:e[i]});r.push(l),l.dynamic&&(n=!0)}return{dynamic:n,encoded:n?oa(r):Lt(r.map(({encoded:o})=>o))}}function sa(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const ao=e=>Zn(Zu(e),0,4);function Yn(e){const{abi:t,args:n=[],name:r}=e,o=Dt(r,{strict:!1}),s=t.filter(l=>o?l.type==="function"?ao(l)===r:l.type==="event"?Ts(l)===r:!1:"name"in l&&l.name===r);if(s.length===0)return;if(s.length===1)return s[0];let i;for(const l of s){if(!("inputs"in l))continue;if(!n||n.length===0){if(!l.inputs||l.inputs.length===0)return l;continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==n.length)continue;if(n.every((c,u)=>{const d="inputs"in l&&l.inputs[u];return d?ia(c,d):!1})){if(i&&"inputs"in i&&i.inputs){const c=ed(l.inputs,i.inputs,n);if(c)throw new gg({abiItem:l,type:c[0]},{abiItem:i,type:c[1]})}i=l}}return i||s[0]}function ia(e,t){const n=typeof e,r=t.type;switch(r){case"address":return yt(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>n==="object"&&ia(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>ia(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function ed(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return ed(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?yt(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?yt(n[r],{strict:!1}):!1)return i}}const td="/docs/contract/encodeEventTopics";function lo(e){var a;const{abi:t,eventName:n,args:r}=e;let o=t[0];if(n){const c=Yn({abi:t,name:n});if(!c)throw new $u(n,{docsPath:td});o=c}if(o.type!=="event")throw new $u(void 0,{docsPath:td});const s=It(o),i=Ts(s);let l=[];if(r&&"inputs"in o){const c=(a=o.inputs)==null?void 0:a.filter(d=>"indexed"in d&&d.indexed),u=Array.isArray(r)?r:Object.values(r).length>0?(c==null?void 0:c.map(d=>r[d.name]))??[]:[];u.length>0&&(l=(c==null?void 0:c.map((d,p)=>Array.isArray(u[p])?u[p].map((f,h)=>nd({param:d,value:u[p][h]})):typeof u[p]<"u"&&u[p]!==null?nd({param:d,value:u[p]}):null))??[])}return[i,...l]}function nd({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return ze(vr(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Eg(e.type);return $n([e],[t])}function Cs(e,{method:t}){var r,o;const n={};return e.transport.type==="fallback"&&((o=(r=e.transport).onResponse)==null||o.call(r,({method:s,response:i,status:l,transport:a})=>{l==="success"&&t===s&&(n[i]=a.request)})),s=>n[s]||e.request}async function rd(e,t){const{address:n,abi:r,args:o,eventName:s,fromBlock:i,strict:l,toBlock:a}=t,c=Cs(e,{method:"eth_newFilter"}),u=s?lo({abi:r,args:o,eventName:s}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof i=="bigint"?ne(i):i,toBlock:typeof a=="bigint"?ne(a):a,topics:u}]});return{abi:r,args:o,eventName:s,id:d,request:c(d),strict:!!l,type:"event"}}function dt(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const od="/docs/contract/encodeFunctionData";function v1(e){const{abi:t,args:n,functionName:r}=e;let o=t[0];if(r){const s=Yn({abi:t,args:n,name:r});if(!s)throw new gr(r,{docsPath:od});o=s}if(o.type!=="function")throw new gr(void 0,{docsPath:od});return{abi:[o],functionName:ao(It(o))}}function vt(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var l;return e.abi.length===1&&((l=e.functionName)!=null&&l.startsWith("0x"))?e:v1(e)})(),o=n[0],s=r,i="inputs"in o&&o.inputs?$n(o.inputs,t??[]):void 0;return Sr([s,i??"0x"])}const w1={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},sd={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},x1={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let id=class extends G{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},ad=class extends G{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},E1=class extends G{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const S1={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new E1({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new ad({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new id({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new id({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function aa(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(S1);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function P1(e,t={}){typeof t.size<"u"&&kt(e,{size:t.size});const n=Le(e,t);return Gt(n,t)}function T1(e,t={}){let n=e;if(typeof t.size<"u"&&(kt(n,{size:t.size}),n=Gn(n)),n.length>1||n[0]>1)throw new Pg(n);return!!n[0]}function dn(e,t={}){typeof t.size<"u"&&kt(e,{size:t.size});const n=Le(e,t);return ln(n,t)}function A1(e,t={}){let n=e;return typeof t.size<"u"&&(kt(n,{size:t.size}),n=Gn(n,{dir:"right"})),new TextDecoder().decode(n)}function co(e,t){const n=typeof t=="string"?qt(t):t,r=aa(n);if(Te(n)===0&&e.length>0)throw new ro;if(Te(t)&&Te(t)<32)throw new Nu({data:typeof t=="string"?t:Le(t),params:e,size:Te(t)});let o=0;const s=[];for(let i=0;i<e.length;++i){const l=e[i];r.setPosition(o);const[a,c]=Pr(r,l,{staticPosition:0});o+=c,s.push(a)}return s}function Pr(e,t,{staticPosition:n}){const r=sa(t.type);if(r){const[o,s]=r;return C1(e,{...t,type:s},{length:o,staticPosition:n})}if(t.type==="tuple")return I1(e,t,{staticPosition:n});if(t.type==="address")return N1(e);if(t.type==="bool")return O1(e);if(t.type.startsWith("bytes"))return $1(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return M1(e,t);if(t.type==="string")return D1(e,{staticPosition:n});throw new wg(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const ld=32,la=32;function N1(e){const t=e.readBytes(32);return[Ns(Le(Ju(t,-20))),32]}function C1(e,t,{length:n,staticPosition:r}){if(!n){const i=dn(e.readBytes(la)),l=r+i,a=l+ld;e.setPosition(l);const c=dn(e.readBytes(ld)),u=uo(t);let d=0;const p=[];for(let f=0;f<c;++f){e.setPosition(a+(u?f*32:d));const[h,m]=Pr(e,t,{staticPosition:a});d+=m,p.push(h)}return e.setPosition(r+32),[p,32]}if(uo(t)){const i=dn(e.readBytes(la)),l=r+i,a=[];for(let c=0;c<n;++c){e.setPosition(l+c*32);const[u]=Pr(e,t,{staticPosition:l});a.push(u)}return e.setPosition(r+32),[a,32]}let o=0;const s=[];for(let i=0;i<n;++i){const[l,a]=Pr(e,t,{staticPosition:r+o});o+=a,s.push(l)}return[s,o]}function O1(e){return[T1(e.readBytes(32),{size:32}),32]}function $1(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=dn(e.readBytes(32));e.setPosition(n+i);const l=dn(e.readBytes(32));if(l===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(l);return e.setPosition(n+32),[Le(a),32]}return[Le(e.readBytes(Number.parseInt(o,10),32)),32]}function M1(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?P1(o,{signed:n}):dn(o,{signed:n}),32]}function I1(e,t,{staticPosition:n}){const r=t.components.length===0||t.components.some(({name:i})=>!i),o=r?[]:{};let s=0;if(uo(t)){const i=dn(e.readBytes(la)),l=n+i;for(let a=0;a<t.components.length;++a){const c=t.components[a];e.setPosition(l+s);const[u,d]=Pr(e,c,{staticPosition:l});s+=d,o[r?a:c==null?void 0:c.name]=u}return e.setPosition(n+32),[o,32]}for(let i=0;i<t.components.length;++i){const l=t.components[i],[a,c]=Pr(e,l,{staticPosition:n});o[r?i:l==null?void 0:l.name]=a,s+=c}return[o,s]}function D1(e,{staticPosition:t}){const n=dn(e.readBytes(32)),r=t+n;e.setPosition(r);const o=dn(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=A1(Gn(s));return e.setPosition(t+32),[i,32]}function uo(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(uo);const n=sa(e.type);return!!(n&&uo({...e,type:n[1]}))}function cd(e){const{abi:t,data:n}=e,r=Zn(n,0,4);if(r==="0x")throw new ro;const s=[...t||[],sd,x1].find(i=>i.type==="error"&&r===ao(It(i)));if(!s)throw new Ou(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?co(s.inputs,Zn(n,4)):void 0,errorName:s.name}}const Be=(e,t,n)=>JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString():o,n);function ud({abiItem:e,args:t,includeFunctionName:n=!0,includeName:r=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((o,s)=>`${r&&o.name?`${o.name}: `:""}${typeof t[s]=="object"?Be(t[s]):t[s]}`).join(", ")})`}const k1={gwei:9,wei:18},L1={ether:-9,wei:9};function ca(e,t){let n=e.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(t,"0");let[o,s]=[n.slice(0,n.length-t),n.slice(n.length-t)];return s=s.replace(/(0+)$/,""),`${r?"-":""}${o||"0"}${s?`.${s}`:""}`}function ua(e,t="wei"){return ca(e,k1[t])}function Xe(e,t="wei"){return ca(e,L1[t])}class B1 extends G{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class F1 extends G{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function dd(e){return e.reduce((t,{slot:n,value:r})=>`${t} ${n}: ${r}
|
|
72
|
+
`,"")}function R1(e){return e.reduce((t,{address:n,...r})=>{let o=`${t} ${n}:
|
|
73
73
|
`;return r.nonce&&(o+=` nonce: ${r.nonce}
|
|
74
74
|
`),r.balance&&(o+=` balance: ${r.balance}
|
|
75
75
|
`),r.code&&(o+=` code: ${r.code}
|
|
@@ -77,46 +77,46 @@ React keys must be passed directly to JSX without using spread:
|
|
|
77
77
|
`,o+=dd(r.state)),r.stateDiff&&(o+=` stateDiff:
|
|
78
78
|
`,o+=dd(r.stateDiff)),o},` State Override:
|
|
79
79
|
`).slice(0,-1)}function fo(e){const t=Object.entries(e).map(([r,o])=>o===void 0||o===!1?null:[r,o]).filter(Boolean),n=t.reduce((r,[o])=>Math.max(r,o.length),0);return t.map(([r,o])=>` ${`${r}:`.padEnd(n+1)} ${o}`).join(`
|
|
80
|
-
`)}class
|
|
81
|
-
${
|
|
82
|
-
`):`The contract function "${r}" reverted.`,{cause:s,metaMessages:l,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.raw=n,this.reason=a,this.signature=c}}class
|
|
83
|
-
`)})}}Object.defineProperty(go,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Jn extends Je{constructor(t){super(t,{code:Jn.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Jn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class
|
|
84
|
-
`)})}}Object.defineProperty(In,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class yo extends Je{constructor(t){super(t,{code:yo.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(yo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class vo extends Je{constructor(t){super(t,{code:vo.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(vo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class wo extends Je{constructor(t){super(t,{code:wo.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(wo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Qn extends Je{constructor(t,{method:n}={}){super(t,{code:Qn.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Qn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Tr extends Je{constructor(t){super(t,{code:Tr.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Tr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class xo extends Je{constructor(t){super(t,{code:xo.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(xo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Ar extends Qe{constructor(t){super(t,{code:Ar.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Ar,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Eo extends Qe{constructor(t){super(t,{code:Eo.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(Eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class So extends Qe{constructor(t,{method:n}={}){super(t,{code:So.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(So,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Po extends Qe{constructor(t){super(t,{code:Po.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(Po,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class To extends Qe{constructor(t){super(t,{code:To.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(To,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Ao extends Qe{constructor(t){super(t,{code:Ao.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Ao,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class No extends Qe{constructor(t){super(t,{code:No.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(No,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class Co extends Qe{constructor(t){super(t,{code:Co.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(Co,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class Oo extends Qe{constructor(t){super(t,{code:Oo.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(Oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class $o extends Qe{constructor(t){super(t,{code:$o.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty($o,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class Io extends Qe{constructor(t){super(t,{code:Io.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(Io,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Mo extends Qe{constructor(t){super(t,{code:Mo.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Mo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Do extends Qe{constructor(t){super(t,{code:Do.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Do,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class ko extends Qe{constructor(t){super(t,{code:ko.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(ko,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class G1 extends Je{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const q1=3;function Nr(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const l=e instanceof Os?e:e instanceof G?e.walk(h=>"data"in h)||e.walk():{},{code:a,data:c,details:u,message:d,shortMessage:p}=l,f=e instanceof ro?new _1({functionName:s}):[q1,Jn.code].includes(a)&&(c||u||d||p)||a===In.code&&u==="execution reverted"&&c?new da({abi:t,data:typeof c=="object"?c.data:c,functionName:s,message:l instanceof fa?u:p??d}):e;return new md(f,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}function K1(e){const t=ze(`0x${e.substring(4)}`).substring(26);return Ns(`0x${t}`)}async function Z1({hash:e,signature:t}){const n=Dt(e)?e:Cn(e),{secp256k1:r}=await Promise.resolve().then(()=>$6);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:c,s:u,v:d,yParity:p}=t,f=Number(p??d),h=gd(f);return new r.Signature(Gt(c),Gt(u)).addRecoveryBit(h)}const i=Dt(t)?t:Cn(t);if(Te(i)!==65)throw new Error("invalid signature length");const l=ln(`0x${i.slice(130)}`),a=gd(l);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(a)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function gd(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function yd({hash:e,signature:t}){return K1(await Z1({hash:e,signature:t}))}function Y1(e,t="hex"){const n=vd(e),r=aa(new Uint8Array(n.length));return n.encode(r),t==="hex"?Le(r.bytes):r.bytes}function vd(e){return Array.isArray(e)?X1(e.map(t=>vd(t))):J1(e)}function X1(e){const t=e.reduce((o,s)=>o+s.length,0),n=wd(t);return{length:t<=55?1+t:1+n+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+n),n===1?o.pushUint8(t):n===2?o.pushUint16(t):n===3?o.pushUint24(t):o.pushUint32(t));for(const{encode:s}of e)s(o)}}}function J1(e){const t=typeof e=="string"?qt(e):e,n=wd(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+n),n===1?o.pushUint8(t.length):n===2?o.pushUint16(t.length):n===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function wd(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new G("Length is too large.")}function Q1(e){const{chainId:t,nonce:n,to:r}=e,o=e.contractAddress??e.address,s=ze(Sr(["0x05",Y1([t?ne(t):"0x",o,n?ne(n):"0x"])]));return r==="bytes"?qt(s):s}async function xd(e){const{authorization:t,signature:n}=e;return yd({hash:Q1(t),signature:n??t})}class ey extends G{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:l,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:u,to:d,value:p}){var h;const f=fo({from:n==null?void 0:n.address,to:d,value:typeof p<"u"&&`${ua(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof l<"u"&&`${Xe(l)} gwei`,maxFeePerGas:typeof a<"u"&&`${Xe(a)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Xe(c)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",f].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Cr extends G{constructor({cause:t,message:n}={}){var o;const r=(o=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:o.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(Cr,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(Cr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class $s extends G{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Xe(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty($s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class pa extends G{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Xe(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(pa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class ha extends G{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(ha,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class ma extends G{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
80
|
+
`)}class j1 extends G{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",fo(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class z1 extends G{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:l,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:u,to:d,value:p}){var h;const f=fo({chain:o&&`${o==null?void 0:o.name} (id: ${o==null?void 0:o.id})`,from:n==null?void 0:n.address,to:d,value:typeof p<"u"&&`${ua(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof l<"u"&&`${Xe(l)} gwei`,maxFeePerGas:typeof a<"u"&&`${Xe(a)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Xe(c)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",f].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class fd extends G{constructor({blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s}){let i="Transaction";r&&s!==void 0&&(i=`Transaction at block time "${r}" at index "${s}"`),t&&s!==void 0&&(i=`Transaction at block hash "${t}" at index "${s}"`),n&&s!==void 0&&(i=`Transaction at block number "${n}" at index "${s}"`),o&&(i=`Transaction with hash "${o}"`),super(`${i} could not be found.`,{name:"TransactionNotFoundError"})}}class pd extends G{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class U1 extends G{constructor({receipt:t}){super(`Transaction with hash "${t.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}}class W1 extends G{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const _1=e=>e,po=e=>e;class hd extends G{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:l,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:u,to:d,value:p,stateOverride:f}){var x;const h=n?dt(n):void 0;let m=fo({from:h==null?void 0:h.address,to:d,value:typeof p<"u"&&`${ua(p)} ${((x=o==null?void 0:o.nativeCurrency)==null?void 0:x.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof l<"u"&&`${Xe(l)} gwei`,maxFeePerGas:typeof a<"u"&&`${Xe(a)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Xe(c)} gwei`,nonce:u});f&&(m+=`
|
|
81
|
+
${R1(f)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class md extends G{constructor(t,{abi:n,args:r,contractAddress:o,docsPath:s,functionName:i,sender:l}){const a=Yn({abi:n,args:r,name:i}),c=a?ud({abiItem:a,args:r,includeFunctionName:!1,includeName:!1}):void 0,u=a?It(a,{includeName:!0}):void 0,d=fo({address:o&&_1(o),function:u,args:c&&c!=="()"&&`${[...Array((i==null?void 0:i.length)??0).keys()].map(()=>" ").join("")}${c}`,sender:l});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:s,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=r,this.cause=t,this.contractAddress=o,this.functionName=i,this.sender=l}}class da extends G{constructor({abi:t,data:n,functionName:r,message:o}){let s,i,l,a;if(n&&n!=="0x")try{i=cd({abi:t,data:n});const{abiItem:u,errorName:d,args:p}=i;if(d==="Error")a=p[0];else if(d==="Panic"){const[f]=p;a=w1[f]}else{const f=u?It(u,{includeName:!0}):void 0,h=u&&p?ud({abiItem:u,args:p,includeFunctionName:!1,includeName:!1}):void 0;l=[f?`Error: ${f}`:"",h&&h!=="()"?` ${[...Array((d==null?void 0:d.length)??0).keys()].map(()=>" ").join("")}${h}`:""]}}catch(u){s=u}else o&&(a=o);let c;s instanceof Ou&&(c=s.signature,l=[`Unable to decode signature "${c}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${c}.`]),super(a&&a!=="execution reverted"||c?[`The contract function "${r}" reverted with the following ${c?"signature":"reason"}:`,a||c].join(`
|
|
82
|
+
`):`The contract function "${r}" reverted.`,{cause:s,metaMessages:l,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=i,this.raw=n,this.reason=a,this.signature=c}}class V1 extends G{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class H1 extends G{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class Os extends G{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class Xn extends G{constructor({body:t,cause:n,details:r,headers:o,status:s,url:i}){super("HTTP request failed.",{cause:n,details:r,metaMessages:[s&&`Status: ${s}`,`URL: ${po(i)}`,t&&`Request body: ${Be(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=o,this.status=s,this.url=i}}class fa extends G{constructor({body:t,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${po(r)}`,`Request body: ${Be(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data,this.url=r}}class bd extends G{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${po(n)}`,`Request body: ${Be(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=n}}const G1=-1;class Je extends G{constructor(t,{code:n,docsPath:r,metaMessages:o,name:s,shortMessage:i}){super(i,{cause:t,docsPath:r,metaMessages:o||(t==null?void 0:t.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||t.name,this.code=t instanceof fa?t.code:n??G1}}class Qe extends Je{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class ho extends Je{constructor(t){super(t,{code:ho.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(ho,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class mo extends Je{constructor(t){super(t,{code:mo.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(mo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class bo extends Je{constructor(t,{method:n}={}){super(t,{code:bo.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(bo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class go extends Je{constructor(t){super(t,{code:go.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
83
|
+
`)})}}Object.defineProperty(go,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Jn extends Je{constructor(t){super(t,{code:Jn.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Jn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Mn extends Je{constructor(t){super(t,{code:Mn.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
84
|
+
`)})}}Object.defineProperty(Mn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class yo extends Je{constructor(t){super(t,{code:yo.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(yo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class vo extends Je{constructor(t){super(t,{code:vo.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(vo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class wo extends Je{constructor(t){super(t,{code:wo.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(wo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Qn extends Je{constructor(t,{method:n}={}){super(t,{code:Qn.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(Qn,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Tr extends Je{constructor(t){super(t,{code:Tr.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Tr,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class xo extends Je{constructor(t){super(t,{code:xo.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(xo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Ar extends Qe{constructor(t){super(t,{code:Ar.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Ar,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Eo extends Qe{constructor(t){super(t,{code:Eo.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(Eo,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class So extends Qe{constructor(t,{method:n}={}){super(t,{code:So.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(So,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Po extends Qe{constructor(t){super(t,{code:Po.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(Po,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class To extends Qe{constructor(t){super(t,{code:To.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(To,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Ao extends Qe{constructor(t){super(t,{code:Ao.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Ao,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class No extends Qe{constructor(t){super(t,{code:No.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(No,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class Co extends Qe{constructor(t){super(t,{code:Co.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(Co,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class Oo extends Qe{constructor(t){super(t,{code:Oo.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(Oo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class $o extends Qe{constructor(t){super(t,{code:$o.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty($o,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class Mo extends Qe{constructor(t){super(t,{code:Mo.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(Mo,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Io extends Qe{constructor(t){super(t,{code:Io.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Io,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Do extends Qe{constructor(t){super(t,{code:Do.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Do,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class ko extends Qe{constructor(t){super(t,{code:ko.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(ko,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class q1 extends Je{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const K1=3;function Nr(e,{abi:t,address:n,args:r,docsPath:o,functionName:s,sender:i}){const l=e instanceof Os?e:e instanceof G?e.walk(h=>"data"in h)||e.walk():{},{code:a,data:c,details:u,message:d,shortMessage:p}=l,f=e instanceof ro?new V1({functionName:s}):[K1,Jn.code].includes(a)&&(c||u||d||p)||a===Mn.code&&u==="execution reverted"&&c?new da({abi:t,data:typeof c=="object"?c.data:c,functionName:s,message:l instanceof fa?u:p??d}):e;return new md(f,{abi:t,args:r,contractAddress:n,docsPath:o,functionName:s,sender:i})}function Z1(e){const t=ze(`0x${e.substring(4)}`).substring(26);return Ns(`0x${t}`)}async function Y1({hash:e,signature:t}){const n=Dt(e)?e:Cn(e),{secp256k1:r}=await Promise.resolve().then(()=>M6);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:c,s:u,v:d,yParity:p}=t,f=Number(p??d),h=gd(f);return new r.Signature(Gt(c),Gt(u)).addRecoveryBit(h)}const i=Dt(t)?t:Cn(t);if(Te(i)!==65)throw new Error("invalid signature length");const l=ln(`0x${i.slice(130)}`),a=gd(l);return r.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(a)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function gd(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function yd({hash:e,signature:t}){return Z1(await Y1({hash:e,signature:t}))}function X1(e,t="hex"){const n=vd(e),r=aa(new Uint8Array(n.length));return n.encode(r),t==="hex"?Le(r.bytes):r.bytes}function vd(e){return Array.isArray(e)?J1(e.map(t=>vd(t))):Q1(e)}function J1(e){const t=e.reduce((o,s)=>o+s.length,0),n=wd(t);return{length:t<=55?1+t:1+n+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+n),n===1?o.pushUint8(t):n===2?o.pushUint16(t):n===3?o.pushUint24(t):o.pushUint32(t));for(const{encode:s}of e)s(o)}}}function Q1(e){const t=typeof e=="string"?qt(e):e,n=wd(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+n),n===1?o.pushUint8(t.length):n===2?o.pushUint16(t.length):n===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function wd(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new G("Length is too large.")}function ey(e){const{chainId:t,nonce:n,to:r}=e,o=e.contractAddress??e.address,s=ze(Sr(["0x05",X1([t?ne(t):"0x",o,n?ne(n):"0x"])]));return r==="bytes"?qt(s):s}async function xd(e){const{authorization:t,signature:n}=e;return yd({hash:ey(t),signature:n??t})}class ty extends G{constructor(t,{account:n,docsPath:r,chain:o,data:s,gas:i,gasPrice:l,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:u,to:d,value:p}){var h;const f=fo({from:n==null?void 0:n.address,to:d,value:typeof p<"u"&&`${ua(p)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:s,gas:i,gasPrice:typeof l<"u"&&`${Xe(l)} gwei`,maxFeePerGas:typeof a<"u"&&`${Xe(a)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Xe(c)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",f].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class Cr extends G{constructor({cause:t,message:n}={}){var o;const r=(o=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:o.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(Cr,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(Cr,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class $s extends G{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Xe(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty($s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class pa extends G{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Xe(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(pa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class ha extends G{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(ha,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class ma extends G{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
85
85
|
`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(ma,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class ba extends G{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(ba,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class ga extends G{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
86
|
-
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(ga,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class ya extends G{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(ya,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class va extends G{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(va,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class wa extends G{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(wa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class
|
|
87
|
-
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Is,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Lo extends G{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function Ms(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof G?e.walk(o=>(o==null?void 0:o.code)===Cr.code):e;return r instanceof G?new Cr({cause:e,message:r.details}):Cr.nodeMessage.test(n)?new Cr({cause:e,message:e.details}):$s.nodeMessage.test(n)?new $s({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):pa.nodeMessage.test(n)?new pa({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):ha.nodeMessage.test(n)?new ha({cause:e,nonce:t==null?void 0:t.nonce}):ma.nodeMessage.test(n)?new ma({cause:e,nonce:t==null?void 0:t.nonce}):ba.nodeMessage.test(n)?new ba({cause:e,nonce:t==null?void 0:t.nonce}):ga.nodeMessage.test(n)?new ga({cause:e}):ya.nodeMessage.test(n)?new ya({cause:e,gas:t==null?void 0:t.gas}):va.nodeMessage.test(n)?new va({cause:e,gas:t==null?void 0:t.gas}):wa.nodeMessage.test(n)?new wa({cause:e}):Is.nodeMessage.test(n)?new Is({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new Lo({cause:e})}function ty(e,{docsPath:t,...n}){const r=(()=>{const o=Ms(e,n);return o instanceof Lo?e:o})();return new ey(r,{docsPath:t,...n})}function Ds(e,{format:t}){if(!t)return{};const n={};function r(s){const i=Object.keys(s);for(const l of i)l in e&&(n[l]=e[l]),s[l]&&typeof s[l]=="object"&&!Array.isArray(s[l])&&r(s[l])}const o=t(e||{});return r(o),n}const ny={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Bo(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=ry(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>Le(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=ne(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=ne(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=ne(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=ne(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=ne(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=ne(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=ny[e.type]),typeof e.value<"u"&&(n.value=ne(e.value)),n}function ry(e){return e.map(t=>({address:t.address,r:t.r?ne(BigInt(t.r)):t.r,s:t.s?ne(BigInt(t.s)):t.s,chainId:ne(t.chainId),nonce:ne(t.nonce),...typeof t.yParity<"u"?{yParity:ne(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:ne(t.v)}:{}}))}function Ed(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Lu({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Lu({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function oy(e){const{balance:t,nonce:n,state:r,stateDiff:o,code:s}=e,i={};if(s!==void 0&&(i.code=s),t!==void 0&&(i.balance=ne(t)),n!==void 0&&(i.nonce=ne(n)),r!==void 0&&(i.state=Ed(r)),o!==void 0){if(i.state)throw new B1;i.stateDiff=Ed(o)}return i}function xa(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!yt(n,{strict:!1}))throw new On({address:n});if(t[n])throw new L1({address:n});t[n]=oy(r)}return t}const Sd=2n**256n-1n;function Or(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:o}=e,s=t?dt(t):void 0;if(s&&!yt(s.address))throw new On({address:s.address});if(o&&!yt(o))throw new On({address:o});if(n&&n>Sd)throw new $s({maxFeePerGas:n});if(r&&n&&r>n)throw new Is({maxFeePerGas:n,maxPriorityFeePerGas:r})}class Pd extends G{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Ea extends G{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class sy extends G{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Xe(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Td extends G{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const Ad={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Sa(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?ln(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?ln(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Ad[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=iy(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}function iy(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Nd(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:Sa(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function Bt(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:o}={}){var c,u,d;const s=o??!1,i=n!==void 0?ne(n):void 0;let l=null;if(t?l=await e.request({method:"eth_getBlockByHash",params:[t,s]},{dedupe:!0}):l=await e.request({method:"eth_getBlockByNumber",params:[i||r,s]},{dedupe:!!i}),!l)throw new Td({blockHash:t,blockNumber:n});return(((d=(u=(c=e.chain)==null?void 0:c.formatters)==null?void 0:u.block)==null?void 0:d.format)||Nd)(l,"getBlock")}async function Pa(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function ay(e,t){return Cd(e,t)}async function Cd(e,t){var s,i;const{block:n,chain:r=e.chain,request:o}=t||{};try{const l=((s=r==null?void 0:r.fees)==null?void 0:s.maxPriorityFeePerGas)??((i=r==null?void 0:r.fees)==null?void 0:i.defaultPriorityFee);if(typeof l=="function"){const c=n||await te(e,Bt,"getBlock")({}),u=await l({block:c,client:e,request:o});if(u===null)throw new Error;return u}if(typeof l<"u")return l;const a=await e.request({method:"eth_maxPriorityFeePerGas"});return Gt(a)}catch{const[l,a]=await Promise.all([n?Promise.resolve(n):te(e,Bt,"getBlock")({}),te(e,Pa,"getGasPrice")({})]);if(typeof l.baseFeePerGas!="bigint")throw new Ea;const c=a-l.baseFeePerGas;return c<0n?0n:c}}async function ly(e,t){return Ta(e,t)}async function Ta(e,t){var p,f;const{block:n,chain:r=e.chain,request:o,type:s="eip1559"}=t||{},i=await(async()=>{var h,m;return typeof((h=r==null?void 0:r.fees)==null?void 0:h.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:o}):((m=r==null?void 0:r.fees)==null?void 0:m.baseFeeMultiplier)??1.2})();if(i<1)throw new Pd;const a=10**(((p=i.toString().split(".")[1])==null?void 0:p.length)??0),c=h=>h*BigInt(Math.ceil(i*a))/BigInt(a),u=n||await te(e,Bt,"getBlock")({});if(typeof((f=r==null?void 0:r.fees)==null?void 0:f.estimateFeesPerGas)=="function"){const h=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:o,type:s});if(h!==null)return h}if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new Ea;const h=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await Cd(e,{block:u,chain:r,request:o}),m=c(u.baseFeePerGas);return{maxFeePerGas:(o==null?void 0:o.maxFeePerGas)??m+h,maxPriorityFeePerGas:h}}return{gasPrice:(o==null?void 0:o.gasPrice)??c(await te(e,Pa,"getGasPrice")({}))}}async function Od(e,{address:t,blockTag:n="latest",blockNumber:r}){const o=await e.request({method:"eth_getTransactionCount",params:[t,typeof r=="bigint"?ne(r):n]},{dedupe:!!r});return ln(o)}function $d(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(s=>qt(s)):e.blobs,o=[];for(const s of r)o.push(Uint8Array.from(t.blobToKzgCommitment(s)));return n==="bytes"?o:o.map(s=>Le(s))}function Id(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>qt(i)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(i=>qt(i)):e.commitments,s=[];for(let i=0;i<r.length;i++){const l=r[i],a=o[i];s.push(Uint8Array.from(t.computeBlobKzgProof(l,a)))}return n==="bytes"?s:s.map(i=>Le(i))}function cy(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),l=Number(n&s),a=r?4:0,c=r?0:4;e.setUint32(t+a,i,r),e.setUint32(t+c,l,r)}function uy(e,t,n){return e&t^~e&n}function dy(e,t,n){return e&t^e&n^t&n}class fy extends Qi{constructor(t,n,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=Ji(this.buffer)}update(t){xr(this),t=Ps(t),Kn(t);const{view:n,buffer:r,blockLen:o}=this,s=t.length;for(let i=0;i<s;){const l=Math.min(o-this.pos,s-i);if(l===o){const a=Ji(t);for(;o<=s-i;i+=o)this.process(a,i);continue}r.set(t.subarray(i,i+l),this.pos),this.pos+=l,i+=l,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){xr(this),ju(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:i}=this;n[i++]=128,Er(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let d=i;d<o;d++)n[d]=0;cy(r,o-8,BigInt(this.length*8),s),this.process(r,0);const l=Ji(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<c;d++)l.setUint32(4*d,u[d],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:o,finished:s,destroyed:i,pos:l}=this;return t.destroyed=i,t.finished=s,t.length=o,t.pos=l,o%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const Mn=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),py=Uint32Array.from([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]),Dn=new Uint32Array(64);class hy extends fy{constructor(t=32){super(64,t,8,!1),this.A=Mn[0]|0,this.B=Mn[1]|0,this.C=Mn[2]|0,this.D=Mn[3]|0,this.E=Mn[4]|0,this.F=Mn[5]|0,this.G=Mn[6]|0,this.H=Mn[7]|0}get(){const{A:t,B:n,C:r,D:o,E:s,F:i,G:l,H:a}=this;return[t,n,r,o,s,i,l,a]}set(t,n,r,o,s,i,l,a){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=l|0,this.H=a|0}process(t,n){for(let d=0;d<16;d++,n+=4)Dn[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){const p=Dn[d-15],f=Dn[d-2],h=Kt(p,7)^Kt(p,18)^p>>>3,m=Kt(f,17)^Kt(f,19)^f>>>10;Dn[d]=m+Dn[d-7]+h+Dn[d-16]|0}let{A:r,B:o,C:s,D:i,E:l,F:a,G:c,H:u}=this;for(let d=0;d<64;d++){const p=Kt(l,6)^Kt(l,11)^Kt(l,25),f=u+p+uy(l,a,c)+py[d]+Dn[d]|0,m=(Kt(r,2)^Kt(r,13)^Kt(r,22))+dy(r,o,s)|0;u=c,c=a,a=l,l=i+f|0,i=s,s=o,o=r,r=f+m|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,l=l+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,o,s,i,l,a,c,u)}roundClean(){Er(Dn)}destroy(){this.set(0,0,0,0,0,0,0,0),Er(this.buffer)}}const Md=Uu(()=>new hy),my=Md;function by(e,t){return my(Dt(e,{strict:!1})?vr(e):e)}function gy(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),o=by(t);return o.set([n],0),r==="bytes"?o:Le(o)}function yy(e){const{commitments:t,version:n}=e,r=e.to,o=[];for(const s of t)o.push(gy({commitment:s,to:r,version:n}));return o}const Dd=6,kd=32,Aa=4096,Ld=kd*Aa,Bd=Ld*Dd-1-1*Aa*Dd;class vy extends G{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class wy extends G{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function xy(e){const t=typeof e.data=="string"?qt(e.data):e.data,n=Te(t);if(!n)throw new wy;if(n>Bd)throw new vy({maxSize:Bd,size:n});const r=[];let o=!0,s=0;for(;o;){const i=aa(new Uint8Array(Ld));let l=0;for(;l<Aa;){const a=t.slice(s,s+(kd-1));if(i.pushByte(0),i.pushBytes(a),a.length<31){i.pushByte(128),o=!1;break}l++,s+=31}r.push(i)}return r.map(i=>Le(i.bytes))}function Ey(e){const{data:t,kzg:n,to:r}=e,o=e.blobs??xy({data:t}),s=e.commitments??$d({blobs:o,kzg:n,to:r}),i=e.proofs??Id({blobs:o,commitments:s,kzg:n,to:r}),l=[];for(let a=0;a<o.length;a++)l.push({blob:o[a],commitment:s[a],proof:i[a]});return l}function Sy(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new R1({transaction:e})}function Py(e,{docsPath:t,...n}){const r=(()=>{const o=Ms(e,n);return o instanceof Lo?e:o})();return new j1(r,{docsPath:t,...n})}async function Na(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return ln(t)}async function Fd(e,t){var b,v,E,I,$;const{account:n=e.account,accessList:r,authorizationList:o,chain:s=e.chain,blobVersionedHashes:i,blobs:l,data:a,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:f,nonce:h,nonceManager:m,to:x,type:T,value:w,...P}=t,A=await(async()=>{if(!n||!m||typeof h<"u")return h;const C=dt(n),D=s?s.id:await te(e,Na,"getChainId")({});return await m.consume({address:C.address,chainId:D,client:e})})();Or(t);const k=(v=(b=s==null?void 0:s.formatters)==null?void 0:b.transactionRequest)==null?void 0:v.format,F=(k||Bo)({...Ds(P,{format:k}),account:n?dt(n):void 0,accessList:r,authorizationList:o,blobs:l,blobVersionedHashes:i,data:a,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:f,nonce:A,to:x,type:T,value:w},"fillTransaction");try{const C=await e.request({method:"eth_fillTransaction",params:[F]}),y=(((I=(E=s==null?void 0:s.formatters)==null?void 0:E.transaction)==null?void 0:I.format)||Sa)(C.tx);delete y.blockHash,delete y.blockNumber,delete y.r,delete y.s,delete y.transactionIndex,delete y.v,delete y.yParity,y.data=y.input,y.gas&&(y.gas=t.gas??y.gas),y.gasPrice&&(y.gasPrice=t.gasPrice??y.gasPrice),y.maxFeePerBlobGas&&(y.maxFeePerBlobGas=t.maxFeePerBlobGas??y.maxFeePerBlobGas),y.maxFeePerGas&&(y.maxFeePerGas=t.maxFeePerGas??y.maxFeePerGas),y.maxPriorityFeePerGas&&(y.maxPriorityFeePerGas=t.maxPriorityFeePerGas??y.maxPriorityFeePerGas),y.nonce&&(y.nonce=t.nonce??y.nonce);const O=await(async()=>{var j,z;if(typeof((j=s==null?void 0:s.fees)==null?void 0:j.baseFeeMultiplier)=="function"){const W=await te(e,Bt,"getBlock")({});return s.fees.baseFeeMultiplier({block:W,client:e,request:t})}return((z=s==null?void 0:s.fees)==null?void 0:z.baseFeeMultiplier)??1.2})();if(O<1)throw new Pd;const S=10**((($=O.toString().split(".")[1])==null?void 0:$.length)??0),L=j=>j*BigInt(Math.ceil(O*S))/BigInt(S);return y.maxFeePerGas&&!t.maxFeePerGas&&(y.maxFeePerGas=L(y.maxFeePerGas)),y.gasPrice&&!t.gasPrice&&(y.gasPrice=L(y.gasPrice)),{raw:C.raw,transaction:{from:F.from,...y}}}catch(C){throw Py(C,{...t,chain:e.chain})}}const Ty=["blobVersionedHashes","chainId","fees","gas","nonce","type"],Rd=new Map,Ca=new As(128);async function jd(e,t){var A,k,B;let n=t;n.account??(n.account=e.account),n.parameters??(n.parameters=Ty);const{account:r,chain:o=e.chain,nonceManager:s,parameters:i}=n,l=(()=>{if(typeof(o==null?void 0:o.prepareTransactionRequest)=="function")return{fn:o.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(o==null?void 0:o.prepareTransactionRequest))return{fn:o.prepareTransactionRequest[0],runAt:o.prepareTransactionRequest[1].runAt}})();let a;async function c(){return a||(typeof n.chainId<"u"?n.chainId:o?o.id:(a=await te(e,Na,"getChainId")({}),a))}const u=r&&dt(r);let d=n.nonce;if(i.includes("nonce")&&typeof d>"u"&&u&&s){const F=await c();d=await s.consume({address:u.address,chainId:F,client:e})}l!=null&&l.fn&&((A=l.runAt)!=null&&A.includes("beforeFillTransaction"))&&(n=await l.fn({...n,chain:o},{phase:"beforeFillTransaction"}),d??(d=n.nonce));const f=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&n.kzg&&n.blobs||Ca.get(e.uid)===!1||!["fees","gas"].some(b=>i.includes(b))?!1:!!(i.includes("chainId")&&typeof n.chainId!="number"||i.includes("nonce")&&typeof d!="number"||i.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||i.includes("gas")&&typeof n.gas!="bigint"))?await te(e,Fd,"fillTransaction")({...n,nonce:d}).then(F=>{const{chainId:b,from:v,gas:E,gasPrice:I,nonce:$,maxFeePerBlobGas:C,maxFeePerGas:D,maxPriorityFeePerGas:y,type:O,...M}=F.transaction;return Ca.set(e.uid,!0),{...n,...v?{from:v}:{},...O&&!n.type?{type:O}:{},...typeof b<"u"?{chainId:b}:{},...typeof E<"u"?{gas:E}:{},...typeof I<"u"?{gasPrice:I}:{},...typeof $<"u"?{nonce:$}:{},...typeof C<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerBlobGas:C}:{},...typeof D<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerGas:D}:{},...typeof y<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxPriorityFeePerGas:y}:{},..."nonceKey"in M&&typeof M.nonceKey<"u"?{nonceKey:M.nonceKey}:{}}}).catch(F=>{var E;const b=F;return b.name!=="TransactionExecutionError"||((E=b.walk)==null?void 0:E.call(b,I=>{const $=I;return $.name==="MethodNotFoundRpcError"||$.name==="MethodNotSupportedRpcError"}))&&Ca.set(e.uid,!1),n}):n;d??(d=f.nonce),n={...f,...u?{from:u==null?void 0:u.address}:{},...d?{nonce:d}:{}};const{blobs:h,gas:m,kzg:x,type:T}=n;l!=null&&l.fn&&((k=l.runAt)!=null&&k.includes("beforeFillParameters"))&&(n=await l.fn({...n,chain:o},{phase:"beforeFillParameters"}));let w;async function P(){return w||(w=await te(e,Bt,"getBlock")({blockTag:"latest"}),w)}if(i.includes("nonce")&&typeof d>"u"&&u&&!s&&(n.nonce=await te(e,Od,"getTransactionCount")({address:u.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&h&&x){const F=$d({blobs:h,kzg:x});if(i.includes("blobVersionedHashes")){const b=yy({commitments:F,to:"hex"});n.blobVersionedHashes=b}if(i.includes("sidecars")){const b=Id({blobs:h,commitments:F,kzg:x}),v=Ey({blobs:h,commitments:F,proofs:b,to:"hex"});n.sidecars=v}}if(i.includes("chainId")&&(n.chainId=await c()),(i.includes("fees")||i.includes("type"))&&typeof T>"u")try{n.type=Sy(n)}catch{let F=Rd.get(e.uid);if(typeof F>"u"){const b=await P();F=typeof(b==null?void 0:b.baseFeePerGas)=="bigint",Rd.set(e.uid,F)}n.type=F?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const F=await P(),{maxFeePerGas:b,maxPriorityFeePerGas:v}=await Ta(e,{block:F,chain:o,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<v)throw new sy({maxPriorityFeePerGas:v});n.maxPriorityFeePerGas=v,n.maxFeePerGas=b}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new Ea;if(typeof n.gasPrice>"u"){const F=await P(),{gasPrice:b}=await Ta(e,{block:F,chain:o,request:n,type:"legacy"});n.gasPrice=b}}return i.includes("gas")&&typeof m>"u"&&(n.gas=await te(e,Oa,"estimateGas")({...n,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),l!=null&&l.fn&&((B=l.runAt)!=null&&B.includes("afterFillParameters"))&&(n=await l.fn({...n,chain:o},{phase:"afterFillParameters"})),Or(n),delete n.parameters,n}async function Oa(e,t){var i,l,a;const{account:n=e.account,prepare:r=!0}=t,o=n?dt(n):void 0,s=(()=>{if(Array.isArray(r))return r;if((o==null?void 0:o.type)!=="local")return["blobVersionedHashes"]})();try{const c=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await xd({authorization:t.authorizationList[0]}).catch(()=>{throw new G("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:u,authorizationList:d,blobs:p,blobVersionedHashes:f,blockNumber:h,blockTag:m,data:x,gas:T,gasPrice:w,maxFeePerBlobGas:P,maxFeePerGas:A,maxPriorityFeePerGas:k,nonce:B,value:F,stateOverride:b,...v}=r?await jd(e,{...t,parameters:s,to:c}):t;if(T&&t.gas!==T)return T;const I=(typeof h=="bigint"?ne(h):void 0)||m,$=xa(b);Or(t);const C=(a=(l=(i=e.chain)==null?void 0:i.formatters)==null?void 0:l.transactionRequest)==null?void 0:a.format,y=(C||Bo)({...Ds(v,{format:C}),account:o,accessList:u,authorizationList:d,blobs:p,blobVersionedHashes:f,data:x,gasPrice:w,maxFeePerBlobGas:P,maxFeePerGas:A,maxPriorityFeePerGas:k,nonce:B,to:c,value:F},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:$?[y,I??e.experimental_blockTag??"latest",$]:I?[y,I]:[y]}))}catch(c){throw ty(c,{...t,account:o,chain:e.chain})}}async function Ay(e,t){var c;const{abi:n,address:r,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:(c=e.dataSuffix)==null?void 0:c.value,...l}=t,a=vt({abi:n,args:o,functionName:s});try{return await te(e,Oa,"estimateGas")({data:`${a}${i?i.replace("0x",""):""}`,to:r,...l})}catch(u){const d=l.account?dt(l.account):void 0;throw Nr(u,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:d==null?void 0:d.address})}}function Fo(e,t){if(!yt(e,{strict:!1}))throw new On({address:e});if(!yt(t,{strict:!1}))throw new On({address:t});return e.toLowerCase()===t.toLowerCase()}function Zt(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const zd="/docs/contract/decodeEventLog";function ks(e){const{abi:t,data:n,strict:r,topics:o}=e,s=r??!0,[i,...l]=o;if(!i)throw new pg({docsPath:zd});const a=t.find(T=>T.type==="event"&&i===Ts(Mt(T)));if(!(a&&"name"in a)||a.type!=="event")throw new hg(i,{docsPath:zd});const{name:c,inputs:u}=a,d=u==null?void 0:u.some(T=>!("name"in T&&T.name)),p=d?[]:{},f=u.map((T,w)=>[T,w]).filter(([T])=>"indexed"in T&&T.indexed),h=[];for(let T=0;T<f.length;T++){const[w,P]=f[T],A=l[T];if(!A){if(s)throw new Yi({abiItem:a,param:w});h.push([w,P]);continue}p[d?P:w.name||P]=Ny({param:w,value:A})}const m=u.filter(T=>!("indexed"in T&&T.indexed)),x=s?m:[...h.map(([T])=>T),...m];if(x.length>0){if(n&&n!=="0x")try{const T=co(x,n);if(T){let w=0;if(!s)for(const[P,A]of h)p[d?A:P.name||A]=T[w++];if(d)for(let P=0;P<u.length;P++)p[P]===void 0&&w<T.length&&(p[P]=T[w++]);else for(let P=0;P<m.length;P++)p[m[P].name]=T[w++]}}catch(T){if(s)throw T instanceof Nu||T instanceof ad?new Es({abiItem:a,data:n,params:x,size:Te(n)}):T}else if(s)throw new Es({abiItem:a,data:"0x",params:x,size:0})}return{eventName:c,args:Object.values(p).length>0?p:void 0}}function Ny({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(co([e],t)||[])[0]}function $a(e){const{abi:t,args:n,logs:r,strict:o=!0}=e,s=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),i=t.filter(l=>l.type==="event").map(l=>({abi:l,selector:Ts(l)}));return r.map(l=>{var p;const a=typeof l.blockNumber=="string"?Zt(l):l,c=i.filter(f=>a.topics[0]===f.selector);if(c.length===0)return null;let u,d;for(const f of c)try{u=ks({...a,abi:[f.abi],strict:!0}),d=f;break}catch{}if(!u&&!o){d=c[0];try{u=ks({data:a.data,topics:a.topics,abi:[d.abi],strict:!1})}catch{const f=(p=d.abi.inputs)==null?void 0:p.some(h=>!("name"in h&&h.name));return{...a,args:f?[]:{},eventName:d.abi.name}}}return!u||!d||s&&!s.includes(u.eventName)||!Cy({args:u.args,inputs:d.abi.inputs,matchArgs:n})?null:{...u,...a}}).filter(Boolean)}function Cy(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function o(s,i,l){try{return s.type==="address"?Fo(i,l):s.type==="string"||s.type==="bytes"?ze(vr(i))===l:i===l}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((s,i)=>{if(s==null)return!0;const l=n[i];return l?(Array.isArray(s)?s:[s]).some(c=>o(l,c,t[i])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([s,i])=>{if(i==null)return!0;const l=n.find(c=>c.name===s);return l?(Array.isArray(i)?i:[i]).some(c=>o(l,c,t[s])):!1}):!1}async function Ia(e,{address:t,blockHash:n,fromBlock:r,toBlock:o,event:s,events:i,args:l,strict:a}={}){const c=a??!1,u=i??(s?[s]:void 0);let d=[];u&&(d=[u.flatMap(m=>lo({abi:[m],eventName:m.name,args:i?void 0:l}))],s&&(d=d[0]));let p;n?p=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:n}]}):p=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:typeof r=="bigint"?ne(r):r,toBlock:typeof o=="bigint"?ne(o):o}]});const f=p.map(h=>Zt(h));return u?$a({abi:u,args:l,logs:f,strict:c}):f}async function Ud(e,t){const{abi:n,address:r,args:o,blockHash:s,eventName:i,fromBlock:l,toBlock:a,strict:c}=t,u=i?Yn({abi:n,name:i}):void 0,d=u?void 0:n.filter(p=>p.type==="event");return te(e,Ia,"getLogs")({address:r,args:o,blockHash:s,event:u,events:d,fromBlock:l,toBlock:a,strict:c})}const Ma="/docs/contract/decodeFunctionResult";function kn(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const l=Yn({abi:t,args:n,name:r});if(!l)throw new gr(r,{docsPath:Ma});s=l}if(s.type!=="function")throw new gr(void 0,{docsPath:Ma});if(!s.outputs)throw new Iu(s.name,{docsPath:Ma});const i=co(s.outputs,o);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Da=BigInt(0),ka=BigInt(1);function Ro(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function La(e){if(!Ro(e))throw new Error("Uint8Array expected")}function jo(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Ls(e){const t=e.toString(16);return t.length&1?"0"+t:t}function Wd(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Da:BigInt("0x"+e)}const _d=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Oy=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function zo(e){if(La(e),_d)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=Oy[e[n]];return t}const fn={_0:48,_9:57,A:65,F:70,a:97,f:102};function Vd(e){if(e>=fn._0&&e<=fn._9)return e-fn._0;if(e>=fn.A&&e<=fn.F)return e-(fn.A-10);if(e>=fn.a&&e<=fn.f)return e-(fn.a-10)}function Bs(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(_d)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let o=0,s=0;o<n;o++,s+=2){const i=Vd(e.charCodeAt(s)),l=Vd(e.charCodeAt(s+1));if(i===void 0||l===void 0){const a=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+a+'" at index '+s)}r[o]=i*16+l}return r}function er(e){return Wd(zo(e))}function Hd(e){return La(e),Wd(zo(Uint8Array.from(e).reverse()))}function Uo(e,t){return Bs(e.toString(16).padStart(t*2,"0"))}function Gd(e,t){return Uo(e,t).reverse()}function wt(e,t,n){let r;if(typeof t=="string")try{r=Bs(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(Ro(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=r.length;if(typeof n=="number"&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return r}function Fs(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];La(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}const Ba=e=>typeof e=="bigint"&&Da<=e;function Fa(e,t,n){return Ba(e)&&Ba(t)&&Ba(n)&&t<=e&&e<n}function $r(e,t,n,r){if(!Fa(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function $y(e){let t;for(t=0;e>Da;e>>=ka,t+=1);return t}const Rs=e=>(ka<<BigInt(e))-ka,Ra=e=>new Uint8Array(e),qd=e=>Uint8Array.from(e);function Iy(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=Ra(e),o=Ra(e),s=0;const i=()=>{r.fill(1),o.fill(0),s=0},l=(...d)=>n(o,r,...d),a=(d=Ra(0))=>{o=l(qd([0]),d),r=l(),d.length!==0&&(o=l(qd([1]),d),r=l())},c=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const p=[];for(;d<t;){r=l();const f=r.slice();p.push(f),d+=r.length}return Fs(...p)};return(d,p)=>{i(),a(d);let f;for(;!(f=p(c()));)a();return i(),f}}const My={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"||Ro(e),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 js(e,t,n={}){const r=(o,s,i)=>{const l=My[s];if(typeof l!="function")throw new Error("invalid validator function");const a=e[o];if(!(i&&a===void 0)&&!l(a,e))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+a)};for(const[o,s]of Object.entries(t))r(o,s,!1);for(const[o,s]of Object.entries(n))r(o,s,!0);return e}function Kd(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(o!==void 0)return o;const s=e(n,...r);return t.set(n,s),s}}const Dy="0.1.1";function ky(){return Dy}class re extends Error{static setStaticOptions(t){re.prototype.docsOrigin=t.docsOrigin,re.prototype.showVersion=t.showVersion,re.prototype.version=t.version}constructor(t,n={}){const r=(()=>{var u;if(n.cause instanceof re){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:(u=n.cause)!=null&&u.message?n.cause.message:n.details})(),o=n.cause instanceof re&&n.cause.docsPath||n.docsPath,s=n.docsOrigin??re.prototype.docsOrigin,i=`${s}${o??""}`,l=!!(n.version??re.prototype.showVersion),a=n.version??re.prototype.version,c=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||o||l?["",r?`Details: ${r}`:void 0,o?`See: ${i}`:void 0,l?`Version: ${a}`:void 0]:[]].filter(u=>typeof u=="string").join(`
|
|
88
|
-
`);super(c,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=r,this.docs=i,this.docsOrigin=s,this.docsPath=o,this.shortMessage=t,this.showVersion=l,this.version=a}walk(t){return Zd(this,t)}}Object.defineProperty(re,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${ky()}`}}),re.setStaticOptions(re.defaultStaticOptions);function Zd(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Zd(e.cause,t):t?null:e}function Wo(e,t){if(Ir(e)>t)throw new Xy({givenSize:Ir(e),maxSize:t})}const pn={zero:48,nine:57,A:65,F:70,a:97,f:102};function Yd(e){if(e>=pn.zero&&e<=pn.nine)return e-pn.zero;if(e>=pn.A&&e<=pn.F)return e-(pn.A-10);if(e>=pn.a&&e<=pn.f)return e-(pn.a-10)}function Ly(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new Jy({size:e.length,targetSize:r,type:"Bytes"});const o=new Uint8Array(r);for(let s=0;s<r;s++){const i=n==="right";o[i?s:r-s-1]=e[i?s:e.length-s-1]}return o}function Xd(e,t={}){const{dir:n="left"}=t;let r=e,o=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)o++;return r=n==="left"?r.slice(o):r.slice(0,r.length-o),r}function zs(e,t){if(ft(e)>t)throw new ov({givenSize:ft(e),maxSize:t})}function By(e,t){if(typeof t=="number"&&t>0&&t>ft(e)-1)throw new cf({offset:t,position:"start",size:ft(e)})}function Fy(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ft(e)!==n-t)throw new cf({offset:n,position:"end",size:ft(e)})}function Jd(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const o=e.replace("0x","");if(o.length>r*2)throw new sv({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return`0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const Ry="#__bigint";function Qd(e,t,n){return JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString()+Ry:o,n)}const jy=new TextDecoder,zy=new TextEncoder;function Uy(e){return e instanceof Uint8Array?e:typeof e=="string"?ef(e):Wy(e)}function Wy(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function ef(e,t={}){const{size:n}=t;let r=e;n&&(zs(e,n),r=nr(e,n));let o=r.slice(2);o.length%2&&(o=`0${o}`);const s=o.length/2,i=new Uint8Array(s);for(let l=0,a=0;l<s;l++){const c=Yd(o.charCodeAt(a++)),u=Yd(o.charCodeAt(a++));if(c===void 0||u===void 0)throw new re(`Invalid byte sequence ("${o[a-2]}${o[a-1]}" in "${o}").`);i[l]=c<<4|u}return i}function _y(e,t={}){const{size:n}=t,r=zy.encode(e);return typeof n=="number"?(Wo(r,n),Vy(r,n)):r}function Vy(e,t){return Ly(e,{dir:"right",size:t})}function Ir(e){return e.length}function Hy(e,t,n,r={}){const{strict:o}=r;return e.slice(t,n)}function Gy(e,t={}){const{size:n}=t;typeof n<"u"&&Wo(e,n);const r=Rt(e,t);return rf(r,t)}function qy(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(Wo(r,n),r=tf(r)),r.length>1||r[0]>1)throw new Yy(r);return!!r[0]}function hn(e,t={}){const{size:n}=t;typeof n<"u"&&Wo(e,n);const r=Rt(e,t);return of(r,t)}function Ky(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(Wo(r,n),r=Zy(r)),jy.decode(r)}function tf(e){return Xd(e,{dir:"left"})}function Zy(e){return Xd(e,{dir:"right"})}class Yy extends re{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let Xy=class extends re{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},Jy=class extends re{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const Qy=new TextEncoder,ev=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function tv(e,t={}){const{strict:n=!1}=t;if(!e)throw new af(e);if(typeof e!="string")throw new af(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new lf(e);if(!e.startsWith("0x"))throw new lf(e)}function Ft(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function nv(e){return e instanceof Uint8Array?Rt(e):Array.isArray(e)?Rt(new Uint8Array(e)):e}function nf(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(zs(n,t.size),tr(n,t.size)):n}function Rt(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=ev[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(zs(r,t.size),nr(r,t.size)):r}function Ve(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const c=typeof e=="bigint"?"n":"";throw new sf({max:s?`${s}${c}`:void 0,min:`${i}${c}`,signed:n,size:r,value:`${e}${c}`})}const a=`0x${(n&&o<0?BigInt.asUintN(r*8,BigInt(o)):o).toString(16)}`;return r?tr(a,r):a}function ja(e,t={}){return Rt(Qy.encode(e),t)}function tr(e,t){return Jd(e,{dir:"left",size:t})}function nr(e,t){return Jd(e,{dir:"right",size:t})}function Yt(e,t,n,r={}){const{strict:o}=r;By(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&Fy(s,t,n),s}function ft(e){return Math.ceil((e.length-2)/2)}function rf(e,t={}){const{signed:n}=t;t.size&&zs(e,t.size);const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n)-1n,i=s>>1n;return r<=i?r:r-s-1n}function of(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:rf(e,t))}function rv(e,t={}){const{strict:n=!1}=t;try{return tv(e,{strict:n}),!0}catch{return!1}}class sf extends re{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number \`${s}\` is not in safe${o?` ${o*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class af extends re{constructor(t){super(`Value \`${typeof t=="object"?Qd(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class lf extends re{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class ov extends re{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class cf extends re{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class sv extends re{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function iv(e){return{address:e.address,amount:Ve(e.amount),index:Ve(e.index),validatorIndex:Ve(e.validatorIndex)}}function uf(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Ve(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Ve(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Ve(e.gasLimit)},...typeof e.number=="bigint"&&{number:Ve(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Ve(e.prevRandao)},...typeof e.time=="bigint"&&{time:Ve(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(iv)}}}const Mr=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],za=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],df=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],ff=[...df,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],av=[...df,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],pf=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],hf=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],mf=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],bf=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],Dr=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],lv="0x82ad56cb",gf="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",cv="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",uv="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Ua="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class Wa extends G{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class yf extends G{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const _a="/docs/contract/encodeDeployData";function Va(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const o=t.find(i=>"type"in i&&i.type==="constructor");if(!o)throw new lg({docsPath:_a});if(!("inputs"in o))throw new Au({docsPath:_a});if(!o.inputs||o.inputs.length===0)throw new Au({docsPath:_a});const s=$n(o.inputs,n);return Sr([r,s])}function kr({blockNumber:e,chain:t,contract:n}){var o;const r=(o=t==null?void 0:t.contracts)==null?void 0:o[n];if(!r)throw new Wa({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Wa({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function vf(e,{docsPath:t,...n}){const r=(()=>{const o=Ms(e,n);return o instanceof Lo?e:o})();return new hd(r,{docsPath:t,...n})}function wf(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}const Ha=new Map;function xf({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){const s=async()=>{const u=a();i();const d=u.map(({args:p})=>p);d.length!==0&&e(d).then(p=>{o&&Array.isArray(p)&&p.sort(o);for(let f=0;f<u.length;f++){const{resolve:h}=u[f];h==null||h([p[f],p])}}).catch(p=>{for(let f=0;f<u.length;f++){const{reject:h}=u[f];h==null||h(p)}})},i=()=>Ha.delete(t),l=()=>a().map(({args:u})=>u),a=()=>Ha.get(t)||[],c=u=>Ha.set(t,[...a(),u]);return{flush:i,async schedule(u){const{promise:d,resolve:p,reject:f}=wf();return(n==null?void 0:n([...l(),u]))&&s(),a().length>0?(c({args:u,resolve:p,reject:f}),d):(c({args:u,resolve:p,reject:f}),setTimeout(s,r),d)}}}async function Lr(e,t){var C,D,y,O;const{account:n=e.account,authorizationList:r,batch:o=!!((C=e.batch)!=null&&C.multicall),blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",accessList:l,blobs:a,blockOverrides:c,code:u,data:d,factory:p,factoryData:f,gas:h,gasPrice:m,maxFeePerBlobGas:x,maxFeePerGas:T,maxPriorityFeePerGas:w,nonce:P,to:A,value:k,stateOverride:B,...F}=t,b=n?dt(n):void 0;if(u&&(p||f))throw new G("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&A)throw new G("Cannot provide both `code` & `to` as parameters.");const v=u&&d,E=p&&f&&A&&d,I=v||E,$=v?Ef({code:u,data:d}):E?pv({data:d,factory:p,factoryData:f,to:A}):d;try{Or(t);const S=(typeof s=="bigint"?ne(s):void 0)||i,L=c?uf(c):void 0,j=xa(B),z=(O=(y=(D=e.chain)==null?void 0:D.formatters)==null?void 0:y.transactionRequest)==null?void 0:O.format,_=(z||Bo)({...Ds(F,{format:z}),accessList:l,account:b,authorizationList:r,blobs:a,data:$,gas:h,gasPrice:m,maxFeePerBlobGas:x,maxFeePerGas:T,maxPriorityFeePerGas:w,nonce:P,to:I?void 0:A,value:k},"call");if(o&&dv({request:_})&&!j&&!L)try{return await fv(e,{..._,blockNumber:s,blockTag:i})}catch(H){if(!(H instanceof yf)&&!(H instanceof Wa))throw H}const Z=(()=>{const H=[_,S];return j&&L?[...H,j,L]:j?[...H,j]:L?[...H,{},L]:H})(),q=await e.request({method:"eth_call",params:Z});return q==="0x"?{data:void 0}:{data:q}}catch(M){const S=hv(M),{offchainLookup:L,offchainLookupSignature:j}=await Promise.resolve().then(()=>pw);if(e.ccipRead!==!1&&(S==null?void 0:S.slice(0,10))===j&&A)return{data:await L(e,{data:S,to:A})};throw I&&(S==null?void 0:S.slice(0,10))==="0x101bb98d"?new V1({factory:p}):vf(M,{...t,account:b,chain:e.chain})}}function dv({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(lv)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function fv(e,t){var m;const{batchSize:n=1024,deployless:r=!1,wait:o=0}=typeof((m=e.batch)==null?void 0:m.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",data:l,to:a}=t,c=(()=>{if(r)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return kr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new yf})(),d=(typeof s=="bigint"?ne(s):void 0)||i,{schedule:p}=xf({id:`${e.uid}.${d}`,wait:o,shouldSplitBatch(x){return x.reduce((w,{data:P})=>w+(P.length-2),0)>n*2},fn:async x=>{const T=x.map(A=>({allowFailure:!0,callData:A.data,target:A.to})),w=vt({abi:Mr,args:[T],functionName:"aggregate3"}),P=await e.request({method:"eth_call",params:[{...c===null?{data:Ef({code:Ua,data:w})}:{to:c,data:w}},d]});return kn({abi:Mr,args:[T],functionName:"aggregate3",data:P||"0x"})}}),[{returnData:f,success:h}]=await p({data:l,to:a});if(!h)throw new Os({data:f});return f==="0x"?{data:void 0}:{data:f}}function Ef(e){const{code:t,data:n}=e;return Va({abi:xu(["constructor(bytes, bytes)"]),bytecode:gf,args:[t,n]})}function pv(e){const{data:t,factory:n,factoryData:r,to:o}=e;return Va({abi:xu(["constructor(address, bytes, address, bytes)"]),bytecode:cv,args:[o,t,n,r]})}function hv(e){var n;if(!(e instanceof G))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function jt(e,t){const{abi:n,address:r,args:o,functionName:s,...i}=t,l=vt({abi:n,args:o,functionName:s});try{const{data:a}=await te(e,Lr,"call")({...i,data:l,to:r});return kn({abi:n,args:o,functionName:s,data:a||"0x"})}catch(a){throw Nr(a,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}async function mv(e,t){var u;const{abi:n,address:r,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:(u=e.dataSuffix)==null?void 0:u.value,...l}=t,a=l.account?dt(l.account):e.account,c=vt({abi:n,args:o,functionName:s});try{const{data:d}=await te(e,Lr,"call")({batch:!1,data:`${c}${i?i.replace("0x",""):""}`,to:r,...l,account:a}),p=kn({abi:n,args:o,functionName:s,data:d||"0x"}),f=n.filter(h=>"name"in h&&h.name===t.functionName);return{result:p,request:{abi:f,address:r,args:o,dataSuffix:i,functionName:s,...l,account:a}}}catch(d){throw Nr(d,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:s,sender:a==null?void 0:a.address})}}const Ga=new Map,Sf=new Map;let bv=0;function Ln(e,t,n){const r=++bv,o=()=>Ga.get(e)||[],s=()=>{const u=o();Ga.set(e,u.filter(d=>d.id!==r))},i=()=>{const u=o();if(!u.some(p=>p.id===r))return;const d=Sf.get(e);if(u.length===1&&d){const p=d();p instanceof Promise&&p.catch(()=>{})}s()},l=o();if(Ga.set(e,[...l,{id:r,fns:t}]),l&&l.length>0)return i;const a={};for(const u in t)a[u]=(...d)=>{var f,h;const p=o();if(p.length!==0)for(const m of p)(h=(f=m.fns)[u])==null||h.call(f,...d)};const c=n(a);return typeof c=="function"&&Sf.set(e,c),i}async function qa(e){return new Promise(t=>setTimeout(t,e))}function _o(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let o=!0;const s=()=>o=!1;return(async()=>{let l;t&&(l=await e({unpoll:s}));const a=await(n==null?void 0:n(l))??r;await qa(a);const c=async()=>{o&&(await e({unpoll:s}),await qa(r),c())};c()})(),s}const gv=new Map,yv=new Map;function vv(e){const t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:i=>s.set(o,i)}),n=t(e,gv),r=t(e,yv);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function wv(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=vv(t),o=r.response.get();if(o&&n>0&&Date.now()-o.created.getTime()<n)return o.data;let s=r.promise.get();s||(s=e(),r.promise.set(s));try{const i=await s;return r.response.set({created:new Date,data:i}),i}finally{r.promise.clear()}}const xv=e=>`blockNumber.${e}`;async function Vo(e,{cacheTime:t=e.cacheTime}={}){const n=await wv(()=>e.request({method:"eth_blockNumber"}),{cacheKey:xv(e.uid),cacheTime:t});return BigInt(n)}async function Us(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const o=r.map(s=>Zt(s));return!("abi"in t)||!t.abi?o:$a({abi:t.abi,logs:o,strict:n})}async function Ws(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function Ev(e,t){const{abi:n,address:r,args:o,batch:s=!0,eventName:i,fromBlock:l,onError:a,onLogs:c,poll:u,pollingInterval:d=e.pollingInterval,strict:p}=t;return(typeof u<"u"?u:typeof l=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const x=p??!1,T=Be(["watchContractEvent",r,o,s,e.uid,i,d,x,l]);return Ln(T,{onLogs:c,onError:a},w=>{let P;l!==void 0&&(P=l-1n);let A,k=!1;const B=_o(async()=>{var F;if(!k){try{A=await te(e,rd,"createContractEventFilter")({abi:n,address:r,args:o,eventName:i,strict:x,fromBlock:l})}catch{}k=!0;return}try{let b;if(A)b=await te(e,Us,"getFilterChanges")({filter:A});else{const v=await te(e,Vo,"getBlockNumber")({});P&&P<v?b=await te(e,Ud,"getContractEvents")({abi:n,address:r,args:o,eventName:i,fromBlock:P+1n,toBlock:v,strict:x}):b=[],P=v}if(b.length===0)return;if(s)w.onLogs(b);else for(const v of b)w.onLogs([v])}catch(b){A&&b instanceof In&&(k=!1),(F=w.onError)==null||F.call(w,b)}},{emitOnBegin:!0,interval:d});return async()=>{A&&await te(e,Ws,"uninstallFilter")({filter:A}),B()}})})():(()=>{const x=p??!1,T=Be(["watchContractEvent",r,o,s,e.uid,i,d,x]);let w=!0,P=()=>w=!1;return Ln(T,{onLogs:c,onError:a},A=>((async()=>{try{const k=(()=>{if(e.transport.type==="fallback"){const b=e.transport.transports.find(v=>v.config.type==="webSocket"||v.config.type==="ipc");return b?b.value:e.transport}return e.transport})(),B=i?lo({abi:n,eventName:i,args:o}):[],{unsubscribe:F}=await k.subscribe({params:["logs",{address:r,topics:B}],onData(b){var E;if(!w)return;const v=b.result;try{const{eventName:I,args:$}=ks({abi:n,data:v.data,topics:v.topics,strict:p}),C=Zt(v,{args:$,eventName:I});A.onLogs([C])}catch(I){let $,C;if(I instanceof Es||I instanceof Yi){if(p)return;$=I.abiItem.name,C=(E=I.abiItem.inputs)==null?void 0:E.some(y=>!("name"in y&&y.name))}const D=Zt(v,{args:C?[]:{},eventName:$});A.onLogs([D])}},onError(b){var v;(v=A.onError)==null||v.call(A,b)}});P=F,w||P()}catch(k){a==null||a(k)}})(),()=>P()))})()}async function Sv(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}function Ka(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((o,s)=>{const i=async({count:l=0}={})=>{const a=async({error:c})=>{const u=typeof t=="function"?t({count:l,error:c}):t;u&&await qa(u),i({count:l+1})};try{const c=await e();o(c)}catch(c){if(l<n&&await r({count:l,error:c}))return a({error:c});s(c)}};i()})}const Pv={"0x0":"reverted","0x1":"success"};function Pf(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>Zt(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?ln(e.transactionIndex):null,status:e.status?Pv[e.status]:null,type:e.type?Ad[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Za=256;let _s=Za,Vs;function Tf(e=11){if(!Vs||_s+e>Za*2){Vs="",_s=0;for(let t=0;t<Za;t++)Vs+=(256+Math.random()*256|0).toString(16).substring(1)}return Vs.substring(_s,_s+++e)}function Tv(e){const{batch:t,chain:n,ccipRead:r,dataSuffix:o,key:s="base",name:i="Base Client",type:l="base"}=e,a=e.experimental_blockTag??(typeof(n==null?void 0:n.experimental_preconfirmationTime)=="number"?"pending":void 0),c=(n==null?void 0:n.blockTime)??12e3,u=Math.min(Math.max(Math.floor(c/2),500),4e3),d=e.pollingInterval??u,p=e.cacheTime??d,f=e.account?dt(e.account):void 0,{config:h,request:m,value:x}=e.transport({account:f,chain:n,pollingInterval:d}),T={...h,...x},w={account:f,batch:t,cacheTime:p,ccipRead:r,chain:n,dataSuffix:o,key:s,name:i,pollingInterval:d,request:m,transport:T,type:l,uid:Tf(),...a?{experimental_blockTag:a}:{}};function P(A){return k=>{const B=k(A);for(const b in w)delete B[b];const F={...A,...B};return Object.assign(F,{extend:P(F)})}}return Object.assign(w,{extend:P(w)})}function Ya(e){var n,r,o,s,i,l;if(!(e instanceof G))return!1;const t=e.walk(a=>a instanceof da);return t instanceof da?((n=t.data)==null?void 0:n.errorName)==="HttpError"||((r=t.data)==null?void 0:r.errorName)==="ResolverError"||((o=t.data)==null?void 0:o.errorName)==="ResolverNotContract"||((s=t.data)==null?void 0:s.errorName)==="ResolverNotFound"||((i=t.data)==null?void 0:i.errorName)==="ReverseAddressMismatch"||((l=t.data)==null?void 0:l.errorName)==="UnsupportedResolverProfile":!1}function Av(e){const{abi:t,data:n}=e,r=Zn(n,0,4),o=t.find(s=>s.type==="function"&&r===ao(Mt(s)));if(!o)throw new mg(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?co(o.inputs,Zn(n,4)):void 0}}const Xa="/docs/contract/encodeErrorResult";function Af(e){const{abi:t,errorName:n,args:r}=e;let o=t[0];if(n){const a=Yn({abi:t,args:r,name:n});if(!a)throw new Cu(n,{docsPath:Xa});o=a}if(o.type!=="error")throw new Cu(void 0,{docsPath:Xa});const s=Mt(o),i=ao(s);let l="0x";if(r&&r.length>0){if(!o.inputs)throw new fg(o.name,{docsPath:Xa});l=$n(o.inputs,r)}return Sr([i,l])}const Ja="/docs/contract/encodeFunctionResult";function Nv(e){const{abi:t,functionName:n,result:r}=e;let o=t[0];if(n){const i=Yn({abi:t,name:n});if(!i)throw new gr(n,{docsPath:Ja});o=i}if(o.type!=="function")throw new gr(void 0,{docsPath:Ja});if(!o.outputs)throw new Iu(o.name,{docsPath:Ja});const s=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new Mu(r)})();return $n(o.outputs,s)}const Ho="x-batch-gateway:true";async function Nf(e){const{data:t,ccipRequest:n}=e,{args:[r]}=Av({abi:za,data:t}),o=[],s=[];return await Promise.all(r.map(async(i,l)=>{try{s[l]=i.urls.includes(Ho)?await Nf({data:i.data,ccipRequest:n}):await n(i),o[l]=!1}catch(a){o[l]=!0,s[l]=Cv(a)}})),Nv({abi:za,functionName:"query",result:[o,s]})}function Cv(e){return e.name==="HttpRequestError"&&e.status?Af({abi:za,errorName:"HttpError",args:[e.status,e.shortMessage]}):Af({abi:[sd],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function Cf(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Dt(t)?t:null}function Qa(e){let t=new Uint8Array(32).fill(0);if(!e)return Le(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const o=Cf(n[r]),s=o?vr(o):ze(qn(n[r]),"bytes");t=ze(Lt([t,s]),"bytes")}return Le(t)}function Ov(e){return`[${e.slice(2)}]`}function $v(e){const t=new Uint8Array(32).fill(0);return e?Cf(e)||ze(qn(e)):Le(t)}function el(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(qn(t).byteLength+2);let r=0;const o=t.split(".");for(let s=0;s<o.length;s++){let i=qn(o[s]);i.byteLength>255&&(i=qn(Ov($v(o[s])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function Iv(e,t){const{blockNumber:n,blockTag:r,coinType:o,name:s,gatewayUrls:i,strict:l}=t,{chain:a}=e,c=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return kr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),u=a==null?void 0:a.ensTlds;if(u&&!u.some(p=>s.endsWith(p)))return null;const d=o!=null?[Qa(s),BigInt(o)]:[Qa(s)];try{const p=vt({abi:hf,functionName:"addr",args:d}),f={address:c,abi:ff,functionName:"resolveWithGateways",args:[Cn(el(s)),p,i??[Ho]],blockNumber:n,blockTag:r},m=await te(e,jt,"readContract")(f);if(m[0]==="0x")return null;const x=kn({abi:hf,args:d,functionName:"addr",data:m[0]});return x==="0x"||Gn(x)==="0x00"?null:x}catch(p){if(l)throw p;if(Ya(p))return null;throw p}}class Mv extends G{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Go extends G{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class tl extends G{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class Dv extends G{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const kv=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Lv=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,Bv=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Fv=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Rv(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function Of(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function $f({uri:e,gatewayUrls:t}){const n=Bv.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=Of(t==null?void 0:t.ipfs,"https://ipfs.io"),o=Of(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(kv),{protocol:i,subpath:l,target:a,subtarget:c=""}=(s==null?void 0:s.groups)||{},u=i==="ipns:/"||l==="ipns/",d=i==="ipfs:/"||l==="ipfs/"||Lv.test(e);if(e.startsWith("http")&&!u&&!d){let f=e;return t!=null&&t.arweave&&(f=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:f,isOnChain:!1,isEncoded:!1}}if((u||d)&&a)return{uri:`${r}/${u?"ipns":"ipfs"}/${a}${c}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&a)return{uri:`${o}/${a}${c||""}`,isOnChain:!1,isEncoded:!1};let p=e.replace(Fv,"");if(p.startsWith("<svg")&&(p=`data:image/svg+xml;base64,${btoa(p)}`),p.startsWith("data:")||p.startsWith("{"))return{uri:p,isOnChain:!0,isEncoded:!1};throw new tl({uri:e})}function If(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Mv({data:e});return e.image||e.image_url||e.image_data}async function jv({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(o=>o.json());return await nl({gatewayUrls:e,uri:If(n)})}catch{throw new tl({uri:t})}}async function nl({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=$f({uri:t,gatewayUrls:e});if(r||await Rv(n))return n;throw new tl({uri:t})}function zv(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,o]=t.split("/"),[s,i]=n.split(":"),[l,a]=r.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Go({reason:"Only EIP-155 supported"});if(!i)throw new Go({reason:"Chain ID not found"});if(!a)throw new Go({reason:"Contract address not found"});if(!o)throw new Go({reason:"Token ID not found"});if(!l)throw new Go({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:l.toLowerCase(),contractAddress:a,tokenID:o}}async function Uv(e,{nft:t}){if(t.namespace==="erc721")return jt(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return jt(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new Dv({namespace:t.namespace})}async function Wv(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?_v(e,{gatewayUrls:t,record:n}):nl({uri:n,gatewayUrls:t})}async function _v(e,{gatewayUrls:t,record:n}){const r=zv(n),o=await Uv(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:l}=$f({uri:o,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const c=l?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(c);return nl({uri:If(u),gatewayUrls:t})}let a=r.tokenID;return r.namespace==="erc1155"&&(a=a.replace("0x","").padStart(64,"0")),jv({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,a)})}async function Mf(e,t){const{blockNumber:n,blockTag:r,key:o,name:s,gatewayUrls:i,strict:l}=t,{chain:a}=e,c=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return kr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),u=a==null?void 0:a.ensTlds;if(u&&!u.some(d=>s.endsWith(d)))return null;try{const d={address:c,abi:ff,args:[Cn(el(s)),vt({abi:pf,functionName:"text",args:[Qa(s),o]}),i??[Ho]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},f=await te(e,jt,"readContract")(d);if(f[0]==="0x")return null;const h=kn({abi:pf,functionName:"text",data:f[0]});return h===""?null:h}catch(d){if(l)throw d;if(Ya(d))return null;throw d}}async function Vv(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:l}){const a=await te(e,Mf,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:l,gatewayUrls:s,strict:i});if(!a)return null;try{return await Wv(e,{record:a,gatewayUrls:r})}catch{return null}}async function Hv(e,t){const{address:n,blockNumber:r,blockTag:o,coinType:s=60n,gatewayUrls:i,strict:l}=t,{chain:a}=e,c=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return kr({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})();try{const u={address:c,abi:av,args:[n,s,i??[Ho]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},d=te(e,jt,"readContract"),[p]=await d(u);return p||null}catch(u){if(l)throw u;if(Ya(u))return null;throw u}}async function Gv(e,t){const{blockNumber:n,blockTag:r,name:o}=t,{chain:s}=e,i=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return kr({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),l=s==null?void 0:s.ensTlds;if(l&&!l.some(c=>o.endsWith(c)))throw new Error(`${o} is not a valid ENS TLD (${l==null?void 0:l.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[a]=await te(e,jt,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Cn(el(o))],blockNumber:n,blockTag:r});return a}async function Df(e,t){var x,T,w;const{account:n=e.account,blockNumber:r,blockTag:o="latest",blobs:s,data:i,gas:l,gasPrice:a,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:d,to:p,value:f,...h}=t,m=n?dt(n):void 0;try{Or(t);const A=(typeof r=="bigint"?ne(r):void 0)||o,k=(w=(T=(x=e.chain)==null?void 0:x.formatters)==null?void 0:T.transactionRequest)==null?void 0:w.format,F=(k||Bo)({...Ds(h,{format:k}),account:m,blobs:s,data:i,gas:l,gasPrice:a,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:d,to:p,value:f},"createAccessList"),b=await e.request({method:"eth_createAccessList",params:[F,A]});return{accessList:b.accessList,gasUsed:BigInt(b.gasUsed)}}catch(P){throw vf(P,{...t,account:m,chain:e.chain})}}async function qv(e){const t=Cs(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function kf(e,{address:t,args:n,event:r,events:o,fromBlock:s,strict:i,toBlock:l}={}){const a=o??(r?[r]:void 0),c=Cs(e,{method:"eth_newFilter"});let u=[];a&&(u=[a.flatMap(f=>lo({abi:[f],eventName:f.name,args:n}))],r&&(u=u[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof s=="bigint"?ne(s):s,toBlock:typeof l=="bigint"?ne(l):l,...u.length?{topics:u}:{}}]});return{abi:a,args:n,eventName:r?r.name:void 0,fromBlock:s,id:d,request:c(d),strict:!!i,toBlock:l,type:"event"}}async function Lf(e){const t=Cs(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Kv(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){var i,l,a;if((i=e.batch)!=null&&i.multicall&&((a=(l=e.chain)==null?void 0:l.contracts)!=null&&a.multicall3)){const c=e.chain.contracts.multicall3.address,u=vt({abi:Mr,functionName:"getEthBalance",args:[t]}),{data:d}=await te(e,Lr,"call")({to:c,data:u,blockNumber:n,blockTag:r});return kn({abi:Mr,functionName:"getEthBalance",args:[t],data:d||"0x"})}const o=typeof n=="bigint"?ne(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}async function Zv(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function Yv(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=n!==void 0?ne(n):void 0;let s;return t?s=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):s=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||r]},{dedupe:!!o}),ln(s)}async function Hs(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=n!==void 0?ne(n):void 0,s=await e.request({method:"eth_getCode",params:[t,o||r]},{dedupe:!!o});if(s!=="0x")return s}async function Xv(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=await Hs(e,{address:t,...n!==void 0?{blockNumber:n}:{blockTag:r}});if(o&&Te(o)===23&&o.startsWith("0xef0100"))return un(Zn(o,3,23))}class Jv extends G{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function Qv(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[s,i,l,a,c,u,d]=await te(e,jt,"readContract")({abi:ew,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:i,version:l,chainId:Number(a),verifyingContract:c,salt:u},extensions:d,fields:s}}catch(s){const i=s;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new Jv({address:n}):i}}const ew=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function tw(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function nw(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:o}){const s=typeof n=="bigint"?ne(n):void 0,i=await e.request({method:"eth_feeHistory",params:[ne(t),s||r,o]},{dedupe:!!s});return tw(i)}async function rw(e,{filter:t}){const n=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>Zt(s));return t.abi?$a({abi:t.abi,logs:o,strict:n}):o}async function ow({address:e,authorization:t,signature:n}){return Fo(un(e),await xd({authorization:t,signature:n}))}const Gs=new As(8192);function sw(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Gs.get(n))return Gs.get(n);const r=e().finally(()=>Gs.delete(n));return Gs.set(n,r),r}function iw(e,t={}){return async(n,r={})=>{var d;const{dedupe:o=!1,methods:s,retryDelay:i=150,retryCount:l=3,uid:a}={...t,...r},{method:c}=n;if((d=s==null?void 0:s.exclude)!=null&&d.includes(c))throw new Qn(new Error("method not supported"),{method:c});if(s!=null&&s.include&&!s.include.includes(c))throw new Qn(new Error("method not supported"),{method:c});const u=o?oo(`${a}.${Be(n)}`):void 0;return sw(()=>Ka(async()=>{try{return await e(n)}catch(p){const f=p;switch(f.code){case ho.code:throw new ho(f);case mo.code:throw new mo(f);case bo.code:throw new bo(f,{method:n.method});case go.code:throw new go(f);case Jn.code:throw new Jn(f);case In.code:throw new In(f);case yo.code:throw new yo(f);case vo.code:throw new vo(f);case wo.code:throw new wo(f);case Qn.code:throw new Qn(f,{method:n.method});case Tr.code:throw new Tr(f);case xo.code:throw new xo(f);case Ar.code:throw new Ar(f);case Eo.code:throw new Eo(f);case So.code:throw new So(f);case Po.code:throw new Po(f);case To.code:throw new To(f);case Ao.code:throw new Ao(f);case No.code:throw new No(f);case Co.code:throw new Co(f);case Oo.code:throw new Oo(f);case $o.code:throw new $o(f);case Io.code:throw new Io(f);case Mo.code:throw new Mo(f);case Do.code:throw new Do(f);case 5e3:throw new Ar(f);case ko.code:throw new ko(f);default:throw p instanceof G?p:new G1(f)}}},{delay:({count:p,error:f})=>{var h;if(f&&f instanceof Xn){const m=(h=f==null?void 0:f.headers)==null?void 0:h.get("Retry-After");if(m!=null&&m.match(/\d/))return Number.parseInt(m,10)*1e3}return~~(1<<p)*i},retryCount:l,shouldRetry:({error:p})=>aw(p)}),{enabled:o,id:u})}}function aw(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===Tr.code||e.code===Jn.code:e instanceof Xn&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}class lw extends G{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:s,urls:i}){var l;super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],(l=n.metaMessages)!=null&&l.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map(a=>` ${po(a)}`)],` Sender: ${s}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}}class cw extends G{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${po(n)}`,`Response: ${Be(t)}`],name:"OffchainLookupResponseMalformedError"})}}class uw extends G{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}const dw="0x556f1830",Bf={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function fw(e,{blockNumber:t,blockTag:n,data:r,to:o}){const{args:s}=cd({data:r,abi:[Bf]}),[i,l,a,c,u]=s,{ccipRead:d}=e,p=d&&typeof(d==null?void 0:d.request)=="function"?d.request:Ff;try{if(!Fo(o,i))throw new uw({sender:i,to:o});const f=l.includes(Ho)?await Nf({data:a,ccipRequest:p}):await p({data:a,sender:i,urls:l}),{data:h}=await Lr(e,{blockNumber:t,blockTag:n,data:Lt([c,$n([{type:"bytes"},{type:"bytes"}],[f,u])]),to:o});return h}catch(f){throw new lw({callbackSelector:c,cause:f,data:r,extraData:u,sender:i,urls:l})}}async function Ff({data:e,sender:t,urls:n}){var o;let r=new Error("An unknown error occurred.");for(let s=0;s<n.length;s++){const i=n[s],l=i.includes("{data}")?"GET":"POST",a=l==="POST"?{data:e,sender:t}:void 0,c=l==="POST"?{"Content-Type":"application/json"}:{};try{const u=await fetch(i.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(a),headers:c,method:l});let d;if((o=u.headers.get("Content-Type"))!=null&&o.startsWith("application/json")?d=(await u.json()).data:d=await u.text(),!u.ok){r=new Xn({body:a,details:d!=null&&d.error?Be(d.error):u.statusText,headers:u.headers,status:u.status,url:i});continue}if(!Dt(d)){r=new cw({result:d,url:i});continue}return d}catch(u){r=new Xn({body:a,details:u.message,url:i})}}throw r}const pw=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Ff,offchainLookup:fw,offchainLookupAbiItem:Bf,offchainLookupSignature:dw},Symbol.toStringTag,{value:"Module"}));function hw(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return o=>{const s=typeof o=="function"?o(r):o,i={...r,...s};return Object.assign(i,{extend:n(i)})}}return Object.assign(t,{extend:n(t)})}function mw(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((o,s)=>{(async()=>{let i;try{const l=new AbortController;n>0&&(i=setTimeout(()=>{r&&l.abort()},n)),o(await e({signal:(l==null?void 0:l.signal)||null}))}catch(l){(l==null?void 0:l.name)==="AbortError"&&s(t),s(l)}finally{clearTimeout(i)}})()})}function bw(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Rf=bw();function gw(e,t={}){const{url:n,headers:r}=yw(e);return{async request(o){var h;const{body:s,fetchFn:i=t.fetchFn??fetch,onRequest:l=t.onRequest,onResponse:a=t.onResponse,timeout:c=t.timeout??1e4}=o,u={...t.fetchOptions??{},...o.fetchOptions??{}},{headers:d,method:p,signal:f}=u;try{const m=await mw(async({signal:T})=>{const w={...u,body:Array.isArray(s)?Be(s.map(B=>({jsonrpc:"2.0",id:B.id??Rf.take(),...B}))):Be({jsonrpc:"2.0",id:s.id??Rf.take(),...s}),headers:{...r,"Content-Type":"application/json",...d},method:p||"POST",signal:f||(c>0?T:null)},P=new Request(n,w),A=await(l==null?void 0:l(P,w))??{...w,url:n};return await i(A.url??n,A)},{errorInstance:new bd({body:s,url:n}),timeout:c,signal:!0});a&&await a(m);let x;if((h=m.headers.get("Content-Type"))!=null&&h.startsWith("application/json"))x=await m.json();else{x=await m.text();try{x=JSON.parse(x||"{}")}catch(T){if(m.ok)throw T;x={error:x}}}if(!m.ok)throw new Xn({body:s,details:Be(x.error)||m.statusText,headers:m.headers,status:m.status,url:n});return x}catch(m){throw m instanceof Xn||m instanceof bd?m:new Xn({body:s,cause:m,url:n})}}}}function yw(e){try{const t=new URL(e),n=(()=>{if(t.username){const r=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}const vw=`Ethereum Signed Message:
|
|
89
|
-
`;function ww(e){const t=typeof e=="string"?oo(e):typeof e.raw=="string"?e.raw:Le(e.raw),n=oo(`${vw}${Te(t)}`);return Lt([n,t])}function jf(e,t){return ze(ww(e),t)}class xw extends G{constructor({domain:t}){super(`Invalid domain "${Be(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Ew extends G{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class Sw extends G{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function Pw(e){const{domain:t,message:n,primaryType:r,types:o}=e,s=(i,l)=>{for(const a of i){const{name:c,type:u}=a,d=l[c],p=u.match(Qu);if(p&&(typeof d=="number"||typeof d=="bigint")){const[m,x,T]=p;ne(d,{signed:x==="int",size:Number.parseInt(T,10)/8})}if(u==="address"&&typeof d=="string"&&!yt(d))throw new On({address:d});const f=u.match(c1);if(f){const[m,x]=f;if(x&&Te(d)!==Number.parseInt(x,10))throw new gg({expectedSize:Number.parseInt(x,10),givenSize:Te(d)})}const h=o[u];h&&(Aw(u),s(h,d))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new xw({domain:t});s(o.EIP712Domain,t)}if(r!=="EIP712Domain")if(o[r])s(o[r],n);else throw new Ew({primaryType:r,types:o})}function Tw({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Aw(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Sw({type:e})}function Nw(e){const{domain:t={},message:n,primaryType:r}=e,o={EIP712Domain:Tw({domain:t}),...e.types};Pw({domain:t,message:n,primaryType:r,types:o});const s=["0x1901"];return t&&s.push(Cw({domain:t,types:o})),r!=="EIP712Domain"&&s.push(zf({data:n,primaryType:r,types:o})),ze(Lt(s))}function Cw({domain:e,types:t}){return zf({data:e,primaryType:"EIP712Domain",types:t})}function zf({data:e,primaryType:t,types:n}){const r=Uf({data:e,primaryType:t,types:n});return ze(r)}function Uf({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],o=[Ow({primaryType:t,types:n})];for(const s of n[t]){const[i,l]=_f({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(i),o.push(l)}return $n(r,o)}function Ow({primaryType:e,types:t}){const n=Cn($w({primaryType:e,types:t}));return ze(n)}function $w({primaryType:e,types:t}){let n="";const r=Wf({primaryType:e,types:t});r.delete(e);const o=[e,...Array.from(r).sort()];for(const s of o)n+=`${s}(${t[s].map(({name:i,type:l})=>`${l} ${i}`).join(",")})`;return n}function Wf({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),o=r==null?void 0:r[0];if(n.has(o)||t[o]===void 0)return n;n.add(o);for(const s of t[o])Wf({primaryType:s.type,types:t},n);return n}function _f({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},ze(Uf({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},ze(r)];if(n==="string")return[{type:"bytes32"},ze(Cn(r))];if(n.lastIndexOf("]")===n.length-1){const o=n.slice(0,n.lastIndexOf("[")),s=r.map(i=>_f({name:t,type:o,types:e,value:i}));return[{type:"bytes32"},ze($n(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:n},r]}class Iw extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const rl={checksum:new Iw(8192)}.checksum;class Vf extends Qi{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,jg(t);const r=Ps(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 o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?t.create().update(r).digest():r);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),Er(s)}update(t){return xr(this),this.iHash.update(t),this}digestInto(t){xr(this),Kn(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:o,destroyed:s,blockLen:i,outputLen:l}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=i,t.outputLen=l,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Hf=(e,t,n)=>new Vf(e,t).update(n).digest();Hf.create=(e,t)=>new Vf(e,t);function Gf(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Ku(Uy(e));return n==="Bytes"?r:Rt(r)}const Mw=/^0x[a-fA-F0-9]{40}$/;function qs(e,t={}){const{strict:n=!0}=t;if(!Mw.test(e))throw new Kf({address:e,cause:new Dw});if(n){if(e.toLowerCase()===e)return;if(qf(e)!==e)throw new Kf({address:e,cause:new kw})}}function qf(e){if(rl.has(e))return rl.get(e);qs(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=Gf(_y(t),{as:"Bytes"}),r=t.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const o=`0x${r.join("")}`;return rl.set(e,o),o}function ol(e,t={}){const{strict:n=!0}=t??{};try{return qs(e,{strict:n}),!0}catch{return!1}}class Kf extends re{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class Dw extends re{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class kw extends re{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const Lw=/^(.*)\[([0-9]*)\]$/,Bw=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Zf=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Yf=2n**256n-1n;function Br(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=ll(t.type);if(s){const[i,l]=s;return Rw(e,{...t,type:l},{checksumAddress:r,length:i,staticPosition:o})}if(t.type==="tuple")return Ww(e,t,{checksumAddress:r,staticPosition:o});if(t.type==="address")return Fw(e,{checksum:r});if(t.type==="bool")return jw(e);if(t.type.startsWith("bytes"))return zw(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Uw(e,t);if(t.type==="string")return _w(e,{staticPosition:o});throw new dl(t.type)}const Xf=32,sl=32;function Fw(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?qf(s):s)(Rt(Hy(r,-20))),32]}function Rw(e,t,n){const{checksumAddress:r,length:o,staticPosition:s}=n;if(!o){const a=hn(e.readBytes(sl)),c=s+a,u=c+Xf;e.setPosition(c);const d=hn(e.readBytes(Xf)),p=qo(t);let f=0;const h=[];for(let m=0;m<d;++m){e.setPosition(u+(p?m*32:f));const[x,T]=Br(e,t,{checksumAddress:r,staticPosition:u});f+=T,h.push(x)}return e.setPosition(s+32),[h,32]}if(qo(t)){const a=hn(e.readBytes(sl)),c=s+a,u=[];for(let d=0;d<o;++d){e.setPosition(c+d*32);const[p]=Br(e,t,{checksumAddress:r,staticPosition:c});u.push(p)}return e.setPosition(s+32),[u,32]}let i=0;const l=[];for(let a=0;a<o;++a){const[c,u]=Br(e,t,{checksumAddress:r,staticPosition:s+i});i+=u,l.push(c)}return[l,i]}function jw(e){return[qy(e.readBytes(32),{size:32}),32]}function zw(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=hn(e.readBytes(32));e.setPosition(n+i);const l=hn(e.readBytes(32));if(l===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(l);return e.setPosition(n+32),[Rt(a),32]}return[Rt(e.readBytes(Number.parseInt(o,10),32)),32]}function Uw(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?Gy(o,{signed:n}):hn(o,{signed:n}),32]}function Ww(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=t.components.length===0||t.components.some(({name:a})=>!a),i=s?[]:{};let l=0;if(qo(t)){const a=hn(e.readBytes(sl)),c=o+a;for(let u=0;u<t.components.length;++u){const d=t.components[u];e.setPosition(c+l);const[p,f]=Br(e,d,{checksumAddress:r,staticPosition:c});l+=f,i[s?u:d==null?void 0:d.name]=p}return e.setPosition(o+32),[i,32]}for(let a=0;a<t.components.length;++a){const c=t.components[a],[u,d]=Br(e,c,{checksumAddress:r,staticPosition:o});i[s?a:c==null?void 0:c.name]=u,l+=d}return[i,l]}function _w(e,{staticPosition:t}){const n=hn(e.readBytes(32)),r=t+n;e.setPosition(r);const o=hn(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=Ky(tf(s));return e.setPosition(t+32),[i,32]}function Vw({checksumAddress:e,parameters:t,values:n}){const r=[];for(let o=0;o<t.length;o++)r.push(il({checksumAddress:e,parameter:t[o],value:n[o]}));return r}function il({checksumAddress:e=!1,parameter:t,value:n}){const r=t,o=ll(r.type);if(o){const[s,i]=o;return Gw(n,{checksumAddress:e,length:s,parameter:{...r,type:i}})}if(r.type==="tuple")return Xw(n,{checksumAddress:e,parameter:r});if(r.type==="address")return Hw(n,{checksum:e});if(r.type==="bool")return Kw(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,i="256"]=Zf.exec(r.type)??[];return Zw(n,{signed:s,size:Number(i)})}if(r.type.startsWith("bytes"))return qw(n,{type:r.type});if(r.type==="string")return Yw(n);throw new dl(r.type)}function al(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:l}=e[s];i?t+=32:t+=ft(l)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:l}=e[s];i?(n.push(Ve(t+o,{size:32})),r.push(l),o+=ft(l)):n.push(l)}return Ft(...n,...r)}function Hw(e,t){const{checksum:n=!1}=t;return qs(e,{strict:n}),{dynamic:!1,encoded:tr(e.toLowerCase())}}function Gw(e,t){const{checksumAddress:n,length:r,parameter:o}=t,s=r===null;if(!Array.isArray(e))throw new i6(e);if(!s&&e.length!==r)throw new s6({expectedLength:r,givenLength:e.length,type:`${o.type}[${r}]`});let i=!1;const l=[];for(let a=0;a<e.length;a++){const c=il({checksumAddress:n,parameter:o,value:e[a]});c.dynamic&&(i=!0),l.push(c)}if(s||i){const a=al(l);if(s){const c=Ve(l.length,{size:32});return{dynamic:!0,encoded:l.length>0?Ft(c,a):c}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:Ft(...l.map(({encoded:a})=>a))}}function qw(e,{type:t}){const[,n]=t.split("bytes"),r=ft(e);if(!n){let o=e;return r%32!==0&&(o=nr(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Ft(tr(Ve(r,{size:32})),o)}}if(r!==Number.parseInt(n,10))throw new e0({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:nr(e)}}function Kw(e){if(typeof e!="boolean")throw new re(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:tr(nf(e))}}function Zw(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new sf({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Ve(e,{size:32,signed:t})}}function Yw(e){const t=ja(e),n=Math.ceil(ft(t)/32),r=[];for(let o=0;o<n;o++)r.push(nr(Yt(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:Ft(nr(Ve(ft(t),{size:32})),...r)}}function Xw(e,t){const{checksumAddress:n,parameter:r}=t;let o=!1;const s=[];for(let i=0;i<r.components.length;i++){const l=r.components[i],a=Array.isArray(e)?i:l.name,c=il({checksumAddress:n,parameter:l,value:e[a]});s.push(c),c.dynamic&&(o=!0)}return{dynamic:o,encoded:o?al(s):Ft(...s.map(({encoded:i})=>i))}}function ll(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function qo(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(qo);const n=ll(e.type);return!!(n&&qo({...e,type:n[1]}))}const Jw={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new t6({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new e6({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Jf({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Jf({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function Qw(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Jw);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Jf extends re{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class e6 extends re{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class t6 extends re{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function n6(e,t,n={}){const{as:r="Array",checksumAddress:o=!1}=n,s=typeof t=="string"?ef(t):t,i=Qw(s);if(Ir(s)===0&&e.length>0)throw new o6;if(Ir(s)&&Ir(s)<32)throw new r6({data:typeof t=="string"?t:Rt(t),parameters:e,size:Ir(s)});let l=0;const a=r==="Array"?[]:{};for(let c=0;c<e.length;++c){const u=e[c];i.setPosition(l);const[d,p]=Br(i,u,{checksumAddress:o,staticPosition:0});l+=p,r==="Array"?a.push(d):a[u.name??c]=d}return a}function cl(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new t0({expectedLength:e.length,givenLength:t.length});const o=Vw({checksumAddress:r,parameters:e,values:t}),s=al(o);return s.length===0?"0x":s}function ul(e,t){if(e.length!==t.length)throw new t0({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r];n.push(ul.encode(o,s))}return Ft(...n)}(function(e){function t(n,r,o=!1){if(n==="address"){const a=r;return qs(a),tr(a.toLowerCase(),o?32:0)}if(n==="string")return ja(r);if(n==="bytes")return r;if(n==="bool")return tr(nf(r),o?32:1);const s=n.match(Zf);if(s){const[a,c,u="256"]=s,d=Number.parseInt(u,10)/8;return Ve(r,{size:o?32:d,signed:c==="int"})}const i=n.match(Bw);if(i){const[a,c]=i;if(Number.parseInt(c,10)!==(r.length-2)/2)throw new e0({expectedSize:Number.parseInt(c,10),value:r});return nr(r,o?32:0)}const l=n.match(Lw);if(l&&Array.isArray(r)){const[a,c]=l,u=[];for(let d=0;d<r.length;d++)u.push(t(c,r[d],!0));return u.length===0?"0x":Ft(...u)}throw new dl(n)}e.encode=t})(ul||(ul={}));function Qf(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Su(e):e}class r6 extends re{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${mr(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class o6 extends re{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class s6 extends re{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class e0 extends re{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${ft(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class t0 extends re{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
90
|
-
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class i6 extends re{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class dl extends re{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const et=BigInt(0),He=BigInt(1),rr=BigInt(2),a6=BigInt(3),n0=BigInt(4),r0=BigInt(5),o0=BigInt(8);function tt(e,t){const n=e%t;return n>=et?n:t+n}function xt(e,t,n){let r=e;for(;t-- >et;)r*=r,r%=n;return r}function fl(e,t){if(e===et)throw new Error("invert: expected non-zero number");if(t<=et)throw new Error("invert: expected positive modulus, got "+t);let n=tt(e,t),r=t,o=et,s=He;for(;n!==et;){const l=r/n,a=r%n,c=o-s*l;r=n,n=a,o=s,s=c}if(r!==He)throw new Error("invert: does not exist");return tt(o,t)}function s0(e,t){const n=(e.ORDER+He)/n0,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function l6(e,t){const n=(e.ORDER-r0)/o0,r=e.mul(t,rr),o=e.pow(r,n),s=e.mul(t,o),i=e.mul(e.mul(s,rr),o),l=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(l),t))throw new Error("Cannot find square root");return l}function c6(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-He,n=0;for(;t%rr===et;)t/=rr,n++;let r=rr;const o=pl(e);for(;a0(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return s0;let s=o.pow(r,t);const i=(t+He)/rr;return function(a,c){if(a.is0(c))return c;if(a0(a,c)!==1)throw new Error("Cannot find square root");let u=n,d=a.mul(a.ONE,s),p=a.pow(c,t),f=a.pow(c,i);for(;!a.eql(p,a.ONE);){if(a.is0(p))return a.ZERO;let h=1,m=a.sqr(p);for(;!a.eql(m,a.ONE);)if(h++,m=a.sqr(m),h===u)throw new Error("Cannot find square root");const x=He<<BigInt(u-h-1),T=a.pow(d,x);u=h,d=a.sqr(T),p=a.mul(p,d),f=a.mul(f,T)}return f}}function u6(e){return e%n0===a6?s0:e%o0===r0?l6:c6(e)}const d6=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function f6(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=d6.reduce((r,o)=>(r[o]="function",r),t);return js(e,n)}function p6(e,t,n){if(n<et)throw new Error("invalid exponent, negatives unsupported");if(n===et)return e.ONE;if(n===He)return t;let r=e.ONE,o=t;for(;n>et;)n&He&&(r=e.mul(r,o)),o=e.sqr(o),n>>=He;return r}function i0(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((i,l,a)=>e.is0(l)?i:(r[a]=i,e.mul(i,l)),e.ONE),s=e.inv(o);return t.reduceRight((i,l,a)=>e.is0(l)?i:(r[a]=e.mul(i,r[a]),e.mul(i,l)),s),r}function a0(e,t){const n=(e.ORDER-He)/rr,r=e.pow(t,n),o=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),i=e.eql(r,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function l0(e,t){t!==void 0&&so(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function pl(e,t,n=!1,r={}){if(e<=et)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:s}=l0(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i;const l=Object.freeze({ORDER:e,isLE:n,BITS:o,BYTES:s,MASK:Rs(o),ZERO:et,ONE:He,create:a=>tt(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return et<=a&&a<e},is0:a=>a===et,isOdd:a=>(a&He)===He,neg:a=>tt(-a,e),eql:(a,c)=>a===c,sqr:a=>tt(a*a,e),add:(a,c)=>tt(a+c,e),sub:(a,c)=>tt(a-c,e),mul:(a,c)=>tt(a*c,e),pow:(a,c)=>p6(l,a,c),div:(a,c)=>tt(a*fl(c,e),e),sqrN:a=>a*a,addN:(a,c)=>a+c,subN:(a,c)=>a-c,mulN:(a,c)=>a*c,inv:a=>fl(a,e),sqrt:r.sqrt||(a=>(i||(i=u6(e)),i(l,a))),toBytes:a=>n?Gd(a,s):Uo(a,s),fromBytes:a=>{if(a.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+a.length);return n?Hd(a):er(a)},invertBatch:a=>i0(l,a),cmov:(a,c,u)=>u?c:a});return Object.freeze(l)}function c0(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 u0(e){const t=c0(e);return t+Math.ceil(t/2)}function h6(e,t,n=!1){const r=e.length,o=c0(t),s=u0(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const i=n?Hd(e):er(e),l=tt(i,t-He)+He;return n?Gd(l,o):Uo(l,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const d0=BigInt(0),hl=BigInt(1);function ml(e,t){const n=t.negate();return e?n:t}function f0(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function bl(e,t){f0(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=Rs(e),i=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:i}}function p0(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:i}=n;let l=Number(e&o),a=e>>i;l>r&&(l-=s,a+=hl);const c=t*r,u=c+Math.abs(l)-1,d=l===0,p=l<0,f=t%2!==0;return{nextN:a,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:c}}function m6(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function b6(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const gl=new WeakMap,h0=new WeakMap;function yl(e){return h0.get(e)||1}function g6(e,t){return{constTimeNegate:ml,hasPrecomputes(n){return yl(n)!==1},unsafeLadder(n,r,o=e.ZERO){let s=n;for(;r>d0;)r&hl&&(o=o.add(s)),s=s.double(),r>>=hl;return o},precomputeWindow(n,r){const{windows:o,windowSize:s}=bl(r,t),i=[];let l=n,a=l;for(let c=0;c<o;c++){a=l,i.push(a);for(let u=1;u<s;u++)a=a.add(l),i.push(a);l=a.double()}return i},wNAF(n,r,o){let s=e.ZERO,i=e.BASE;const l=bl(n,t);for(let a=0;a<l.windows;a++){const{nextN:c,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:h}=p0(o,a,l);o=c,d?i=i.add(ml(f,r[h])):s=s.add(ml(p,r[u]))}return{p:s,f:i}},wNAFUnsafe(n,r,o,s=e.ZERO){const i=bl(n,t);for(let l=0;l<i.windows&&o!==d0;l++){const{nextN:a,offset:c,isZero:u,isNeg:d}=p0(o,l,i);if(o=a,!u){const p=r[c];s=s.add(d?p.negate():p)}}return s},getPrecomputes(n,r,o){let s=gl.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&gl.set(r,o(s))),s},wNAFCached(n,r,o){const s=yl(n);return this.wNAF(s,this.getPrecomputes(s,n,o),r)},wNAFCachedUnsafe(n,r,o,s){const i=yl(n);return i===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(i,this.getPrecomputes(i,n,o),r,s)},setWindowSize(n,r){f0(r,t),h0.set(n,r),gl.delete(n)}}}function y6(e,t,n,r){m6(n,e),b6(r,t);const o=n.length,s=r.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,l=$y(BigInt(o));let a=1;l>12?a=l-3:l>4?a=l-2:l>0&&(a=2);const c=Rs(a),u=new Array(Number(c)+1).fill(i),d=Math.floor((t.BITS-1)/a)*a;let p=i;for(let f=d;f>=0;f-=a){u.fill(i);for(let m=0;m<s;m++){const x=r[m],T=Number(x>>BigInt(f)&c);u[T]=u[T].add(n[m])}let h=i;for(let m=u.length-1,x=i;m>0;m--)x=x.add(u[m]),h=h.add(x);if(p=p.add(h),f!==0)for(let m=0;m<a;m++)p=p.double()}return p}function m0(e){return f6(e.Fp),js(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...l0(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function b0(e){e.lowS!==void 0&&jo("lowS",e.lowS),e.prehash!==void 0&&jo("prehash",e.prehash)}function v6(e){const t=m0(e);js(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class w6 extends Error{constructor(t=""){super(t)}}const mn={Err:w6,_tlv:{encode:(e,t)=>{const{Err:n}=mn;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,o=Ls(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?Ls(o.length/2|128):"";return Ls(e)+s+o+t},decode(e,t){const{Err:n}=mn;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const o=t[r++],s=!!(o&128);let i=0;if(!s)i=o;else{const a=o&127;if(!a)throw new n("tlv.decode(long): indefinite length not supported");if(a>4)throw new n("tlv.decode(long): byte length is too big");const c=t.subarray(r,r+a);if(c.length!==a)throw new n("tlv.decode: length bytes not complete");if(c[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of c)i=i<<8|u;if(r+=a,i<128)throw new n("tlv.decode(long): not minimal encoding")}const l=t.subarray(r,r+i);if(l.length!==i)throw new n("tlv.decode: wrong value length");return{v:l,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=mn;if(e<bn)throw new t("integer: negative integers are not allowed");let n=Ls(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=mn;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return er(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=mn,o=wt("signature",e),{v:s,l:i}=r.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:l,l:a}=r.decode(2,s),{v:c,l:u}=r.decode(2,a);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(l),s:n.decode(c)}},hexFromSig(e){const{_tlv:t,_int:n}=mn,r=t.encode(2,n.encode(e.r)),o=t.encode(2,n.encode(e.s)),s=r+o;return t.encode(48,s)}};function vl(e,t){return zo(Uo(e,t))}const bn=BigInt(0),Re=BigInt(1);BigInt(2);const wl=BigInt(3),x6=BigInt(4);function E6(e){const t=v6(e),{Fp:n}=t,r=pl(t.n,t.nBitLength),o=t.toBytes||((P,A,k)=>{const B=A.toAffine();return Fs(Uint8Array.from([4]),n.toBytes(B.x),n.toBytes(B.y))}),s=t.fromBytes||(P=>{const A=P.subarray(1),k=n.fromBytes(A.subarray(0,n.BYTES)),B=n.fromBytes(A.subarray(n.BYTES,2*n.BYTES));return{x:k,y:B}});function i(P){const{a:A,b:k}=t,B=n.sqr(P),F=n.mul(B,P);return n.add(n.add(F,n.mul(P,A)),k)}function l(P,A){const k=n.sqr(A),B=i(P);return n.eql(k,B)}if(!l(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const a=n.mul(n.pow(t.a,wl),x6),c=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(a,c)))throw new Error("bad curve params: a or b");function u(P){return Fa(P,Re,t.n)}function d(P){const{allowedPrivateKeyLengths:A,nByteLength:k,wrapPrivateKey:B,n:F}=t;if(A&&typeof P!="bigint"){if(Ro(P)&&(P=zo(P)),typeof P!="string"||!A.includes(P.length))throw new Error("invalid private key");P=P.padStart(k*2,"0")}let b;try{b=typeof P=="bigint"?P:er(wt("private key",P,k))}catch{throw new Error("invalid private key, expected hex or "+k+" bytes, got "+typeof P)}return B&&(b=tt(b,F)),$r("private key",b,Re,F),b}function p(P){if(!(P instanceof m))throw new Error("ProjectivePoint expected")}const f=Kd((P,A)=>{const{px:k,py:B,pz:F}=P;if(n.eql(F,n.ONE))return{x:k,y:B};const b=P.is0();A==null&&(A=b?n.ONE:n.inv(F));const v=n.mul(k,A),E=n.mul(B,A),I=n.mul(F,A);if(b)return{x:n.ZERO,y:n.ZERO};if(!n.eql(I,n.ONE))throw new Error("invZ was invalid");return{x:v,y:E}}),h=Kd(P=>{if(P.is0()){if(t.allowInfinityPoint&&!n.is0(P.py))return;throw new Error("bad point: ZERO")}const{x:A,y:k}=P.toAffine();if(!n.isValid(A)||!n.isValid(k))throw new Error("bad point: x or y not FE");if(!l(A,k))throw new Error("bad point: equation left != right");if(!P.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(A,k,B){if(A==null||!n.isValid(A))throw new Error("x required");if(k==null||!n.isValid(k)||n.is0(k))throw new Error("y required");if(B==null||!n.isValid(B))throw new Error("z required");this.px=A,this.py=k,this.pz=B,Object.freeze(this)}static fromAffine(A){const{x:k,y:B}=A||{};if(!A||!n.isValid(k)||!n.isValid(B))throw new Error("invalid affine point");if(A instanceof m)throw new Error("projective point not allowed");const F=b=>n.eql(b,n.ZERO);return F(k)&&F(B)?m.ZERO:new m(k,B,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(A){const k=i0(n,A.map(B=>B.pz));return A.map((B,F)=>B.toAffine(k[F])).map(m.fromAffine)}static fromHex(A){const k=m.fromAffine(s(wt("pointHex",A)));return k.assertValidity(),k}static fromPrivateKey(A){return m.BASE.multiply(d(A))}static msm(A,k){return y6(m,r,A,k)}_setWindowSize(A){w.setWindowSize(this,A)}assertValidity(){h(this)}hasEvenY(){const{y:A}=this.toAffine();if(n.isOdd)return!n.isOdd(A);throw new Error("Field doesn't support isOdd")}equals(A){p(A);const{px:k,py:B,pz:F}=this,{px:b,py:v,pz:E}=A,I=n.eql(n.mul(k,E),n.mul(b,F)),$=n.eql(n.mul(B,E),n.mul(v,F));return I&&$}negate(){return new m(this.px,n.neg(this.py),this.pz)}double(){const{a:A,b:k}=t,B=n.mul(k,wl),{px:F,py:b,pz:v}=this;let E=n.ZERO,I=n.ZERO,$=n.ZERO,C=n.mul(F,F),D=n.mul(b,b),y=n.mul(v,v),O=n.mul(F,b);return O=n.add(O,O),$=n.mul(F,v),$=n.add($,$),E=n.mul(A,$),I=n.mul(B,y),I=n.add(E,I),E=n.sub(D,I),I=n.add(D,I),I=n.mul(E,I),E=n.mul(O,E),$=n.mul(B,$),y=n.mul(A,y),O=n.sub(C,y),O=n.mul(A,O),O=n.add(O,$),$=n.add(C,C),C=n.add($,C),C=n.add(C,y),C=n.mul(C,O),I=n.add(I,C),y=n.mul(b,v),y=n.add(y,y),C=n.mul(y,O),E=n.sub(E,C),$=n.mul(y,D),$=n.add($,$),$=n.add($,$),new m(E,I,$)}add(A){p(A);const{px:k,py:B,pz:F}=this,{px:b,py:v,pz:E}=A;let I=n.ZERO,$=n.ZERO,C=n.ZERO;const D=t.a,y=n.mul(t.b,wl);let O=n.mul(k,b),M=n.mul(B,v),S=n.mul(F,E),L=n.add(k,B),j=n.add(b,v);L=n.mul(L,j),j=n.add(O,M),L=n.sub(L,j),j=n.add(k,F);let z=n.add(b,E);return j=n.mul(j,z),z=n.add(O,S),j=n.sub(j,z),z=n.add(B,F),I=n.add(v,E),z=n.mul(z,I),I=n.add(M,S),z=n.sub(z,I),C=n.mul(D,j),I=n.mul(y,S),C=n.add(I,C),I=n.sub(M,C),C=n.add(M,C),$=n.mul(I,C),M=n.add(O,O),M=n.add(M,O),S=n.mul(D,S),j=n.mul(y,j),M=n.add(M,S),S=n.sub(O,S),S=n.mul(D,S),j=n.add(j,S),O=n.mul(M,j),$=n.add($,O),O=n.mul(z,j),I=n.mul(L,I),I=n.sub(I,O),O=n.mul(L,M),C=n.mul(z,C),C=n.add(C,O),new m(I,$,C)}subtract(A){return this.add(A.negate())}is0(){return this.equals(m.ZERO)}wNAF(A){return w.wNAFCached(this,A,m.normalizeZ)}multiplyUnsafe(A){const{endo:k,n:B}=t;$r("scalar",A,bn,B);const F=m.ZERO;if(A===bn)return F;if(this.is0()||A===Re)return this;if(!k||w.hasPrecomputes(this))return w.wNAFCachedUnsafe(this,A,m.normalizeZ);let{k1neg:b,k1:v,k2neg:E,k2:I}=k.splitScalar(A),$=F,C=F,D=this;for(;v>bn||I>bn;)v&Re&&($=$.add(D)),I&Re&&(C=C.add(D)),D=D.double(),v>>=Re,I>>=Re;return b&&($=$.negate()),E&&(C=C.negate()),C=new m(n.mul(C.px,k.beta),C.py,C.pz),$.add(C)}multiply(A){const{endo:k,n:B}=t;$r("scalar",A,Re,B);let F,b;if(k){const{k1neg:v,k1:E,k2neg:I,k2:$}=k.splitScalar(A);let{p:C,f:D}=this.wNAF(E),{p:y,f:O}=this.wNAF($);C=w.constTimeNegate(v,C),y=w.constTimeNegate(I,y),y=new m(n.mul(y.px,k.beta),y.py,y.pz),F=C.add(y),b=D.add(O)}else{const{p:v,f:E}=this.wNAF(A);F=v,b=E}return m.normalizeZ([F,b])[0]}multiplyAndAddUnsafe(A,k,B){const F=m.BASE,b=(E,I)=>I===bn||I===Re||!E.equals(F)?E.multiplyUnsafe(I):E.multiply(I),v=b(this,k).add(b(A,B));return v.is0()?void 0:v}toAffine(A){return f(this,A)}isTorsionFree(){const{h:A,isTorsionFree:k}=t;if(A===Re)return!0;if(k)return k(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:A,clearCofactor:k}=t;return A===Re?this:k?k(m,this):this.multiplyUnsafe(t.h)}toRawBytes(A=!0){return jo("isCompressed",A),this.assertValidity(),o(m,this,A)}toHex(A=!0){return jo("isCompressed",A),zo(this.toRawBytes(A))}}m.BASE=new m(t.Gx,t.Gy,n.ONE),m.ZERO=new m(n.ZERO,n.ONE,n.ZERO);const{endo:x,nBitLength:T}=t,w=g6(m,x?Math.ceil(T/2):T);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:d,weierstrassEquation:i,isWithinCurveOrder:u}}function S6(e){const t=m0(e);return js(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function P6(e){const t=S6(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,i=n.BYTES+1,l=2*n.BYTES+1;function a(y){return tt(y,r)}function c(y){return fl(y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:p,isWithinCurveOrder:f}=E6({...t,toBytes(y,O,M){const S=O.toAffine(),L=n.toBytes(S.x),j=Fs;return jo("isCompressed",M),M?j(Uint8Array.from([O.hasEvenY()?2:3]),L):j(Uint8Array.from([4]),L,n.toBytes(S.y))},fromBytes(y){const O=y.length,M=y[0],S=y.subarray(1);if(O===i&&(M===2||M===3)){const L=er(S);if(!Fa(L,Re,n.ORDER))throw new Error("Point is not on curve");const j=p(L);let z;try{z=n.sqrt(j)}catch(Z){const q=Z instanceof Error?": "+Z.message:"";throw new Error("Point is not on curve"+q)}const W=(z&Re)===Re;return(M&1)===1!==W&&(z=n.neg(z)),{x:L,y:z}}else if(O===l&&M===4){const L=n.fromBytes(S.subarray(0,n.BYTES)),j=n.fromBytes(S.subarray(n.BYTES,2*n.BYTES));return{x:L,y:j}}else{const L=i,j=l;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+j+", got "+O)}}});function h(y){const O=r>>Re;return y>O}function m(y){return h(y)?a(-y):y}const x=(y,O,M)=>er(y.slice(O,M));class T{constructor(O,M,S){$r("r",O,Re,r),$r("s",M,Re,r),this.r=O,this.s=M,S!=null&&(this.recovery=S),Object.freeze(this)}static fromCompact(O){const M=o;return O=wt("compactSignature",O,M*2),new T(x(O,0,M),x(O,M,2*M))}static fromDER(O){const{r:M,s:S}=mn.toSig(wt("DER",O));return new T(M,S)}assertValidity(){}addRecoveryBit(O){return new T(this.r,this.s,O)}recoverPublicKey(O){const{r:M,s:S,recovery:L}=this,j=F(wt("msgHash",O));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const z=L===2||L===3?M+t.n:M;if(z>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const W=L&1?"03":"02",_=u.fromHex(W+vl(z,n.BYTES)),Z=c(z),q=a(-j*Z),H=a(S*Z),ee=u.BASE.multiplyAndAddUnsafe(_,q,H);if(!ee)throw new Error("point at infinify");return ee.assertValidity(),ee}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new T(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Bs(this.toDERHex())}toDERHex(){return mn.hexFromSig(this)}toCompactRawBytes(){return Bs(this.toCompactHex())}toCompactHex(){const O=o;return vl(this.r,O)+vl(this.s,O)}}const w={isValidPrivateKey(y){try{return d(y),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const y=u0(t.n);return h6(t.randomBytes(y),t.n)},precompute(y=8,O=u.BASE){return O._setWindowSize(y),O.multiply(BigInt(3)),O}};function P(y,O=!0){return u.fromPrivateKey(y).toRawBytes(O)}function A(y){if(typeof y=="bigint")return!1;if(y instanceof u)return!0;const M=wt("key",y).length,S=n.BYTES,L=S+1,j=2*S+1;if(!(t.allowedPrivateKeyLengths||o===L))return M===L||M===j}function k(y,O,M=!0){if(A(y)===!0)throw new Error("first arg must be private key");if(A(O)===!1)throw new Error("second arg must be public key");return u.fromHex(O).multiply(d(y)).toRawBytes(M)}const B=t.bits2int||function(y){if(y.length>8192)throw new Error("input is too large");const O=er(y),M=y.length*8-s;return M>0?O>>BigInt(M):O},F=t.bits2int_modN||function(y){return a(B(y))},b=Rs(s);function v(y){return $r("num < 2^"+s,y,bn,b),Uo(y,o)}function E(y,O,M=I){if(["recovered","canonical"].some(me=>me in M))throw new Error("sign() legacy options not supported");const{hash:S,randomBytes:L}=t;let{lowS:j,prehash:z,extraEntropy:W}=M;j==null&&(j=!0),y=wt("msgHash",y),b0(M),z&&(y=wt("prehashed msgHash",S(y)));const _=F(y),Z=d(O),q=[v(Z),v(_)];if(W!=null&&W!==!1){const me=W===!0?L(n.BYTES):W;q.push(wt("extraEntropy",me))}const H=Fs(...q),ee=_;function fe(me){const ye=B(me);if(!f(ye))return;const ve=c(ye),oe=u.BASE.multiply(ye).toAffine(),V=a(oe.x);if(V===bn)return;const X=a(ve*a(ee+V*Z));if(X===bn)return;let Q=(oe.x===V?0:2)|Number(oe.y&Re),we=X;return j&&h(X)&&(we=m(X),Q^=1),new T(V,we,Q)}return{seed:H,k2sig:fe}}const I={lowS:t.lowS,prehash:!1},$={lowS:t.lowS,prehash:!1};function C(y,O,M=I){const{seed:S,k2sig:L}=E(y,O,M),j=t;return Iy(j.hash.outputLen,j.nByteLength,j.hmac)(S,L)}u.BASE._setWindowSize(8);function D(y,O,M,S=$){var Q;const L=y;O=wt("msgHash",O),M=wt("publicKey",M);const{lowS:j,prehash:z,format:W}=S;if(b0(S),"strict"in S)throw new Error("options.strict was renamed to lowS");if(W!==void 0&&W!=="compact"&&W!=="der")throw new Error("format must be compact or der");const _=typeof L=="string"||Ro(L),Z=!_&&!W&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!_&&!Z)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let q,H;try{if(Z&&(q=new T(L.r,L.s)),_){try{W!=="compact"&&(q=T.fromDER(L))}catch(we){if(!(we instanceof mn.Err))throw we}!q&&W!=="der"&&(q=T.fromCompact(L))}H=u.fromHex(M)}catch{return!1}if(!q||j&&q.hasHighS())return!1;z&&(O=t.hash(O));const{r:ee,s:fe}=q,me=F(O),ye=c(fe),ve=a(me*ye),oe=a(ee*ye),V=(Q=u.BASE.multiplyAndAddUnsafe(H,ve,oe))==null?void 0:Q.toAffine();return V?a(V.x)===ee:!1}return{CURVE:t,getPublicKey:P,getSharedSecret:k,sign:C,verify:D,ProjectivePoint:u,Signature:T,utils:w}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function T6(e){return{hash:e,hmac:(t,...n)=>Hf(e,t,Hg(...n)),randomBytes:Gg}}function A6(e,t){const n=r=>P6({...e,...T6(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const g0=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),y0=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),N6=BigInt(0),C6=BigInt(1),xl=BigInt(2),v0=(e,t)=>(e+t/xl)/t;function O6(e){const t=g0,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),l=BigInt(44),a=BigInt(88),c=e*e*e%t,u=c*c*e%t,d=xt(u,n,t)*u%t,p=xt(d,n,t)*u%t,f=xt(p,xl,t)*c%t,h=xt(f,o,t)*f%t,m=xt(h,s,t)*h%t,x=xt(m,l,t)*m%t,T=xt(x,a,t)*x%t,w=xt(T,l,t)*m%t,P=xt(w,n,t)*u%t,A=xt(P,i,t)*h%t,k=xt(A,r,t)*c%t,B=xt(k,xl,t);if(!El.eql(El.sqr(B),e))throw new Error("Cannot find square root");return B}const El=pl(g0,void 0,void 0,{sqrt:O6}),w0=A6({a:N6,b:BigInt(7),Fp:El,n:y0,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=y0,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-C6*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,i=BigInt("0x100000000000000000000000000000000"),l=v0(s*e,t),a=v0(-r*e,t);let c=tt(e-l*n-a*o,t),u=tt(-l*r-a*s,t);const d=c>i,p=u>i;if(d&&(c=t-c),p&&(u=t-u),c>i||u>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:p,k2:u}}}},Md),$6=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:w0},Symbol.toStringTag,{value:"Module"}));function x0(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new Pl({signature:e});if(typeof e.s>"u")throw new Pl({signature:e});if(n&&typeof e.yParity>"u")throw new Pl({signature:e});if(e.r<0n||e.r>Yf)throw new F6({value:e.r});if(e.s<0n||e.s>Yf)throw new R6({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Tl({value:e.yParity})}function I6(e){return E0(Rt(e))}function E0(e){if(e.length!==130&&e.length!==132)throw new B6({signature:e});const t=BigInt(Yt(e,0,32)),n=BigInt(Yt(e,32,64)),r=(()=>{const o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return Sl(o)}catch{throw new Tl({value:o})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function M6(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return D6(e)}function D6(e){const t=typeof e=="string"?E0(e):e instanceof Uint8Array?I6(e):typeof e.r=="string"?L6(e):e.v?k6(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return x0(t),t}function k6(e){return{r:e.r,s:e.s,yParity:Sl(e.v)}}function L6(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=Sl(n)),typeof r!="number")throw new Tl({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function Sl(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new j6({value:e})}class B6 extends re{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${ft(nv(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Pl extends re{constructor({signature:t}){super(`Signature \`${Qd(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class F6 extends re{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class R6 extends re{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class Tl extends re{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class j6 extends re{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function z6(e,t={}){return typeof e.chainId=="string"?U6(e):{...e,...t.signature}}function U6(e){const{address:t,chainId:n,nonce:r}=e,o=M6(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}const W6="0x8010801080108010801080108010801080108010801080108010801080108010",_6=Qf("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function S0(e){if(typeof e=="string"){if(Yt(e,-32)!==W6)throw new G6(e)}else x0(e.authorization)}function V6(e){S0(e);const t=of(Yt(e,-64,-32)),n=Yt(e,-t-64,-64),r=Yt(e,0,-t-64),[o,s,i]=n6(_6,n);return{authorization:z6({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:r,...i&&i!=="0x"?{data:i,to:s}:{}}}function H6(e){try{return S0(e),!0}catch{return!1}}let G6=class extends re{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};class q6 extends G{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function K6(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new q6({value:e});let[n,r="0"]=e.split(".");const o=n.startsWith("-");if(o&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[s,i,l]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],a=Math.round(+`${i}.${l}`);a>9?r=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):r=`${s}${a}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${o?"-":""}${n}${r}`)}function Z6(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function Y6(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?ln(e.nonce):void 0,storageProof:e.storageProof?Z6(e.storageProof):void 0}}async function X6(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",i=n!==void 0?ne(n):void 0,l=await e.request({method:"eth_getProof",params:[t,o,i||s]});return Y6(l)}async function J6(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=n!==void 0?ne(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}async function Al(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s,sender:i,nonce:l}){var p,f,h;const a=r||"latest",c=n!==void 0?ne(n):void 0;let u=null;if(o?u=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?u=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,ne(s)]},{dedupe:!0}):typeof s=="number"?u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[c||a,ne(s)]},{dedupe:!!c}):i&&typeof l=="number"&&(u=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,ne(l)]},{dedupe:!0})),!u)throw new fd({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(((h=(f=(p=e.chain)==null?void 0:p.formatters)==null?void 0:f.transaction)==null?void 0:h.format)||Sa)(u,"getTransaction")}async function Q6(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([te(e,Vo,"getBlockNumber")({}),t?te(e,Al,"getTransaction")({hash:t}):void 0]),s=(n==null?void 0:n.blockNumber)||(o==null?void 0:o.blockNumber);return s?r-s+1n:0n}async function Ks(e,{hash:t}){var o,s,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new pd({hash:t});return(((i=(s=(o=e.chain)==null?void 0:o.formatters)==null?void 0:s.transactionReceipt)==null?void 0:i.format)||Pf)(n,"getTransactionReceipt")}async function ex(e,t){var w;const{account:n,authorizationList:r,allowFailure:o=!0,blockNumber:s,blockOverrides:i,blockTag:l,stateOverride:a}=t,c=t.contracts,{batchSize:u=t.batchSize??1024,deployless:d=t.deployless??!1}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},p=(()=>{if(t.multicallAddress)return t.multicallAddress;if(d)return null;if(e.chain)return kr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),f=[[]];let h=0,m=0;for(let P=0;P<c.length;P++){const{abi:A,address:k,args:B,functionName:F}=c[P];try{const b=vt({abi:A,args:B,functionName:F});m+=(b.length-2)/2,u>0&&m>u&&f[h].length>0&&(h++,m=(b.length-2)/2,f[h]=[]),f[h]=[...f[h],{allowFailure:!0,callData:b,target:k}]}catch(b){const v=Nr(b,{abi:A,address:k,args:B,docsPath:"/docs/contract/multicall",functionName:F,sender:n});if(!o)throw v;f[h]=[...f[h],{allowFailure:!0,callData:"0x",target:k}]}}const x=await Promise.allSettled(f.map(P=>te(e,jt,"readContract")({...p===null?{code:Ua}:{address:p},abi:Mr,account:n,args:[P],authorizationList:r,blockNumber:s,blockOverrides:i,blockTag:l,functionName:"aggregate3",stateOverride:a}))),T=[];for(let P=0;P<x.length;P++){const A=x[P];if(A.status==="rejected"){if(!o)throw A.reason;for(let B=0;B<f[P].length;B++)T.push({status:"failure",error:A.reason,result:void 0});continue}const k=A.value;for(let B=0;B<k.length;B++){const{returnData:F,success:b}=k[B],{callData:v}=f[P][B],{abi:E,address:I,functionName:$,args:C}=c[T.length];try{if(v==="0x")throw new ro;if(!b)throw new Os({data:F});const D=kn({abi:E,args:C,data:F,functionName:$});T.push(o?{result:D,status:"success"}:D)}catch(D){const y=Nr(D,{abi:E,address:I,args:C,docsPath:"/docs/contract/multicall",functionName:$});if(!o)throw y;T.push({error:y,result:void 0,status:"failure"})}}}if(T.length!==c.length)throw new G("multicall results mismatch");return T}async function Nl(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:i,validation:l}=t;try{const a=[];for(const p of o){const f=p.blockOverrides?uf(p.blockOverrides):void 0,h=p.calls.map(x=>{const T=x,w=T.account?dt(T.account):void 0,P=T.abi?vt(T):T.data,A={...T,account:w,data:T.dataSuffix?Lt([P||"0x",T.dataSuffix]):P,from:T.from??(w==null?void 0:w.address)};return Or(A),Bo(A)}),m=p.stateOverrides?xa(p.stateOverrides):void 0;a.push({blockOverrides:f,calls:h,stateOverrides:m})}const u=(typeof n=="bigint"?ne(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:a,returnFullTransactions:s,traceTransfers:i,validation:l},u]})).map((p,f)=>({...Nd(p),calls:p.calls.map((h,m)=>{var E,I;const{abi:x,args:T,functionName:w,to:P}=o[f].calls[m],A=((E=h.error)==null?void 0:E.data)??h.returnData,k=BigInt(h.gasUsed),B=(I=h.logs)==null?void 0:I.map($=>Zt($)),F=h.status==="0x1"?"success":"failure",b=x&&F==="success"&&A!=="0x"?kn({abi:x,data:A,functionName:w}):null,v=(()=>{if(F==="success")return;let $;if(A==="0x"?$=new ro:A&&($=new Os({data:A})),!!$)return Nr($,{abi:x??[],address:P??"0x",args:T,functionName:w??"<unknown>"})})();return{data:A,gasUsed:k,logs:B,status:F,...F==="success"?{result:b}:{error:v}}})}))}catch(a){const c=a,u=Ms(c,{});throw u instanceof Lo?c:u}}function Cl(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const l=e[i];if(["(",")",","].includes(l)&&(t=!0),l==="("&&r++,l===")"&&r--,!!t){if(r===0){if(l===" "&&["event","function","error",""].includes(o))o="";else if(o+=l,l===")"){s=!0;break}continue}if(l===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=l,n+=l}}if(!s)throw new re("Unable to normalize signature.");return o}function Ol(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ol(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>Ol(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>Ol(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function P0(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return P0(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?ol(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?ol(n[r],{strict:!1}):!1)return i}}function T0(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Eu(e):e;return{...r,...n?{hash:Fr(r)}:{}}}function Zs(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=rv(t,{strict:!1}),i=e.filter(c=>s?c.type==="function"||c.type==="error"?A0(c)===Yt(t,0,4):c.type==="event"?Fr(c)===t:!1:"name"in c&&c.name===t);if(i.length===0)throw new Ys({name:t});if(i.length===1)return{...i[0],...o?{hash:Fr(i[0])}:{}};let l;for(const c of i){if(!("inputs"in c))continue;if(!r||r.length===0){if(!c.inputs||c.inputs.length===0)return{...c,...o?{hash:Fr(c)}:{}};continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==r.length)continue;if(r.every((d,p)=>{const f="inputs"in c&&c.inputs[p];return f?Ol(d,f):!1})){if(l&&"inputs"in l&&l.inputs){const d=P0(c.inputs,l.inputs,r);if(d)throw new nx({abiItem:c,type:d[0]},{abiItem:l,type:d[1]})}l=c}}const a=(()=>{if(l)return l;const[c,...u]=i;return{...c,overloads:u}})();if(!a)throw new Ys({name:t});return{...a,...o?{hash:Fr(a)}:{}}}function A0(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Zs(n,r)}return e[0]})();return Yt(Fr(t),0,4)}function tx(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,o]=e;return Zs(r,o)}return e[0]})(),n=typeof t=="string"?t:vs(t);return Cl(n)}function Fr(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Zs(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:Gf(ja(tx(t)))}class nx extends re{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${Cl(vs(t.abiItem))}\`, and`,`\`${n.type}\` in \`${Cl(vs(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class Ys extends re{constructor({name:t,data:n,type:r="item"}){const o=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${o} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function rx(...e){var s;const[t,n]=(()=>{if(Array.isArray(e[0])){const[i,l]=e;return[sx(i),l]}return e})(),{bytecode:r,args:o}=n;return Ft(r,(s=t.inputs)!=null&&s.length&&(o!=null&&o.length)?cl(t.inputs,o):"0x")}function ox(e){return T0(e)}function sx(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new Ys({name:"constructor"});return t}function ix(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[c,u,d]=e;return[N0(c,u,{args:d}),d]}const[l,a]=e;return[l,a]})(),{overloads:r}=t,o=r?N0([t,...r],t.name,{args:n}):t,s=ax(o),i=n.length>0?cl(o.inputs,n):void 0;return i?Ft(s,i):s}function Rr(e,t={}){return T0(e,t)}function N0(e,t,n){const r=Zs(e,t,n);if(r.type!=="function")throw new Ys({name:t,type:"function"});return r}function ax(e){return A0(e)}const lx="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",zt="0x0000000000000000000000000000000000000000",cx="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function ux(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:i,traceTransfers:l,validation:a}=t,c=t.account?dt(t.account):void 0;if(i&&!c)throw new G("`account` is required when `traceAssetChanges` is true");const u=c?rx(ox("constructor(bytes, bytes)"),{bytecode:gf,args:[cx,ix(Rr("function getBalance(address)"),[c.address])]}):void 0,d=i?await Promise.all(t.calls.map(async S=>{if(!S.data&&!S.abi)return;const{accessList:L}=await Df(e,{account:c.address,...S,data:S.abi?vt(S):S.data});return L.map(({address:j,storageKeys:z})=>z.length>0?j:null)})).then(S=>S.flat().filter(Boolean)):[],p=await Nl(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:u}],stateOverrides:s},{calls:d.map((S,L)=>({abi:[Rr("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[c.address],to:S,from:zt,nonce:L})),stateOverrides:[{address:zt,nonce:0}]}]:[],{calls:[...o,{to:zt}].map(S=>({...S,from:c==null?void 0:c.address})),stateOverrides:s},...i?[{calls:[{data:u}]},{calls:d.map((S,L)=>({abi:[Rr("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[c.address],to:S,from:zt,nonce:L})),stateOverrides:[{address:zt,nonce:0}]},{calls:d.map((S,L)=>({to:S,abi:[Rr("function decimals() returns (uint256)")],functionName:"decimals",from:zt,nonce:L})),stateOverrides:[{address:zt,nonce:0}]},{calls:d.map((S,L)=>({to:S,abi:[Rr("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:zt,nonce:L})),stateOverrides:[{address:zt,nonce:0}]},{calls:d.map((S,L)=>({to:S,abi:[Rr("function symbol() returns (string)")],functionName:"symbol",from:zt,nonce:L})),stateOverrides:[{address:zt,nonce:0}]}]:[]],traceTransfers:l,validation:a}),f=i?p[2]:p[0],[h,m,,x,T,w,P,A]=i?p:[],{calls:k,...B}=f,F=k.slice(0,-1)??[],b=(h==null?void 0:h.calls)??[],v=(m==null?void 0:m.calls)??[],E=[...b,...v].map(S=>S.status==="success"?Gt(S.data):null),I=(x==null?void 0:x.calls)??[],$=(T==null?void 0:T.calls)??[],C=[...I,...$].map(S=>S.status==="success"?Gt(S.data):null),D=((w==null?void 0:w.calls)??[]).map(S=>S.status==="success"?S.result:null),y=((A==null?void 0:A.calls)??[]).map(S=>S.status==="success"?S.result:null),O=((P==null?void 0:P.calls)??[]).map(S=>S.status==="success"?S.result:null),M=[];for(const[S,L]of C.entries()){const j=E[S];if(typeof L!="bigint"||typeof j!="bigint")continue;const z=D[S-1],W=y[S-1],_=O[S-1],Z=S===0?{address:lx,decimals:18,symbol:"ETH"}:{address:d[S-1],decimals:_||z?Number(z??1):void 0,symbol:W??void 0};M.some(q=>q.token.address===Z.address)||M.push({token:Z,value:{pre:j,post:L,diff:L-j}})}return{assetChanges:M,block:B,results:F}}const C0="0x6492649264926492649264926492649264926492649264926492649264926492";function dx(e){if(Yt(e,-32)!==C0)throw new hx(e)}function fx(e){const{data:t,signature:n,to:r}=e;return Ft(cl(Qf("address, bytes, bytes"),[r,t,n]),C0)}function px(e){try{return dx(e),!0}catch{return!1}}class hx extends re{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function mx({r:e,s:t,to:n="hex",v:r,yParity:o}){const s=(()=>{if(o===0||o===1)return o;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),i=`0x${new w0.Signature(Gt(e),Gt(t)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?i:qt(i)}async function Xs(e,t){var a,c,u,d;const{address:n,chain:r=e.chain,hash:o,erc6492VerifierAddress:s=t.universalSignatureVerifierAddress??((c=(a=r==null?void 0:r.contracts)==null?void 0:a.erc6492Verifier)==null?void 0:c.address),multicallAddress:i=t.multicallAddress??((d=(u=r==null?void 0:r.contracts)==null?void 0:u.multicall3)==null?void 0:d.address)}=t;if(r!=null&&r.verifyHash)return await r.verifyHash(e,t);const l=(()=>{const p=t.signature;return Dt(p)?p:typeof p=="object"&&"r"in p&&"s"in p?mx(p):Le(p)})();try{return H6(l)?await bx(e,{...t,multicallAddress:i,signature:l}):await gx(e,{...t,verifierAddress:s,signature:l})}catch(p){try{if(Fo(un(n),await yd({hash:o,signature:l})))return!0}catch{}if(p instanceof or)return!1;throw p}}async function bx(e,t){var x;const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:i}=t,{authorization:l,data:a,signature:c,to:u}=V6(t.signature);if(await Hs(e,{address:n,blockNumber:r,blockTag:o})===Sr(["0xef0100",l.address]))return await yx(e,{address:n,blockNumber:r,blockTag:o,hash:s,signature:c});const p={address:l.address,chainId:Number(l.chainId),nonce:Number(l.nonce),r:ne(l.r,{size:32}),s:ne(l.s,{size:32}),yParity:l.yParity};if(!await ow({address:n,authorization:p}))throw new or;const h=await te(e,jt,"readContract")({...i?{address:i}:{code:Ua},authorizationList:[p],abi:Mr,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...a?[{allowFailure:!0,target:u??n,callData:a}]:[],{allowFailure:!0,target:n,callData:vt({abi:mf,functionName:"isValidSignature",args:[s,c]})}]]}),m=(x=h[h.length-1])==null?void 0:x.returnData;if(m!=null&&m.startsWith("0x1626ba7e"))return!0;throw new or}async function gx(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:i,verifierAddress:l,...a}=t,c=await(async()=>!r&&!o||px(i)?i:fx({data:o,signature:i,to:r}))(),u=l?{to:l,data:vt({abi:bf,functionName:"isValidSig",args:[n,s,c]}),...a}:{data:Va({abi:bf,args:[n,s,c],bytecode:uv}),...a},{data:d}=await te(e,Lr,"call")(u).catch(p=>{throw p instanceof hd?new or:p});if(Ag(d??"0x0"))return!0;throw new or}async function yx(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:i}=t;if((await te(e,jt,"readContract")({address:n,abi:mf,args:[s,i],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(a=>{throw a instanceof md?new or:a})).startsWith("0x1626ba7e"))return!0;throw new or}class or extends Error{}async function vx(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...i}){const l=jf(n);return te(e,Xs,"verifyHash")({address:t,factory:r,factoryData:o,hash:l,signature:s,...i})}async function wx(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:i,primaryType:l,types:a,domain:c,...u}=t,d=Nw({message:i,primaryType:l,types:a,domain:c});return te(e,Xs,"verifyHash")({address:n,factory:r,factoryData:o,hash:d,signature:s,...u})}function O0(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:o,poll:s,pollingInterval:i=e.pollingInterval}){const l=typeof s<"u"?s:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let a;return l?(()=>{const d=Be(["watchBlockNumber",e.uid,t,n,i]);return Ln(d,{onBlockNumber:r,onError:o},p=>_o(async()=>{var f;try{const h=await te(e,Vo,"getBlockNumber")({cacheTime:0});if(a!==void 0){if(h===a)return;if(h-a>1&&n)for(let m=a+1n;m<h;m++)p.onBlockNumber(m,a),a=m}(a===void 0||h>a)&&(p.onBlockNumber(h,a),a=h)}catch(h){(f=p.onError)==null||f.call(p,h)}},{emitOnBegin:t,interval:i}))})():(()=>{const d=Be(["watchBlockNumber",e.uid,t,n]);return Ln(d,{onBlockNumber:r,onError:o},p=>{let f=!0,h=()=>f=!1;return(async()=>{try{const m=(()=>{if(e.transport.type==="fallback"){const T=e.transport.transports.find(w=>w.config.type==="webSocket"||w.config.type==="ipc");return T?T.value:e.transport}return e.transport})(),{unsubscribe:x}=await m.subscribe({params:["newHeads"],onData(T){var P;if(!f)return;const w=Gt((P=T.result)==null?void 0:P.number);p.onBlockNumber(w,a),a=w},onError(T){var w;(w=p.onError)==null||w.call(p,T)}});h=x,f||h()}catch(m){o==null||o(m)}})(),()=>h()})})()}async function xx(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:i=6,retryDelay:l=({count:k})=>~~(1<<k)*200,timeout:a=18e4}=t,c=Be(["waitForTransactionReceipt",e.uid,o]),u=(()=>{var k;return t.pollingInterval?t.pollingInterval:(k=e.chain)!=null&&k.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let d,p,f,h=!1,m,x;const{promise:T,resolve:w,reject:P}=wf(),A=a?setTimeout(()=>{x==null||x(),m==null||m(),P(new U1({hash:o}))},a):void 0;return m=Ln(c,{onReplaced:s,resolve:w,reject:P},async k=>{if(f=await te(e,Ks,"getTransactionReceipt")({hash:o}).catch(()=>{}),f&&r<=1){clearTimeout(A),k.resolve(f),m==null||m();return}x=te(e,O0,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(B){const F=v=>{clearTimeout(A),x==null||x(),v(),m==null||m()};let b=B;if(!h)try{if(f){if(r>1&&(!f.blockNumber||b-f.blockNumber+1n<r))return;F(()=>k.resolve(f));return}if(n&&!d&&(h=!0,await Ka(async()=>{d=await te(e,Al,"getTransaction")({hash:o}),d.blockNumber&&(b=d.blockNumber)},{delay:l,retryCount:i}),h=!1),f=await te(e,Ks,"getTransactionReceipt")({hash:o}),r>1&&(!f.blockNumber||b-f.blockNumber+1n<r))return;F(()=>k.resolve(f))}catch(v){if(v instanceof fd||v instanceof pd){if(!d){h=!1;return}try{p=d,h=!0;const E=await Ka(()=>te(e,Bt,"getBlock")({blockNumber:b,includeTransactions:!0}),{delay:l,retryCount:i,shouldRetry:({error:C})=>C instanceof Td});h=!1;const I=E.transactions.find(({from:C,nonce:D})=>C===p.from&&D===p.nonce);if(!I||(f=await te(e,Ks,"getTransactionReceipt")({hash:I.hash}),r>1&&(!f.blockNumber||b-f.blockNumber+1n<r)))return;let $="replaced";I.to===p.to&&I.value===p.value&&I.input===p.input?$="repriced":I.from===I.to&&I.value===0n&&($="cancelled"),F(()=>{var C;(C=k.onReplaced)==null||C.call(k,{reason:$,replacedTransaction:p,transaction:I,transactionReceipt:f}),k.resolve(f)})}catch(E){F(()=>k.reject(E))}}else F(()=>k.reject(v))}}})}),T}function Ex(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:o,onError:s,includeTransactions:i,poll:l,pollingInterval:a=e.pollingInterval}){const c=typeof l<"u"?l:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),u=i??!1;let d;return c?(()=>{const h=Be(["watchBlocks",e.uid,t,n,r,u,a]);return Ln(h,{onBlock:o,onError:s},m=>_o(async()=>{var x;try{const T=await te(e,Bt,"getBlock")({blockTag:t,includeTransactions:u});if(T.number!==null&&(d==null?void 0:d.number)!=null){if(T.number===d.number)return;if(T.number-d.number>1&&n)for(let w=(d==null?void 0:d.number)+1n;w<T.number;w++){const P=await te(e,Bt,"getBlock")({blockNumber:w,includeTransactions:u});m.onBlock(P,d),d=P}}((d==null?void 0:d.number)==null||t==="pending"&&(T==null?void 0:T.number)==null||T.number!==null&&T.number>d.number)&&(m.onBlock(T,d),d=T)}catch(T){(x=m.onError)==null||x.call(m,T)}},{emitOnBegin:r,interval:a}))})():(()=>{let h=!0,m=!0,x=()=>h=!1;return(async()=>{try{r&&te(e,Bt,"getBlock")({blockTag:t,includeTransactions:u}).then(P=>{h&&m&&(o(P,void 0),m=!1)}).catch(s);const T=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(A=>A.config.type==="webSocket"||A.config.type==="ipc");return P?P.value:e.transport}return e.transport})(),{unsubscribe:w}=await T.subscribe({params:["newHeads"],async onData(P){var k;if(!h)return;const A=await te(e,Bt,"getBlock")({blockNumber:(k=P.result)==null?void 0:k.number,includeTransactions:u}).catch(()=>{});h&&(o(A,d),m=!1,d=A)},onError(P){s==null||s(P)}});x=w,h||x()}catch(T){s==null||s(T)}})(),()=>x()})()}function Sx(e,{address:t,args:n,batch:r=!0,event:o,events:s,fromBlock:i,onError:l,onLogs:a,poll:c,pollingInterval:u=e.pollingInterval,strict:d}){const p=typeof c<"u"?c:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),f=d??!1;return p?(()=>{const x=Be(["watchEvent",t,n,r,e.uid,o,u,i]);return Ln(x,{onLogs:a,onError:l},T=>{let w;i!==void 0&&(w=i-1n);let P,A=!1;const k=_o(async()=>{var B;if(!A){try{P=await te(e,kf,"createEventFilter")({address:t,args:n,event:o,events:s,strict:f,fromBlock:i})}catch{}A=!0;return}try{let F;if(P)F=await te(e,Us,"getFilterChanges")({filter:P});else{const b=await te(e,Vo,"getBlockNumber")({});w&&w!==b?F=await te(e,Ia,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:w+1n,toBlock:b}):F=[],w=b}if(F.length===0)return;if(r)T.onLogs(F);else for(const b of F)T.onLogs([b])}catch(F){P&&F instanceof In&&(A=!1),(B=T.onError)==null||B.call(T,F)}},{emitOnBegin:!0,interval:u});return async()=>{P&&await te(e,Ws,"uninstallFilter")({filter:P}),k()}})})():(()=>{let x=!0,T=()=>x=!1;return(async()=>{try{const w=(()=>{if(e.transport.type==="fallback"){const B=e.transport.transports.find(F=>F.config.type==="webSocket"||F.config.type==="ipc");return B?B.value:e.transport}return e.transport})(),P=s??(o?[o]:void 0);let A=[];P&&(A=[P.flatMap(F=>lo({abi:[F],eventName:F.name,args:n}))],o&&(A=A[0]));const{unsubscribe:k}=await w.subscribe({params:["logs",{address:t,topics:A}],onData(B){var b;if(!x)return;const F=B.result;try{const{eventName:v,args:E}=ks({abi:P??[],data:F.data,topics:F.topics,strict:f}),I=Zt(F,{args:E,eventName:v});a([I])}catch(v){let E,I;if(v instanceof Es||v instanceof Yi){if(d)return;E=v.abiItem.name,I=(b=v.abiItem.inputs)==null?void 0:b.some(C=>!("name"in C&&C.name))}const $=Zt(F,{args:I?[]:{},eventName:E});a([$])}},onError(B){l==null||l(B)}});T=k,x||T()}catch(w){l==null||l(w)}})(),()=>T()})()}function Px(e,{batch:t=!0,onError:n,onTransactions:r,poll:o,pollingInterval:s=e.pollingInterval}){return(typeof o<"u"?o:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const c=Be(["watchPendingTransactions",e.uid,t,s]);return Ln(c,{onTransactions:r,onError:n},u=>{let d;const p=_o(async()=>{var f;try{if(!d)try{d=await te(e,Lf,"createPendingTransactionFilter")({});return}catch(m){throw p(),m}const h=await te(e,Us,"getFilterChanges")({filter:d});if(h.length===0)return;if(t)u.onTransactions(h);else for(const m of h)u.onTransactions([m])}catch(h){(f=u.onError)==null||f.call(u,h)}},{emitOnBegin:!0,interval:s});return async()=>{d&&await te(e,Ws,"uninstallFilter")({filter:d}),p()}})})():(()=>{let c=!0,u=()=>c=!1;return(async()=>{try{const{unsubscribe:d}=await e.transport.subscribe({params:["newPendingTransactions"],onData(p){if(!c)return;const f=p.result;r([f])},onError(p){n==null||n(p)}});u=d,c||u()}catch(d){n==null||n(d)}})(),()=>u()})()}function Tx(e){var d,p,f;const{scheme:t,statement:n,...r}=((d=e.match(Ax))==null?void 0:d.groups)??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:l,requestId:a,...c}=((p=e.match(Nx))==null?void 0:p.groups)??{},u=(f=e.split("Resources:")[1])==null?void 0:f.split(`
|
|
91
|
-
- `).slice(1);return{...r,...c,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...i?{issuedAt:new Date(i)}:{},...l?{notBefore:new Date(l)}:{},...a?{requestId:a}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const
|
|
86
|
+
`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(ga,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class ya extends G{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(ya,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class va extends G{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(va,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class wa extends G{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(wa,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Ms extends G{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Xe(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${Xe(r)} gwei`:""}).`].join(`
|
|
87
|
+
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Ms,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Lo extends G{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function Is(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof G?e.walk(o=>(o==null?void 0:o.code)===Cr.code):e;return r instanceof G?new Cr({cause:e,message:r.details}):Cr.nodeMessage.test(n)?new Cr({cause:e,message:e.details}):$s.nodeMessage.test(n)?new $s({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):pa.nodeMessage.test(n)?new pa({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):ha.nodeMessage.test(n)?new ha({cause:e,nonce:t==null?void 0:t.nonce}):ma.nodeMessage.test(n)?new ma({cause:e,nonce:t==null?void 0:t.nonce}):ba.nodeMessage.test(n)?new ba({cause:e,nonce:t==null?void 0:t.nonce}):ga.nodeMessage.test(n)?new ga({cause:e}):ya.nodeMessage.test(n)?new ya({cause:e,gas:t==null?void 0:t.gas}):va.nodeMessage.test(n)?new va({cause:e,gas:t==null?void 0:t.gas}):wa.nodeMessage.test(n)?new wa({cause:e}):Ms.nodeMessage.test(n)?new Ms({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new Lo({cause:e})}function ny(e,{docsPath:t,...n}){const r=(()=>{const o=Is(e,n);return o instanceof Lo?e:o})();return new ty(r,{docsPath:t,...n})}function Ds(e,{format:t}){if(!t)return{};const n={};function r(s){const i=Object.keys(s);for(const l of i)l in e&&(n[l]=e[l]),s[l]&&typeof s[l]=="object"&&!Array.isArray(s[l])&&r(s[l])}const o=t(e||{});return r(o),n}const ry={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Bo(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=oy(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>Le(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=ne(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=ne(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=ne(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=ne(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=ne(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=ne(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=ry[e.type]),typeof e.value<"u"&&(n.value=ne(e.value)),n}function oy(e){return e.map(t=>({address:t.address,r:t.r?ne(BigInt(t.r)):t.r,s:t.s?ne(BigInt(t.s)):t.s,chainId:ne(t.chainId),nonce:ne(t.nonce),...typeof t.yParity<"u"?{yParity:ne(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:ne(t.v)}:{}}))}function Ed(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new Lu({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new Lu({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function sy(e){const{balance:t,nonce:n,state:r,stateDiff:o,code:s}=e,i={};if(s!==void 0&&(i.code=s),t!==void 0&&(i.balance=ne(t)),n!==void 0&&(i.nonce=ne(n)),r!==void 0&&(i.state=Ed(r)),o!==void 0){if(i.state)throw new F1;i.stateDiff=Ed(o)}return i}function xa(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!yt(n,{strict:!1}))throw new On({address:n});if(t[n])throw new B1({address:n});t[n]=sy(r)}return t}const Sd=2n**256n-1n;function Or(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:o}=e,s=t?dt(t):void 0;if(s&&!yt(s.address))throw new On({address:s.address});if(o&&!yt(o))throw new On({address:o});if(n&&n>Sd)throw new $s({maxFeePerGas:n});if(r&&n&&r>n)throw new Ms({maxFeePerGas:n,maxPriorityFeePerGas:r})}class Pd extends G{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Ea extends G{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class iy extends G{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Xe(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class Td extends G{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const Ad={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Sa(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?ln(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?ln(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?Ad[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=ay(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}function ay(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Nd(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:Sa(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function Bt(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:o}={}){var c,u,d;const s=o??!1,i=n!==void 0?ne(n):void 0;let l=null;if(t?l=await e.request({method:"eth_getBlockByHash",params:[t,s]},{dedupe:!0}):l=await e.request({method:"eth_getBlockByNumber",params:[i||r,s]},{dedupe:!!i}),!l)throw new Td({blockHash:t,blockNumber:n});return(((d=(u=(c=e.chain)==null?void 0:c.formatters)==null?void 0:u.block)==null?void 0:d.format)||Nd)(l,"getBlock")}async function Pa(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function ly(e,t){return Cd(e,t)}async function Cd(e,t){var s,i;const{block:n,chain:r=e.chain,request:o}=t||{};try{const l=((s=r==null?void 0:r.fees)==null?void 0:s.maxPriorityFeePerGas)??((i=r==null?void 0:r.fees)==null?void 0:i.defaultPriorityFee);if(typeof l=="function"){const c=n||await te(e,Bt,"getBlock")({}),u=await l({block:c,client:e,request:o});if(u===null)throw new Error;return u}if(typeof l<"u")return l;const a=await e.request({method:"eth_maxPriorityFeePerGas"});return Gt(a)}catch{const[l,a]=await Promise.all([n?Promise.resolve(n):te(e,Bt,"getBlock")({}),te(e,Pa,"getGasPrice")({})]);if(typeof l.baseFeePerGas!="bigint")throw new Ea;const c=a-l.baseFeePerGas;return c<0n?0n:c}}async function cy(e,t){return Ta(e,t)}async function Ta(e,t){var p,f;const{block:n,chain:r=e.chain,request:o,type:s="eip1559"}=t||{},i=await(async()=>{var h,m;return typeof((h=r==null?void 0:r.fees)==null?void 0:h.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:o}):((m=r==null?void 0:r.fees)==null?void 0:m.baseFeeMultiplier)??1.2})();if(i<1)throw new Pd;const a=10**(((p=i.toString().split(".")[1])==null?void 0:p.length)??0),c=h=>h*BigInt(Math.ceil(i*a))/BigInt(a),u=n||await te(e,Bt,"getBlock")({});if(typeof((f=r==null?void 0:r.fees)==null?void 0:f.estimateFeesPerGas)=="function"){const h=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:c,request:o,type:s});if(h!==null)return h}if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new Ea;const h=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await Cd(e,{block:u,chain:r,request:o}),m=c(u.baseFeePerGas);return{maxFeePerGas:(o==null?void 0:o.maxFeePerGas)??m+h,maxPriorityFeePerGas:h}}return{gasPrice:(o==null?void 0:o.gasPrice)??c(await te(e,Pa,"getGasPrice")({}))}}async function Od(e,{address:t,blockTag:n="latest",blockNumber:r}){const o=await e.request({method:"eth_getTransactionCount",params:[t,typeof r=="bigint"?ne(r):n]},{dedupe:!!r});return ln(o)}function $d(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(s=>qt(s)):e.blobs,o=[];for(const s of r)o.push(Uint8Array.from(t.blobToKzgCommitment(s)));return n==="bytes"?o:o.map(s=>Le(s))}function Md(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(i=>qt(i)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(i=>qt(i)):e.commitments,s=[];for(let i=0;i<r.length;i++){const l=r[i],a=o[i];s.push(Uint8Array.from(t.computeBlobKzgProof(l,a)))}return n==="bytes"?s:s.map(i=>Le(i))}function uy(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const o=BigInt(32),s=BigInt(4294967295),i=Number(n>>o&s),l=Number(n&s),a=r?4:0,c=r?0:4;e.setUint32(t+a,i,r),e.setUint32(t+c,l,r)}function dy(e,t,n){return e&t^~e&n}function fy(e,t,n){return e&t^e&n^t&n}class py extends Qi{constructor(t,n,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=Ji(this.buffer)}update(t){xr(this),t=Ps(t),Kn(t);const{view:n,buffer:r,blockLen:o}=this,s=t.length;for(let i=0;i<s;){const l=Math.min(o-this.pos,s-i);if(l===o){const a=Ji(t);for(;o<=s-i;i+=o)this.process(a,i);continue}r.set(t.subarray(i,i+l),this.pos),this.pos+=l,i+=l,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){xr(this),ju(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:o,isLE:s}=this;let{pos:i}=this;n[i++]=128,Er(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(r,0),i=0);for(let d=i;d<o;d++)n[d]=0;uy(r,o-8,BigInt(this.length*8),s),this.process(r,0);const l=Ji(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<c;d++)l.setUint32(4*d,u[d],s)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:o,finished:s,destroyed:i,pos:l}=this;return t.destroyed=i,t.finished=s,t.length=o,t.pos=l,o%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const In=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),hy=Uint32Array.from([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]),Dn=new Uint32Array(64);class my extends py{constructor(t=32){super(64,t,8,!1),this.A=In[0]|0,this.B=In[1]|0,this.C=In[2]|0,this.D=In[3]|0,this.E=In[4]|0,this.F=In[5]|0,this.G=In[6]|0,this.H=In[7]|0}get(){const{A:t,B:n,C:r,D:o,E:s,F:i,G:l,H:a}=this;return[t,n,r,o,s,i,l,a]}set(t,n,r,o,s,i,l,a){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=l|0,this.H=a|0}process(t,n){for(let d=0;d<16;d++,n+=4)Dn[d]=t.getUint32(n,!1);for(let d=16;d<64;d++){const p=Dn[d-15],f=Dn[d-2],h=Kt(p,7)^Kt(p,18)^p>>>3,m=Kt(f,17)^Kt(f,19)^f>>>10;Dn[d]=m+Dn[d-7]+h+Dn[d-16]|0}let{A:r,B:o,C:s,D:i,E:l,F:a,G:c,H:u}=this;for(let d=0;d<64;d++){const p=Kt(l,6)^Kt(l,11)^Kt(l,25),f=u+p+dy(l,a,c)+hy[d]+Dn[d]|0,m=(Kt(r,2)^Kt(r,13)^Kt(r,22))+fy(r,o,s)|0;u=c,c=a,a=l,l=i+f|0,i=s,s=o,o=r,r=f+m|0}r=r+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,l=l+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,o,s,i,l,a,c,u)}roundClean(){Er(Dn)}destroy(){this.set(0,0,0,0,0,0,0,0),Er(this.buffer)}}const Id=Uu(()=>new my),by=Id;function gy(e,t){return by(Dt(e,{strict:!1})?vr(e):e)}function yy(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),o=gy(t);return o.set([n],0),r==="bytes"?o:Le(o)}function vy(e){const{commitments:t,version:n}=e,r=e.to,o=[];for(const s of t)o.push(yy({commitment:s,to:r,version:n}));return o}const Dd=6,kd=32,Aa=4096,Ld=kd*Aa,Bd=Ld*Dd-1-1*Aa*Dd;class wy extends G{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class xy extends G{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function Ey(e){const t=typeof e.data=="string"?qt(e.data):e.data,n=Te(t);if(!n)throw new xy;if(n>Bd)throw new wy({maxSize:Bd,size:n});const r=[];let o=!0,s=0;for(;o;){const i=aa(new Uint8Array(Ld));let l=0;for(;l<Aa;){const a=t.slice(s,s+(kd-1));if(i.pushByte(0),i.pushBytes(a),a.length<31){i.pushByte(128),o=!1;break}l++,s+=31}r.push(i)}return r.map(i=>Le(i.bytes))}function Sy(e){const{data:t,kzg:n,to:r}=e,o=e.blobs??Ey({data:t}),s=e.commitments??$d({blobs:o,kzg:n,to:r}),i=e.proofs??Md({blobs:o,commitments:s,kzg:n,to:r}),l=[];for(let a=0;a<o.length;a++)l.push({blob:o[a],commitment:s[a],proof:i[a]});return l}function Py(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new j1({transaction:e})}function Ty(e,{docsPath:t,...n}){const r=(()=>{const o=Is(e,n);return o instanceof Lo?e:o})();return new z1(r,{docsPath:t,...n})}async function Na(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return ln(t)}async function Fd(e,t){var b,v,E,M,$;const{account:n=e.account,accessList:r,authorizationList:o,chain:s=e.chain,blobVersionedHashes:i,blobs:l,data:a,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:f,nonce:h,nonceManager:m,to:x,type:T,value:w,...P}=t,A=await(async()=>{if(!n||!m||typeof h<"u")return h;const C=dt(n),D=s?s.id:await te(e,Na,"getChainId")({});return await m.consume({address:C.address,chainId:D,client:e})})();Or(t);const k=(v=(b=s==null?void 0:s.formatters)==null?void 0:b.transactionRequest)==null?void 0:v.format,F=(k||Bo)({...Ds(P,{format:k}),account:n?dt(n):void 0,accessList:r,authorizationList:o,blobs:l,blobVersionedHashes:i,data:a,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:f,nonce:A,to:x,type:T,value:w},"fillTransaction");try{const C=await e.request({method:"eth_fillTransaction",params:[F]}),y=(((M=(E=s==null?void 0:s.formatters)==null?void 0:E.transaction)==null?void 0:M.format)||Sa)(C.tx);delete y.blockHash,delete y.blockNumber,delete y.r,delete y.s,delete y.transactionIndex,delete y.v,delete y.yParity,y.data=y.input,y.gas&&(y.gas=t.gas??y.gas),y.gasPrice&&(y.gasPrice=t.gasPrice??y.gasPrice),y.maxFeePerBlobGas&&(y.maxFeePerBlobGas=t.maxFeePerBlobGas??y.maxFeePerBlobGas),y.maxFeePerGas&&(y.maxFeePerGas=t.maxFeePerGas??y.maxFeePerGas),y.maxPriorityFeePerGas&&(y.maxPriorityFeePerGas=t.maxPriorityFeePerGas??y.maxPriorityFeePerGas),y.nonce&&(y.nonce=t.nonce??y.nonce);const O=await(async()=>{var j,z;if(typeof((j=s==null?void 0:s.fees)==null?void 0:j.baseFeeMultiplier)=="function"){const W=await te(e,Bt,"getBlock")({});return s.fees.baseFeeMultiplier({block:W,client:e,request:t})}return((z=s==null?void 0:s.fees)==null?void 0:z.baseFeeMultiplier)??1.2})();if(O<1)throw new Pd;const S=10**((($=O.toString().split(".")[1])==null?void 0:$.length)??0),L=j=>j*BigInt(Math.ceil(O*S))/BigInt(S);return y.maxFeePerGas&&!t.maxFeePerGas&&(y.maxFeePerGas=L(y.maxFeePerGas)),y.gasPrice&&!t.gasPrice&&(y.gasPrice=L(y.gasPrice)),{raw:C.raw,transaction:{from:F.from,...y}}}catch(C){throw Ty(C,{...t,chain:e.chain})}}const Ay=["blobVersionedHashes","chainId","fees","gas","nonce","type"],Rd=new Map,Ca=new As(128);async function jd(e,t){var A,k,B;let n=t;n.account??(n.account=e.account),n.parameters??(n.parameters=Ay);const{account:r,chain:o=e.chain,nonceManager:s,parameters:i}=n,l=(()=>{if(typeof(o==null?void 0:o.prepareTransactionRequest)=="function")return{fn:o.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(o==null?void 0:o.prepareTransactionRequest))return{fn:o.prepareTransactionRequest[0],runAt:o.prepareTransactionRequest[1].runAt}})();let a;async function c(){return a||(typeof n.chainId<"u"?n.chainId:o?o.id:(a=await te(e,Na,"getChainId")({}),a))}const u=r&&dt(r);let d=n.nonce;if(i.includes("nonce")&&typeof d>"u"&&u&&s){const F=await c();d=await s.consume({address:u.address,chainId:F,client:e})}l!=null&&l.fn&&((A=l.runAt)!=null&&A.includes("beforeFillTransaction"))&&(n=await l.fn({...n,chain:o},{phase:"beforeFillTransaction"}),d??(d=n.nonce));const f=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&n.kzg&&n.blobs||Ca.get(e.uid)===!1||!["fees","gas"].some(b=>i.includes(b))?!1:!!(i.includes("chainId")&&typeof n.chainId!="number"||i.includes("nonce")&&typeof d!="number"||i.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||i.includes("gas")&&typeof n.gas!="bigint"))?await te(e,Fd,"fillTransaction")({...n,nonce:d}).then(F=>{const{chainId:b,from:v,gas:E,gasPrice:M,nonce:$,maxFeePerBlobGas:C,maxFeePerGas:D,maxPriorityFeePerGas:y,type:O,...I}=F.transaction;return Ca.set(e.uid,!0),{...n,...v?{from:v}:{},...O&&!n.type?{type:O}:{},...typeof b<"u"?{chainId:b}:{},...typeof E<"u"?{gas:E}:{},...typeof M<"u"?{gasPrice:M}:{},...typeof $<"u"?{nonce:$}:{},...typeof C<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerBlobGas:C}:{},...typeof D<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerGas:D}:{},...typeof y<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxPriorityFeePerGas:y}:{},..."nonceKey"in I&&typeof I.nonceKey<"u"?{nonceKey:I.nonceKey}:{}}}).catch(F=>{var E;const b=F;return b.name!=="TransactionExecutionError"||((E=b.walk)==null?void 0:E.call(b,M=>{const $=M;return $.name==="MethodNotFoundRpcError"||$.name==="MethodNotSupportedRpcError"}))&&Ca.set(e.uid,!1),n}):n;d??(d=f.nonce),n={...f,...u?{from:u==null?void 0:u.address}:{},...d?{nonce:d}:{}};const{blobs:h,gas:m,kzg:x,type:T}=n;l!=null&&l.fn&&((k=l.runAt)!=null&&k.includes("beforeFillParameters"))&&(n=await l.fn({...n,chain:o},{phase:"beforeFillParameters"}));let w;async function P(){return w||(w=await te(e,Bt,"getBlock")({blockTag:"latest"}),w)}if(i.includes("nonce")&&typeof d>"u"&&u&&!s&&(n.nonce=await te(e,Od,"getTransactionCount")({address:u.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&h&&x){const F=$d({blobs:h,kzg:x});if(i.includes("blobVersionedHashes")){const b=vy({commitments:F,to:"hex"});n.blobVersionedHashes=b}if(i.includes("sidecars")){const b=Md({blobs:h,commitments:F,kzg:x}),v=Sy({blobs:h,commitments:F,proofs:b,to:"hex"});n.sidecars=v}}if(i.includes("chainId")&&(n.chainId=await c()),(i.includes("fees")||i.includes("type"))&&typeof T>"u")try{n.type=Py(n)}catch{let F=Rd.get(e.uid);if(typeof F>"u"){const b=await P();F=typeof(b==null?void 0:b.baseFeePerGas)=="bigint",Rd.set(e.uid,F)}n.type=F?"eip1559":"legacy"}if(i.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const F=await P(),{maxFeePerGas:b,maxPriorityFeePerGas:v}=await Ta(e,{block:F,chain:o,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<v)throw new iy({maxPriorityFeePerGas:v});n.maxPriorityFeePerGas=v,n.maxFeePerGas=b}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new Ea;if(typeof n.gasPrice>"u"){const F=await P(),{gasPrice:b}=await Ta(e,{block:F,chain:o,request:n,type:"legacy"});n.gasPrice=b}}return i.includes("gas")&&typeof m>"u"&&(n.gas=await te(e,Oa,"estimateGas")({...n,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),l!=null&&l.fn&&((B=l.runAt)!=null&&B.includes("afterFillParameters"))&&(n=await l.fn({...n,chain:o},{phase:"afterFillParameters"})),Or(n),delete n.parameters,n}async function Oa(e,t){var i,l,a;const{account:n=e.account,prepare:r=!0}=t,o=n?dt(n):void 0,s=(()=>{if(Array.isArray(r))return r;if((o==null?void 0:o.type)!=="local")return["blobVersionedHashes"]})();try{const c=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await xd({authorization:t.authorizationList[0]}).catch(()=>{throw new G("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:u,authorizationList:d,blobs:p,blobVersionedHashes:f,blockNumber:h,blockTag:m,data:x,gas:T,gasPrice:w,maxFeePerBlobGas:P,maxFeePerGas:A,maxPriorityFeePerGas:k,nonce:B,value:F,stateOverride:b,...v}=r?await jd(e,{...t,parameters:s,to:c}):t;if(T&&t.gas!==T)return T;const M=(typeof h=="bigint"?ne(h):void 0)||m,$=xa(b);Or(t);const C=(a=(l=(i=e.chain)==null?void 0:i.formatters)==null?void 0:l.transactionRequest)==null?void 0:a.format,y=(C||Bo)({...Ds(v,{format:C}),account:o,accessList:u,authorizationList:d,blobs:p,blobVersionedHashes:f,data:x,gasPrice:w,maxFeePerBlobGas:P,maxFeePerGas:A,maxPriorityFeePerGas:k,nonce:B,to:c,value:F},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:$?[y,M??e.experimental_blockTag??"latest",$]:M?[y,M]:[y]}))}catch(c){throw ny(c,{...t,account:o,chain:e.chain})}}async function Ny(e,t){var c;const{abi:n,address:r,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:(c=e.dataSuffix)==null?void 0:c.value,...l}=t,a=vt({abi:n,args:o,functionName:s});try{return await te(e,Oa,"estimateGas")({data:`${a}${i?i.replace("0x",""):""}`,to:r,...l})}catch(u){const d=l.account?dt(l.account):void 0;throw Nr(u,{abi:n,address:r,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:d==null?void 0:d.address})}}function Fo(e,t){if(!yt(e,{strict:!1}))throw new On({address:e});if(!yt(t,{strict:!1}))throw new On({address:t});return e.toLowerCase()===t.toLowerCase()}function Zt(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const zd="/docs/contract/decodeEventLog";function ks(e){const{abi:t,data:n,strict:r,topics:o}=e,s=r??!0,[i,...l]=o;if(!i)throw new hg({docsPath:zd});const a=t.find(T=>T.type==="event"&&i===Ts(It(T)));if(!(a&&"name"in a)||a.type!=="event")throw new mg(i,{docsPath:zd});const{name:c,inputs:u}=a,d=u==null?void 0:u.some(T=>!("name"in T&&T.name)),p=d?[]:{},f=u.map((T,w)=>[T,w]).filter(([T])=>"indexed"in T&&T.indexed),h=[];for(let T=0;T<f.length;T++){const[w,P]=f[T],A=l[T];if(!A){if(s)throw new Yi({abiItem:a,param:w});h.push([w,P]);continue}p[d?P:w.name||P]=Cy({param:w,value:A})}const m=u.filter(T=>!("indexed"in T&&T.indexed)),x=s?m:[...h.map(([T])=>T),...m];if(x.length>0){if(n&&n!=="0x")try{const T=co(x,n);if(T){let w=0;if(!s)for(const[P,A]of h)p[d?A:P.name||A]=T[w++];if(d)for(let P=0;P<u.length;P++)p[P]===void 0&&w<T.length&&(p[P]=T[w++]);else for(let P=0;P<m.length;P++)p[m[P].name]=T[w++]}}catch(T){if(s)throw T instanceof Nu||T instanceof ad?new Es({abiItem:a,data:n,params:x,size:Te(n)}):T}else if(s)throw new Es({abiItem:a,data:"0x",params:x,size:0})}return{eventName:c,args:Object.values(p).length>0?p:void 0}}function Cy({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(co([e],t)||[])[0]}function $a(e){const{abi:t,args:n,logs:r,strict:o=!0}=e,s=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),i=t.filter(l=>l.type==="event").map(l=>({abi:l,selector:Ts(l)}));return r.map(l=>{var p;const a=typeof l.blockNumber=="string"?Zt(l):l,c=i.filter(f=>a.topics[0]===f.selector);if(c.length===0)return null;let u,d;for(const f of c)try{u=ks({...a,abi:[f.abi],strict:!0}),d=f;break}catch{}if(!u&&!o){d=c[0];try{u=ks({data:a.data,topics:a.topics,abi:[d.abi],strict:!1})}catch{const f=(p=d.abi.inputs)==null?void 0:p.some(h=>!("name"in h&&h.name));return{...a,args:f?[]:{},eventName:d.abi.name}}}return!u||!d||s&&!s.includes(u.eventName)||!Oy({args:u.args,inputs:d.abi.inputs,matchArgs:n})?null:{...u,...a}}).filter(Boolean)}function Oy(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function o(s,i,l){try{return s.type==="address"?Fo(i,l):s.type==="string"||s.type==="bytes"?ze(vr(i))===l:i===l}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((s,i)=>{if(s==null)return!0;const l=n[i];return l?(Array.isArray(s)?s:[s]).some(c=>o(l,c,t[i])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([s,i])=>{if(i==null)return!0;const l=n.find(c=>c.name===s);return l?(Array.isArray(i)?i:[i]).some(c=>o(l,c,t[s])):!1}):!1}async function Ma(e,{address:t,blockHash:n,fromBlock:r,toBlock:o,event:s,events:i,args:l,strict:a}={}){const c=a??!1,u=i??(s?[s]:void 0);let d=[];u&&(d=[u.flatMap(m=>lo({abi:[m],eventName:m.name,args:i?void 0:l}))],s&&(d=d[0]));let p;n?p=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:n}]}):p=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:typeof r=="bigint"?ne(r):r,toBlock:typeof o=="bigint"?ne(o):o}]});const f=p.map(h=>Zt(h));return u?$a({abi:u,args:l,logs:f,strict:c}):f}async function Ud(e,t){const{abi:n,address:r,args:o,blockHash:s,eventName:i,fromBlock:l,toBlock:a,strict:c}=t,u=i?Yn({abi:n,name:i}):void 0,d=u?void 0:n.filter(p=>p.type==="event");return te(e,Ma,"getLogs")({address:r,args:o,blockHash:s,event:u,events:d,fromBlock:l,toBlock:a,strict:c})}const Ia="/docs/contract/decodeFunctionResult";function kn(e){const{abi:t,args:n,functionName:r,data:o}=e;let s=t[0];if(r){const l=Yn({abi:t,args:n,name:r});if(!l)throw new gr(r,{docsPath:Ia});s=l}if(s.type!=="function")throw new gr(void 0,{docsPath:Ia});if(!s.outputs)throw new Mu(s.name,{docsPath:Ia});const i=co(s.outputs,o);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Da=BigInt(0),ka=BigInt(1);function Ro(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function La(e){if(!Ro(e))throw new Error("Uint8Array expected")}function jo(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Ls(e){const t=e.toString(16);return t.length&1?"0"+t:t}function Wd(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Da:BigInt("0x"+e)}const _d=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",$y=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function zo(e){if(La(e),_d)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=$y[e[n]];return t}const fn={_0:48,_9:57,A:65,F:70,a:97,f:102};function Vd(e){if(e>=fn._0&&e<=fn._9)return e-fn._0;if(e>=fn.A&&e<=fn.F)return e-(fn.A-10);if(e>=fn.a&&e<=fn.f)return e-(fn.a-10)}function Bs(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(_d)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(n);for(let o=0,s=0;o<n;o++,s+=2){const i=Vd(e.charCodeAt(s)),l=Vd(e.charCodeAt(s+1));if(i===void 0||l===void 0){const a=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+a+'" at index '+s)}r[o]=i*16+l}return r}function er(e){return Wd(zo(e))}function Hd(e){return La(e),Wd(zo(Uint8Array.from(e).reverse()))}function Uo(e,t){return Bs(e.toString(16).padStart(t*2,"0"))}function Gd(e,t){return Uo(e,t).reverse()}function wt(e,t,n){let r;if(typeof t=="string")try{r=Bs(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(Ro(t))r=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=r.length;if(typeof n=="number"&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return r}function Fs(...e){let t=0;for(let r=0;r<e.length;r++){const o=e[r];La(o),t+=o.length}const n=new Uint8Array(t);for(let r=0,o=0;r<e.length;r++){const s=e[r];n.set(s,o),o+=s.length}return n}const Ba=e=>typeof e=="bigint"&&Da<=e;function Fa(e,t,n){return Ba(e)&&Ba(t)&&Ba(n)&&t<=e&&e<n}function $r(e,t,n,r){if(!Fa(t,n,r))throw new Error("expected valid "+e+": "+n+" <= n < "+r+", got "+t)}function My(e){let t;for(t=0;e>Da;e>>=ka,t+=1);return t}const Rs=e=>(ka<<BigInt(e))-ka,Ra=e=>new Uint8Array(e),qd=e=>Uint8Array.from(e);function Iy(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=Ra(e),o=Ra(e),s=0;const i=()=>{r.fill(1),o.fill(0),s=0},l=(...d)=>n(o,r,...d),a=(d=Ra(0))=>{o=l(qd([0]),d),r=l(),d.length!==0&&(o=l(qd([1]),d),r=l())},c=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const p=[];for(;d<t;){r=l();const f=r.slice();p.push(f),d+=r.length}return Fs(...p)};return(d,p)=>{i(),a(d);let f;for(;!(f=p(c()));)a();return i(),f}}const Dy={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"||Ro(e),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 js(e,t,n={}){const r=(o,s,i)=>{const l=Dy[s];if(typeof l!="function")throw new Error("invalid validator function");const a=e[o];if(!(i&&a===void 0)&&!l(a,e))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+a)};for(const[o,s]of Object.entries(t))r(o,s,!1);for(const[o,s]of Object.entries(n))r(o,s,!0);return e}function Kd(e){const t=new WeakMap;return(n,...r)=>{const o=t.get(n);if(o!==void 0)return o;const s=e(n,...r);return t.set(n,s),s}}const ky="0.1.1";function Ly(){return ky}class re extends Error{static setStaticOptions(t){re.prototype.docsOrigin=t.docsOrigin,re.prototype.showVersion=t.showVersion,re.prototype.version=t.version}constructor(t,n={}){const r=(()=>{var u;if(n.cause instanceof re){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:(u=n.cause)!=null&&u.message?n.cause.message:n.details})(),o=n.cause instanceof re&&n.cause.docsPath||n.docsPath,s=n.docsOrigin??re.prototype.docsOrigin,i=`${s}${o??""}`,l=!!(n.version??re.prototype.showVersion),a=n.version??re.prototype.version,c=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...r||o||l?["",r?`Details: ${r}`:void 0,o?`See: ${i}`:void 0,l?`Version: ${a}`:void 0]:[]].filter(u=>typeof u=="string").join(`
|
|
88
|
+
`);super(c,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=r,this.docs=i,this.docsOrigin=s,this.docsPath=o,this.shortMessage=t,this.showVersion=l,this.version=a}walk(t){return Zd(this,t)}}Object.defineProperty(re,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${Ly()}`}}),re.setStaticOptions(re.defaultStaticOptions);function Zd(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Zd(e.cause,t):t?null:e}function Wo(e,t){if(Mr(e)>t)throw new Jy({givenSize:Mr(e),maxSize:t})}const pn={zero:48,nine:57,A:65,F:70,a:97,f:102};function Yd(e){if(e>=pn.zero&&e<=pn.nine)return e-pn.zero;if(e>=pn.A&&e<=pn.F)return e-(pn.A-10);if(e>=pn.a&&e<=pn.f)return e-(pn.a-10)}function By(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new Qy({size:e.length,targetSize:r,type:"Bytes"});const o=new Uint8Array(r);for(let s=0;s<r;s++){const i=n==="right";o[i?s:r-s-1]=e[i?s:e.length-s-1]}return o}function Xd(e,t={}){const{dir:n="left"}=t;let r=e,o=0;for(let s=0;s<r.length-1&&r[n==="left"?s:r.length-s-1].toString()==="0";s++)o++;return r=n==="left"?r.slice(o):r.slice(0,r.length-o),r}function zs(e,t){if(ft(e)>t)throw new sv({givenSize:ft(e),maxSize:t})}function Fy(e,t){if(typeof t=="number"&&t>0&&t>ft(e)-1)throw new cf({offset:t,position:"start",size:ft(e)})}function Ry(e,t,n){if(typeof t=="number"&&typeof n=="number"&&ft(e)!==n-t)throw new cf({offset:n,position:"end",size:ft(e)})}function Jd(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const o=e.replace("0x","");if(o.length>r*2)throw new iv({size:Math.ceil(o.length/2),targetSize:r,type:"Hex"});return`0x${o[n==="right"?"padEnd":"padStart"](r*2,"0")}`}const jy="#__bigint";function Qd(e,t,n){return JSON.stringify(e,(r,o)=>typeof o=="bigint"?o.toString()+jy:o,n)}const zy=new TextDecoder,Uy=new TextEncoder;function Wy(e){return e instanceof Uint8Array?e:typeof e=="string"?ef(e):_y(e)}function _y(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function ef(e,t={}){const{size:n}=t;let r=e;n&&(zs(e,n),r=nr(e,n));let o=r.slice(2);o.length%2&&(o=`0${o}`);const s=o.length/2,i=new Uint8Array(s);for(let l=0,a=0;l<s;l++){const c=Yd(o.charCodeAt(a++)),u=Yd(o.charCodeAt(a++));if(c===void 0||u===void 0)throw new re(`Invalid byte sequence ("${o[a-2]}${o[a-1]}" in "${o}").`);i[l]=c<<4|u}return i}function Vy(e,t={}){const{size:n}=t,r=Uy.encode(e);return typeof n=="number"?(Wo(r,n),Hy(r,n)):r}function Hy(e,t){return By(e,{dir:"right",size:t})}function Mr(e){return e.length}function Gy(e,t,n,r={}){const{strict:o}=r;return e.slice(t,n)}function qy(e,t={}){const{size:n}=t;typeof n<"u"&&Wo(e,n);const r=Rt(e,t);return rf(r,t)}function Ky(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(Wo(r,n),r=tf(r)),r.length>1||r[0]>1)throw new Xy(r);return!!r[0]}function hn(e,t={}){const{size:n}=t;typeof n<"u"&&Wo(e,n);const r=Rt(e,t);return of(r,t)}function Zy(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(Wo(r,n),r=Yy(r)),zy.decode(r)}function tf(e){return Xd(e,{dir:"left"})}function Yy(e){return Xd(e,{dir:"right"})}class Xy extends re{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let Jy=class extends re{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},Qy=class extends re{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const ev=new TextEncoder,tv=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function nv(e,t={}){const{strict:n=!1}=t;if(!e)throw new af(e);if(typeof e!="string")throw new af(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new lf(e);if(!e.startsWith("0x"))throw new lf(e)}function Ft(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function rv(e){return e instanceof Uint8Array?Rt(e):Array.isArray(e)?Rt(new Uint8Array(e)):e}function nf(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(zs(n,t.size),tr(n,t.size)):n}function Rt(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=tv[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(zs(r,t.size),nr(r,t.size)):r}function Ve(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let s;r?n?s=(1n<<BigInt(r)*8n-1n)-1n:s=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const i=typeof s=="bigint"&&n?-s-1n:0;if(s&&o>s||o<i){const c=typeof e=="bigint"?"n":"";throw new sf({max:s?`${s}${c}`:void 0,min:`${i}${c}`,signed:n,size:r,value:`${e}${c}`})}const a=`0x${(n&&o<0?BigInt.asUintN(r*8,BigInt(o)):o).toString(16)}`;return r?tr(a,r):a}function ja(e,t={}){return Rt(ev.encode(e),t)}function tr(e,t){return Jd(e,{dir:"left",size:t})}function nr(e,t){return Jd(e,{dir:"right",size:t})}function Yt(e,t,n,r={}){const{strict:o}=r;Fy(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return o&&Ry(s,t,n),s}function ft(e){return Math.ceil((e.length-2)/2)}function rf(e,t={}){const{signed:n}=t;t.size&&zs(e,t.size);const r=BigInt(e);if(!n)return r;const o=(e.length-2)/2,s=(1n<<BigInt(o)*8n)-1n,i=s>>1n;return r<=i?r:r-s-1n}function of(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:rf(e,t))}function ov(e,t={}){const{strict:n=!1}=t;try{return nv(e,{strict:n}),!0}catch{return!1}}class sf extends re{constructor({max:t,min:n,signed:r,size:o,value:s}){super(`Number \`${s}\` is not in safe${o?` ${o*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class af extends re{constructor(t){super(`Value \`${typeof t=="object"?Qd(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class lf extends re{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class sv extends re{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class cf extends re{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class iv extends re{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function av(e){return{address:e.address,amount:Ve(e.amount),index:Ve(e.index),validatorIndex:Ve(e.validatorIndex)}}function uf(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Ve(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Ve(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Ve(e.gasLimit)},...typeof e.number=="bigint"&&{number:Ve(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Ve(e.prevRandao)},...typeof e.time=="bigint"&&{time:Ve(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(av)}}}const Ir=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],za=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],df=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],ff=[...df,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],lv=[...df,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],pf=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],hf=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],mf=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],bf=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],Dr=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],cv="0x82ad56cb",gf="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",uv="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",dv="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Ua="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class Wa extends G{constructor({blockNumber:t,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...t&&r.blockCreated&&r.blockCreated>t?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${r.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class yf extends G{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const _a="/docs/contract/encodeDeployData";function Va(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const o=t.find(i=>"type"in i&&i.type==="constructor");if(!o)throw new cg({docsPath:_a});if(!("inputs"in o))throw new Au({docsPath:_a});if(!o.inputs||o.inputs.length===0)throw new Au({docsPath:_a});const s=$n(o.inputs,n);return Sr([r,s])}function kr({blockNumber:e,chain:t,contract:n}){var o;const r=(o=t==null?void 0:t.contracts)==null?void 0:o[n];if(!r)throw new Wa({chain:t,contract:{name:n}});if(e&&r.blockCreated&&r.blockCreated>e)throw new Wa({blockNumber:e,chain:t,contract:{name:n,blockCreated:r.blockCreated}});return r.address}function vf(e,{docsPath:t,...n}){const r=(()=>{const o=Is(e,n);return o instanceof Lo?e:o})();return new hd(r,{docsPath:t,...n})}function wf(){let e=()=>{},t=()=>{};return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}const Ha=new Map;function xf({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:o}){const s=async()=>{const u=a();i();const d=u.map(({args:p})=>p);d.length!==0&&e(d).then(p=>{o&&Array.isArray(p)&&p.sort(o);for(let f=0;f<u.length;f++){const{resolve:h}=u[f];h==null||h([p[f],p])}}).catch(p=>{for(let f=0;f<u.length;f++){const{reject:h}=u[f];h==null||h(p)}})},i=()=>Ha.delete(t),l=()=>a().map(({args:u})=>u),a=()=>Ha.get(t)||[],c=u=>Ha.set(t,[...a(),u]);return{flush:i,async schedule(u){const{promise:d,resolve:p,reject:f}=wf();return(n==null?void 0:n([...l(),u]))&&s(),a().length>0?(c({args:u,resolve:p,reject:f}),d):(c({args:u,resolve:p,reject:f}),setTimeout(s,r),d)}}}async function Lr(e,t){var C,D,y,O;const{account:n=e.account,authorizationList:r,batch:o=!!((C=e.batch)!=null&&C.multicall),blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",accessList:l,blobs:a,blockOverrides:c,code:u,data:d,factory:p,factoryData:f,gas:h,gasPrice:m,maxFeePerBlobGas:x,maxFeePerGas:T,maxPriorityFeePerGas:w,nonce:P,to:A,value:k,stateOverride:B,...F}=t,b=n?dt(n):void 0;if(u&&(p||f))throw new G("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&A)throw new G("Cannot provide both `code` & `to` as parameters.");const v=u&&d,E=p&&f&&A&&d,M=v||E,$=v?Ef({code:u,data:d}):E?hv({data:d,factory:p,factoryData:f,to:A}):d;try{Or(t);const S=(typeof s=="bigint"?ne(s):void 0)||i,L=c?uf(c):void 0,j=xa(B),z=(O=(y=(D=e.chain)==null?void 0:D.formatters)==null?void 0:y.transactionRequest)==null?void 0:O.format,_=(z||Bo)({...Ds(F,{format:z}),accessList:l,account:b,authorizationList:r,blobs:a,data:$,gas:h,gasPrice:m,maxFeePerBlobGas:x,maxFeePerGas:T,maxPriorityFeePerGas:w,nonce:P,to:M?void 0:A,value:k},"call");if(o&&fv({request:_})&&!j&&!L)try{return await pv(e,{..._,blockNumber:s,blockTag:i})}catch(H){if(!(H instanceof yf)&&!(H instanceof Wa))throw H}const Z=(()=>{const H=[_,S];return j&&L?[...H,j,L]:j?[...H,j]:L?[...H,{},L]:H})(),q=await e.request({method:"eth_call",params:Z});return q==="0x"?{data:void 0}:{data:q}}catch(I){const S=mv(I),{offchainLookup:L,offchainLookupSignature:j}=await Promise.resolve().then(()=>hw);if(e.ccipRead!==!1&&(S==null?void 0:S.slice(0,10))===j&&A)return{data:await L(e,{data:S,to:A})};throw M&&(S==null?void 0:S.slice(0,10))==="0x101bb98d"?new H1({factory:p}):vf(I,{...t,account:b,chain:e.chain})}}function fv({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(cv)||!n||Object.values(r).filter(o=>typeof o<"u").length>0)}async function pv(e,t){var m;const{batchSize:n=1024,deployless:r=!1,wait:o=0}=typeof((m=e.batch)==null?void 0:m.multicall)=="object"?e.batch.multicall:{},{blockNumber:s,blockTag:i=e.experimental_blockTag??"latest",data:l,to:a}=t,c=(()=>{if(r)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return kr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new yf})(),d=(typeof s=="bigint"?ne(s):void 0)||i,{schedule:p}=xf({id:`${e.uid}.${d}`,wait:o,shouldSplitBatch(x){return x.reduce((w,{data:P})=>w+(P.length-2),0)>n*2},fn:async x=>{const T=x.map(A=>({allowFailure:!0,callData:A.data,target:A.to})),w=vt({abi:Ir,args:[T],functionName:"aggregate3"}),P=await e.request({method:"eth_call",params:[{...c===null?{data:Ef({code:Ua,data:w})}:{to:c,data:w}},d]});return kn({abi:Ir,args:[T],functionName:"aggregate3",data:P||"0x"})}}),[{returnData:f,success:h}]=await p({data:l,to:a});if(!h)throw new Os({data:f});return f==="0x"?{data:void 0}:{data:f}}function Ef(e){const{code:t,data:n}=e;return Va({abi:xu(["constructor(bytes, bytes)"]),bytecode:gf,args:[t,n]})}function hv(e){const{data:t,factory:n,factoryData:r,to:o}=e;return Va({abi:xu(["constructor(address, bytes, address, bytes)"]),bytecode:uv,args:[o,t,n,r]})}function mv(e){var n;if(!(e instanceof G))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function jt(e,t){const{abi:n,address:r,args:o,functionName:s,...i}=t,l=vt({abi:n,args:o,functionName:s});try{const{data:a}=await te(e,Lr,"call")({...i,data:l,to:r});return kn({abi:n,args:o,functionName:s,data:a||"0x"})}catch(a){throw Nr(a,{abi:n,address:r,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}async function bv(e,t){var u;const{abi:n,address:r,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:(u=e.dataSuffix)==null?void 0:u.value,...l}=t,a=l.account?dt(l.account):e.account,c=vt({abi:n,args:o,functionName:s});try{const{data:d}=await te(e,Lr,"call")({batch:!1,data:`${c}${i?i.replace("0x",""):""}`,to:r,...l,account:a}),p=kn({abi:n,args:o,functionName:s,data:d||"0x"}),f=n.filter(h=>"name"in h&&h.name===t.functionName);return{result:p,request:{abi:f,address:r,args:o,dataSuffix:i,functionName:s,...l,account:a}}}catch(d){throw Nr(d,{abi:n,address:r,args:o,docsPath:"/docs/contract/simulateContract",functionName:s,sender:a==null?void 0:a.address})}}const Ga=new Map,Sf=new Map;let gv=0;function Ln(e,t,n){const r=++gv,o=()=>Ga.get(e)||[],s=()=>{const u=o();Ga.set(e,u.filter(d=>d.id!==r))},i=()=>{const u=o();if(!u.some(p=>p.id===r))return;const d=Sf.get(e);if(u.length===1&&d){const p=d();p instanceof Promise&&p.catch(()=>{})}s()},l=o();if(Ga.set(e,[...l,{id:r,fns:t}]),l&&l.length>0)return i;const a={};for(const u in t)a[u]=(...d)=>{var f,h;const p=o();if(p.length!==0)for(const m of p)(h=(f=m.fns)[u])==null||h.call(f,...d)};const c=n(a);return typeof c=="function"&&Sf.set(e,c),i}async function qa(e){return new Promise(t=>setTimeout(t,e))}function _o(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let o=!0;const s=()=>o=!1;return(async()=>{let l;t&&(l=await e({unpoll:s}));const a=await(n==null?void 0:n(l))??r;await qa(a);const c=async()=>{o&&(await e({unpoll:s}),await qa(r),c())};c()})(),s}const yv=new Map,vv=new Map;function wv(e){const t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:i=>s.set(o,i)}),n=t(e,yv),r=t(e,vv);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function xv(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=wv(t),o=r.response.get();if(o&&n>0&&Date.now()-o.created.getTime()<n)return o.data;let s=r.promise.get();s||(s=e(),r.promise.set(s));try{const i=await s;return r.response.set({created:new Date,data:i}),i}finally{r.promise.clear()}}const Ev=e=>`blockNumber.${e}`;async function Vo(e,{cacheTime:t=e.cacheTime}={}){const n=await xv(()=>e.request({method:"eth_blockNumber"}),{cacheKey:Ev(e.uid),cacheTime:t});return BigInt(n)}async function Us(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const o=r.map(s=>Zt(s));return!("abi"in t)||!t.abi?o:$a({abi:t.abi,logs:o,strict:n})}async function Ws(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function Sv(e,t){const{abi:n,address:r,args:o,batch:s=!0,eventName:i,fromBlock:l,onError:a,onLogs:c,poll:u,pollingInterval:d=e.pollingInterval,strict:p}=t;return(typeof u<"u"?u:typeof l=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const x=p??!1,T=Be(["watchContractEvent",r,o,s,e.uid,i,d,x,l]);return Ln(T,{onLogs:c,onError:a},w=>{let P;l!==void 0&&(P=l-1n);let A,k=!1;const B=_o(async()=>{var F;if(!k){try{A=await te(e,rd,"createContractEventFilter")({abi:n,address:r,args:o,eventName:i,strict:x,fromBlock:l})}catch{}k=!0;return}try{let b;if(A)b=await te(e,Us,"getFilterChanges")({filter:A});else{const v=await te(e,Vo,"getBlockNumber")({});P&&P<v?b=await te(e,Ud,"getContractEvents")({abi:n,address:r,args:o,eventName:i,fromBlock:P+1n,toBlock:v,strict:x}):b=[],P=v}if(b.length===0)return;if(s)w.onLogs(b);else for(const v of b)w.onLogs([v])}catch(b){A&&b instanceof Mn&&(k=!1),(F=w.onError)==null||F.call(w,b)}},{emitOnBegin:!0,interval:d});return async()=>{A&&await te(e,Ws,"uninstallFilter")({filter:A}),B()}})})():(()=>{const x=p??!1,T=Be(["watchContractEvent",r,o,s,e.uid,i,d,x]);let w=!0,P=()=>w=!1;return Ln(T,{onLogs:c,onError:a},A=>((async()=>{try{const k=(()=>{if(e.transport.type==="fallback"){const b=e.transport.transports.find(v=>v.config.type==="webSocket"||v.config.type==="ipc");return b?b.value:e.transport}return e.transport})(),B=i?lo({abi:n,eventName:i,args:o}):[],{unsubscribe:F}=await k.subscribe({params:["logs",{address:r,topics:B}],onData(b){var E;if(!w)return;const v=b.result;try{const{eventName:M,args:$}=ks({abi:n,data:v.data,topics:v.topics,strict:p}),C=Zt(v,{args:$,eventName:M});A.onLogs([C])}catch(M){let $,C;if(M instanceof Es||M instanceof Yi){if(p)return;$=M.abiItem.name,C=(E=M.abiItem.inputs)==null?void 0:E.some(y=>!("name"in y&&y.name))}const D=Zt(v,{args:C?[]:{},eventName:$});A.onLogs([D])}},onError(b){var v;(v=A.onError)==null||v.call(A,b)}});P=F,w||P()}catch(k){a==null||a(k)}})(),()=>P()))})()}async function Pv(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}function Ka(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((o,s)=>{const i=async({count:l=0}={})=>{const a=async({error:c})=>{const u=typeof t=="function"?t({count:l,error:c}):t;u&&await qa(u),i({count:l+1})};try{const c=await e();o(c)}catch(c){if(l<n&&await r({count:l,error:c}))return a({error:c});s(c)}};i()})}const Tv={"0x0":"reverted","0x1":"success"};function Pf(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>Zt(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?ln(e.transactionIndex):null,status:e.status?Tv[e.status]:null,type:e.type?Ad[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Za=256;let _s=Za,Vs;function Tf(e=11){if(!Vs||_s+e>Za*2){Vs="",_s=0;for(let t=0;t<Za;t++)Vs+=(256+Math.random()*256|0).toString(16).substring(1)}return Vs.substring(_s,_s+++e)}function Av(e){const{batch:t,chain:n,ccipRead:r,dataSuffix:o,key:s="base",name:i="Base Client",type:l="base"}=e,a=e.experimental_blockTag??(typeof(n==null?void 0:n.experimental_preconfirmationTime)=="number"?"pending":void 0),c=(n==null?void 0:n.blockTime)??12e3,u=Math.min(Math.max(Math.floor(c/2),500),4e3),d=e.pollingInterval??u,p=e.cacheTime??d,f=e.account?dt(e.account):void 0,{config:h,request:m,value:x}=e.transport({account:f,chain:n,pollingInterval:d}),T={...h,...x},w={account:f,batch:t,cacheTime:p,ccipRead:r,chain:n,dataSuffix:o,key:s,name:i,pollingInterval:d,request:m,transport:T,type:l,uid:Tf(),...a?{experimental_blockTag:a}:{}};function P(A){return k=>{const B=k(A);for(const b in w)delete B[b];const F={...A,...B};return Object.assign(F,{extend:P(F)})}}return Object.assign(w,{extend:P(w)})}function Ya(e){var n,r,o,s,i,l;if(!(e instanceof G))return!1;const t=e.walk(a=>a instanceof da);return t instanceof da?((n=t.data)==null?void 0:n.errorName)==="HttpError"||((r=t.data)==null?void 0:r.errorName)==="ResolverError"||((o=t.data)==null?void 0:o.errorName)==="ResolverNotContract"||((s=t.data)==null?void 0:s.errorName)==="ResolverNotFound"||((i=t.data)==null?void 0:i.errorName)==="ReverseAddressMismatch"||((l=t.data)==null?void 0:l.errorName)==="UnsupportedResolverProfile":!1}function Nv(e){const{abi:t,data:n}=e,r=Zn(n,0,4),o=t.find(s=>s.type==="function"&&r===ao(It(s)));if(!o)throw new bg(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?co(o.inputs,Zn(n,4)):void 0}}const Xa="/docs/contract/encodeErrorResult";function Af(e){const{abi:t,errorName:n,args:r}=e;let o=t[0];if(n){const a=Yn({abi:t,args:r,name:n});if(!a)throw new Cu(n,{docsPath:Xa});o=a}if(o.type!=="error")throw new Cu(void 0,{docsPath:Xa});const s=It(o),i=ao(s);let l="0x";if(r&&r.length>0){if(!o.inputs)throw new pg(o.name,{docsPath:Xa});l=$n(o.inputs,r)}return Sr([i,l])}const Ja="/docs/contract/encodeFunctionResult";function Cv(e){const{abi:t,functionName:n,result:r}=e;let o=t[0];if(n){const i=Yn({abi:t,name:n});if(!i)throw new gr(n,{docsPath:Ja});o=i}if(o.type!=="function")throw new gr(void 0,{docsPath:Ja});if(!o.outputs)throw new Mu(o.name,{docsPath:Ja});const s=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new Iu(r)})();return $n(o.outputs,s)}const Ho="x-batch-gateway:true";async function Nf(e){const{data:t,ccipRequest:n}=e,{args:[r]}=Nv({abi:za,data:t}),o=[],s=[];return await Promise.all(r.map(async(i,l)=>{try{s[l]=i.urls.includes(Ho)?await Nf({data:i.data,ccipRequest:n}):await n(i),o[l]=!1}catch(a){o[l]=!0,s[l]=Ov(a)}})),Cv({abi:za,functionName:"query",result:[o,s]})}function Ov(e){return e.name==="HttpRequestError"&&e.status?Af({abi:za,errorName:"HttpError",args:[e.status,e.shortMessage]}):Af({abi:[sd],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function Cf(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Dt(t)?t:null}function Qa(e){let t=new Uint8Array(32).fill(0);if(!e)return Le(t);const n=e.split(".");for(let r=n.length-1;r>=0;r-=1){const o=Cf(n[r]),s=o?vr(o):ze(qn(n[r]),"bytes");t=ze(Lt([t,s]),"bytes")}return Le(t)}function $v(e){return`[${e.slice(2)}]`}function Mv(e){const t=new Uint8Array(32).fill(0);return e?Cf(e)||ze(qn(e)):Le(t)}function el(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(qn(t).byteLength+2);let r=0;const o=t.split(".");for(let s=0;s<o.length;s++){let i=qn(o[s]);i.byteLength>255&&(i=qn($v(Mv(o[s])))),n[r]=i.length,n.set(i,r+1),r+=i.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}async function Iv(e,t){const{blockNumber:n,blockTag:r,coinType:o,name:s,gatewayUrls:i,strict:l}=t,{chain:a}=e,c=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return kr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),u=a==null?void 0:a.ensTlds;if(u&&!u.some(p=>s.endsWith(p)))return null;const d=o!=null?[Qa(s),BigInt(o)]:[Qa(s)];try{const p=vt({abi:hf,functionName:"addr",args:d}),f={address:c,abi:ff,functionName:"resolveWithGateways",args:[Cn(el(s)),p,i??[Ho]],blockNumber:n,blockTag:r},m=await te(e,jt,"readContract")(f);if(m[0]==="0x")return null;const x=kn({abi:hf,args:d,functionName:"addr",data:m[0]});return x==="0x"||Gn(x)==="0x00"?null:x}catch(p){if(l)throw p;if(Ya(p))return null;throw p}}class Dv extends G{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Go extends G{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class tl extends G{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class kv extends G{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Lv=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Bv=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,Fv=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Rv=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function jv(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function Of(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function $f({uri:e,gatewayUrls:t}){const n=Fv.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=Of(t==null?void 0:t.ipfs,"https://ipfs.io"),o=Of(t==null?void 0:t.arweave,"https://arweave.net"),s=e.match(Lv),{protocol:i,subpath:l,target:a,subtarget:c=""}=(s==null?void 0:s.groups)||{},u=i==="ipns:/"||l==="ipns/",d=i==="ipfs:/"||l==="ipfs/"||Bv.test(e);if(e.startsWith("http")&&!u&&!d){let f=e;return t!=null&&t.arweave&&(f=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:f,isOnChain:!1,isEncoded:!1}}if((u||d)&&a)return{uri:`${r}/${u?"ipns":"ipfs"}/${a}${c}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&a)return{uri:`${o}/${a}${c||""}`,isOnChain:!1,isEncoded:!1};let p=e.replace(Rv,"");if(p.startsWith("<svg")&&(p=`data:image/svg+xml;base64,${btoa(p)}`),p.startsWith("data:")||p.startsWith("{"))return{uri:p,isOnChain:!0,isEncoded:!1};throw new tl({uri:e})}function Mf(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Dv({data:e});return e.image||e.image_url||e.image_data}async function zv({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(o=>o.json());return await nl({gatewayUrls:e,uri:Mf(n)})}catch{throw new tl({uri:t})}}async function nl({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=$f({uri:t,gatewayUrls:e});if(r||await jv(n))return n;throw new tl({uri:t})}function Uv(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,o]=t.split("/"),[s,i]=n.split(":"),[l,a]=r.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Go({reason:"Only EIP-155 supported"});if(!i)throw new Go({reason:"Chain ID not found"});if(!a)throw new Go({reason:"Contract address not found"});if(!o)throw new Go({reason:"Token ID not found"});if(!l)throw new Go({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:l.toLowerCase(),contractAddress:a,tokenID:o}}async function Wv(e,{nft:t}){if(t.namespace==="erc721")return jt(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return jt(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new kv({namespace:t.namespace})}async function _v(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Vv(e,{gatewayUrls:t,record:n}):nl({uri:n,gatewayUrls:t})}async function Vv(e,{gatewayUrls:t,record:n}){const r=Uv(n),o=await Wv(e,{nft:r}),{uri:s,isOnChain:i,isEncoded:l}=$f({uri:o,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const c=l?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(c);return nl({uri:Mf(u),gatewayUrls:t})}let a=r.tokenID;return r.namespace==="erc1155"&&(a=a.replace("0x","").padStart(64,"0")),zv({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,a)})}async function If(e,t){const{blockNumber:n,blockTag:r,key:o,name:s,gatewayUrls:i,strict:l}=t,{chain:a}=e,c=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return kr({blockNumber:n,chain:a,contract:"ensUniversalResolver"})})(),u=a==null?void 0:a.ensTlds;if(u&&!u.some(d=>s.endsWith(d)))return null;try{const d={address:c,abi:ff,args:[Cn(el(s)),vt({abi:pf,functionName:"text",args:[Qa(s),o]}),i??[Ho]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},f=await te(e,jt,"readContract")(d);if(f[0]==="0x")return null;const h=kn({abi:pf,functionName:"text",data:f[0]});return h===""?null:h}catch(d){if(l)throw d;if(Ya(d))return null;throw d}}async function Hv(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:o,gatewayUrls:s,strict:i,universalResolverAddress:l}){const a=await te(e,If,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:o,universalResolverAddress:l,gatewayUrls:s,strict:i});if(!a)return null;try{return await _v(e,{record:a,gatewayUrls:r})}catch{return null}}async function Gv(e,t){const{address:n,blockNumber:r,blockTag:o,coinType:s=60n,gatewayUrls:i,strict:l}=t,{chain:a}=e,c=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!a)throw new Error("client chain not configured. universalResolverAddress is required.");return kr({blockNumber:r,chain:a,contract:"ensUniversalResolver"})})();try{const u={address:c,abi:lv,args:[n,s,i??[Ho]],functionName:"reverseWithGateways",blockNumber:r,blockTag:o},d=te(e,jt,"readContract"),[p]=await d(u);return p||null}catch(u){if(l)throw u;if(Ya(u))return null;throw u}}async function qv(e,t){const{blockNumber:n,blockTag:r,name:o}=t,{chain:s}=e,i=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return kr({blockNumber:n,chain:s,contract:"ensUniversalResolver"})})(),l=s==null?void 0:s.ensTlds;if(l&&!l.some(c=>o.endsWith(c)))throw new Error(`${o} is not a valid ENS TLD (${l==null?void 0:l.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[a]=await te(e,jt,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Cn(el(o))],blockNumber:n,blockTag:r});return a}async function Df(e,t){var x,T,w;const{account:n=e.account,blockNumber:r,blockTag:o="latest",blobs:s,data:i,gas:l,gasPrice:a,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:d,to:p,value:f,...h}=t,m=n?dt(n):void 0;try{Or(t);const A=(typeof r=="bigint"?ne(r):void 0)||o,k=(w=(T=(x=e.chain)==null?void 0:x.formatters)==null?void 0:T.transactionRequest)==null?void 0:w.format,F=(k||Bo)({...Ds(h,{format:k}),account:m,blobs:s,data:i,gas:l,gasPrice:a,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:d,to:p,value:f},"createAccessList"),b=await e.request({method:"eth_createAccessList",params:[F,A]});return{accessList:b.accessList,gasUsed:BigInt(b.gasUsed)}}catch(P){throw vf(P,{...t,account:m,chain:e.chain})}}async function Kv(e){const t=Cs(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}async function kf(e,{address:t,args:n,event:r,events:o,fromBlock:s,strict:i,toBlock:l}={}){const a=o??(r?[r]:void 0),c=Cs(e,{method:"eth_newFilter"});let u=[];a&&(u=[a.flatMap(f=>lo({abi:[f],eventName:f.name,args:n}))],r&&(u=u[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof s=="bigint"?ne(s):s,toBlock:typeof l=="bigint"?ne(l):l,...u.length?{topics:u}:{}}]});return{abi:a,args:n,eventName:r?r.name:void 0,fromBlock:s,id:d,request:c(d),strict:!!i,toBlock:l,type:"event"}}async function Lf(e){const t=Cs(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}async function Zv(e,{address:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}){var i,l,a;if((i=e.batch)!=null&&i.multicall&&((a=(l=e.chain)==null?void 0:l.contracts)!=null&&a.multicall3)){const c=e.chain.contracts.multicall3.address,u=vt({abi:Ir,functionName:"getEthBalance",args:[t]}),{data:d}=await te(e,Lr,"call")({to:c,data:u,blockNumber:n,blockTag:r});return kn({abi:Ir,functionName:"getEthBalance",args:[t],data:d||"0x"})}const o=typeof n=="bigint"?ne(n):void 0,s=await e.request({method:"eth_getBalance",params:[t,o||r]});return BigInt(s)}async function Yv(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function Xv(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const o=n!==void 0?ne(n):void 0;let s;return t?s=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):s=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||r]},{dedupe:!!o}),ln(s)}async function Hs(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=n!==void 0?ne(n):void 0,s=await e.request({method:"eth_getCode",params:[t,o||r]},{dedupe:!!o});if(s!=="0x")return s}async function Jv(e,{address:t,blockNumber:n,blockTag:r="latest"}){const o=await Hs(e,{address:t,...n!==void 0?{blockNumber:n}:{blockTag:r}});if(o&&Te(o)===23&&o.startsWith("0xef0100"))return un(Zn(o,3,23))}class Qv extends G{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function ew(e,t){const{address:n,factory:r,factoryData:o}=t;try{const[s,i,l,a,c,u,d]=await te(e,jt,"readContract")({abi:tw,address:n,functionName:"eip712Domain",factory:r,factoryData:o});return{domain:{name:i,version:l,chainId:Number(a),verifyingContract:c,salt:u},extensions:d,fields:s}}catch(s){const i=s;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new Qv({address:n}):i}}const tw=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function nw(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function rw(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:o}){const s=typeof n=="bigint"?ne(n):void 0,i=await e.request({method:"eth_feeHistory",params:[ne(t),s||r,o]},{dedupe:!!s});return nw(i)}async function ow(e,{filter:t}){const n=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>Zt(s));return t.abi?$a({abi:t.abi,logs:o,strict:n}):o}async function sw({address:e,authorization:t,signature:n}){return Fo(un(e),await xd({authorization:t,signature:n}))}const Gs=new As(8192);function iw(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Gs.get(n))return Gs.get(n);const r=e().finally(()=>Gs.delete(n));return Gs.set(n,r),r}function aw(e,t={}){return async(n,r={})=>{var d;const{dedupe:o=!1,methods:s,retryDelay:i=150,retryCount:l=3,uid:a}={...t,...r},{method:c}=n;if((d=s==null?void 0:s.exclude)!=null&&d.includes(c))throw new Qn(new Error("method not supported"),{method:c});if(s!=null&&s.include&&!s.include.includes(c))throw new Qn(new Error("method not supported"),{method:c});const u=o?oo(`${a}.${Be(n)}`):void 0;return iw(()=>Ka(async()=>{try{return await e(n)}catch(p){const f=p;switch(f.code){case ho.code:throw new ho(f);case mo.code:throw new mo(f);case bo.code:throw new bo(f,{method:n.method});case go.code:throw new go(f);case Jn.code:throw new Jn(f);case Mn.code:throw new Mn(f);case yo.code:throw new yo(f);case vo.code:throw new vo(f);case wo.code:throw new wo(f);case Qn.code:throw new Qn(f,{method:n.method});case Tr.code:throw new Tr(f);case xo.code:throw new xo(f);case Ar.code:throw new Ar(f);case Eo.code:throw new Eo(f);case So.code:throw new So(f);case Po.code:throw new Po(f);case To.code:throw new To(f);case Ao.code:throw new Ao(f);case No.code:throw new No(f);case Co.code:throw new Co(f);case Oo.code:throw new Oo(f);case $o.code:throw new $o(f);case Mo.code:throw new Mo(f);case Io.code:throw new Io(f);case Do.code:throw new Do(f);case 5e3:throw new Ar(f);case ko.code:throw new ko(f);default:throw p instanceof G?p:new q1(f)}}},{delay:({count:p,error:f})=>{var h;if(f&&f instanceof Xn){const m=(h=f==null?void 0:f.headers)==null?void 0:h.get("Retry-After");if(m!=null&&m.match(/\d/))return Number.parseInt(m,10)*1e3}return~~(1<<p)*i},retryCount:l,shouldRetry:({error:p})=>lw(p)}),{enabled:o,id:u})}}function lw(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===Tr.code||e.code===Jn.code:e instanceof Xn&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}class cw extends G{constructor({callbackSelector:t,cause:n,data:r,extraData:o,sender:s,urls:i}){var l;super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],(l=n.metaMessages)!=null&&l.length?"":[],"Offchain Gateway Call:",i&&[" Gateway URL(s):",...i.map(a=>` ${po(a)}`)],` Sender: ${s}`,` Data: ${r}`,` Callback selector: ${t}`,` Extra data: ${o}`].flat(),name:"OffchainLookupError"})}}class uw extends G{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${po(n)}`,`Response: ${Be(t)}`],name:"OffchainLookupResponseMalformedError"})}}class dw extends G{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}const fw="0x556f1830",Bf={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function pw(e,{blockNumber:t,blockTag:n,data:r,to:o}){const{args:s}=cd({data:r,abi:[Bf]}),[i,l,a,c,u]=s,{ccipRead:d}=e,p=d&&typeof(d==null?void 0:d.request)=="function"?d.request:Ff;try{if(!Fo(o,i))throw new dw({sender:i,to:o});const f=l.includes(Ho)?await Nf({data:a,ccipRequest:p}):await p({data:a,sender:i,urls:l}),{data:h}=await Lr(e,{blockNumber:t,blockTag:n,data:Lt([c,$n([{type:"bytes"},{type:"bytes"}],[f,u])]),to:o});return h}catch(f){throw new cw({callbackSelector:c,cause:f,data:r,extraData:u,sender:i,urls:l})}}async function Ff({data:e,sender:t,urls:n}){var o;let r=new Error("An unknown error occurred.");for(let s=0;s<n.length;s++){const i=n[s],l=i.includes("{data}")?"GET":"POST",a=l==="POST"?{data:e,sender:t}:void 0,c=l==="POST"?{"Content-Type":"application/json"}:{};try{const u=await fetch(i.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(a),headers:c,method:l});let d;if((o=u.headers.get("Content-Type"))!=null&&o.startsWith("application/json")?d=(await u.json()).data:d=await u.text(),!u.ok){r=new Xn({body:a,details:d!=null&&d.error?Be(d.error):u.statusText,headers:u.headers,status:u.status,url:i});continue}if(!Dt(d)){r=new uw({result:d,url:i});continue}return d}catch(u){r=new Xn({body:a,details:u.message,url:i})}}throw r}const hw=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Ff,offchainLookup:pw,offchainLookupAbiItem:Bf,offchainLookupSignature:fw},Symbol.toStringTag,{value:"Module"}));function mw(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return o=>{const s=typeof o=="function"?o(r):o,i={...r,...s};return Object.assign(i,{extend:n(i)})}}return Object.assign(t,{extend:n(t)})}function bw(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((o,s)=>{(async()=>{let i;try{const l=new AbortController;n>0&&(i=setTimeout(()=>{r&&l.abort()},n)),o(await e({signal:(l==null?void 0:l.signal)||null}))}catch(l){(l==null?void 0:l.name)==="AbortError"&&s(t),s(l)}finally{clearTimeout(i)}})()})}function gw(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Rf=gw();function yw(e,t={}){const{url:n,headers:r}=vw(e);return{async request(o){var h;const{body:s,fetchFn:i=t.fetchFn??fetch,onRequest:l=t.onRequest,onResponse:a=t.onResponse,timeout:c=t.timeout??1e4}=o,u={...t.fetchOptions??{},...o.fetchOptions??{}},{headers:d,method:p,signal:f}=u;try{const m=await bw(async({signal:T})=>{const w={...u,body:Array.isArray(s)?Be(s.map(B=>({jsonrpc:"2.0",id:B.id??Rf.take(),...B}))):Be({jsonrpc:"2.0",id:s.id??Rf.take(),...s}),headers:{...r,"Content-Type":"application/json",...d},method:p||"POST",signal:f||(c>0?T:null)},P=new Request(n,w),A=await(l==null?void 0:l(P,w))??{...w,url:n};return await i(A.url??n,A)},{errorInstance:new bd({body:s,url:n}),timeout:c,signal:!0});a&&await a(m);let x;if((h=m.headers.get("Content-Type"))!=null&&h.startsWith("application/json"))x=await m.json();else{x=await m.text();try{x=JSON.parse(x||"{}")}catch(T){if(m.ok)throw T;x={error:x}}}if(!m.ok)throw new Xn({body:s,details:Be(x.error)||m.statusText,headers:m.headers,status:m.status,url:n});return x}catch(m){throw m instanceof Xn||m instanceof bd?m:new Xn({body:s,cause:m,url:n})}}}}function vw(e){try{const t=new URL(e),n=(()=>{if(t.username){const r=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}const ww=`Ethereum Signed Message:
|
|
89
|
+
`;function xw(e){const t=typeof e=="string"?oo(e):typeof e.raw=="string"?e.raw:Le(e.raw),n=oo(`${ww}${Te(t)}`);return Lt([n,t])}function jf(e,t){return ze(xw(e),t)}class Ew extends G{constructor({domain:t}){super(`Invalid domain "${Be(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class Sw extends G{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class Pw extends G{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function Tw(e){const{domain:t,message:n,primaryType:r,types:o}=e,s=(i,l)=>{for(const a of i){const{name:c,type:u}=a,d=l[c],p=u.match(Qu);if(p&&(typeof d=="number"||typeof d=="bigint")){const[m,x,T]=p;ne(d,{signed:x==="int",size:Number.parseInt(T,10)/8})}if(u==="address"&&typeof d=="string"&&!yt(d))throw new On({address:d});const f=u.match(u1);if(f){const[m,x]=f;if(x&&Te(d)!==Number.parseInt(x,10))throw new yg({expectedSize:Number.parseInt(x,10),givenSize:Te(d)})}const h=o[u];h&&(Nw(u),s(h,d))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new Ew({domain:t});s(o.EIP712Domain,t)}if(r!=="EIP712Domain")if(o[r])s(o[r],n);else throw new Sw({primaryType:r,types:o})}function Aw({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function Nw(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new Pw({type:e})}function Cw(e){const{domain:t={},message:n,primaryType:r}=e,o={EIP712Domain:Aw({domain:t}),...e.types};Tw({domain:t,message:n,primaryType:r,types:o});const s=["0x1901"];return t&&s.push(Ow({domain:t,types:o})),r!=="EIP712Domain"&&s.push(zf({data:n,primaryType:r,types:o})),ze(Lt(s))}function Ow({domain:e,types:t}){return zf({data:e,primaryType:"EIP712Domain",types:t})}function zf({data:e,primaryType:t,types:n}){const r=Uf({data:e,primaryType:t,types:n});return ze(r)}function Uf({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],o=[$w({primaryType:t,types:n})];for(const s of n[t]){const[i,l]=_f({types:n,name:s.name,type:s.type,value:e[s.name]});r.push(i),o.push(l)}return $n(r,o)}function $w({primaryType:e,types:t}){const n=Cn(Mw({primaryType:e,types:t}));return ze(n)}function Mw({primaryType:e,types:t}){let n="";const r=Wf({primaryType:e,types:t});r.delete(e);const o=[e,...Array.from(r).sort()];for(const s of o)n+=`${s}(${t[s].map(({name:i,type:l})=>`${l} ${i}`).join(",")})`;return n}function Wf({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),o=r==null?void 0:r[0];if(n.has(o)||t[o]===void 0)return n;n.add(o);for(const s of t[o])Wf({primaryType:s.type,types:t},n);return n}function _f({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},ze(Uf({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},ze(r)];if(n==="string")return[{type:"bytes32"},ze(Cn(r))];if(n.lastIndexOf("]")===n.length-1){const o=n.slice(0,n.lastIndexOf("[")),s=r.map(i=>_f({name:t,type:o,types:e,value:i}));return[{type:"bytes32"},ze($n(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:n},r]}class Iw extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const rl={checksum:new Iw(8192)}.checksum;class Vf extends Qi{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,zg(t);const r=Ps(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 o=this.blockLen,s=new Uint8Array(o);s.set(r.length>o?t.create().update(r).digest():r);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),Er(s)}update(t){return xr(this),this.iHash.update(t),this}digestInto(t){xr(this),Kn(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:o,destroyed:s,blockLen:i,outputLen:l}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=i,t.outputLen=l,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Hf=(e,t,n)=>new Vf(e,t).update(n).digest();Hf.create=(e,t)=>new Vf(e,t);function Gf(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=Ku(Wy(e));return n==="Bytes"?r:Rt(r)}const Dw=/^0x[a-fA-F0-9]{40}$/;function qs(e,t={}){const{strict:n=!0}=t;if(!Dw.test(e))throw new Kf({address:e,cause:new kw});if(n){if(e.toLowerCase()===e)return;if(qf(e)!==e)throw new Kf({address:e,cause:new Lw})}}function qf(e){if(rl.has(e))return rl.get(e);qs(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=Gf(Vy(t),{as:"Bytes"}),r=t.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&r[s]&&(r[s]=r[s].toUpperCase()),(n[s>>1]&15)>=8&&r[s+1]&&(r[s+1]=r[s+1].toUpperCase());const o=`0x${r.join("")}`;return rl.set(e,o),o}function ol(e,t={}){const{strict:n=!0}=t??{};try{return qs(e,{strict:n}),!0}catch{return!1}}class Kf extends re{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class kw extends re{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class Lw extends re{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const Bw=/^(.*)\[([0-9]*)\]$/,Fw=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Zf=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Yf=2n**256n-1n;function Br(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=ll(t.type);if(s){const[i,l]=s;return jw(e,{...t,type:l},{checksumAddress:r,length:i,staticPosition:o})}if(t.type==="tuple")return _w(e,t,{checksumAddress:r,staticPosition:o});if(t.type==="address")return Rw(e,{checksum:r});if(t.type==="bool")return zw(e);if(t.type.startsWith("bytes"))return Uw(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Ww(e,t);if(t.type==="string")return Vw(e,{staticPosition:o});throw new dl(t.type)}const Xf=32,sl=32;function Rw(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(s=>n?qf(s):s)(Rt(Gy(r,-20))),32]}function jw(e,t,n){const{checksumAddress:r,length:o,staticPosition:s}=n;if(!o){const a=hn(e.readBytes(sl)),c=s+a,u=c+Xf;e.setPosition(c);const d=hn(e.readBytes(Xf)),p=qo(t);let f=0;const h=[];for(let m=0;m<d;++m){e.setPosition(u+(p?m*32:f));const[x,T]=Br(e,t,{checksumAddress:r,staticPosition:u});f+=T,h.push(x)}return e.setPosition(s+32),[h,32]}if(qo(t)){const a=hn(e.readBytes(sl)),c=s+a,u=[];for(let d=0;d<o;++d){e.setPosition(c+d*32);const[p]=Br(e,t,{checksumAddress:r,staticPosition:c});u.push(p)}return e.setPosition(s+32),[u,32]}let i=0;const l=[];for(let a=0;a<o;++a){const[c,u]=Br(e,t,{checksumAddress:r,staticPosition:s+i});i+=u,l.push(c)}return[l,i]}function zw(e){return[Ky(e.readBytes(32),{size:32}),32]}function Uw(e,t,{staticPosition:n}){const[r,o]=t.type.split("bytes");if(!o){const i=hn(e.readBytes(32));e.setPosition(n+i);const l=hn(e.readBytes(32));if(l===0)return e.setPosition(n+32),["0x",32];const a=e.readBytes(l);return e.setPosition(n+32),[Rt(a),32]}return[Rt(e.readBytes(Number.parseInt(o,10),32)),32]}function Ww(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[r>48?qy(o,{signed:n}):hn(o,{signed:n}),32]}function _w(e,t,n){const{checksumAddress:r,staticPosition:o}=n,s=t.components.length===0||t.components.some(({name:a})=>!a),i=s?[]:{};let l=0;if(qo(t)){const a=hn(e.readBytes(sl)),c=o+a;for(let u=0;u<t.components.length;++u){const d=t.components[u];e.setPosition(c+l);const[p,f]=Br(e,d,{checksumAddress:r,staticPosition:c});l+=f,i[s?u:d==null?void 0:d.name]=p}return e.setPosition(o+32),[i,32]}for(let a=0;a<t.components.length;++a){const c=t.components[a],[u,d]=Br(e,c,{checksumAddress:r,staticPosition:o});i[s?a:c==null?void 0:c.name]=u,l+=d}return[i,l]}function Vw(e,{staticPosition:t}){const n=hn(e.readBytes(32)),r=t+n;e.setPosition(r);const o=hn(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];const s=e.readBytes(o,32),i=Zy(tf(s));return e.setPosition(t+32),[i,32]}function Hw({checksumAddress:e,parameters:t,values:n}){const r=[];for(let o=0;o<t.length;o++)r.push(il({checksumAddress:e,parameter:t[o],value:n[o]}));return r}function il({checksumAddress:e=!1,parameter:t,value:n}){const r=t,o=ll(r.type);if(o){const[s,i]=o;return qw(n,{checksumAddress:e,length:s,parameter:{...r,type:i}})}if(r.type==="tuple")return Jw(n,{checksumAddress:e,parameter:r});if(r.type==="address")return Gw(n,{checksum:e});if(r.type==="bool")return Zw(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const s=r.type.startsWith("int"),[,,i="256"]=Zf.exec(r.type)??[];return Yw(n,{signed:s,size:Number(i)})}if(r.type.startsWith("bytes"))return Kw(n,{type:r.type});if(r.type==="string")return Xw(n);throw new dl(r.type)}function al(e){let t=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:l}=e[s];i?t+=32:t+=ft(l)}const n=[],r=[];let o=0;for(let s=0;s<e.length;s++){const{dynamic:i,encoded:l}=e[s];i?(n.push(Ve(t+o,{size:32})),r.push(l),o+=ft(l)):n.push(l)}return Ft(...n,...r)}function Gw(e,t){const{checksum:n=!1}=t;return qs(e,{strict:n}),{dynamic:!1,encoded:tr(e.toLowerCase())}}function qw(e,t){const{checksumAddress:n,length:r,parameter:o}=t,s=r===null;if(!Array.isArray(e))throw new a6(e);if(!s&&e.length!==r)throw new i6({expectedLength:r,givenLength:e.length,type:`${o.type}[${r}]`});let i=!1;const l=[];for(let a=0;a<e.length;a++){const c=il({checksumAddress:n,parameter:o,value:e[a]});c.dynamic&&(i=!0),l.push(c)}if(s||i){const a=al(l);if(s){const c=Ve(l.length,{size:32});return{dynamic:!0,encoded:l.length>0?Ft(c,a):c}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:Ft(...l.map(({encoded:a})=>a))}}function Kw(e,{type:t}){const[,n]=t.split("bytes"),r=ft(e);if(!n){let o=e;return r%32!==0&&(o=nr(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Ft(tr(Ve(r,{size:32})),o)}}if(r!==Number.parseInt(n,10))throw new e0({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:nr(e)}}function Zw(e){if(typeof e!="boolean")throw new re(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:tr(nf(e))}}function Yw(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,o=t?-r-1n:0n;if(e>r||e<o)throw new sf({max:r.toString(),min:o.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Ve(e,{size:32,signed:t})}}function Xw(e){const t=ja(e),n=Math.ceil(ft(t)/32),r=[];for(let o=0;o<n;o++)r.push(nr(Yt(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:Ft(nr(Ve(ft(t),{size:32})),...r)}}function Jw(e,t){const{checksumAddress:n,parameter:r}=t;let o=!1;const s=[];for(let i=0;i<r.components.length;i++){const l=r.components[i],a=Array.isArray(e)?i:l.name,c=il({checksumAddress:n,parameter:l,value:e[a]});s.push(c),c.dynamic&&(o=!0)}return{dynamic:o,encoded:o?al(s):Ft(...s.map(({encoded:i})=>i))}}function ll(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function qo(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(qo);const n=ll(e.type);return!!(n&&qo({...e,type:n[1]}))}const Qw={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new n6({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new t6({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Jf({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Jf({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function e6(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(Qw);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Jf extends re{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class t6 extends re{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class n6 extends re{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function r6(e,t,n={}){const{as:r="Array",checksumAddress:o=!1}=n,s=typeof t=="string"?ef(t):t,i=e6(s);if(Mr(s)===0&&e.length>0)throw new s6;if(Mr(s)&&Mr(s)<32)throw new o6({data:typeof t=="string"?t:Rt(t),parameters:e,size:Mr(s)});let l=0;const a=r==="Array"?[]:{};for(let c=0;c<e.length;++c){const u=e[c];i.setPosition(l);const[d,p]=Br(i,u,{checksumAddress:o,staticPosition:0});l+=p,r==="Array"?a.push(d):a[u.name??c]=d}return a}function cl(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new t0({expectedLength:e.length,givenLength:t.length});const o=Hw({checksumAddress:r,parameters:e,values:t}),s=al(o);return s.length===0?"0x":s}function ul(e,t){if(e.length!==t.length)throw new t0({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r];n.push(ul.encode(o,s))}return Ft(...n)}(function(e){function t(n,r,o=!1){if(n==="address"){const a=r;return qs(a),tr(a.toLowerCase(),o?32:0)}if(n==="string")return ja(r);if(n==="bytes")return r;if(n==="bool")return tr(nf(r),o?32:1);const s=n.match(Zf);if(s){const[a,c,u="256"]=s,d=Number.parseInt(u,10)/8;return Ve(r,{size:o?32:d,signed:c==="int"})}const i=n.match(Fw);if(i){const[a,c]=i;if(Number.parseInt(c,10)!==(r.length-2)/2)throw new e0({expectedSize:Number.parseInt(c,10),value:r});return nr(r,o?32:0)}const l=n.match(Bw);if(l&&Array.isArray(r)){const[a,c]=l,u=[];for(let d=0;d<r.length;d++)u.push(t(c,r[d],!0));return u.length===0?"0x":Ft(...u)}throw new dl(n)}e.encode=t})(ul||(ul={}));function Qf(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Su(e):e}class o6 extends re{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${mr(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class s6 extends re{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class i6 extends re{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class e0 extends re{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${ft(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class t0 extends re{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
|
|
90
|
+
`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class a6 extends re{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class dl extends re{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const et=BigInt(0),He=BigInt(1),rr=BigInt(2),l6=BigInt(3),n0=BigInt(4),r0=BigInt(5),o0=BigInt(8);function tt(e,t){const n=e%t;return n>=et?n:t+n}function xt(e,t,n){let r=e;for(;t-- >et;)r*=r,r%=n;return r}function fl(e,t){if(e===et)throw new Error("invert: expected non-zero number");if(t<=et)throw new Error("invert: expected positive modulus, got "+t);let n=tt(e,t),r=t,o=et,s=He;for(;n!==et;){const l=r/n,a=r%n,c=o-s*l;r=n,n=a,o=s,s=c}if(r!==He)throw new Error("invert: does not exist");return tt(o,t)}function s0(e,t){const n=(e.ORDER+He)/n0,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function c6(e,t){const n=(e.ORDER-r0)/o0,r=e.mul(t,rr),o=e.pow(r,n),s=e.mul(t,o),i=e.mul(e.mul(s,rr),o),l=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(l),t))throw new Error("Cannot find square root");return l}function u6(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-He,n=0;for(;t%rr===et;)t/=rr,n++;let r=rr;const o=pl(e);for(;a0(o,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return s0;let s=o.pow(r,t);const i=(t+He)/rr;return function(a,c){if(a.is0(c))return c;if(a0(a,c)!==1)throw new Error("Cannot find square root");let u=n,d=a.mul(a.ONE,s),p=a.pow(c,t),f=a.pow(c,i);for(;!a.eql(p,a.ONE);){if(a.is0(p))return a.ZERO;let h=1,m=a.sqr(p);for(;!a.eql(m,a.ONE);)if(h++,m=a.sqr(m),h===u)throw new Error("Cannot find square root");const x=He<<BigInt(u-h-1),T=a.pow(d,x);u=h,d=a.sqr(T),p=a.mul(p,d),f=a.mul(f,T)}return f}}function d6(e){return e%n0===l6?s0:e%o0===r0?c6:u6(e)}const f6=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function p6(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=f6.reduce((r,o)=>(r[o]="function",r),t);return js(e,n)}function h6(e,t,n){if(n<et)throw new Error("invalid exponent, negatives unsupported");if(n===et)return e.ONE;if(n===He)return t;let r=e.ONE,o=t;for(;n>et;)n&He&&(r=e.mul(r,o)),o=e.sqr(o),n>>=He;return r}function i0(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((i,l,a)=>e.is0(l)?i:(r[a]=i,e.mul(i,l)),e.ONE),s=e.inv(o);return t.reduceRight((i,l,a)=>e.is0(l)?i:(r[a]=e.mul(i,r[a]),e.mul(i,l)),s),r}function a0(e,t){const n=(e.ORDER-He)/rr,r=e.pow(t,n),o=e.eql(r,e.ONE),s=e.eql(r,e.ZERO),i=e.eql(r,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function l0(e,t){t!==void 0&&so(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function pl(e,t,n=!1,r={}){if(e<=et)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:s}=l0(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i;const l=Object.freeze({ORDER:e,isLE:n,BITS:o,BYTES:s,MASK:Rs(o),ZERO:et,ONE:He,create:a=>tt(a,e),isValid:a=>{if(typeof a!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof a);return et<=a&&a<e},is0:a=>a===et,isOdd:a=>(a&He)===He,neg:a=>tt(-a,e),eql:(a,c)=>a===c,sqr:a=>tt(a*a,e),add:(a,c)=>tt(a+c,e),sub:(a,c)=>tt(a-c,e),mul:(a,c)=>tt(a*c,e),pow:(a,c)=>h6(l,a,c),div:(a,c)=>tt(a*fl(c,e),e),sqrN:a=>a*a,addN:(a,c)=>a+c,subN:(a,c)=>a-c,mulN:(a,c)=>a*c,inv:a=>fl(a,e),sqrt:r.sqrt||(a=>(i||(i=d6(e)),i(l,a))),toBytes:a=>n?Gd(a,s):Uo(a,s),fromBytes:a=>{if(a.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+a.length);return n?Hd(a):er(a)},invertBatch:a=>i0(l,a),cmov:(a,c,u)=>u?c:a});return Object.freeze(l)}function c0(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 u0(e){const t=c0(e);return t+Math.ceil(t/2)}function m6(e,t,n=!1){const r=e.length,o=c0(t),s=u0(t);if(r<16||r<s||r>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+r);const i=n?Hd(e):er(e),l=tt(i,t-He)+He;return n?Gd(l,o):Uo(l,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const d0=BigInt(0),hl=BigInt(1);function ml(e,t){const n=t.negate();return e?n:t}function f0(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function bl(e,t){f0(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),o=2**e,s=Rs(e),i=BigInt(e);return{windows:n,windowSize:r,mask:s,maxNumber:o,shiftBy:i}}function p0(e,t,n){const{windowSize:r,mask:o,maxNumber:s,shiftBy:i}=n;let l=Number(e&o),a=e>>i;l>r&&(l-=s,a+=hl);const c=t*r,u=c+Math.abs(l)-1,d=l===0,p=l<0,f=t%2!==0;return{nextN:a,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:c}}function b6(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function g6(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const gl=new WeakMap,h0=new WeakMap;function yl(e){return h0.get(e)||1}function y6(e,t){return{constTimeNegate:ml,hasPrecomputes(n){return yl(n)!==1},unsafeLadder(n,r,o=e.ZERO){let s=n;for(;r>d0;)r&hl&&(o=o.add(s)),s=s.double(),r>>=hl;return o},precomputeWindow(n,r){const{windows:o,windowSize:s}=bl(r,t),i=[];let l=n,a=l;for(let c=0;c<o;c++){a=l,i.push(a);for(let u=1;u<s;u++)a=a.add(l),i.push(a);l=a.double()}return i},wNAF(n,r,o){let s=e.ZERO,i=e.BASE;const l=bl(n,t);for(let a=0;a<l.windows;a++){const{nextN:c,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:h}=p0(o,a,l);o=c,d?i=i.add(ml(f,r[h])):s=s.add(ml(p,r[u]))}return{p:s,f:i}},wNAFUnsafe(n,r,o,s=e.ZERO){const i=bl(n,t);for(let l=0;l<i.windows&&o!==d0;l++){const{nextN:a,offset:c,isZero:u,isNeg:d}=p0(o,l,i);if(o=a,!u){const p=r[c];s=s.add(d?p.negate():p)}}return s},getPrecomputes(n,r,o){let s=gl.get(r);return s||(s=this.precomputeWindow(r,n),n!==1&&gl.set(r,o(s))),s},wNAFCached(n,r,o){const s=yl(n);return this.wNAF(s,this.getPrecomputes(s,n,o),r)},wNAFCachedUnsafe(n,r,o,s){const i=yl(n);return i===1?this.unsafeLadder(n,r,s):this.wNAFUnsafe(i,this.getPrecomputes(i,n,o),r,s)},setWindowSize(n,r){f0(r,t),h0.set(n,r),gl.delete(n)}}}function v6(e,t,n,r){b6(n,e),g6(r,t);const o=n.length,s=r.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,l=My(BigInt(o));let a=1;l>12?a=l-3:l>4?a=l-2:l>0&&(a=2);const c=Rs(a),u=new Array(Number(c)+1).fill(i),d=Math.floor((t.BITS-1)/a)*a;let p=i;for(let f=d;f>=0;f-=a){u.fill(i);for(let m=0;m<s;m++){const x=r[m],T=Number(x>>BigInt(f)&c);u[T]=u[T].add(n[m])}let h=i;for(let m=u.length-1,x=i;m>0;m--)x=x.add(u[m]),h=h.add(x);if(p=p.add(h),f!==0)for(let m=0;m<a;m++)p=p.double()}return p}function m0(e){return p6(e.Fp),js(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...l0(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function b0(e){e.lowS!==void 0&&jo("lowS",e.lowS),e.prehash!==void 0&&jo("prehash",e.prehash)}function w6(e){const t=m0(e);js(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:o}=t;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class x6 extends Error{constructor(t=""){super(t)}}const mn={Err:x6,_tlv:{encode:(e,t)=>{const{Err:n}=mn;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,o=Ls(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const s=r>127?Ls(o.length/2|128):"";return Ls(e)+s+o+t},decode(e,t){const{Err:n}=mn;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const o=t[r++],s=!!(o&128);let i=0;if(!s)i=o;else{const a=o&127;if(!a)throw new n("tlv.decode(long): indefinite length not supported");if(a>4)throw new n("tlv.decode(long): byte length is too big");const c=t.subarray(r,r+a);if(c.length!==a)throw new n("tlv.decode: length bytes not complete");if(c[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of c)i=i<<8|u;if(r+=a,i<128)throw new n("tlv.decode(long): not minimal encoding")}const l=t.subarray(r,r+i);if(l.length!==i)throw new n("tlv.decode: wrong value length");return{v:l,l:t.subarray(r+i)}}},_int:{encode(e){const{Err:t}=mn;if(e<bn)throw new t("integer: negative integers are not allowed");let n=Ls(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=mn;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return er(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=mn,o=wt("signature",e),{v:s,l:i}=r.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:l,l:a}=r.decode(2,s),{v:c,l:u}=r.decode(2,a);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(l),s:n.decode(c)}},hexFromSig(e){const{_tlv:t,_int:n}=mn,r=t.encode(2,n.encode(e.r)),o=t.encode(2,n.encode(e.s)),s=r+o;return t.encode(48,s)}};function vl(e,t){return zo(Uo(e,t))}const bn=BigInt(0),Re=BigInt(1);BigInt(2);const wl=BigInt(3),E6=BigInt(4);function S6(e){const t=w6(e),{Fp:n}=t,r=pl(t.n,t.nBitLength),o=t.toBytes||((P,A,k)=>{const B=A.toAffine();return Fs(Uint8Array.from([4]),n.toBytes(B.x),n.toBytes(B.y))}),s=t.fromBytes||(P=>{const A=P.subarray(1),k=n.fromBytes(A.subarray(0,n.BYTES)),B=n.fromBytes(A.subarray(n.BYTES,2*n.BYTES));return{x:k,y:B}});function i(P){const{a:A,b:k}=t,B=n.sqr(P),F=n.mul(B,P);return n.add(n.add(F,n.mul(P,A)),k)}function l(P,A){const k=n.sqr(A),B=i(P);return n.eql(k,B)}if(!l(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const a=n.mul(n.pow(t.a,wl),E6),c=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(a,c)))throw new Error("bad curve params: a or b");function u(P){return Fa(P,Re,t.n)}function d(P){const{allowedPrivateKeyLengths:A,nByteLength:k,wrapPrivateKey:B,n:F}=t;if(A&&typeof P!="bigint"){if(Ro(P)&&(P=zo(P)),typeof P!="string"||!A.includes(P.length))throw new Error("invalid private key");P=P.padStart(k*2,"0")}let b;try{b=typeof P=="bigint"?P:er(wt("private key",P,k))}catch{throw new Error("invalid private key, expected hex or "+k+" bytes, got "+typeof P)}return B&&(b=tt(b,F)),$r("private key",b,Re,F),b}function p(P){if(!(P instanceof m))throw new Error("ProjectivePoint expected")}const f=Kd((P,A)=>{const{px:k,py:B,pz:F}=P;if(n.eql(F,n.ONE))return{x:k,y:B};const b=P.is0();A==null&&(A=b?n.ONE:n.inv(F));const v=n.mul(k,A),E=n.mul(B,A),M=n.mul(F,A);if(b)return{x:n.ZERO,y:n.ZERO};if(!n.eql(M,n.ONE))throw new Error("invZ was invalid");return{x:v,y:E}}),h=Kd(P=>{if(P.is0()){if(t.allowInfinityPoint&&!n.is0(P.py))return;throw new Error("bad point: ZERO")}const{x:A,y:k}=P.toAffine();if(!n.isValid(A)||!n.isValid(k))throw new Error("bad point: x or y not FE");if(!l(A,k))throw new Error("bad point: equation left != right");if(!P.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(A,k,B){if(A==null||!n.isValid(A))throw new Error("x required");if(k==null||!n.isValid(k)||n.is0(k))throw new Error("y required");if(B==null||!n.isValid(B))throw new Error("z required");this.px=A,this.py=k,this.pz=B,Object.freeze(this)}static fromAffine(A){const{x:k,y:B}=A||{};if(!A||!n.isValid(k)||!n.isValid(B))throw new Error("invalid affine point");if(A instanceof m)throw new Error("projective point not allowed");const F=b=>n.eql(b,n.ZERO);return F(k)&&F(B)?m.ZERO:new m(k,B,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(A){const k=i0(n,A.map(B=>B.pz));return A.map((B,F)=>B.toAffine(k[F])).map(m.fromAffine)}static fromHex(A){const k=m.fromAffine(s(wt("pointHex",A)));return k.assertValidity(),k}static fromPrivateKey(A){return m.BASE.multiply(d(A))}static msm(A,k){return v6(m,r,A,k)}_setWindowSize(A){w.setWindowSize(this,A)}assertValidity(){h(this)}hasEvenY(){const{y:A}=this.toAffine();if(n.isOdd)return!n.isOdd(A);throw new Error("Field doesn't support isOdd")}equals(A){p(A);const{px:k,py:B,pz:F}=this,{px:b,py:v,pz:E}=A,M=n.eql(n.mul(k,E),n.mul(b,F)),$=n.eql(n.mul(B,E),n.mul(v,F));return M&&$}negate(){return new m(this.px,n.neg(this.py),this.pz)}double(){const{a:A,b:k}=t,B=n.mul(k,wl),{px:F,py:b,pz:v}=this;let E=n.ZERO,M=n.ZERO,$=n.ZERO,C=n.mul(F,F),D=n.mul(b,b),y=n.mul(v,v),O=n.mul(F,b);return O=n.add(O,O),$=n.mul(F,v),$=n.add($,$),E=n.mul(A,$),M=n.mul(B,y),M=n.add(E,M),E=n.sub(D,M),M=n.add(D,M),M=n.mul(E,M),E=n.mul(O,E),$=n.mul(B,$),y=n.mul(A,y),O=n.sub(C,y),O=n.mul(A,O),O=n.add(O,$),$=n.add(C,C),C=n.add($,C),C=n.add(C,y),C=n.mul(C,O),M=n.add(M,C),y=n.mul(b,v),y=n.add(y,y),C=n.mul(y,O),E=n.sub(E,C),$=n.mul(y,D),$=n.add($,$),$=n.add($,$),new m(E,M,$)}add(A){p(A);const{px:k,py:B,pz:F}=this,{px:b,py:v,pz:E}=A;let M=n.ZERO,$=n.ZERO,C=n.ZERO;const D=t.a,y=n.mul(t.b,wl);let O=n.mul(k,b),I=n.mul(B,v),S=n.mul(F,E),L=n.add(k,B),j=n.add(b,v);L=n.mul(L,j),j=n.add(O,I),L=n.sub(L,j),j=n.add(k,F);let z=n.add(b,E);return j=n.mul(j,z),z=n.add(O,S),j=n.sub(j,z),z=n.add(B,F),M=n.add(v,E),z=n.mul(z,M),M=n.add(I,S),z=n.sub(z,M),C=n.mul(D,j),M=n.mul(y,S),C=n.add(M,C),M=n.sub(I,C),C=n.add(I,C),$=n.mul(M,C),I=n.add(O,O),I=n.add(I,O),S=n.mul(D,S),j=n.mul(y,j),I=n.add(I,S),S=n.sub(O,S),S=n.mul(D,S),j=n.add(j,S),O=n.mul(I,j),$=n.add($,O),O=n.mul(z,j),M=n.mul(L,M),M=n.sub(M,O),O=n.mul(L,I),C=n.mul(z,C),C=n.add(C,O),new m(M,$,C)}subtract(A){return this.add(A.negate())}is0(){return this.equals(m.ZERO)}wNAF(A){return w.wNAFCached(this,A,m.normalizeZ)}multiplyUnsafe(A){const{endo:k,n:B}=t;$r("scalar",A,bn,B);const F=m.ZERO;if(A===bn)return F;if(this.is0()||A===Re)return this;if(!k||w.hasPrecomputes(this))return w.wNAFCachedUnsafe(this,A,m.normalizeZ);let{k1neg:b,k1:v,k2neg:E,k2:M}=k.splitScalar(A),$=F,C=F,D=this;for(;v>bn||M>bn;)v&Re&&($=$.add(D)),M&Re&&(C=C.add(D)),D=D.double(),v>>=Re,M>>=Re;return b&&($=$.negate()),E&&(C=C.negate()),C=new m(n.mul(C.px,k.beta),C.py,C.pz),$.add(C)}multiply(A){const{endo:k,n:B}=t;$r("scalar",A,Re,B);let F,b;if(k){const{k1neg:v,k1:E,k2neg:M,k2:$}=k.splitScalar(A);let{p:C,f:D}=this.wNAF(E),{p:y,f:O}=this.wNAF($);C=w.constTimeNegate(v,C),y=w.constTimeNegate(M,y),y=new m(n.mul(y.px,k.beta),y.py,y.pz),F=C.add(y),b=D.add(O)}else{const{p:v,f:E}=this.wNAF(A);F=v,b=E}return m.normalizeZ([F,b])[0]}multiplyAndAddUnsafe(A,k,B){const F=m.BASE,b=(E,M)=>M===bn||M===Re||!E.equals(F)?E.multiplyUnsafe(M):E.multiply(M),v=b(this,k).add(b(A,B));return v.is0()?void 0:v}toAffine(A){return f(this,A)}isTorsionFree(){const{h:A,isTorsionFree:k}=t;if(A===Re)return!0;if(k)return k(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:A,clearCofactor:k}=t;return A===Re?this:k?k(m,this):this.multiplyUnsafe(t.h)}toRawBytes(A=!0){return jo("isCompressed",A),this.assertValidity(),o(m,this,A)}toHex(A=!0){return jo("isCompressed",A),zo(this.toRawBytes(A))}}m.BASE=new m(t.Gx,t.Gy,n.ONE),m.ZERO=new m(n.ZERO,n.ONE,n.ZERO);const{endo:x,nBitLength:T}=t,w=y6(m,x?Math.ceil(T/2):T);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:d,weierstrassEquation:i,isWithinCurveOrder:u}}function P6(e){const t=m0(e);return js(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function T6(e){const t=P6(e),{Fp:n,n:r,nByteLength:o,nBitLength:s}=t,i=n.BYTES+1,l=2*n.BYTES+1;function a(y){return tt(y,r)}function c(y){return fl(y,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:p,isWithinCurveOrder:f}=S6({...t,toBytes(y,O,I){const S=O.toAffine(),L=n.toBytes(S.x),j=Fs;return jo("isCompressed",I),I?j(Uint8Array.from([O.hasEvenY()?2:3]),L):j(Uint8Array.from([4]),L,n.toBytes(S.y))},fromBytes(y){const O=y.length,I=y[0],S=y.subarray(1);if(O===i&&(I===2||I===3)){const L=er(S);if(!Fa(L,Re,n.ORDER))throw new Error("Point is not on curve");const j=p(L);let z;try{z=n.sqrt(j)}catch(Z){const q=Z instanceof Error?": "+Z.message:"";throw new Error("Point is not on curve"+q)}const W=(z&Re)===Re;return(I&1)===1!==W&&(z=n.neg(z)),{x:L,y:z}}else if(O===l&&I===4){const L=n.fromBytes(S.subarray(0,n.BYTES)),j=n.fromBytes(S.subarray(n.BYTES,2*n.BYTES));return{x:L,y:j}}else{const L=i,j=l;throw new Error("invalid Point, expected length of "+L+", or uncompressed "+j+", got "+O)}}});function h(y){const O=r>>Re;return y>O}function m(y){return h(y)?a(-y):y}const x=(y,O,I)=>er(y.slice(O,I));class T{constructor(O,I,S){$r("r",O,Re,r),$r("s",I,Re,r),this.r=O,this.s=I,S!=null&&(this.recovery=S),Object.freeze(this)}static fromCompact(O){const I=o;return O=wt("compactSignature",O,I*2),new T(x(O,0,I),x(O,I,2*I))}static fromDER(O){const{r:I,s:S}=mn.toSig(wt("DER",O));return new T(I,S)}assertValidity(){}addRecoveryBit(O){return new T(this.r,this.s,O)}recoverPublicKey(O){const{r:I,s:S,recovery:L}=this,j=F(wt("msgHash",O));if(L==null||![0,1,2,3].includes(L))throw new Error("recovery id invalid");const z=L===2||L===3?I+t.n:I;if(z>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const W=L&1?"03":"02",_=u.fromHex(W+vl(z,n.BYTES)),Z=c(z),q=a(-j*Z),H=a(S*Z),ee=u.BASE.multiplyAndAddUnsafe(_,q,H);if(!ee)throw new Error("point at infinify");return ee.assertValidity(),ee}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new T(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Bs(this.toDERHex())}toDERHex(){return mn.hexFromSig(this)}toCompactRawBytes(){return Bs(this.toCompactHex())}toCompactHex(){const O=o;return vl(this.r,O)+vl(this.s,O)}}const w={isValidPrivateKey(y){try{return d(y),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const y=u0(t.n);return m6(t.randomBytes(y),t.n)},precompute(y=8,O=u.BASE){return O._setWindowSize(y),O.multiply(BigInt(3)),O}};function P(y,O=!0){return u.fromPrivateKey(y).toRawBytes(O)}function A(y){if(typeof y=="bigint")return!1;if(y instanceof u)return!0;const I=wt("key",y).length,S=n.BYTES,L=S+1,j=2*S+1;if(!(t.allowedPrivateKeyLengths||o===L))return I===L||I===j}function k(y,O,I=!0){if(A(y)===!0)throw new Error("first arg must be private key");if(A(O)===!1)throw new Error("second arg must be public key");return u.fromHex(O).multiply(d(y)).toRawBytes(I)}const B=t.bits2int||function(y){if(y.length>8192)throw new Error("input is too large");const O=er(y),I=y.length*8-s;return I>0?O>>BigInt(I):O},F=t.bits2int_modN||function(y){return a(B(y))},b=Rs(s);function v(y){return $r("num < 2^"+s,y,bn,b),Uo(y,o)}function E(y,O,I=M){if(["recovered","canonical"].some(me=>me in I))throw new Error("sign() legacy options not supported");const{hash:S,randomBytes:L}=t;let{lowS:j,prehash:z,extraEntropy:W}=I;j==null&&(j=!0),y=wt("msgHash",y),b0(I),z&&(y=wt("prehashed msgHash",S(y)));const _=F(y),Z=d(O),q=[v(Z),v(_)];if(W!=null&&W!==!1){const me=W===!0?L(n.BYTES):W;q.push(wt("extraEntropy",me))}const H=Fs(...q),ee=_;function fe(me){const ye=B(me);if(!f(ye))return;const ve=c(ye),oe=u.BASE.multiply(ye).toAffine(),V=a(oe.x);if(V===bn)return;const X=a(ve*a(ee+V*Z));if(X===bn)return;let Q=(oe.x===V?0:2)|Number(oe.y&Re),we=X;return j&&h(X)&&(we=m(X),Q^=1),new T(V,we,Q)}return{seed:H,k2sig:fe}}const M={lowS:t.lowS,prehash:!1},$={lowS:t.lowS,prehash:!1};function C(y,O,I=M){const{seed:S,k2sig:L}=E(y,O,I),j=t;return Iy(j.hash.outputLen,j.nByteLength,j.hmac)(S,L)}u.BASE._setWindowSize(8);function D(y,O,I,S=$){var Q;const L=y;O=wt("msgHash",O),I=wt("publicKey",I);const{lowS:j,prehash:z,format:W}=S;if(b0(S),"strict"in S)throw new Error("options.strict was renamed to lowS");if(W!==void 0&&W!=="compact"&&W!=="der")throw new Error("format must be compact or der");const _=typeof L=="string"||Ro(L),Z=!_&&!W&&typeof L=="object"&&L!==null&&typeof L.r=="bigint"&&typeof L.s=="bigint";if(!_&&!Z)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let q,H;try{if(Z&&(q=new T(L.r,L.s)),_){try{W!=="compact"&&(q=T.fromDER(L))}catch(we){if(!(we instanceof mn.Err))throw we}!q&&W!=="der"&&(q=T.fromCompact(L))}H=u.fromHex(I)}catch{return!1}if(!q||j&&q.hasHighS())return!1;z&&(O=t.hash(O));const{r:ee,s:fe}=q,me=F(O),ye=c(fe),ve=a(me*ye),oe=a(ee*ye),V=(Q=u.BASE.multiplyAndAddUnsafe(H,ve,oe))==null?void 0:Q.toAffine();return V?a(V.x)===ee:!1}return{CURVE:t,getPublicKey:P,getSharedSecret:k,sign:C,verify:D,ProjectivePoint:u,Signature:T,utils:w}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function A6(e){return{hash:e,hmac:(t,...n)=>Hf(e,t,Gg(...n)),randomBytes:qg}}function N6(e,t){const n=r=>T6({...e,...A6(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const g0=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),y0=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),C6=BigInt(0),O6=BigInt(1),xl=BigInt(2),v0=(e,t)=>(e+t/xl)/t;function $6(e){const t=g0,n=BigInt(3),r=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),l=BigInt(44),a=BigInt(88),c=e*e*e%t,u=c*c*e%t,d=xt(u,n,t)*u%t,p=xt(d,n,t)*u%t,f=xt(p,xl,t)*c%t,h=xt(f,o,t)*f%t,m=xt(h,s,t)*h%t,x=xt(m,l,t)*m%t,T=xt(x,a,t)*x%t,w=xt(T,l,t)*m%t,P=xt(w,n,t)*u%t,A=xt(P,i,t)*h%t,k=xt(A,r,t)*c%t,B=xt(k,xl,t);if(!El.eql(El.sqr(B),e))throw new Error("Cannot find square root");return B}const El=pl(g0,void 0,void 0,{sqrt:$6}),w0=N6({a:C6,b:BigInt(7),Fp:El,n:y0,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=y0,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-O6*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=n,i=BigInt("0x100000000000000000000000000000000"),l=v0(s*e,t),a=v0(-r*e,t);let c=tt(e-l*n-a*o,t),u=tt(-l*r-a*s,t);const d=c>i,p=u>i;if(d&&(c=t-c),p&&(u=t-u),c>i||u>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:c,k2neg:p,k2:u}}}},Id),M6=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:w0},Symbol.toStringTag,{value:"Module"}));function x0(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new Pl({signature:e});if(typeof e.s>"u")throw new Pl({signature:e});if(n&&typeof e.yParity>"u")throw new Pl({signature:e});if(e.r<0n||e.r>Yf)throw new R6({value:e.r});if(e.s<0n||e.s>Yf)throw new j6({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Tl({value:e.yParity})}function I6(e){return E0(Rt(e))}function E0(e){if(e.length!==130&&e.length!==132)throw new F6({signature:e});const t=BigInt(Yt(e,0,32)),n=BigInt(Yt(e,32,64)),r=(()=>{const o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return Sl(o)}catch{throw new Tl({value:o})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function D6(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return k6(e)}function k6(e){const t=typeof e=="string"?E0(e):e instanceof Uint8Array?I6(e):typeof e.r=="string"?B6(e):e.v?L6(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return x0(t),t}function L6(e){return{r:e.r,s:e.s,yParity:Sl(e.v)}}function B6(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=Sl(n)),typeof r!="number")throw new Tl({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function Sl(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new z6({value:e})}class F6 extends re{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${ft(rv(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Pl extends re{constructor({signature:t}){super(`Signature \`${Qd(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class R6 extends re{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class j6 extends re{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class Tl extends re{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class z6 extends re{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function U6(e,t={}){return typeof e.chainId=="string"?W6(e):{...e,...t.signature}}function W6(e){const{address:t,chainId:n,nonce:r}=e,o=D6(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...o}}const _6="0x8010801080108010801080108010801080108010801080108010801080108010",V6=Qf("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function S0(e){if(typeof e=="string"){if(Yt(e,-32)!==_6)throw new q6(e)}else x0(e.authorization)}function H6(e){S0(e);const t=of(Yt(e,-64,-32)),n=Yt(e,-t-64,-64),r=Yt(e,0,-t-64),[o,s,i]=r6(V6,n);return{authorization:U6({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:r,...i&&i!=="0x"?{data:i,to:s}:{}}}function G6(e){try{return S0(e),!0}catch{return!1}}let q6=class extends re{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};class K6 extends G{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function Z6(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new K6({value:e});let[n,r="0"]=e.split(".");const o=n.startsWith("-");if(o&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[s,i,l]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],a=Math.round(+`${i}.${l}`);a>9?r=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):r=`${s}${a}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${o?"-":""}${n}${r}`)}function Y6(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function X6(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?ln(e.nonce):void 0,storageProof:e.storageProof?Y6(e.storageProof):void 0}}async function J6(e,{address:t,blockNumber:n,blockTag:r,storageKeys:o}){const s=r??"latest",i=n!==void 0?ne(n):void 0,l=await e.request({method:"eth_getProof",params:[t,o,i||s]});return X6(l)}async function Q6(e,{address:t,blockNumber:n,blockTag:r="latest",slot:o}){const s=n!==void 0?ne(n):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,s||r]})}async function Al(e,{blockHash:t,blockNumber:n,blockTag:r,hash:o,index:s,sender:i,nonce:l}){var p,f,h;const a=r||"latest",c=n!==void 0?ne(n):void 0;let u=null;if(o?u=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?u=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,ne(s)]},{dedupe:!0}):typeof s=="number"?u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[c||a,ne(s)]},{dedupe:!!c}):i&&typeof l=="number"&&(u=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,ne(l)]},{dedupe:!0})),!u)throw new fd({blockHash:t,blockNumber:n,blockTag:a,hash:o,index:s});return(((h=(f=(p=e.chain)==null?void 0:p.formatters)==null?void 0:f.transaction)==null?void 0:h.format)||Sa)(u,"getTransaction")}async function ex(e,{hash:t,transactionReceipt:n}){const[r,o]=await Promise.all([te(e,Vo,"getBlockNumber")({}),t?te(e,Al,"getTransaction")({hash:t}):void 0]),s=(n==null?void 0:n.blockNumber)||(o==null?void 0:o.blockNumber);return s?r-s+1n:0n}async function Ks(e,{hash:t}){var o,s,i;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new pd({hash:t});return(((i=(s=(o=e.chain)==null?void 0:o.formatters)==null?void 0:s.transactionReceipt)==null?void 0:i.format)||Pf)(n,"getTransactionReceipt")}async function tx(e,t){var w;const{account:n,authorizationList:r,allowFailure:o=!0,blockNumber:s,blockOverrides:i,blockTag:l,stateOverride:a}=t,c=t.contracts,{batchSize:u=t.batchSize??1024,deployless:d=t.deployless??!1}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},p=(()=>{if(t.multicallAddress)return t.multicallAddress;if(d)return null;if(e.chain)return kr({blockNumber:s,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),f=[[]];let h=0,m=0;for(let P=0;P<c.length;P++){const{abi:A,address:k,args:B,functionName:F}=c[P];try{const b=vt({abi:A,args:B,functionName:F});m+=(b.length-2)/2,u>0&&m>u&&f[h].length>0&&(h++,m=(b.length-2)/2,f[h]=[]),f[h]=[...f[h],{allowFailure:!0,callData:b,target:k}]}catch(b){const v=Nr(b,{abi:A,address:k,args:B,docsPath:"/docs/contract/multicall",functionName:F,sender:n});if(!o)throw v;f[h]=[...f[h],{allowFailure:!0,callData:"0x",target:k}]}}const x=await Promise.allSettled(f.map(P=>te(e,jt,"readContract")({...p===null?{code:Ua}:{address:p},abi:Ir,account:n,args:[P],authorizationList:r,blockNumber:s,blockOverrides:i,blockTag:l,functionName:"aggregate3",stateOverride:a}))),T=[];for(let P=0;P<x.length;P++){const A=x[P];if(A.status==="rejected"){if(!o)throw A.reason;for(let B=0;B<f[P].length;B++)T.push({status:"failure",error:A.reason,result:void 0});continue}const k=A.value;for(let B=0;B<k.length;B++){const{returnData:F,success:b}=k[B],{callData:v}=f[P][B],{abi:E,address:M,functionName:$,args:C}=c[T.length];try{if(v==="0x")throw new ro;if(!b)throw new Os({data:F});const D=kn({abi:E,args:C,data:F,functionName:$});T.push(o?{result:D,status:"success"}:D)}catch(D){const y=Nr(D,{abi:E,address:M,args:C,docsPath:"/docs/contract/multicall",functionName:$});if(!o)throw y;T.push({error:y,result:void 0,status:"failure"})}}}if(T.length!==c.length)throw new G("multicall results mismatch");return T}async function Nl(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:i,validation:l}=t;try{const a=[];for(const p of o){const f=p.blockOverrides?uf(p.blockOverrides):void 0,h=p.calls.map(x=>{const T=x,w=T.account?dt(T.account):void 0,P=T.abi?vt(T):T.data,A={...T,account:w,data:T.dataSuffix?Lt([P||"0x",T.dataSuffix]):P,from:T.from??(w==null?void 0:w.address)};return Or(A),Bo(A)}),m=p.stateOverrides?xa(p.stateOverrides):void 0;a.push({blockOverrides:f,calls:h,stateOverrides:m})}const u=(typeof n=="bigint"?ne(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:a,returnFullTransactions:s,traceTransfers:i,validation:l},u]})).map((p,f)=>({...Nd(p),calls:p.calls.map((h,m)=>{var E,M;const{abi:x,args:T,functionName:w,to:P}=o[f].calls[m],A=((E=h.error)==null?void 0:E.data)??h.returnData,k=BigInt(h.gasUsed),B=(M=h.logs)==null?void 0:M.map($=>Zt($)),F=h.status==="0x1"?"success":"failure",b=x&&F==="success"&&A!=="0x"?kn({abi:x,data:A,functionName:w}):null,v=(()=>{if(F==="success")return;let $;if(A==="0x"?$=new ro:A&&($=new Os({data:A})),!!$)return Nr($,{abi:x??[],address:P??"0x",args:T,functionName:w??"<unknown>"})})();return{data:A,gasUsed:k,logs:B,status:F,...F==="success"?{result:b}:{error:v}}})}))}catch(a){const c=a,u=Is(c,{});throw u instanceof Lo?c:u}}function Cl(e){let t=!0,n="",r=0,o="",s=!1;for(let i=0;i<e.length;i++){const l=e[i];if(["(",")",","].includes(l)&&(t=!0),l==="("&&r++,l===")"&&r--,!!t){if(r===0){if(l===" "&&["event","function","error",""].includes(o))o="";else if(o+=l,l===")"){s=!0;break}continue}if(l===" "){e[i-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}o+=l,n+=l}}if(!s)throw new re("Unable to normalize signature.");return o}function Ol(e,t){const n=typeof e,r=t.type;switch(r){case"address":return ol(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>Ol(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(o=>Ol(o,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function P0(e,t,n){for(const r in e){const o=e[r],s=t[r];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return P0(o.components,s.components,n[r]);const i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?ol(n[r],{strict:!1}):i.includes("address")&&i.includes("bytes")?ol(n[r],{strict:!1}):!1)return i}}function T0(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Eu(e):e;return{...r,...n?{hash:Fr(r)}:{}}}function Zs(e,t,n){const{args:r=[],prepare:o=!0}=n??{},s=ov(t,{strict:!1}),i=e.filter(c=>s?c.type==="function"||c.type==="error"?A0(c)===Yt(t,0,4):c.type==="event"?Fr(c)===t:!1:"name"in c&&c.name===t);if(i.length===0)throw new Ys({name:t});if(i.length===1)return{...i[0],...o?{hash:Fr(i[0])}:{}};let l;for(const c of i){if(!("inputs"in c))continue;if(!r||r.length===0){if(!c.inputs||c.inputs.length===0)return{...c,...o?{hash:Fr(c)}:{}};continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==r.length)continue;if(r.every((d,p)=>{const f="inputs"in c&&c.inputs[p];return f?Ol(d,f):!1})){if(l&&"inputs"in l&&l.inputs){const d=P0(c.inputs,l.inputs,r);if(d)throw new rx({abiItem:c,type:d[0]},{abiItem:l,type:d[1]})}l=c}}const a=(()=>{if(l)return l;const[c,...u]=i;return{...c,overloads:u}})();if(!a)throw new Ys({name:t});return{...a,...o?{hash:Fr(a)}:{}}}function A0(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Zs(n,r)}return e[0]})();return Yt(Fr(t),0,4)}function nx(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,o]=e;return Zs(r,o)}return e[0]})(),n=typeof t=="string"?t:vs(t);return Cl(n)}function Fr(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return Zs(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:Gf(ja(nx(t)))}class rx extends re{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${Cl(vs(t.abiItem))}\`, and`,`\`${n.type}\` in \`${Cl(vs(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class Ys extends re{constructor({name:t,data:n,type:r="item"}){const o=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${o} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function ox(...e){var s;const[t,n]=(()=>{if(Array.isArray(e[0])){const[i,l]=e;return[ix(i),l]}return e})(),{bytecode:r,args:o}=n;return Ft(r,(s=t.inputs)!=null&&s.length&&(o!=null&&o.length)?cl(t.inputs,o):"0x")}function sx(e){return T0(e)}function ix(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new Ys({name:"constructor"});return t}function ax(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[c,u,d]=e;return[N0(c,u,{args:d}),d]}const[l,a]=e;return[l,a]})(),{overloads:r}=t,o=r?N0([t,...r],t.name,{args:n}):t,s=lx(o),i=n.length>0?cl(o.inputs,n):void 0;return i?Ft(s,i):s}function Rr(e,t={}){return T0(e,t)}function N0(e,t,n){const r=Zs(e,t,n);if(r.type!=="function")throw new Ys({name:t,type:"function"});return r}function lx(e){return A0(e)}const cx="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",zt="0x0000000000000000000000000000000000000000",ux="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function dx(e,t){const{blockNumber:n,blockTag:r,calls:o,stateOverrides:s,traceAssetChanges:i,traceTransfers:l,validation:a}=t,c=t.account?dt(t.account):void 0;if(i&&!c)throw new G("`account` is required when `traceAssetChanges` is true");const u=c?ox(sx("constructor(bytes, bytes)"),{bytecode:gf,args:[ux,ax(Rr("function getBalance(address)"),[c.address])]}):void 0,d=i?await Promise.all(t.calls.map(async S=>{if(!S.data&&!S.abi)return;const{accessList:L}=await Df(e,{account:c.address,...S,data:S.abi?vt(S):S.data});return L.map(({address:j,storageKeys:z})=>z.length>0?j:null)})).then(S=>S.flat().filter(Boolean)):[],p=await Nl(e,{blockNumber:n,blockTag:r,blocks:[...i?[{calls:[{data:u}],stateOverrides:s},{calls:d.map((S,L)=>({abi:[Rr("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[c.address],to:S,from:zt,nonce:L})),stateOverrides:[{address:zt,nonce:0}]}]:[],{calls:[...o,{to:zt}].map(S=>({...S,from:c==null?void 0:c.address})),stateOverrides:s},...i?[{calls:[{data:u}]},{calls:d.map((S,L)=>({abi:[Rr("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[c.address],to:S,from:zt,nonce:L})),stateOverrides:[{address:zt,nonce:0}]},{calls:d.map((S,L)=>({to:S,abi:[Rr("function decimals() returns (uint256)")],functionName:"decimals",from:zt,nonce:L})),stateOverrides:[{address:zt,nonce:0}]},{calls:d.map((S,L)=>({to:S,abi:[Rr("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:zt,nonce:L})),stateOverrides:[{address:zt,nonce:0}]},{calls:d.map((S,L)=>({to:S,abi:[Rr("function symbol() returns (string)")],functionName:"symbol",from:zt,nonce:L})),stateOverrides:[{address:zt,nonce:0}]}]:[]],traceTransfers:l,validation:a}),f=i?p[2]:p[0],[h,m,,x,T,w,P,A]=i?p:[],{calls:k,...B}=f,F=k.slice(0,-1)??[],b=(h==null?void 0:h.calls)??[],v=(m==null?void 0:m.calls)??[],E=[...b,...v].map(S=>S.status==="success"?Gt(S.data):null),M=(x==null?void 0:x.calls)??[],$=(T==null?void 0:T.calls)??[],C=[...M,...$].map(S=>S.status==="success"?Gt(S.data):null),D=((w==null?void 0:w.calls)??[]).map(S=>S.status==="success"?S.result:null),y=((A==null?void 0:A.calls)??[]).map(S=>S.status==="success"?S.result:null),O=((P==null?void 0:P.calls)??[]).map(S=>S.status==="success"?S.result:null),I=[];for(const[S,L]of C.entries()){const j=E[S];if(typeof L!="bigint"||typeof j!="bigint")continue;const z=D[S-1],W=y[S-1],_=O[S-1],Z=S===0?{address:cx,decimals:18,symbol:"ETH"}:{address:d[S-1],decimals:_||z?Number(z??1):void 0,symbol:W??void 0};I.some(q=>q.token.address===Z.address)||I.push({token:Z,value:{pre:j,post:L,diff:L-j}})}return{assetChanges:I,block:B,results:F}}const C0="0x6492649264926492649264926492649264926492649264926492649264926492";function fx(e){if(Yt(e,-32)!==C0)throw new mx(e)}function px(e){const{data:t,signature:n,to:r}=e;return Ft(cl(Qf("address, bytes, bytes"),[r,t,n]),C0)}function hx(e){try{return fx(e),!0}catch{return!1}}class mx extends re{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function bx({r:e,s:t,to:n="hex",v:r,yParity:o}){const s=(()=>{if(o===0||o===1)return o;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),i=`0x${new w0.Signature(Gt(e),Gt(t)).toCompactHex()}${s===0?"1b":"1c"}`;return n==="hex"?i:qt(i)}async function Xs(e,t){var a,c,u,d;const{address:n,chain:r=e.chain,hash:o,erc6492VerifierAddress:s=t.universalSignatureVerifierAddress??((c=(a=r==null?void 0:r.contracts)==null?void 0:a.erc6492Verifier)==null?void 0:c.address),multicallAddress:i=t.multicallAddress??((d=(u=r==null?void 0:r.contracts)==null?void 0:u.multicall3)==null?void 0:d.address)}=t;if(r!=null&&r.verifyHash)return await r.verifyHash(e,t);const l=(()=>{const p=t.signature;return Dt(p)?p:typeof p=="object"&&"r"in p&&"s"in p?bx(p):Le(p)})();try{return G6(l)?await gx(e,{...t,multicallAddress:i,signature:l}):await yx(e,{...t,verifierAddress:s,signature:l})}catch(p){try{if(Fo(un(n),await yd({hash:o,signature:l})))return!0}catch{}if(p instanceof or)return!1;throw p}}async function gx(e,t){var x;const{address:n,blockNumber:r,blockTag:o,hash:s,multicallAddress:i}=t,{authorization:l,data:a,signature:c,to:u}=H6(t.signature);if(await Hs(e,{address:n,blockNumber:r,blockTag:o})===Sr(["0xef0100",l.address]))return await vx(e,{address:n,blockNumber:r,blockTag:o,hash:s,signature:c});const p={address:l.address,chainId:Number(l.chainId),nonce:Number(l.nonce),r:ne(l.r,{size:32}),s:ne(l.s,{size:32}),yParity:l.yParity};if(!await sw({address:n,authorization:p}))throw new or;const h=await te(e,jt,"readContract")({...i?{address:i}:{code:Ua},authorizationList:[p],abi:Ir,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...a?[{allowFailure:!0,target:u??n,callData:a}]:[],{allowFailure:!0,target:n,callData:vt({abi:mf,functionName:"isValidSignature",args:[s,c]})}]]}),m=(x=h[h.length-1])==null?void 0:x.returnData;if(m!=null&&m.startsWith("0x1626ba7e"))return!0;throw new or}async function yx(e,t){const{address:n,factory:r,factoryData:o,hash:s,signature:i,verifierAddress:l,...a}=t,c=await(async()=>!r&&!o||hx(i)?i:px({data:o,signature:i,to:r}))(),u=l?{to:l,data:vt({abi:bf,functionName:"isValidSig",args:[n,s,c]}),...a}:{data:Va({abi:bf,args:[n,s,c],bytecode:dv}),...a},{data:d}=await te(e,Lr,"call")(u).catch(p=>{throw p instanceof hd?new or:p});if(Ng(d??"0x0"))return!0;throw new or}async function vx(e,t){const{address:n,blockNumber:r,blockTag:o,hash:s,signature:i}=t;if((await te(e,jt,"readContract")({address:n,abi:mf,args:[s,i],blockNumber:r,blockTag:o,functionName:"isValidSignature"}).catch(a=>{throw a instanceof md?new or:a})).startsWith("0x1626ba7e"))return!0;throw new or}class or extends Error{}async function wx(e,{address:t,message:n,factory:r,factoryData:o,signature:s,...i}){const l=jf(n);return te(e,Xs,"verifyHash")({address:t,factory:r,factoryData:o,hash:l,signature:s,...i})}async function xx(e,t){const{address:n,factory:r,factoryData:o,signature:s,message:i,primaryType:l,types:a,domain:c,...u}=t,d=Cw({message:i,primaryType:l,types:a,domain:c});return te(e,Xs,"verifyHash")({address:n,factory:r,factoryData:o,hash:d,signature:s,...u})}function O0(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:o,poll:s,pollingInterval:i=e.pollingInterval}){const l=typeof s<"u"?s:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let a;return l?(()=>{const d=Be(["watchBlockNumber",e.uid,t,n,i]);return Ln(d,{onBlockNumber:r,onError:o},p=>_o(async()=>{var f;try{const h=await te(e,Vo,"getBlockNumber")({cacheTime:0});if(a!==void 0){if(h===a)return;if(h-a>1&&n)for(let m=a+1n;m<h;m++)p.onBlockNumber(m,a),a=m}(a===void 0||h>a)&&(p.onBlockNumber(h,a),a=h)}catch(h){(f=p.onError)==null||f.call(p,h)}},{emitOnBegin:t,interval:i}))})():(()=>{const d=Be(["watchBlockNumber",e.uid,t,n]);return Ln(d,{onBlockNumber:r,onError:o},p=>{let f=!0,h=()=>f=!1;return(async()=>{try{const m=(()=>{if(e.transport.type==="fallback"){const T=e.transport.transports.find(w=>w.config.type==="webSocket"||w.config.type==="ipc");return T?T.value:e.transport}return e.transport})(),{unsubscribe:x}=await m.subscribe({params:["newHeads"],onData(T){var P;if(!f)return;const w=Gt((P=T.result)==null?void 0:P.number);p.onBlockNumber(w,a),a=w},onError(T){var w;(w=p.onError)==null||w.call(p,T)}});h=x,f||h()}catch(m){o==null||o(m)}})(),()=>h()})})()}async function Ex(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:o,onReplaced:s,retryCount:i=6,retryDelay:l=({count:k})=>~~(1<<k)*200,timeout:a=18e4}=t,c=Be(["waitForTransactionReceipt",e.uid,o]),u=(()=>{var k;return t.pollingInterval?t.pollingInterval:(k=e.chain)!=null&&k.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let d,p,f,h=!1,m,x;const{promise:T,resolve:w,reject:P}=wf(),A=a?setTimeout(()=>{x==null||x(),m==null||m(),P(new W1({hash:o}))},a):void 0;return m=Ln(c,{onReplaced:s,resolve:w,reject:P},async k=>{if(f=await te(e,Ks,"getTransactionReceipt")({hash:o}).catch(()=>{}),f&&r<=1){clearTimeout(A),k.resolve(f),m==null||m();return}x=te(e,O0,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(B){const F=v=>{clearTimeout(A),x==null||x(),v(),m==null||m()};let b=B;if(!h)try{if(f){if(r>1&&(!f.blockNumber||b-f.blockNumber+1n<r))return;F(()=>k.resolve(f));return}if(n&&!d&&(h=!0,await Ka(async()=>{d=await te(e,Al,"getTransaction")({hash:o}),d.blockNumber&&(b=d.blockNumber)},{delay:l,retryCount:i}),h=!1),f=await te(e,Ks,"getTransactionReceipt")({hash:o}),r>1&&(!f.blockNumber||b-f.blockNumber+1n<r))return;F(()=>k.resolve(f))}catch(v){if(v instanceof fd||v instanceof pd){if(!d){h=!1;return}try{p=d,h=!0;const E=await Ka(()=>te(e,Bt,"getBlock")({blockNumber:b,includeTransactions:!0}),{delay:l,retryCount:i,shouldRetry:({error:C})=>C instanceof Td});h=!1;const M=E.transactions.find(({from:C,nonce:D})=>C===p.from&&D===p.nonce);if(!M||(f=await te(e,Ks,"getTransactionReceipt")({hash:M.hash}),r>1&&(!f.blockNumber||b-f.blockNumber+1n<r)))return;let $="replaced";M.to===p.to&&M.value===p.value&&M.input===p.input?$="repriced":M.from===M.to&&M.value===0n&&($="cancelled"),F(()=>{var C;(C=k.onReplaced)==null||C.call(k,{reason:$,replacedTransaction:p,transaction:M,transactionReceipt:f}),k.resolve(f)})}catch(E){F(()=>k.reject(E))}}else F(()=>k.reject(v))}}})}),T}function Sx(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:o,onError:s,includeTransactions:i,poll:l,pollingInterval:a=e.pollingInterval}){const c=typeof l<"u"?l:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),u=i??!1;let d;return c?(()=>{const h=Be(["watchBlocks",e.uid,t,n,r,u,a]);return Ln(h,{onBlock:o,onError:s},m=>_o(async()=>{var x;try{const T=await te(e,Bt,"getBlock")({blockTag:t,includeTransactions:u});if(T.number!==null&&(d==null?void 0:d.number)!=null){if(T.number===d.number)return;if(T.number-d.number>1&&n)for(let w=(d==null?void 0:d.number)+1n;w<T.number;w++){const P=await te(e,Bt,"getBlock")({blockNumber:w,includeTransactions:u});m.onBlock(P,d),d=P}}((d==null?void 0:d.number)==null||t==="pending"&&(T==null?void 0:T.number)==null||T.number!==null&&T.number>d.number)&&(m.onBlock(T,d),d=T)}catch(T){(x=m.onError)==null||x.call(m,T)}},{emitOnBegin:r,interval:a}))})():(()=>{let h=!0,m=!0,x=()=>h=!1;return(async()=>{try{r&&te(e,Bt,"getBlock")({blockTag:t,includeTransactions:u}).then(P=>{h&&m&&(o(P,void 0),m=!1)}).catch(s);const T=(()=>{if(e.transport.type==="fallback"){const P=e.transport.transports.find(A=>A.config.type==="webSocket"||A.config.type==="ipc");return P?P.value:e.transport}return e.transport})(),{unsubscribe:w}=await T.subscribe({params:["newHeads"],async onData(P){var k;if(!h)return;const A=await te(e,Bt,"getBlock")({blockNumber:(k=P.result)==null?void 0:k.number,includeTransactions:u}).catch(()=>{});h&&(o(A,d),m=!1,d=A)},onError(P){s==null||s(P)}});x=w,h||x()}catch(T){s==null||s(T)}})(),()=>x()})()}function Px(e,{address:t,args:n,batch:r=!0,event:o,events:s,fromBlock:i,onError:l,onLogs:a,poll:c,pollingInterval:u=e.pollingInterval,strict:d}){const p=typeof c<"u"?c:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),f=d??!1;return p?(()=>{const x=Be(["watchEvent",t,n,r,e.uid,o,u,i]);return Ln(x,{onLogs:a,onError:l},T=>{let w;i!==void 0&&(w=i-1n);let P,A=!1;const k=_o(async()=>{var B;if(!A){try{P=await te(e,kf,"createEventFilter")({address:t,args:n,event:o,events:s,strict:f,fromBlock:i})}catch{}A=!0;return}try{let F;if(P)F=await te(e,Us,"getFilterChanges")({filter:P});else{const b=await te(e,Vo,"getBlockNumber")({});w&&w!==b?F=await te(e,Ma,"getLogs")({address:t,args:n,event:o,events:s,fromBlock:w+1n,toBlock:b}):F=[],w=b}if(F.length===0)return;if(r)T.onLogs(F);else for(const b of F)T.onLogs([b])}catch(F){P&&F instanceof Mn&&(A=!1),(B=T.onError)==null||B.call(T,F)}},{emitOnBegin:!0,interval:u});return async()=>{P&&await te(e,Ws,"uninstallFilter")({filter:P}),k()}})})():(()=>{let x=!0,T=()=>x=!1;return(async()=>{try{const w=(()=>{if(e.transport.type==="fallback"){const B=e.transport.transports.find(F=>F.config.type==="webSocket"||F.config.type==="ipc");return B?B.value:e.transport}return e.transport})(),P=s??(o?[o]:void 0);let A=[];P&&(A=[P.flatMap(F=>lo({abi:[F],eventName:F.name,args:n}))],o&&(A=A[0]));const{unsubscribe:k}=await w.subscribe({params:["logs",{address:t,topics:A}],onData(B){var b;if(!x)return;const F=B.result;try{const{eventName:v,args:E}=ks({abi:P??[],data:F.data,topics:F.topics,strict:f}),M=Zt(F,{args:E,eventName:v});a([M])}catch(v){let E,M;if(v instanceof Es||v instanceof Yi){if(d)return;E=v.abiItem.name,M=(b=v.abiItem.inputs)==null?void 0:b.some(C=>!("name"in C&&C.name))}const $=Zt(F,{args:M?[]:{},eventName:E});a([$])}},onError(B){l==null||l(B)}});T=k,x||T()}catch(w){l==null||l(w)}})(),()=>T()})()}function Tx(e,{batch:t=!0,onError:n,onTransactions:r,poll:o,pollingInterval:s=e.pollingInterval}){return(typeof o<"u"?o:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const c=Be(["watchPendingTransactions",e.uid,t,s]);return Ln(c,{onTransactions:r,onError:n},u=>{let d;const p=_o(async()=>{var f;try{if(!d)try{d=await te(e,Lf,"createPendingTransactionFilter")({});return}catch(m){throw p(),m}const h=await te(e,Us,"getFilterChanges")({filter:d});if(h.length===0)return;if(t)u.onTransactions(h);else for(const m of h)u.onTransactions([m])}catch(h){(f=u.onError)==null||f.call(u,h)}},{emitOnBegin:!0,interval:s});return async()=>{d&&await te(e,Ws,"uninstallFilter")({filter:d}),p()}})})():(()=>{let c=!0,u=()=>c=!1;return(async()=>{try{const{unsubscribe:d}=await e.transport.subscribe({params:["newPendingTransactions"],onData(p){if(!c)return;const f=p.result;r([f])},onError(p){n==null||n(p)}});u=d,c||u()}catch(d){n==null||n(d)}})(),()=>u()})()}function Ax(e){var d,p,f;const{scheme:t,statement:n,...r}=((d=e.match(Nx))==null?void 0:d.groups)??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:l,requestId:a,...c}=((p=e.match(Cx))==null?void 0:p.groups)??{},u=(f=e.split("Resources:")[1])==null?void 0:f.split(`
|
|
91
|
+
- `).slice(1);return{...r,...c,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...i?{issuedAt:new Date(i)}:{},...l?{notBefore:new Date(l)}:{},...a?{requestId:a}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...n?{statement:n}:{}}}const Nx=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,Cx=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function Ox(e){const{address:t,domain:n,message:r,nonce:o,scheme:s,time:i=new Date}=e;if(n&&r.domain!==n||o&&r.nonce!==o||s&&r.scheme!==s||r.expirationTime&&i>=r.expirationTime||r.notBefore&&i<r.notBefore)return!1;try{if(!r.address||!yt(r.address,{strict:!1})||t&&!Fo(r.address,t))return!1}catch{return!1}return!0}async function $x(e,t){const{address:n,domain:r,message:o,nonce:s,scheme:i,signature:l,time:a=new Date,...c}=t,u=Ax(o);if(!u.address||!Ox({address:n,domain:r,message:u,nonce:s,scheme:i,time:a}))return!1;const p=jf(o);return Xs(e,{address:u.address,hash:p,signature:l,...c})}async function Mx(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){var l,a,c;const o=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,r]:[t]},{retryCount:0}),i=(((c=(a=(l=e.chain)==null?void 0:l.formatters)==null?void 0:a.transactionReceipt)==null?void 0:c.format)||Pf)(o);if(i.status==="reverted"&&n)throw new U1({receipt:i});return i}function Ix(e){return{call:t=>Lr(e,t),createAccessList:t=>Df(e,t),createBlockFilter:()=>Kv(e),createContractEventFilter:t=>rd(e,t),createEventFilter:t=>kf(e,t),createPendingTransactionFilter:()=>Lf(e),estimateContractGas:t=>Ny(e,t),estimateGas:t=>Oa(e,t),getBalance:t=>Zv(e,t),getBlobBaseFee:()=>Yv(e),getBlock:t=>Bt(e,t),getBlockNumber:t=>Vo(e,t),getBlockTransactionCount:t=>Xv(e,t),getBytecode:t=>Hs(e,t),getChainId:()=>Na(e),getCode:t=>Hs(e,t),getContractEvents:t=>Ud(e,t),getDelegation:t=>Jv(e,t),getEip712Domain:t=>ew(e,t),getEnsAddress:t=>Iv(e,t),getEnsAvatar:t=>Hv(e,t),getEnsName:t=>Gv(e,t),getEnsResolver:t=>qv(e,t),getEnsText:t=>If(e,t),getFeeHistory:t=>rw(e,t),estimateFeesPerGas:t=>cy(e,t),getFilterChanges:t=>Us(e,t),getFilterLogs:t=>ow(e,t),getGasPrice:()=>Pa(e),getLogs:t=>Ma(e,t),getProof:t=>J6(e,t),estimateMaxPriorityFeePerGas:t=>ly(e,t),fillTransaction:t=>Fd(e,t),getStorageAt:t=>Q6(e,t),getTransaction:t=>Al(e,t),getTransactionConfirmations:t=>ex(e,t),getTransactionCount:t=>Od(e,t),getTransactionReceipt:t=>Ks(e,t),multicall:t=>tx(e,t),prepareTransactionRequest:t=>jd(e,t),readContract:t=>jt(e,t),sendRawTransaction:t=>Pv(e,t),sendRawTransactionSync:t=>Mx(e,t),simulate:t=>Nl(e,t),simulateBlocks:t=>Nl(e,t),simulateCalls:t=>dx(e,t),simulateContract:t=>bv(e,t),verifyHash:t=>Xs(e,t),verifyMessage:t=>wx(e,t),verifySiweMessage:t=>$x(e,t),verifyTypedData:t=>xx(e,t),uninstallFilter:t=>Ws(e,t),waitForTransactionReceipt:t=>Ex(e,t),watchBlocks:t=>Sx(e,t),watchBlockNumber:t=>O0(e,t),watchContractEvent:t=>Sv(e,t),watchEvent:t=>Px(e,t),watchPendingTransactions:t=>Tx(e,t)}}function Dx(e){const{key:t="public",name:n="Public Client"}=e;return Av({...e,key:t,name:n,type:"publicClient"}).extend(Ix)}function kx({key:e,methods:t,name:n,request:r,retryCount:o=3,retryDelay:s=150,timeout:i,type:l},a){const c=Tf();return{config:{key:e,methods:t,name:n,request:r,retryCount:o,retryDelay:s,timeout:i,type:l},request:aw(r,{methods:t,retryCount:o,retryDelay:s,uid:c}),value:a}}class Lx extends G{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function Bx(e,t={}){const{batch:n,fetchFn:r,fetchOptions:o,key:s="http",methods:i,name:l="HTTP JSON-RPC",onFetchRequest:a,onFetchResponse:c,retryDelay:u,raw:d}=t;return({chain:p,retryCount:f,timeout:h})=>{const{batchSize:m=1e3,wait:x=0}=typeof n=="object"?n:{},T=t.retryCount??f,w=h??t.timeout??1e4,P=e||(p==null?void 0:p.rpcUrls.default.http[0]);if(!P)throw new Lx;const A=yw(P,{fetchFn:r,fetchOptions:o,onRequest:a,onResponse:c,timeout:w});return kx({key:s,methods:i,name:l,async request({method:k,params:B}){const F={method:k,params:B},{schedule:b}=xf({id:P,wait:x,shouldSplitBatch($){return $.length>m},fn:$=>A.request({body:$}),sort:($,C)=>$.id-C.id}),v=async $=>n?b($):[await A.request({body:$})],[{error:E,result:M}]=await v(F);if(d)return{error:E,result:M};if(E)throw new fa({body:F,error:E,url:P});return M},retryCount:T,retryDelay:u,timeout:w,type:"http"},{fetchOptions:o,url:P})}}const Fx=mw({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}});function Rx({client:e,tokenAddress:t,holder:n,decimals:r,fallbackFormatted:o="0",pollingInterval:s=12e3}){const[i,l]=g.useState(null),[a,c]=g.useState(o);return g.useEffect(()=>{let u,d;const p=async()=>{try{const f=await e.readContract({address:t,abi:Dr,functionName:"balanceOf",args:[n]});l(f),c(ca(f,r))}catch{c(o)}};p();try{u=e.watchContractEvent({address:t,abi:Dr,eventName:"Transfer",args:{to:n},onLogs:()=>{p()},poll:!0,pollingInterval:s}),d=e.watchContractEvent({address:t,abi:Dr,eventName:"Transfer",args:{from:n},onLogs:()=>{p()},poll:!0,pollingInterval:s})}catch{}return()=>{u==null||u(),d==null||d()}},[e,t,n,r,o,s]),{value:i,formatted:a}}const jx=()=>({openDeposit:g.useCallback(t=>{},[])}),zx=()=>({openWithdraw:g.useCallback(t=>{},[])}),gn="MPC",Js="EVM";var Ne=(e=>(e.SPOT="spot",e.PERPETUAL="perpetual",e.PERPETUALV2="perpetual_v2",e))(Ne||{});const Ux="spot",Wx="perpetual";/**
|
|
92
92
|
* @license lucide-react v0.540.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
95
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const
|
|
96
|
+
*/const _x=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Vx=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),$0=e=>{const t=Vx(e);return t.charAt(0).toUpperCase()+t.slice(1)},M0=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Hx=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
97
97
|
* @license lucide-react v0.540.0 - ISC
|
|
98
98
|
*
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/var
|
|
101
|
+
*/var Gx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
102
102
|
* @license lucide-react v0.540.0 - ISC
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const
|
|
106
|
+
*/const qx=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...l},a)=>g.createElement("svg",{ref:a,...Gx,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:M0("lucide",o),...!s&&!Hx(l)&&{"aria-hidden":"true"},...l},[...i.map(([c,u])=>g.createElement(c,u)),...Array.isArray(s)?s:[s]]));/**
|
|
107
107
|
* @license lucide-react v0.540.0 - ISC
|
|
108
108
|
*
|
|
109
109
|
* This source code is licensed under the ISC license.
|
|
110
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const
|
|
111
|
+
*/const Kx=(e,t)=>{const n=g.forwardRef(({className:r,...o},s)=>g.createElement(qx,{ref:s,iconNode:t,className:M0(`lucide-${_x($0(e))}`,`lucide-${e}`,r),...o}));return n.displayName=$0(e),n};/**
|
|
112
112
|
* @license lucide-react v0.540.0 - ISC
|
|
113
113
|
*
|
|
114
114
|
* This source code is licensed under the ISC license.
|
|
115
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const M0=qx("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Kx=typeof document<"u"?g.useLayoutEffect:()=>{},Bn=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},sr=e=>e&&"window"in e&&e.window===e?e:Bn(e).defaultView||window;function Zx(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Yx(e){return Zx(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Xx=!1;function $l(){return Xx}function Fn(e,t){if(!$l())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:Yx(n)?n=n.host:n=n.parentNode}return!1}const jr=(e=document)=>{var t;if(!$l())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Ue(e){if($l()&&e.target instanceof Element&&e.target.shadowRoot){var t,n;if("composedPath"in e)return(t=e.composedPath()[0])!==null&&t!==void 0?t:null;if("composedPath"in e.nativeEvent)return(n=e.nativeEvent.composedPath()[0])!==null&&n!==void 0?n:null}return e.target}function Jx(e){if(Qx())e.focus({preventScroll:!0});else{let t=e5(e);e.focus(),t5(t)}}let Qs=null;function Qx(){if(Qs==null){Qs=!1;try{document.createElement("div").focus({get preventScroll(){return Qs=!0,!0}})}catch{}}return Qs}function e5(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function t5(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function ei(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function Il(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function yn(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const Ko=yn(function(){return Il(/^Mac/i)}),n5=yn(function(){return Il(/^iPhone/i)}),D0=yn(function(){return Il(/^iPad/i)||Ko()&&navigator.maxTouchPoints>1}),r5=yn(function(){return n5()||D0()});yn(function(){return Ko()||r5()});const o5=yn(function(){return ei(/AppleWebKit/i)&&!s5()}),s5=yn(function(){return ei(/Chrome/i)}),i5=yn(function(){return ei(/Android/i)}),a5=yn(function(){return ei(/Firefox/i)});function Zo(e,t,n=!0){var r,o;let{metaKey:s,ctrlKey:i,altKey:l,shiftKey:a}=t;a5()&&(!((o=window.event)===null||o===void 0||(r=o.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(Ko()?s=!0:i=!0);let c=o5()&&Ko()&&!D0()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:s,ctrlKey:i,altKey:l,shiftKey:a}):new MouseEvent("click",{metaKey:s,ctrlKey:i,altKey:l,shiftKey:a,detail:1,bubbles:!0,cancelable:!0});Zo.isOpening=n,Jx(e),e.dispatchEvent(c),Zo.isOpening=!1}Zo.isOpening=!1;function k0(){let e=g.useRef(new Map),t=g.useCallback((o,s,i,l)=>{let a=l!=null&&l.once?(...c)=>{e.current.delete(i),i(...c)}:i;e.current.set(i,{type:s,eventTarget:o,fn:a,options:l}),o.addEventListener(s,a,l)},[]),n=g.useCallback((o,s,i,l)=>{var a;let c=((a=e.current.get(i))===null||a===void 0?void 0:a.fn)||i;o.removeEventListener(s,c,l),e.current.delete(i)},[]),r=g.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return g.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function l5(e){return e.pointerType===""&&e.isTrusted?!0:i5()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function L0(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function c5(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function B0(e){let t=g.useRef({isFocused:!1,observer:null});return Kx(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),g.useCallback(n=>{let r=Ue(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r,s=i=>{if(t.current.isFocused=!1,o.disabled){let l=L0(i);e==null||e(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let l=o===jr()?null:jr();o.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let u5=!1,Yo=null;const Ml=new Set;let Xo=new Map,ir=!1,Dl=!1;const d5={Tab:!0,Escape:!0};function kl(e,t){for(let n of Ml)n(e,t)}function f5(e){return!(e.metaKey||!Ko()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function ti(e){ir=!0,!Zo.isOpening&&f5(e)&&(Yo="keyboard",kl("keyboard",e))}function Et(e){Yo="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(ir=!0,kl("pointer",e))}function F0(e){!Zo.isOpening&&l5(e)&&(ir=!0,Yo="virtual")}function R0(e){Ue(e)===window||Ue(e)===document||u5||!e.isTrusted||(!ir&&!Dl&&(Yo="virtual",kl("virtual",e)),ir=!1,Dl=!1)}function j0(){ir=!1,Dl=!0}function Ll(e){if(typeof window>"u"||typeof document>"u"||Xo.get(sr(e)))return;const t=sr(e),n=Bn(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){ir=!0,r.apply(this,arguments)},n.addEventListener("keydown",ti,!0),n.addEventListener("keyup",ti,!0),n.addEventListener("click",F0,!0),t.addEventListener("focus",R0,!0),t.addEventListener("blur",j0,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Et,!0),n.addEventListener("pointermove",Et,!0),n.addEventListener("pointerup",Et,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",Et,!0),n.addEventListener("mousemove",Et,!0),n.addEventListener("mouseup",Et,!0)),t.addEventListener("beforeunload",()=>{z0(e)},{once:!0}),Xo.set(t,{focus:r})}const z0=(e,t)=>{const n=sr(e),r=Bn(e);t&&r.removeEventListener("DOMContentLoaded",t),Xo.has(n)&&(n.HTMLElement.prototype.focus=Xo.get(n).focus,r.removeEventListener("keydown",ti,!0),r.removeEventListener("keyup",ti,!0),r.removeEventListener("click",F0,!0),n.removeEventListener("focus",R0,!0),n.removeEventListener("blur",j0,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Et,!0),r.removeEventListener("pointermove",Et,!0),r.removeEventListener("pointerup",Et,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",Et,!0),r.removeEventListener("mousemove",Et,!0),r.removeEventListener("mouseup",Et,!0)),Xo.delete(n))};function p5(e){const t=Bn(e);let n;return t.readyState!=="loading"?Ll(e):(n=()=>{Ll(e)},t.addEventListener("DOMContentLoaded",n)),()=>z0(e,n)}typeof document<"u"&&p5();function Bl(){return Yo!=="pointer"}const h5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function m5(e,t,n){let r=Bn(n?Ue(n):void 0),o=n?Ue(n):void 0;const s=typeof window<"u"?sr(o).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?sr(o).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?sr(o).HTMLElement:HTMLElement,a=typeof window<"u"?sr(o).KeyboardEvent:KeyboardEvent;let c=jr(r);return e=e||c instanceof s&&!h5.has(c.type)||c instanceof i||c instanceof l&&c.isContentEditable,!(e&&t==="keyboard"&&n instanceof a&&!d5[n.key])}function b5(e,t,n){Ll(),g.useEffect(()=>{if((n==null?void 0:n.enabled)===!1)return;let r=(o,s)=>{m5(!!(n!=null&&n.isTextInput),o,s)&&e(Bl())};return Ml.add(r),()=>{Ml.delete(r)}},t)}function g5(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=g.useCallback(a=>{if(Ue(a)===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),i=B0(s),l=g.useCallback(a=>{let c=Ue(a);const u=Bn(c),d=u?jr(u):jr();c===a.currentTarget&&c===d&&(n&&n(a),o&&o(!0),i(a))},[o,n,i]);return{focusProps:{onFocus:!t&&(n||o||r)?l:void 0,onBlur:!t&&(r||o)?s:void 0}}}function y5(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=g.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:l}=k0(),a=g.useCallback(d=>{Fn(d.currentTarget,Ue(d))&&s.current.isFocusWithin&&!Fn(d.currentTarget,d.relatedTarget)&&(s.current.isFocusWithin=!1,l(),n&&n(d),o&&o(!1))},[n,o,s,l]),c=B0(a),u=g.useCallback(d=>{if(!Fn(d.currentTarget,Ue(d)))return;let p=Ue(d);const f=Bn(p),h=jr(f);if(!s.current.isFocusWithin&&h===p){r&&r(d),o&&o(!0),s.current.isFocusWithin=!0,c(d);let m=d.currentTarget;i(f,"focus",x=>{let T=Ue(x);if(s.current.isFocusWithin&&!Fn(m,T)){let w=new f.defaultView.FocusEvent("blur",{relatedTarget:T});c5(w,m);let P=L0(w);a(P)}},{capture:!0})}},[r,o,c,i,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:a}}}let ni=!1,ri=0;function Fl(){ni=!0,setTimeout(()=>{ni=!1},50)}function U0(e){e.pointerType==="touch"&&Fl()}function v5(){if(!(typeof document>"u"))return ri===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",U0):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Fl)),ri++,()=>{ri--,!(ri>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",U0):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Fl))}}function w5(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=g.useState(!1),l=g.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;g.useEffect(v5,[]);let{addGlobalListener:a,removeAllGlobalListeners:c}=k0(),{hoverProps:u,triggerHoverEnd:d}=g.useMemo(()=>{let p=(m,x)=>{if(l.pointerType=x,o||x==="touch"||l.isHovered||!Fn(m.currentTarget,Ue(m)))return;l.isHovered=!0;let T=m.currentTarget;l.target=T,a(Bn(Ue(m)),"pointerover",w=>{l.isHovered&&l.target&&!Fn(l.target,Ue(w))&&f(w,w.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:T,pointerType:x}),n&&n(!0),i(!0)},f=(m,x)=>{let T=l.target;l.pointerType="",l.target=null,!(x==="touch"||!l.isHovered||!T)&&(l.isHovered=!1,c(),r&&r({type:"hoverend",target:T,pointerType:x}),n&&n(!1),i(!1))},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=m=>{ni&&m.pointerType==="mouse"||p(m,m.pointerType)},h.onPointerLeave=m=>{!o&&Fn(m.currentTarget,Ue(m))&&f(m,m.pointerType)}):process.env.NODE_ENV==="test"&&(h.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=m=>{!l.ignoreEmulatedMouseEvents&&!ni&&p(m,"mouse"),l.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=m=>{!o&&Fn(m.currentTarget,Ue(m))&&f(m,"mouse")}),{hoverProps:h,triggerHoverEnd:f}},[t,n,r,o,l,a,c]);return g.useEffect(()=>{o&&d({currentTarget:l.target},l.pointerType)},[o]),{hoverProps:u,isHovered:s}}function x5(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=g.useRef({isFocused:!1,isFocusVisible:t||Bl()}),[s,i]=g.useState(!1),[l,a]=g.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=g.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),u=g.useCallback(f=>{o.current.isFocused=f,o.current.isFocusVisible=Bl(),i(f),c()},[c]);b5(f=>{o.current.isFocusVisible=f,c()},[n,s],{enabled:s,isTextInput:n});let{focusProps:d}=g5({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=y5({isDisabled:!r,onFocusWithinChange:u});return{isFocused:s,isFocusVisible:l,focusProps:r?p:d}}var E5=Object.defineProperty,S5=(e,t,n)=>t in e?E5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rl=(e,t,n)=>(S5(e,typeof t!="symbol"?t+"":t,n),n);let P5=class{constructor(){Rl(this,"current",this.detect()),Rl(this,"handoffState","pending"),Rl(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Xt=new P5;function oi(e){var t;return Xt.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function si(e){var t,n;return Xt.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function W0(e){var t,n;return(n=(t=si(e))==null?void 0:t.activeElement)!=null?n:null}function T5(e){return W0(e)===e}function _0(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function pt(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return _0(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=pt();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function ar(){let[e]=g.useState(pt);return g.useEffect(()=>()=>e.dispose(),[e]),e}let $e=(e,t)=>{Xt.isServer?g.useEffect(e,t):g.useLayoutEffect(e,t)};function lr(e){let t=g.useRef(e);return $e(()=>{t.current=e},[e]),t}let he=function(e){let t=lr(e);return g.useCallback((...n)=>t.current(...n),[t])};function A5(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function N5(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function C5({disabled:e=!1}={}){let t=g.useRef(null),[n,r]=g.useState(!1),o=ar(),s=he(()=>{t.current=null,r(!1),o.dispose()}),i=he(l=>{if(o.dispose(),t.current===null){t.current=l.currentTarget,r(!0);{let a=oi(l.currentTarget);o.addEventListener(a,"pointerup",s,!1),o.addEventListener(a,"pointermove",c=>{if(t.current){let u=A5(c);r(N5(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function Rn(e){return g.useMemo(()=>e,Object.values(e))}let O5=g.createContext(void 0);function jl(){return g.useContext(O5)}function zl(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function St(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,St),r}var ii=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ii||{}),jn=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(jn||{});function ht(){let e=I5();return g.useCallback(t=>$5({mergeRefs:e,...t}),[e])}function $5({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:l}){l=l??M5;let a=V0(t,e);if(s)return ai(a,n,r,i,l);let c=o??0;if(c&2){let{static:u=!1,...d}=a;if(u)return ai(d,n,r,i,l)}if(c&1){let{unmount:u=!0,...d}=a;return St(u?0:1,{0(){return null},1(){return ai({...d,hidden:!0,style:{display:"none"}},n,r,i,l)}})}return ai(a,n,r,i,l)}function ai(e,t={},n,r,o){let{as:s=n,children:i,refName:l="ref",...a}=Ul(e,["unmount","static"]),c=e.ref!==void 0?{[l]:e.ref}:{},u=typeof i=="function"?i(t):i;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let d={};if(t){let p=!1,f=[];for(let[h,m]of Object.entries(t))typeof m=="boolean"&&(p=!0),m===!0&&f.push(h.replace(/([A-Z])/g,x=>`-${x.toLowerCase()}`));if(p){d["data-headlessui-state"]=f.join(" ");for(let h of f)d[`data-${h}`]=""}}if(Jo(s)&&(Object.keys(zn(a)).length>0||Object.keys(zn(d)).length>0))if(!g.isValidElement(u)||Array.isArray(u)&&u.length>1||k5(u)){if(Object.keys(zn(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(zn(a)).concat(Object.keys(zn(d))).map(p=>` - ${p}`).join(`
|
|
116
|
+
*/const I0=Kx("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Zx=typeof document<"u"?g.useLayoutEffect:()=>{},Bn=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},sr=e=>e&&"window"in e&&e.window===e?e:Bn(e).defaultView||window;function Yx(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Xx(e){return Yx(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Jx=!1;function $l(){return Jx}function Fn(e,t){if(!$l())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:Xx(n)?n=n.host:n=n.parentNode}return!1}const jr=(e=document)=>{var t;if(!$l())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Ue(e){if($l()&&e.target instanceof Element&&e.target.shadowRoot){var t,n;if("composedPath"in e)return(t=e.composedPath()[0])!==null&&t!==void 0?t:null;if("composedPath"in e.nativeEvent)return(n=e.nativeEvent.composedPath()[0])!==null&&n!==void 0?n:null}return e.target}function Qx(e){if(e5())e.focus({preventScroll:!0});else{let t=t5(e);e.focus(),n5(t)}}let Qs=null;function e5(){if(Qs==null){Qs=!1;try{document.createElement("div").focus({get preventScroll(){return Qs=!0,!0}})}catch{}}return Qs}function t5(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function n5(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function ei(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function Ml(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function yn(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const Ko=yn(function(){return Ml(/^Mac/i)}),r5=yn(function(){return Ml(/^iPhone/i)}),D0=yn(function(){return Ml(/^iPad/i)||Ko()&&navigator.maxTouchPoints>1}),o5=yn(function(){return r5()||D0()});yn(function(){return Ko()||o5()});const s5=yn(function(){return ei(/AppleWebKit/i)&&!i5()}),i5=yn(function(){return ei(/Chrome/i)}),a5=yn(function(){return ei(/Android/i)}),l5=yn(function(){return ei(/Firefox/i)});function Zo(e,t,n=!0){var r,o;let{metaKey:s,ctrlKey:i,altKey:l,shiftKey:a}=t;l5()&&(!((o=window.event)===null||o===void 0||(r=o.type)===null||r===void 0)&&r.startsWith("key"))&&e.target==="_blank"&&(Ko()?s=!0:i=!0);let c=s5()&&Ko()&&!D0()&&process.env.NODE_ENV!=="test"?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:s,ctrlKey:i,altKey:l,shiftKey:a}):new MouseEvent("click",{metaKey:s,ctrlKey:i,altKey:l,shiftKey:a,detail:1,bubbles:!0,cancelable:!0});Zo.isOpening=n,Qx(e),e.dispatchEvent(c),Zo.isOpening=!1}Zo.isOpening=!1;function k0(){let e=g.useRef(new Map),t=g.useCallback((o,s,i,l)=>{let a=l!=null&&l.once?(...c)=>{e.current.delete(i),i(...c)}:i;e.current.set(i,{type:s,eventTarget:o,fn:a,options:l}),o.addEventListener(s,a,l)},[]),n=g.useCallback((o,s,i,l)=>{var a;let c=((a=e.current.get(i))===null||a===void 0?void 0:a.fn)||i;o.removeEventListener(s,c,l),e.current.delete(i)},[]),r=g.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return g.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function c5(e){return e.pointerType===""&&e.isTrusted?!0:a5()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function L0(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function u5(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function B0(e){let t=g.useRef({isFocused:!1,observer:null});return Zx(()=>{const n=t.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),g.useCallback(n=>{let r=Ue(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r,s=i=>{if(t.current.isFocused=!1,o.disabled){let l=L0(i);e==null||e(l)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var i;(i=t.current.observer)===null||i===void 0||i.disconnect();let l=o===jr()?null:jr();o.dispatchEvent(new FocusEvent("blur",{relatedTarget:l})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:l}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[e])}let d5=!1,Yo=null;const Il=new Set;let Xo=new Map,ir=!1,Dl=!1;const f5={Tab:!0,Escape:!0};function kl(e,t){for(let n of Il)n(e,t)}function p5(e){return!(e.metaKey||!Ko()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function ti(e){ir=!0,!Zo.isOpening&&p5(e)&&(Yo="keyboard",kl("keyboard",e))}function Et(e){Yo="pointer","pointerType"in e&&e.pointerType,(e.type==="mousedown"||e.type==="pointerdown")&&(ir=!0,kl("pointer",e))}function F0(e){!Zo.isOpening&&c5(e)&&(ir=!0,Yo="virtual")}function R0(e){Ue(e)===window||Ue(e)===document||d5||!e.isTrusted||(!ir&&!Dl&&(Yo="virtual",kl("virtual",e)),ir=!1,Dl=!1)}function j0(){ir=!1,Dl=!0}function Ll(e){if(typeof window>"u"||typeof document>"u"||Xo.get(sr(e)))return;const t=sr(e),n=Bn(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){ir=!0,r.apply(this,arguments)},n.addEventListener("keydown",ti,!0),n.addEventListener("keyup",ti,!0),n.addEventListener("click",F0,!0),t.addEventListener("focus",R0,!0),t.addEventListener("blur",j0,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Et,!0),n.addEventListener("pointermove",Et,!0),n.addEventListener("pointerup",Et,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",Et,!0),n.addEventListener("mousemove",Et,!0),n.addEventListener("mouseup",Et,!0)),t.addEventListener("beforeunload",()=>{z0(e)},{once:!0}),Xo.set(t,{focus:r})}const z0=(e,t)=>{const n=sr(e),r=Bn(e);t&&r.removeEventListener("DOMContentLoaded",t),Xo.has(n)&&(n.HTMLElement.prototype.focus=Xo.get(n).focus,r.removeEventListener("keydown",ti,!0),r.removeEventListener("keyup",ti,!0),r.removeEventListener("click",F0,!0),n.removeEventListener("focus",R0,!0),n.removeEventListener("blur",j0,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Et,!0),r.removeEventListener("pointermove",Et,!0),r.removeEventListener("pointerup",Et,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",Et,!0),r.removeEventListener("mousemove",Et,!0),r.removeEventListener("mouseup",Et,!0)),Xo.delete(n))};function h5(e){const t=Bn(e);let n;return t.readyState!=="loading"?Ll(e):(n=()=>{Ll(e)},t.addEventListener("DOMContentLoaded",n)),()=>z0(e,n)}typeof document<"u"&&h5();function Bl(){return Yo!=="pointer"}const m5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function b5(e,t,n){let r=Bn(n?Ue(n):void 0),o=n?Ue(n):void 0;const s=typeof window<"u"?sr(o).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?sr(o).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?sr(o).HTMLElement:HTMLElement,a=typeof window<"u"?sr(o).KeyboardEvent:KeyboardEvent;let c=jr(r);return e=e||c instanceof s&&!m5.has(c.type)||c instanceof i||c instanceof l&&c.isContentEditable,!(e&&t==="keyboard"&&n instanceof a&&!f5[n.key])}function g5(e,t,n){Ll(),g.useEffect(()=>{if((n==null?void 0:n.enabled)===!1)return;let r=(o,s)=>{b5(!!(n!=null&&n.isTextInput),o,s)&&e(Bl())};return Il.add(r),()=>{Il.delete(r)}},t)}function y5(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=g.useCallback(a=>{if(Ue(a)===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),i=B0(s),l=g.useCallback(a=>{let c=Ue(a);const u=Bn(c),d=u?jr(u):jr();c===a.currentTarget&&c===d&&(n&&n(a),o&&o(!0),i(a))},[o,n,i]);return{focusProps:{onFocus:!t&&(n||o||r)?l:void 0,onBlur:!t&&(r||o)?s:void 0}}}function v5(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=g.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:l}=k0(),a=g.useCallback(d=>{Fn(d.currentTarget,Ue(d))&&s.current.isFocusWithin&&!Fn(d.currentTarget,d.relatedTarget)&&(s.current.isFocusWithin=!1,l(),n&&n(d),o&&o(!1))},[n,o,s,l]),c=B0(a),u=g.useCallback(d=>{if(!Fn(d.currentTarget,Ue(d)))return;let p=Ue(d);const f=Bn(p),h=jr(f);if(!s.current.isFocusWithin&&h===p){r&&r(d),o&&o(!0),s.current.isFocusWithin=!0,c(d);let m=d.currentTarget;i(f,"focus",x=>{let T=Ue(x);if(s.current.isFocusWithin&&!Fn(m,T)){let w=new f.defaultView.FocusEvent("blur",{relatedTarget:T});u5(w,m);let P=L0(w);a(P)}},{capture:!0})}},[r,o,c,i,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:a}}}let ni=!1,ri=0;function Fl(){ni=!0,setTimeout(()=>{ni=!1},50)}function U0(e){e.pointerType==="touch"&&Fl()}function w5(){if(!(typeof document>"u"))return ri===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",U0):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",Fl)),ri++,()=>{ri--,!(ri>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",U0):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",Fl))}}function x5(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,i]=g.useState(!1),l=g.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;g.useEffect(w5,[]);let{addGlobalListener:a,removeAllGlobalListeners:c}=k0(),{hoverProps:u,triggerHoverEnd:d}=g.useMemo(()=>{let p=(m,x)=>{if(l.pointerType=x,o||x==="touch"||l.isHovered||!Fn(m.currentTarget,Ue(m)))return;l.isHovered=!0;let T=m.currentTarget;l.target=T,a(Bn(Ue(m)),"pointerover",w=>{l.isHovered&&l.target&&!Fn(l.target,Ue(w))&&f(w,w.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:T,pointerType:x}),n&&n(!0),i(!0)},f=(m,x)=>{let T=l.target;l.pointerType="",l.target=null,!(x==="touch"||!l.isHovered||!T)&&(l.isHovered=!1,c(),r&&r({type:"hoverend",target:T,pointerType:x}),n&&n(!1),i(!1))},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=m=>{ni&&m.pointerType==="mouse"||p(m,m.pointerType)},h.onPointerLeave=m=>{!o&&Fn(m.currentTarget,Ue(m))&&f(m,m.pointerType)}):process.env.NODE_ENV==="test"&&(h.onTouchStart=()=>{l.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=m=>{!l.ignoreEmulatedMouseEvents&&!ni&&p(m,"mouse"),l.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=m=>{!o&&Fn(m.currentTarget,Ue(m))&&f(m,"mouse")}),{hoverProps:h,triggerHoverEnd:f}},[t,n,r,o,l,a,c]);return g.useEffect(()=>{o&&d({currentTarget:l.target},l.pointerType)},[o]),{hoverProps:u,isHovered:s}}function E5(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=g.useRef({isFocused:!1,isFocusVisible:t||Bl()}),[s,i]=g.useState(!1),[l,a]=g.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=g.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),u=g.useCallback(f=>{o.current.isFocused=f,o.current.isFocusVisible=Bl(),i(f),c()},[c]);g5(f=>{o.current.isFocusVisible=f,c()},[n,s],{enabled:s,isTextInput:n});let{focusProps:d}=y5({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=v5({isDisabled:!r,onFocusWithinChange:u});return{isFocused:s,isFocusVisible:l,focusProps:r?p:d}}var S5=Object.defineProperty,P5=(e,t,n)=>t in e?S5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rl=(e,t,n)=>(P5(e,typeof t!="symbol"?t+"":t,n),n);let T5=class{constructor(){Rl(this,"current",this.detect()),Rl(this,"handoffState","pending"),Rl(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Xt=new T5;function oi(e){var t;return Xt.isServer?null:e==null?document:(t=e==null?void 0:e.ownerDocument)!=null?t:document}function si(e){var t,n;return Xt.isServer?null:e==null?document:(n=(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))!=null?n:document}function W0(e){var t,n;return(n=(t=si(e))==null?void 0:t.activeElement)!=null?n:null}function A5(e){return W0(e)===e}function _0(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function pt(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return _0(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=pt();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function ar(){let[e]=g.useState(pt);return g.useEffect(()=>()=>e.dispose(),[e]),e}let $e=(e,t)=>{Xt.isServer?g.useEffect(e,t):g.useLayoutEffect(e,t)};function lr(e){let t=g.useRef(e);return $e(()=>{t.current=e},[e]),t}let he=function(e){let t=lr(e);return g.useCallback((...n)=>t.current(...n),[t])};function N5(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function C5(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function O5({disabled:e=!1}={}){let t=g.useRef(null),[n,r]=g.useState(!1),o=ar(),s=he(()=>{t.current=null,r(!1),o.dispose()}),i=he(l=>{if(o.dispose(),t.current===null){t.current=l.currentTarget,r(!0);{let a=oi(l.currentTarget);o.addEventListener(a,"pointerup",s,!1),o.addEventListener(a,"pointermove",c=>{if(t.current){let u=N5(c);r(C5(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:i,onPointerUp:s,onClick:s}}}function Rn(e){return g.useMemo(()=>e,Object.values(e))}let $5=g.createContext(void 0);function jl(){return g.useContext($5)}function zl(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function St(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,St),r}var ii=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(ii||{}),jn=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(jn||{});function ht(){let e=I5();return g.useCallback(t=>M5({mergeRefs:e,...t}),[e])}function M5({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:i,mergeRefs:l}){l=l??D5;let a=V0(t,e);if(s)return ai(a,n,r,i,l);let c=o??0;if(c&2){let{static:u=!1,...d}=a;if(u)return ai(d,n,r,i,l)}if(c&1){let{unmount:u=!0,...d}=a;return St(u?0:1,{0(){return null},1(){return ai({...d,hidden:!0,style:{display:"none"}},n,r,i,l)}})}return ai(a,n,r,i,l)}function ai(e,t={},n,r,o){let{as:s=n,children:i,refName:l="ref",...a}=Ul(e,["unmount","static"]),c=e.ref!==void 0?{[l]:e.ref}:{},u=typeof i=="function"?i(t):i;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let d={};if(t){let p=!1,f=[];for(let[h,m]of Object.entries(t))typeof m=="boolean"&&(p=!0),m===!0&&f.push(h.replace(/([A-Z])/g,x=>`-${x.toLowerCase()}`));if(p){d["data-headlessui-state"]=f.join(" ");for(let h of f)d[`data-${h}`]=""}}if(Jo(s)&&(Object.keys(zn(a)).length>0||Object.keys(zn(d)).length>0))if(!g.isValidElement(u)||Array.isArray(u)&&u.length>1||L5(u)){if(Object.keys(zn(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(zn(a)).concat(Object.keys(zn(d))).map(p=>` - ${p}`).join(`
|
|
117
117
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
|
|
118
118
|
`)].join(`
|
|
119
|
-
`))}else{let p=u.props,f=p==null?void 0:p.className,h=typeof f=="function"?(...T)=>zl(f(...T),a.className):zl(f,a.className),m=h?{className:h}:{},x=V0(u.props,zn(Ul(a,["ref"])));for(let T in d)T in x&&delete d[T];return g.cloneElement(u,Object.assign({},x,d,c,{ref:o(D5(u),c.ref)},m))}return g.createElement(s,Object.assign({},Ul(a,["ref"]),!Jo(s)&&c,!Jo(s)&&d),u)}function I5(){let e=g.useRef([]),t=g.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function M5(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function V0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let i=n[r];for(let l of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;l(o,...s)}}});return t}function H0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let s=n[r];for(let i of s)i==null||i(...o)}});return t}function nt(e){var t;return Object.assign(g.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function zn(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Ul(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function D5(e){return g.version.split(".")[0]>="19"?e.props.ref:e.ref}function Jo(e){return e===g.Fragment||e===Symbol.for("react.fragment")}function k5(e){return Jo(e.type)}function L5(e,t,n){let[r,o]=g.useState(n),s=e!==void 0,i=g.useRef(s),l=g.useRef(!1),a=g.useRef(!1);return s&&!i.current&&!l.current?(l.current=!0,i.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&i.current&&!a.current&&(a.current=!0,i.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:r,he(c=>(s||Ke.flushSync(()=>o(c)),t==null?void 0:t(c)))]}function B5(e){let[t]=g.useState(e);return t}function G0(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))K0(n,q0(t,r),o);return n}function q0(e,t){return e?e+"["+t+"]":t}function K0(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())K0(e,q0(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):R5(n)&&!g.isValidElement(n)&&G0(n,t,e)}function F5(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}function R5(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let j5="span";var Wl=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Wl||{});function z5(e,t){var n;let{features:r=1,...o}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return ht()({ourProps:s,theirProps:o,slot:{},defaultTag:j5,name:"Hidden"})}let Z0=nt(z5),U5=g.createContext(null);function W5({children:e}){let t=g.useContext(U5);if(!t)return g.createElement(g.Fragment,null,e);let{target:n}=t;return n?Ke.createPortal(g.createElement(g.Fragment,null,e),n):null}function _5({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=g.useState(null),l=ar();return g.useEffect(()=>{if(r&&s)return l.addEventListener(s,"reset",r)},[s,t,r]),g.createElement(W5,null,g.createElement(V5,{setForm:i,formId:t}),G0(e).map(([a,c])=>g.createElement(Z0,{features:Wl.Hidden,...zn({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:c,...o})})))}function V5({setForm:e,formId:t}){return g.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:g.createElement(Z0,{features:Wl.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let H5=g.createContext(void 0);function Y0(){return g.useContext(H5)}function X0(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function li(e){return X0(e)&&"tagName"in e}function vn(e){return li(e)&&"accessKey"in e}function zr(e){return li(e)&&"tabIndex"in e}function G5(e){return li(e)&&"style"in e}function q5(e){return vn(e)&&e.nodeName==="IFRAME"}function J0(e){return vn(e)&&e.nodeName==="INPUT"}function Q0(e){return vn(e)&&e.nodeName==="LABEL"}function K5(e){return vn(e)&&e.nodeName==="FIELDSET"}function ep(e){return vn(e)&&e.nodeName==="LEGEND"}function Z5(e){return li(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function tp(e){let t=e.parentElement,n=null;for(;t&&!K5(t);)ep(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Y5(n)?!1:r}function Y5(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(ep(t))return!1;t=t.previousElementSibling}return!0}let np=Symbol();function X5(e,t=!0){return Object.assign(e,{[np]:t})}function Pt(...e){let t=g.useRef(e);g.useEffect(()=>{t.current=e},[e]);let n=he(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[np]))?void 0:n}let _l=g.createContext(null);_l.displayName="DescriptionContext";function rp(){let e=g.useContext(_l);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,rp),t}return e}function J5(){var e,t;return(t=(e=g.useContext(_l))==null?void 0:e.value)!=null?t:void 0}let Q5="p";function e2(e,t){let n=g.useId(),r=jl(),{id:o=`headlessui-description-${n}`,...s}=e,i=rp(),l=Pt(t);$e(()=>i.register(o),[o,i.register]);let a=Rn({...i.slot,disabled:r||!1}),c={ref:l,...i.props,id:o};return ht()({ourProps:c,theirProps:s,slot:a,defaultTag:Q5,name:i.name||"Description"})}let t2=nt(e2);Object.assign(t2,{});var je=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(je||{});let ci=g.createContext(null);ci.displayName="LabelContext";function op(){let e=g.useContext(ci);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,op),t}return e}function sp(e){var t,n,r;let o=(n=(t=g.useContext(ci))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function n2({inherit:e=!1}={}){let t=sp(),[n,r]=g.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,g.useMemo(()=>function(s){let i=he(a=>(r(c=>[...c,a]),()=>r(c=>{let u=c.slice(),d=u.indexOf(a);return d!==-1&&u.splice(d,1),u}))),l=g.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return g.createElement(ci.Provider,{value:l},s.children)},[r])]}let r2="label";function o2(e,t){var n;let r=g.useId(),o=op(),s=Y0(),i=jl(),{id:l=`headlessui-label-${r}`,htmlFor:a=s??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,d=Pt(t);$e(()=>o.register(l),[l,o.register]);let p=he(m=>{let x=m.currentTarget;if(!(m.target!==m.currentTarget&&Z5(m.target))&&(Q0(x)&&m.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(m),Q0(x))){let T=document.getElementById(x.htmlFor);if(T){let w=T.getAttribute("disabled");if(w==="true"||w==="")return;let P=T.getAttribute("aria-disabled");if(P==="true"||P==="")return;(J0(T)&&(T.type==="file"||T.type==="radio"||T.type==="checkbox")||T.role==="radio"||T.role==="checkbox"||T.role==="switch")&&T.click(),T.focus({preventScroll:!0})}}}),f=Rn({...o.slot,disabled:i||!1}),h={ref:d,...o.props,id:l,htmlFor:a,onClick:p};return c&&("onClick"in h&&(delete h.htmlFor,delete h.onClick),"onClick"in u&&delete u.onClick),ht()({ourProps:h,theirProps:u,slot:f,defaultTag:a?r2:"div",name:o.name||"Label"})}let s2=nt(o2),i2=Object.assign(s2,{});function a2(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function l2(e=a2){return g.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function ip(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function c2(e,t,n=!1){let[r,o]=g.useState(()=>ip(t));return $e(()=>{if(!t||!e)return;let s=pt();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(l=>{let a=ip(t);return a.width===l.width&&a.height===l.height?l:a})}),()=>{s.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var ap=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(ap||{});function u2(e){let t=g.useRef(null),n=he(o=>{t.current=o.pointerType,!tp(o.currentTarget)&&o.pointerType==="mouse"&&o.button===ap.Left&&(o.preventDefault(),e(o))}),r=he(o=>{t.current!=="mouse"&&(tp(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let lp=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};var d2=Object.defineProperty,f2=(e,t,n)=>t in e?d2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p2=(e,t,n)=>(f2(e,t+"",n),n),cp=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Tt=(e,t,n)=>(cp(e,t,"read from private field"),n?n.call(e):t.get(e)),Vl=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},up=(e,t,n,r)=>(cp(e,t,"write to private field"),t.set(e,n),n),Jt,Qo,es;let dp=class{constructor(t){Vl(this,Jt,{}),Vl(this,Qo,new lp(()=>new Set)),Vl(this,es,new Set),p2(this,"disposables",pt()),up(this,Jt,t),Xt.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Tt(this,Jt)}subscribe(t,n){if(Xt.isServer)return()=>{};let r={selector:t,callback:n,current:t(Tt(this,Jt))};return Tt(this,es).add(r),this.disposables.add(()=>{Tt(this,es).delete(r)})}on(t,n){return Xt.isServer?()=>{}:(Tt(this,Qo).get(t).add(n),this.disposables.add(()=>{Tt(this,Qo).get(t).delete(n)}))}send(t){let n=this.reduce(Tt(this,Jt),t);if(n!==Tt(this,Jt)){up(this,Jt,n);for(let r of Tt(this,es)){let o=r.selector(Tt(this,Jt));fp(r.current,o)||(r.current=o,r.callback(o))}for(let r of Tt(this,Qo).get(t.type))r(Tt(this,Jt),t)}}};Jt=new WeakMap,Qo=new WeakMap,es=new WeakMap;function fp(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Hl(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Hl(e.entries(),t.entries()):pp(e)&&pp(t)?Hl(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Hl(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function pp(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Gl(e){let[t,n]=e(),r=pt();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var h2=Object.defineProperty,m2=(e,t,n)=>t in e?h2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hp=(e,t,n)=>(m2(e,typeof t!="symbol"?t+"":t,n),n),mp=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(mp||{});let b2={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(n),r=s,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},g2=class tb extends dp{constructor(){super(...arguments),hp(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),hp(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new tb({stack:[]})}reduce(t,n){return St(n.type,b2,t,n)}};const ql=new lp(()=>g2.new());var Kl={exports:{}},Zl={};/**
|
|
119
|
+
`))}else{let p=u.props,f=p==null?void 0:p.className,h=typeof f=="function"?(...T)=>zl(f(...T),a.className):zl(f,a.className),m=h?{className:h}:{},x=V0(u.props,zn(Ul(a,["ref"])));for(let T in d)T in x&&delete d[T];return g.cloneElement(u,Object.assign({},x,d,c,{ref:o(k5(u),c.ref)},m))}return g.createElement(s,Object.assign({},Ul(a,["ref"]),!Jo(s)&&c,!Jo(s)&&d),u)}function I5(){let e=g.useRef([]),t=g.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function D5(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function V0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let i=n[r];for(let l of i){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;l(o,...s)}}});return t}function H0(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let s=n[r];for(let i of s)i==null||i(...o)}});return t}function nt(e){var t;return Object.assign(g.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function zn(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Ul(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function k5(e){return g.version.split(".")[0]>="19"?e.props.ref:e.ref}function Jo(e){return e===g.Fragment||e===Symbol.for("react.fragment")}function L5(e){return Jo(e.type)}function B5(e,t,n){let[r,o]=g.useState(n),s=e!==void 0,i=g.useRef(s),l=g.useRef(!1),a=g.useRef(!1);return s&&!i.current&&!l.current?(l.current=!0,i.current=s,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!s&&i.current&&!a.current&&(a.current=!0,i.current=s,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[s?e:r,he(c=>(s||Ke.flushSync(()=>o(c)),t==null?void 0:t(c)))]}function F5(e){let[t]=g.useState(e);return t}function G0(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))K0(n,q0(t,r),o);return n}function q0(e,t){return e?e+"["+t+"]":t}function K0(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())K0(e,q0(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):j5(n)&&!g.isValidElement(n)&&G0(n,t,e)}function R5(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}function j5(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}let z5="span";var Wl=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Wl||{});function U5(e,t){var n;let{features:r=1,...o}=e,s={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return ht()({ourProps:s,theirProps:o,slot:{},defaultTag:z5,name:"Hidden"})}let Z0=nt(U5),W5=g.createContext(null);function _5({children:e}){let t=g.useContext(W5);if(!t)return g.createElement(g.Fragment,null,e);let{target:n}=t;return n?Ke.createPortal(g.createElement(g.Fragment,null,e),n):null}function V5({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,i]=g.useState(null),l=ar();return g.useEffect(()=>{if(r&&s)return l.addEventListener(s,"reset",r)},[s,t,r]),g.createElement(_5,null,g.createElement(H5,{setForm:i,formId:t}),G0(e).map(([a,c])=>g.createElement(Z0,{features:Wl.Hidden,...zn({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:c,...o})})))}function H5({setForm:e,formId:t}){return g.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:g.createElement(Z0,{features:Wl.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let G5=g.createContext(void 0);function Y0(){return g.useContext(G5)}function X0(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function li(e){return X0(e)&&"tagName"in e}function vn(e){return li(e)&&"accessKey"in e}function zr(e){return li(e)&&"tabIndex"in e}function q5(e){return li(e)&&"style"in e}function K5(e){return vn(e)&&e.nodeName==="IFRAME"}function J0(e){return vn(e)&&e.nodeName==="INPUT"}function Q0(e){return vn(e)&&e.nodeName==="LABEL"}function Z5(e){return vn(e)&&e.nodeName==="FIELDSET"}function ep(e){return vn(e)&&e.nodeName==="LEGEND"}function Y5(e){return li(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function tp(e){let t=e.parentElement,n=null;for(;t&&!Z5(t);)ep(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&X5(n)?!1:r}function X5(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(ep(t))return!1;t=t.previousElementSibling}return!0}let np=Symbol();function J5(e,t=!0){return Object.assign(e,{[np]:t})}function Pt(...e){let t=g.useRef(e);g.useEffect(()=>{t.current=e},[e]);let n=he(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[np]))?void 0:n}let _l=g.createContext(null);_l.displayName="DescriptionContext";function rp(){let e=g.useContext(_l);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,rp),t}return e}function Q5(){var e,t;return(t=(e=g.useContext(_l))==null?void 0:e.value)!=null?t:void 0}let e2="p";function t2(e,t){let n=g.useId(),r=jl(),{id:o=`headlessui-description-${n}`,...s}=e,i=rp(),l=Pt(t);$e(()=>i.register(o),[o,i.register]);let a=Rn({...i.slot,disabled:r||!1}),c={ref:l,...i.props,id:o};return ht()({ourProps:c,theirProps:s,slot:a,defaultTag:e2,name:i.name||"Description"})}let n2=nt(t2);Object.assign(n2,{});var je=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(je||{});let ci=g.createContext(null);ci.displayName="LabelContext";function op(){let e=g.useContext(ci);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,op),t}return e}function sp(e){var t,n,r;let o=(n=(t=g.useContext(ci))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function r2({inherit:e=!1}={}){let t=sp(),[n,r]=g.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,g.useMemo(()=>function(s){let i=he(a=>(r(c=>[...c,a]),()=>r(c=>{let u=c.slice(),d=u.indexOf(a);return d!==-1&&u.splice(d,1),u}))),l=g.useMemo(()=>({register:i,slot:s.slot,name:s.name,props:s.props,value:s.value}),[i,s.slot,s.name,s.props,s.value]);return g.createElement(ci.Provider,{value:l},s.children)},[r])]}let o2="label";function s2(e,t){var n;let r=g.useId(),o=op(),s=Y0(),i=jl(),{id:l=`headlessui-label-${r}`,htmlFor:a=s??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,d=Pt(t);$e(()=>o.register(l),[l,o.register]);let p=he(m=>{let x=m.currentTarget;if(!(m.target!==m.currentTarget&&Y5(m.target))&&(Q0(x)&&m.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(m),Q0(x))){let T=document.getElementById(x.htmlFor);if(T){let w=T.getAttribute("disabled");if(w==="true"||w==="")return;let P=T.getAttribute("aria-disabled");if(P==="true"||P==="")return;(J0(T)&&(T.type==="file"||T.type==="radio"||T.type==="checkbox")||T.role==="radio"||T.role==="checkbox"||T.role==="switch")&&T.click(),T.focus({preventScroll:!0})}}}),f=Rn({...o.slot,disabled:i||!1}),h={ref:d,...o.props,id:l,htmlFor:a,onClick:p};return c&&("onClick"in h&&(delete h.htmlFor,delete h.onClick),"onClick"in u&&delete u.onClick),ht()({ourProps:h,theirProps:u,slot:f,defaultTag:a?o2:"div",name:o.name||"Label"})}let i2=nt(s2),a2=Object.assign(i2,{});function l2(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function c2(e=l2){return g.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function ip(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function u2(e,t,n=!1){let[r,o]=g.useState(()=>ip(t));return $e(()=>{if(!t||!e)return;let s=pt();return s.requestAnimationFrame(function i(){s.requestAnimationFrame(i),o(l=>{let a=ip(t);return a.width===l.width&&a.height===l.height?l:a})}),()=>{s.dispose()}},[t,e]),n?{width:`${r.width}px`,height:`${r.height}px`}:r}var ap=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(ap||{});function d2(e){let t=g.useRef(null),n=he(o=>{t.current=o.pointerType,!tp(o.currentTarget)&&o.pointerType==="mouse"&&o.button===ap.Left&&(o.preventDefault(),e(o))}),r=he(o=>{t.current!=="mouse"&&(tp(o.currentTarget)||e(o))});return{onPointerDown:n,onClick:r}}let lp=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};var f2=Object.defineProperty,p2=(e,t,n)=>t in e?f2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h2=(e,t,n)=>(p2(e,t+"",n),n),cp=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Tt=(e,t,n)=>(cp(e,t,"read from private field"),n?n.call(e):t.get(e)),Vl=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},up=(e,t,n,r)=>(cp(e,t,"write to private field"),t.set(e,n),n),Jt,Qo,es;let dp=class{constructor(t){Vl(this,Jt,{}),Vl(this,Qo,new lp(()=>new Set)),Vl(this,es,new Set),h2(this,"disposables",pt()),up(this,Jt,t),Xt.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Tt(this,Jt)}subscribe(t,n){if(Xt.isServer)return()=>{};let r={selector:t,callback:n,current:t(Tt(this,Jt))};return Tt(this,es).add(r),this.disposables.add(()=>{Tt(this,es).delete(r)})}on(t,n){return Xt.isServer?()=>{}:(Tt(this,Qo).get(t).add(n),this.disposables.add(()=>{Tt(this,Qo).get(t).delete(n)}))}send(t){let n=this.reduce(Tt(this,Jt),t);if(n!==Tt(this,Jt)){up(this,Jt,n);for(let r of Tt(this,es)){let o=r.selector(Tt(this,Jt));fp(r.current,o)||(r.current=o,r.callback(o))}for(let r of Tt(this,Qo).get(t.type))r(Tt(this,Jt),t)}}};Jt=new WeakMap,Qo=new WeakMap,es=new WeakMap;function fp(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Hl(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Hl(e.entries(),t.entries()):pp(e)&&pp(t)?Hl(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Hl(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function pp(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Gl(e){let[t,n]=e(),r=pt();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var m2=Object.defineProperty,b2=(e,t,n)=>t in e?m2(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hp=(e,t,n)=>(b2(e,typeof t!="symbol"?t+"":t,n),n),mp=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(mp||{});let g2={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(n),r=s,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},y2=class nb extends dp{constructor(){super(...arguments),hp(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),hp(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new nb({stack:[]})}reduce(t,n){return St(n.type,g2,t,n)}};const ql=new lp(()=>y2.new());var Kl={exports:{}},Zl={};/**
|
|
120
120
|
* @license React
|
|
121
121
|
* use-sync-external-store-with-selector.production.js
|
|
122
122
|
*
|
|
@@ -124,7 +124,7 @@ ${F1(f)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
124
124
|
*
|
|
125
125
|
* This source code is licensed under the MIT license found in the
|
|
126
126
|
* LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/var bp;function
|
|
127
|
+
*/var bp;function v2(){if(bp)return Zl;bp=1;var e=g;function t(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,i=e.useMemo,l=e.useDebugValue;return Zl.useSyncExternalStoreWithSelector=function(a,c,u,d,p){var f=o(null);if(f.current===null){var h={hasValue:!1,value:null};f.current=h}else h=f.current;f=i(function(){function x(k){if(!T){if(T=!0,w=k,k=d(k),p!==void 0&&h.hasValue){var B=h.value;if(p(B,k))return P=B}return P=k}if(B=P,n(w,k))return B;var F=d(k);return p!==void 0&&p(B,F)?(w=k,B):(w=k,P=F)}var T=!1,w,P,A=u===void 0?null:u;return[function(){return x(c())},A===null?void 0:function(){return x(A())}]},[c,u,d,p]);var m=r(a,f[0],f[1]);return s(function(){h.hasValue=!0,h.value=m},[m]),l(m),m},Zl}var Yl={};/**
|
|
128
128
|
* @license React
|
|
129
129
|
* use-sync-external-store-with-selector.development.js
|
|
130
130
|
*
|
|
@@ -132,11 +132,11 @@ ${F1(f)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
132
132
|
*
|
|
133
133
|
* This source code is licensed under the MIT license found in the
|
|
134
134
|
* LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/var gp;function v2(){return gp||(gp=1,process.env.NODE_ENV!=="production"&&function(){function e(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=g,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,l=t.useDebugValue;Yl.useSyncExternalStoreWithSelector=function(a,c,u,d,p){var f=o(null);if(f.current===null){var h={hasValue:!1,value:null};f.current=h}else h=f.current;f=i(function(){function x(k){if(!T){if(T=!0,w=k,k=d(k),p!==void 0&&h.hasValue){var B=h.value;if(p(B,k))return P=B}return P=k}if(B=P,n(w,k))return B;var F=d(k);return p!==void 0&&p(B,F)?(w=k,B):(w=k,P=F)}var T=!1,w,P,A=u===void 0?null:u;return[function(){return x(c())},A===null?void 0:function(){return x(A())}]},[c,u,d,p]);var m=r(a,f[0],f[1]);return s(function(){h.hasValue=!0,h.value=m},[m]),l(m),m},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Yl}process.env.NODE_ENV==="production"?Kl.exports=y2():Kl.exports=v2();var w2=Kl.exports;function rt(e,t,n=fp){return w2.useSyncExternalStoreWithSelector(he(r=>e.subscribe(x2,r)),he(()=>e.state),he(()=>e.state),he(t),n)}function x2(e){return e}function yp(e,t){let n=g.useId(),r=ql.get(t),[o,s]=rt(r,g.useCallback(i=>[r.selectors.isTop(i,n),r.selectors.inStack(i,n)],[r,n]));return $e(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let Xl=new Map,ts=new Map;function vp(e){var t;let n=(t=ts.get(e))!=null?t:0;return ts.set(e,n+1),n!==0?()=>wp(e):(Xl.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>wp(e))}function wp(e){var t;let n=(t=ts.get(e))!=null?t:1;if(n===1?ts.delete(e):ts.set(e,n-1),n!==1)return;let r=Xl.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Xl.delete(e))}function E2(e,{allowed:t,disallowed:n}={}){let r=yp(e,"inert-others");$e(()=>{var o,s;if(!r)return;let i=pt();for(let a of(o=n==null?void 0:n())!=null?o:[])a&&i.add(vp(a));let l=(s=t==null?void 0:t())!=null?s:[];for(let a of l){if(!a)continue;let c=oi(a);if(!c)continue;let u=a.parentElement;for(;u&&u!==c.body;){for(let d of u.children)l.some(p=>d.contains(p))||i.add(vp(d));u=u.parentElement}}return i.dispose},[r,t,n])}function S2(e,t,n){let r=lr(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});g.useEffect(()=>{if(!e)return;let o=t===null?null:vn(t)?t:t.current;if(!o)return;let s=pt();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,r,e])}let Jl=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),P2=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ql=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Ql||{}),T2=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(T2||{}),A2=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(A2||{});function xp(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Jl)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function N2(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(P2)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var ec=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(ec||{});function Ep(e,t=0){var n;return e===((n=oi(e))==null?void 0:n.body)?!1:St(t,{0(){return e.matches(Jl)},1(){let r=e;for(;r!==null;){if(r.matches(Jl))return!0;r=r.parentElement}return!1}})}var C2=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(C2||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let O2=["textarea","input"].join(",");function $2(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,O2))!=null?n:!1}function Sp(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function I2(e,t,n=e===null?document.body:si(e)){return M2(xp(n),t,{relativeTo:e})}function M2(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?si(e[0]):document:si(e),i=Array.isArray(e)?n?Sp(e):e:t&64?N2(e):xp(e);o.length>0&&i.length>1&&(i=i.filter(f=>!o.some(h=>h!=null&&"current"in h?(h==null?void 0:h.current)===f:h===f))),r=r??(s==null?void 0:s.activeElement);let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=t&32?{preventScroll:!0}:{},u=0,d=i.length,p;do{if(u>=d||u+d<=0)return 0;let f=a+u;if(t&16)f=(f+d)%d;else{if(f<0)return 3;if(f>=d)return 1}p=i[f],p==null||p.focus(c),u+=l}while(p!==W0(p));return t&6&&$2(p)&&p.select(),2}function Pp(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function D2(){return/Android/gi.test(window.navigator.userAgent)}function Tp(){return Pp()||D2()}function Ur(e,t,n,r){let o=lr(n);g.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function k2(e,t,n,r){let o=lr(n);g.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const Ap=30;function L2(e,t,n){let r=lr(n),o=g.useCallback(function(l,a){if(l.defaultPrevented)return;let c=a(l);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let u=function d(p){return typeof p=="function"?d(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let d of u)if(d!==null&&(d.contains(c)||l.composed&&l.composedPath().includes(d)))return;return!Ep(c,ec.Loose)&&c.tabIndex!==-1&&l.preventDefault(),r.current(l,c)},[r,t]),s=g.useRef(null);Ur(e,"pointerdown",l=>{var a,c;Tp()||(s.current=((c=(a=l.composedPath)==null?void 0:a.call(l))==null?void 0:c[0])||l.target)},!0),Ur(e,"pointerup",l=>{if(Tp()||!s.current)return;let a=s.current;return s.current=null,o(l,()=>a)},!0);let i=g.useRef({x:0,y:0});Ur(e,"touchstart",l=>{i.current.x=l.touches[0].clientX,i.current.y=l.touches[0].clientY},!0),Ur(e,"touchend",l=>{let a={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(a.x-i.current.x)>=Ap||Math.abs(a.y-i.current.y)>=Ap))return o(l,()=>zr(l.target)?l.target:null)},!0),k2(e,"blur",l=>o(l,()=>q5(window.document.activeElement)?window.document.activeElement:null),!0)}function tc(...e){return g.useMemo(()=>oi(...e),[...e])}var B2=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(B2||{});const ui={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},F2=200,Np=5;function R2(e,{trigger:t,action:n,close:r,select:o}){let s=g.useRef(null),i=g.useRef(null),l=g.useRef(null);Ur(e&&t!==null,"pointerdown",a=>{X0(a==null?void 0:a.target)&&t!=null&&t.contains(a.target)&&(i.current=a.x,l.current=a.y,s.current=a.timeStamp)}),Ur(e&&t!==null,"pointerup",a=>{var c,u;let d=s.current;if(d===null||(s.current=null,!zr(a.target))||Math.abs(a.x-((c=i.current)!=null?c:a.x))<Np&&Math.abs(a.y-((u=l.current)!=null?u:a.y))<Np)return;let p=n(a);switch(p.kind){case 0:return;case 1:{a.timeStamp-d>F2&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function j2(e,t){return g.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function z2(e){return g.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function U2(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(l=>l()))}}}function W2(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function _2(){return Pp()?{before({doc:e,d:t,meta:n}){function r(o){for(let s of n().containers)for(let i of s())if(i.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=pt();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",l=>{if(zr(l.target))try{let a=l.target.closest("a");if(!a)return;let{hash:c}=new URL(a.href),u=e.querySelector(c);zr(u)&&!r(u)&&(i=u)}catch{}},!0),t.group(l=>{t.addEventListener(e,"touchstart",a=>{if(l.dispose(),zr(a.target)&&G5(a.target))if(r(a.target)){let c=a.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;l.style(c,"overscrollBehavior","contain")}else l.style(a.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",l=>{if(zr(l.target)){if(J0(l.target))return;if(r(l.target)){let a=l.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let a=(l=window.scrollY)!=null?l:window.pageYOffset;s!==a&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function V2(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Cp(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let cr=U2(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:pt(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=Cp(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=Cp(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[_2(),W2(),V2()];n.forEach(({before:r})=>r==null?void 0:r(t)),n.forEach(({after:r})=>r==null?void 0:r(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});cr.subscribe(()=>{let e=cr.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&cr.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&cr.dispatch("TEARDOWN",n)}});function H2(e,t,n=()=>({containers:[]})){let r=z2(cr),o=t?r.get(t):void 0,s=o?o.count>0:!1;return $e(()=>{if(!(!t||!e))return cr.dispatch("PUSH",t,n),()=>cr.dispatch("POP",t,n)},[e,t]),s}function G2(e,t,n=()=>[document.body]){let r=yp(e,"scroll-lock");H2(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function Op(e){return[e.screenX,e.screenY]}function q2(){let e=g.useRef([-1,-1]);return{wasMoved(t){let n=Op(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Op(t)}}}function K2(e=0){let[t,n]=g.useState(e),r=g.useCallback(a=>n(a),[]),o=g.useCallback(a=>n(c=>c|a),[]),s=g.useCallback(a=>(t&a)===a,[t]),i=g.useCallback(a=>n(c=>c&~a),[]),l=g.useCallback(a=>n(c=>c^a),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:l}}var $p,Ip;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&(($p=process==null?void 0:process.env)==null?void 0:$p.NODE_ENV)==="test"&&typeof((Ip=Element==null?void 0:Element.prototype)==null?void 0:Ip.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
136
|
-
`)),[]});var
|
|
135
|
+
*/var gp;function w2(){return gp||(gp=1,process.env.NODE_ENV!=="production"&&function(){function e(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=g,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,i=t.useMemo,l=t.useDebugValue;Yl.useSyncExternalStoreWithSelector=function(a,c,u,d,p){var f=o(null);if(f.current===null){var h={hasValue:!1,value:null};f.current=h}else h=f.current;f=i(function(){function x(k){if(!T){if(T=!0,w=k,k=d(k),p!==void 0&&h.hasValue){var B=h.value;if(p(B,k))return P=B}return P=k}if(B=P,n(w,k))return B;var F=d(k);return p!==void 0&&p(B,F)?(w=k,B):(w=k,P=F)}var T=!1,w,P,A=u===void 0?null:u;return[function(){return x(c())},A===null?void 0:function(){return x(A())}]},[c,u,d,p]);var m=r(a,f[0],f[1]);return s(function(){h.hasValue=!0,h.value=m},[m]),l(m),m},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Yl}process.env.NODE_ENV==="production"?Kl.exports=v2():Kl.exports=w2();var x2=Kl.exports;function rt(e,t,n=fp){return x2.useSyncExternalStoreWithSelector(he(r=>e.subscribe(E2,r)),he(()=>e.state),he(()=>e.state),he(t),n)}function E2(e){return e}function yp(e,t){let n=g.useId(),r=ql.get(t),[o,s]=rt(r,g.useCallback(i=>[r.selectors.isTop(i,n),r.selectors.inStack(i,n)],[r,n]));return $e(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let Xl=new Map,ts=new Map;function vp(e){var t;let n=(t=ts.get(e))!=null?t:0;return ts.set(e,n+1),n!==0?()=>wp(e):(Xl.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>wp(e))}function wp(e){var t;let n=(t=ts.get(e))!=null?t:1;if(n===1?ts.delete(e):ts.set(e,n-1),n!==1)return;let r=Xl.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Xl.delete(e))}function S2(e,{allowed:t,disallowed:n}={}){let r=yp(e,"inert-others");$e(()=>{var o,s;if(!r)return;let i=pt();for(let a of(o=n==null?void 0:n())!=null?o:[])a&&i.add(vp(a));let l=(s=t==null?void 0:t())!=null?s:[];for(let a of l){if(!a)continue;let c=oi(a);if(!c)continue;let u=a.parentElement;for(;u&&u!==c.body;){for(let d of u.children)l.some(p=>d.contains(p))||i.add(vp(d));u=u.parentElement}}return i.dispose},[r,t,n])}function P2(e,t,n){let r=lr(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});g.useEffect(()=>{if(!e)return;let o=t===null?null:vn(t)?t:t.current;if(!o)return;let s=pt();if(typeof ResizeObserver<"u"){let i=new ResizeObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}if(typeof IntersectionObserver<"u"){let i=new IntersectionObserver(()=>r.current(o));i.observe(o),s.add(()=>i.disconnect())}return()=>s.dispose()},[t,r,e])}let Jl=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),T2=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ql=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Ql||{}),A2=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(A2||{}),N2=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(N2||{});function xp(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Jl)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function C2(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(T2)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var ec=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(ec||{});function Ep(e,t=0){var n;return e===((n=oi(e))==null?void 0:n.body)?!1:St(t,{0(){return e.matches(Jl)},1(){let r=e;for(;r!==null;){if(r.matches(Jl))return!0;r=r.parentElement}return!1}})}var O2=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(O2||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let $2=["textarea","input"].join(",");function M2(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,$2))!=null?n:!1}function Sp(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);if(o===null||s===null)return 0;let i=o.compareDocumentPosition(s);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function I2(e,t,n=e===null?document.body:si(e)){return D2(xp(n),t,{relativeTo:e})}function D2(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?si(e[0]):document:si(e),i=Array.isArray(e)?n?Sp(e):e:t&64?C2(e):xp(e);o.length>0&&i.length>1&&(i=i.filter(f=>!o.some(h=>h!=null&&"current"in h?(h==null?void 0:h.current)===f:h===f))),r=r??(s==null?void 0:s.activeElement);let l=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=t&32?{preventScroll:!0}:{},u=0,d=i.length,p;do{if(u>=d||u+d<=0)return 0;let f=a+u;if(t&16)f=(f+d)%d;else{if(f<0)return 3;if(f>=d)return 1}p=i[f],p==null||p.focus(c),u+=l}while(p!==W0(p));return t&6&&M2(p)&&p.select(),2}function Pp(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function k2(){return/Android/gi.test(window.navigator.userAgent)}function Tp(){return Pp()||k2()}function Ur(e,t,n,r){let o=lr(n);g.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function L2(e,t,n,r){let o=lr(n);g.useEffect(()=>{if(!e)return;function s(i){o.current(i)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const Ap=30;function B2(e,t,n){let r=lr(n),o=g.useCallback(function(l,a){if(l.defaultPrevented)return;let c=a(l);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let u=function d(p){return typeof p=="function"?d(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let d of u)if(d!==null&&(d.contains(c)||l.composed&&l.composedPath().includes(d)))return;return!Ep(c,ec.Loose)&&c.tabIndex!==-1&&l.preventDefault(),r.current(l,c)},[r,t]),s=g.useRef(null);Ur(e,"pointerdown",l=>{var a,c;Tp()||(s.current=((c=(a=l.composedPath)==null?void 0:a.call(l))==null?void 0:c[0])||l.target)},!0),Ur(e,"pointerup",l=>{if(Tp()||!s.current)return;let a=s.current;return s.current=null,o(l,()=>a)},!0);let i=g.useRef({x:0,y:0});Ur(e,"touchstart",l=>{i.current.x=l.touches[0].clientX,i.current.y=l.touches[0].clientY},!0),Ur(e,"touchend",l=>{let a={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(a.x-i.current.x)>=Ap||Math.abs(a.y-i.current.y)>=Ap))return o(l,()=>zr(l.target)?l.target:null)},!0),L2(e,"blur",l=>o(l,()=>K5(window.document.activeElement)?window.document.activeElement:null),!0)}function tc(...e){return g.useMemo(()=>oi(...e),[...e])}var F2=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(F2||{});const ui={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},R2=200,Np=5;function j2(e,{trigger:t,action:n,close:r,select:o}){let s=g.useRef(null),i=g.useRef(null),l=g.useRef(null);Ur(e&&t!==null,"pointerdown",a=>{X0(a==null?void 0:a.target)&&t!=null&&t.contains(a.target)&&(i.current=a.x,l.current=a.y,s.current=a.timeStamp)}),Ur(e&&t!==null,"pointerup",a=>{var c,u;let d=s.current;if(d===null||(s.current=null,!zr(a.target))||Math.abs(a.x-((c=i.current)!=null?c:a.x))<Np&&Math.abs(a.y-((u=l.current)!=null?u:a.y))<Np)return;let p=n(a);switch(p.kind){case 0:return;case 1:{a.timeStamp-d>R2&&(o(p.target),r());break}case 2:{r();break}}},{capture:!0})}function z2(e,t){return g.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function U2(e){return g.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function W2(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let i=t[o].call(n,...s);i&&(n=i,r.forEach(l=>l()))}}}function _2(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function V2(){return Pp()?{before({doc:e,d:t,meta:n}){function r(o){for(let s of n().containers)for(let i of s())if(i.contains(o))return!0;return!1}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let l=pt();l.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>l.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,i=null;t.addEventListener(e,"click",l=>{if(zr(l.target))try{let a=l.target.closest("a");if(!a)return;let{hash:c}=new URL(a.href),u=e.querySelector(c);zr(u)&&!r(u)&&(i=u)}catch{}},!0),t.group(l=>{t.addEventListener(e,"touchstart",a=>{if(l.dispose(),zr(a.target)&&q5(a.target))if(r(a.target)){let c=a.target;for(;c.parentElement&&r(c.parentElement);)c=c.parentElement;l.style(c,"overscrollBehavior","contain")}else l.style(a.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",l=>{if(zr(l.target)){if(J0(l.target))return;if(r(l.target)){let a=l.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&l.preventDefault()}else l.preventDefault()}},{passive:!1}),t.add(()=>{var l;let a=(l=window.scrollY)!=null?l:window.pageYOffset;s!==a&&window.scrollTo(0,s),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function H2(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Cp(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let cr=W2(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:pt(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=Cp(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=Cp(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[V2(),_2(),H2()];n.forEach(({before:r})=>r==null?void 0:r(t)),n.forEach(({after:r})=>r==null?void 0:r(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});cr.subscribe(()=>{let e=cr.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&cr.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&cr.dispatch("TEARDOWN",n)}});function G2(e,t,n=()=>({containers:[]})){let r=U2(cr),o=t?r.get(t):void 0,s=o?o.count>0:!1;return $e(()=>{if(!(!t||!e))return cr.dispatch("PUSH",t,n),()=>cr.dispatch("POP",t,n)},[e,t]),s}function q2(e,t,n=()=>[document.body]){let r=yp(e,"scroll-lock");G2(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function Op(e){return[e.screenX,e.screenY]}function K2(){let e=g.useRef([-1,-1]);return{wasMoved(t){let n=Op(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Op(t)}}}function Z2(e=0){let[t,n]=g.useState(e),r=g.useCallback(a=>n(a),[]),o=g.useCallback(a=>n(c=>c|a),[]),s=g.useCallback(a=>(t&a)===a,[t]),i=g.useCallback(a=>n(c=>c&~a),[]),l=g.useCallback(a=>n(c=>c^a),[]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:i,toggleFlag:l}}var $p,Mp;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&(($p=process==null?void 0:process.env)==null?void 0:$p.NODE_ENV)==="test"&&typeof((Mp=Element==null?void 0:Element.prototype)==null?void 0:Mp.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
136
|
+
`)),[]});var Y2=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Y2||{});function Ip(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Dp(e,t,n,r){let[o,s]=g.useState(n),{hasFlag:i,addFlag:l,removeFlag:a}=Z2(e&&o?3:0),c=g.useRef(!1),u=g.useRef(!1),d=ar();return $e(()=>{var p;if(e){if(n&&s(!0),!t){n&&l(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),X2(t,{inFlight:c,prepare(){u.current?u.current=!1:u.current=c.current,c.current=!0,!u.current&&(n?(l(3),a(4)):(l(4),a(2)))},run(){u.current?n?(a(3),l(4)):(a(4),l(3)):n?a(1):l(1)},done(){var f;u.current&&eE(t)||(c.current=!1,a(7),n||s(!1),(f=r==null?void 0:r.end)==null||f.call(r,n))}})}},[e,n,t,d]),e?[o,{closed:i(1),enter:i(2),leave:i(4),transition:i(2)||i(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function X2(e,{prepare:t,run:n,done:r,inFlight:o}){let s=pt();return Q2(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(J2(e,r))})}),s.dispose}function J2(e,t){var n,r;let o=pt();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let i=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(l=>l instanceof CSSTransition))!=null?r:[];return i.length===0?(t(),o.dispose):(Promise.allSettled(i.map(l=>l.finished)).then(()=>{s||t()}),o.dispose)}function Q2(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function eE(e){var t,n;return((n=(t=e.getAnimations)==null?void 0:t.call(e))!=null?n:[]).some(r=>r instanceof CSSTransition&&r.playState!=="finished")}function di(){return typeof window<"u"}function Wr(e){return nc(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qt(e){var t;return(t=(nc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function nc(e){return di()?e instanceof Node||e instanceof ot(e).Node:!1}function be(e){return di()?e instanceof Element||e instanceof ot(e).Element:!1}function st(e){return di()?e instanceof HTMLElement||e instanceof ot(e).HTMLElement:!1}function rc(e){return!di()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot}function ns(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=At(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function tE(e){return/^(table|td|th)$/.test(Wr(e))}function fi(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const nE=/transform|translate|scale|rotate|perspective|filter/,rE=/paint|layout|strict|content/,ur=e=>!!e&&e!=="none";let oc;function sc(e){const t=be(e)?At(e):e;return ur(t.transform)||ur(t.translate)||ur(t.scale)||ur(t.rotate)||ur(t.perspective)||!pi()&&(ur(t.backdropFilter)||ur(t.filter))||nE.test(t.willChange||"")||rE.test(t.contain||"")}function oE(e){let t=xn(e);for(;st(t)&&!wn(t);){if(sc(t))return t;if(fi(t))return null;t=xn(t)}return null}function pi(){return oc==null&&(oc=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),oc}function wn(e){return/^(html|body|#document)$/.test(Wr(e))}function At(e){return ot(e).getComputedStyle(e)}function hi(e){return be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xn(e){if(Wr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rc(e)&&e.host||Qt(e);return rc(t)?t.host:t}function kp(e){const t=xn(e);return wn(t)?e.ownerDocument?e.ownerDocument.body:e.body:st(t)&&ns(t)?t:kp(t)}function Un(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=kp(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ot(o);if(s){const l=ic(i);return t.concat(i,i.visualViewport||[],ns(o)?o:[],l&&n?Un(l):[])}else return t.concat(o,Un(o,[],n))}function ic(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sE(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const En=Math.min,We=Math.max,rs=Math.round,mi=Math.floor,en=e=>({x:e,y:e}),iE={left:"right",right:"left",bottom:"top",top:"bottom"};function ac(e,t,n){return We(e,En(t,n))}function dr(e,t){return typeof e=="function"?e(t):e}function Wn(e){return e.split("-")[0]}function _r(e){return e.split("-")[1]}function Lp(e){return e==="x"?"y":"x"}function lc(e){return e==="y"?"height":"width"}function Sn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function cc(e){return Lp(Sn(e))}function aE(e,t,n){n===void 0&&(n=!1);const r=_r(e),o=cc(e),s=lc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=bi(i)),[i,bi(i)]}function lE(e){const t=bi(e);return[uc(e),t,uc(t)]}function uc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Bp=["left","right"],Fp=["right","left"],cE=["top","bottom"],uE=["bottom","top"];function dE(e,t,n){switch(e){case"top":case"bottom":return n?t?Fp:Bp:t?Bp:Fp;case"left":case"right":return t?cE:uE;default:return[]}}function fE(e,t,n,r){const o=_r(e);let s=dE(Wn(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(uc)))),s}function bi(e){const t=Wn(e);return iE[t]+e.slice(t.length)}function pE(e){return{top:0,right:0,bottom:0,left:0,...e}}function Rp(e){return typeof e!="number"?pE(e):{top:e,right:e,bottom:e,left:e}}function gi(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}/*!
|
|
137
137
|
* tabbable 6.4.0
|
|
138
138
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
139
|
-
*/var pE=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],dc=pE.join(","),jp=typeof Element>"u",os=jp?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,yi=!jp&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},vi=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):vi(t.parentNode));return i},hE=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},mE=function(t,n,r){if(vi(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(dc));return n&&os.call(t,dc)&&o.unshift(t),o=o.filter(r),o},fc=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!vi(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),a=l.length?l:i.children,c=fc(a,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var u=os.call(i,dc);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!vi(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&p){var f=fc(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else s.unshift.apply(s,i.children)}}return o},zp=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Up=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||hE(t))&&!zp(t)?0:t.tabIndex},bE=function(t,n){var r=Up(t);return r<0&&n&&!zp(t)?0:r},gE=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Wp=function(t){return t.tagName==="INPUT"},yE=function(t){return Wp(t)&&t.type==="hidden"},vE=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},wE=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},xE=function(t){if(!t.name)return!0;var n=t.form||yi(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=wE(o,t.form);return!s||s===t},EE=function(t){return Wp(t)&&t.type==="radio"},SE=function(t){return EE(t)&&!xE(t)},PE=function(t){var n,r=t&&yi(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,l,a;for(s=!!((i=o)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!s&&o;){var c,u,d;r=yi(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},_p=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},TE=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=os.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(os.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var c=t.parentElement,u=yi(t);if(c&&!c.shadowRoot&&o(c)===!0)return _p(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=a}if(PE(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return _p(t);return!1},AE=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return os.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},NE=function(t,n){return!(n.disabled||yE(n)||TE(n,t)||vE(n)||AE(n))},Vp=function(t,n){return!(SE(n)||Up(n)<0||!NE(t,n))},CE=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Hp=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,l=i?o.scopeParent:o,a=bE(l,i),c=i?Hp(o.candidates):l;a===0?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:s,tabIndex:a,item:o,isScope:i,content:c})}),r.sort(gE).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Gp=function(t,n){n=n||{};var r;return n.getShadowRoot?r=fc([t],n.includeContainer,{filter:Vp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:CE}):r=mE(t,n.includeContainer,Vp.bind(null,n)),Hp(r)};function qp(e,t,n){let{reference:r,floating:o}=e;const s=Sn(t),i=cc(t),l=lc(i),a=Wn(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[l]/2-o[l]/2;let f;switch(a){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(_r(t)){case"start":f[i]-=p*(n&&c?-1:1);break;case"end":f[i]+=p*(n&&c?-1:1);break}return f}async function Kp(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=dr(t,e),h=Rp(f),x=l[p?d==="floating"?"reference":"floating":d],T=gi(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),w=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),A=await(s.isElement==null?void 0:s.isElement(P))?await(s.getScale==null?void 0:s.getScale(P))||{x:1,y:1}:{x:1,y:1},k=gi(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:P,strategy:a}):w);return{top:(T.top-k.top+h.top)/A.y,bottom:(k.bottom-T.bottom+h.bottom)/A.y,left:(T.left-k.left+h.left)/A.x,right:(k.right-T.right+h.right)/A.x}}const OE=50,$E=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:Kp},a=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=qp(c,r,a),p=r,f=0;const h={};for(let m=0;m<s.length;m++){const x=s[m];if(!x)continue;const{name:T,fn:w}=x,{x:P,y:A,data:k,reset:B}=await w({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:l,elements:{reference:e,floating:t}});u=P??u,d=A??d,h[T]={...h[T],...k},B&&f<OE&&(f++,typeof B=="object"&&(B.placement&&(p=B.placement),B.rects&&(c=B.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):B.rects),{x:u,y:d}=qp(c,p,a)),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}},IE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:a}=t,{element:c,padding:u=0}=dr(e,t)||{};if(c==null)return{};const d=Rp(u),p={x:n,y:r},f=cc(o),h=lc(f),m=await i.getDimensions(c),x=f==="y",T=x?"top":"left",w=x?"bottom":"right",P=x?"clientHeight":"clientWidth",A=s.reference[h]+s.reference[f]-p[f]-s.floating[h],k=p[f]-s.reference[f],B=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let F=B?B[P]:0;(!F||!await(i.isElement==null?void 0:i.isElement(B)))&&(F=l.floating[P]||s.floating[h]);const b=A/2-k/2,v=F/2-m[h]/2-1,E=En(d[T],v),I=En(d[w],v),$=E,C=F-m[h]-I,D=F/2-m[h]/2+b,y=ac($,D,C),O=!a.arrow&&_r(o)!=null&&D!==y&&s.reference[h]/2-(D<$?E:I)-m[h]/2<0,M=O?D<$?D-$:D-C:0;return{[f]:p[f]+M,data:{[f]:y,centerOffset:D-y-M,...O&&{alignmentOffset:M}},reset:O}}}),ME=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...x}=dr(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=Wn(o),w=Sn(l),P=Wn(l)===l,A=await(a.isRTL==null?void 0:a.isRTL(c.floating)),k=p||(P||!m?[bi(l)]:aE(l)),B=h!=="none";!p&&B&&k.push(...dE(l,m,h,A));const F=[l,...k],b=await a.detectOverflow(t,x),v=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&v.push(b[T]),d){const D=iE(o,i,A);v.push(b[D[0]],b[D[1]])}if(E=[...E,{placement:o,overflows:v}],!v.every(D=>D<=0)){var I,$;const D=(((I=s.flip)==null?void 0:I.index)||0)+1,y=F[D];if(y&&(!(d==="alignment"?w!==Sn(y):!1)||E.every(S=>Sn(S.placement)===w?S.overflows[0]>0:!0)))return{data:{index:D,overflows:E},reset:{placement:y}};let O=($=E.filter(M=>M.overflows[0]<=0).sort((M,S)=>M.overflows[1]-S.overflows[1])[0])==null?void 0:$.placement;if(!O)switch(f){case"bestFit":{var C;const M=(C=E.filter(S=>{if(B){const L=Sn(S.placement);return L===w||L==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(L=>L>0).reduce((L,j)=>L+j,0)]).sort((S,L)=>S[1]-L[1])[0])==null?void 0:C[0];M&&(O=M);break}case"initialPlacement":O=l;break}if(o!==O)return{reset:{placement:O}}}return{}}}},DE=new Set(["left","top"]);async function kE(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Wn(n),l=_r(n),a=Sn(n)==="y",c=DE.has(i)?-1:1,u=s&&a?-1:1,d=dr(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof h=="number"&&(f=l==="end"?h*-1:h),a?{x:f*u,y:p*c}:{x:p*c,y:f*u}}const LE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=t,a=await kE(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:i}}}}},BE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:T=>{let{x:w,y:P}=T;return{x:w,y:P}}},...c}=dr(e,t),u={x:n,y:r},d=await s.detectOverflow(t,c),p=Sn(Wn(o)),f=Lp(p);let h=u[f],m=u[p];if(i){const T=f==="y"?"top":"left",w=f==="y"?"bottom":"right",P=h+d[T],A=h-d[w];h=ac(P,h,A)}if(l){const T=p==="y"?"top":"left",w=p==="y"?"bottom":"right",P=m+d[T],A=m-d[w];m=ac(P,m,A)}const x=a.fn({...t,[f]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[f]:i,[p]:l}}}}}},FE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:l}=t,{apply:a=()=>{},...c}=dr(e,t),u=await i.detectOverflow(t,c),d=Wn(o),p=_r(o),f=Sn(o)==="y",{width:h,height:m}=s.floating;let x,T;d==="top"||d==="bottom"?(x=d,T=p===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(T=d,x=p==="end"?"top":"bottom");const w=m-u.top-u.bottom,P=h-u.left-u.right,A=En(m-u[x],w),k=En(h-u[T],P),B=!t.middlewareData.shift;let F=A,b=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(b=P),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(F=w),B&&!p){const E=We(u.left,0),I=We(u.right,0),$=We(u.top,0),C=We(u.bottom,0);f?b=h-2*(E!==0||I!==0?E+I:We(u.left,u.right)):F=m-2*($!==0||C!==0?$+C:We(u.top,u.bottom))}await a({...t,availableWidth:b,availableHeight:F});const v=await i.getDimensions(l.floating);return h!==v.width||m!==v.height?{reset:{rects:!0}}:{}}}};function Zp(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=st(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=rs(n)!==s||rs(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function pc(e){return be(e)?e:e.contextElement}function Vr(e){const t=pc(e);if(!st(t))return en(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Zp(t);let i=(s?rs(n.width):n.width)/r,l=(s?rs(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const RE=en(0);function Yp(e){const t=ot(e);return!pi()||!t.visualViewport?RE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ot(e)?!1:t}function fr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=pc(e);let i=en(1);t&&(r?be(r)&&(i=Vr(r)):i=Vr(e));const l=jE(s,n,r)?Yp(s):en(0);let a=(o.left+l.x)/i.x,c=(o.top+l.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const p=ot(s),f=r&&be(r)?ot(r):r;let h=p,m=ic(h);for(;m&&r&&f!==h;){const x=Vr(m),T=m.getBoundingClientRect(),w=At(m),P=T.left+(m.clientLeft+parseFloat(w.paddingLeft))*x.x,A=T.top+(m.clientTop+parseFloat(w.paddingTop))*x.y;a*=x.x,c*=x.y,u*=x.x,d*=x.y,a+=P,c+=A,h=ot(m),m=ic(h)}}return gi({width:u,height:d,x:a,y:c})}function wi(e,t){const n=hi(e).scrollLeft;return t?t.left+n:fr(Qt(e)).left+n}function Xp(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wi(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function zE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Qt(r),l=t?fi(t.floating):!1;if(r===i||l&&s)return n;let a={scrollLeft:0,scrollTop:0},c=en(1);const u=en(0),d=st(r);if((d||!d&&!s)&&((Wr(r)!=="body"||ns(i))&&(a=hi(r)),d)){const f=fr(r);c=Vr(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const p=i&&!d&&!s?Xp(i,a):en(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-a.scrollTop*c.y+u.y+p.y}}function UE(e){return Array.from(e.getClientRects())}function WE(e){const t=Qt(e),n=hi(e),r=e.ownerDocument.body,o=We(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=We(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+wi(e);const l=-n.scrollTop;return At(r).direction==="rtl"&&(i+=We(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:l}}const Jp=25;function _E(e,t){const n=ot(e),r=Qt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,a=0;if(o){s=o.width,i=o.height;const u=pi();(!u||u&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}const c=wi(r);if(c<=0){const u=r.ownerDocument,d=u.body,p=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(r.clientWidth-d.clientWidth-f);h<=Jp&&(s-=h)}else c<=Jp&&(s+=c);return{width:s,height:i,x:l,y:a}}function VE(e,t){const n=fr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=st(e)?Vr(e):en(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,a=o*s.x,c=r*s.y;return{width:i,height:l,x:a,y:c}}function Qp(e,t,n){let r;if(t==="viewport")r=_E(e,n);else if(t==="document")r=WE(Qt(e));else if(be(t))r=VE(t,n);else{const o=Yp(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return gi(r)}function eh(e,t){const n=xn(e);return n===t||!be(n)||wn(n)?!1:At(n).position==="fixed"||eh(n,t)}function HE(e,t){const n=t.get(e);if(n)return n;let r=Un(e,[],!1).filter(l=>be(l)&&Wr(l)!=="body"),o=null;const s=At(e).position==="fixed";let i=s?xn(e):e;for(;be(i)&&!wn(i);){const l=At(i),a=sc(i);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||ns(i)&&!a&&eh(e,i))?r=r.filter(u=>u!==i):o=l,i=xn(i)}return t.set(e,r),r}function GE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?fi(t)?[]:HE(t,this._c):[].concat(n),r],l=Qp(t,i[0],o);let a=l.top,c=l.right,u=l.bottom,d=l.left;for(let p=1;p<i.length;p++){const f=Qp(t,i[p],o);a=We(f.top,a),c=En(f.right,c),u=En(f.bottom,u),d=We(f.left,d)}return{width:c-d,height:u-a,x:d,y:a}}function qE(e){const{width:t,height:n}=Zp(e);return{width:t,height:n}}function KE(e,t,n){const r=st(t),o=Qt(t),s=n==="fixed",i=fr(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const a=en(0);function c(){a.x=wi(o)}if(r||!r&&!s)if((Wr(t)!=="body"||ns(o))&&(l=hi(t)),r){const f=fr(t,!0,s,t);a.x=f.x+t.clientLeft,a.y=f.y+t.clientTop}else o&&c();s&&!r&&o&&c();const u=o&&!r&&!s?Xp(o,l):en(0),d=i.left+l.scrollLeft-a.x-u.x,p=i.top+l.scrollTop-a.y-u.y;return{x:d,y:p,width:i.width,height:i.height}}function hc(e){return At(e).position==="static"}function th(e,t){if(!st(e)||At(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qt(e)===n&&(n=n.ownerDocument.body),n}function nh(e,t){const n=ot(e);if(fi(e))return n;if(!st(e)){let o=xn(e);for(;o&&!wn(o);){if(be(o)&&!hc(o))return o;o=xn(o)}return n}let r=th(e,t);for(;r&&eE(r)&&hc(r);)r=th(r,t);return r&&wn(r)&&hc(r)&&!sc(r)?n:r||rE(e)||n}const ZE=async function(e){const t=this.getOffsetParent||nh,n=this.getDimensions,r=await n(e.floating);return{reference:KE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function YE(e){return At(e).direction==="rtl"}const XE={convertOffsetParentRelativeRectToViewportRelativeRect:zE,getDocumentElement:Qt,getClippingRect:GE,getOffsetParent:nh,getElementRects:ZE,getClientRects:UE,getDimensions:qE,getScale:Vr,isElement:be,isRTL:YE};function rh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function JE(e,t){let n=null,r;const o=Qt(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=c;if(l||t(),!p||!f)return;const h=mi(d),m=mi(o.clientWidth-(u+p)),x=mi(o.clientHeight-(d+f)),T=mi(u),P={rootMargin:-h+"px "+-m+"px "+-x+"px "+-T+"px",threshold:We(0,En(1,a))||1};let A=!0;function k(B){const F=B[0].intersectionRatio;if(F!==a){if(!A)return i();F?i(!1,F):r=setTimeout(()=>{i(!1,1e-7)},1e3)}F===1&&!rh(c,e.getBoundingClientRect())&&i(),A=!1}try{n=new IntersectionObserver(k,{...P,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,P)}n.observe(e)}return i(!0),s}function oh(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=pc(e),u=o||s?[...c?Un(c):[],...t?Un(t):[]]:[];u.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),s&&T.addEventListener("resize",n)});const d=c&&l?JE(c,n):null;let p=-1,f=null;i&&(f=new ResizeObserver(T=>{let[w]=T;w&&w.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var P;(P=f)==null||P.observe(t)})),n()}),c&&!a&&f.observe(c),t&&f.observe(t));let h,m=a?fr(e):null;a&&x();function x(){const T=fr(e);m&&!rh(m,T)&&n(),m=T,h=requestAnimationFrame(x)}return n(),()=>{var T;u.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),d==null||d(),(T=f)==null||T.disconnect(),f=null,a&&cancelAnimationFrame(h)}}const mc=Kp,QE=LE,e8=BE,t8=ME,n8=FE,sh=IE,r8=(e,t,n)=>{const r=new Map,o={platform:XE,...n},s={...o.platform,_c:r};return $E(e,t,{...o,platform:s})};var o8=typeof document<"u",s8=function(){},xi=o8?g.useLayoutEffect:s8;function Ei(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ei(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ei(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ih(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ah(e,t){const n=ih(e);return Math.round(t*n)/n}function bc(e){const t=U.useRef(e);return xi(()=>{t.current=e}),t}function lh(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:a,open:c}=e,[u,d]=U.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=U.useState(r);Ei(p,r)||f(r);const[h,m]=U.useState(null),[x,T]=U.useState(null),w=U.useCallback(S=>{S!==B.current&&(B.current=S,m(S))},[]),P=U.useCallback(S=>{S!==F.current&&(F.current=S,T(S))},[]),A=s||h,k=i||x,B=U.useRef(null),F=U.useRef(null),b=U.useRef(u),v=a!=null,E=bc(a),I=bc(o),$=bc(c),C=U.useCallback(()=>{if(!B.current||!F.current)return;const S={placement:t,strategy:n,middleware:p};I.current&&(S.platform=I.current),r8(B.current,F.current,S).then(L=>{const j={...L,isPositioned:$.current!==!1};D.current&&!Ei(b.current,j)&&(b.current=j,Qr.flushSync(()=>{d(j)}))})},[p,t,n,I,$]);xi(()=>{c===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,d(S=>({...S,isPositioned:!1})))},[c]);const D=U.useRef(!1);xi(()=>(D.current=!0,()=>{D.current=!1}),[]),xi(()=>{if(A&&(B.current=A),k&&(F.current=k),A&&k){if(E.current)return E.current(A,k,C);C()}},[A,k,C,E,v]);const y=U.useMemo(()=>({reference:B,floating:F,setReference:w,setFloating:P}),[w,P]),O=U.useMemo(()=>({reference:A,floating:k}),[A,k]),M=U.useMemo(()=>{const S={position:n,left:0,top:0};if(!O.floating)return S;const L=ah(O.floating,u.x),j=ah(O.floating,u.y);return l?{...S,transform:"translate("+L+"px, "+j+"px)",...ih(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:j}},[n,l,O.floating,u.x,u.y]);return U.useMemo(()=>({...u,update:C,refs:y,elements:O,floatingStyles:M}),[u,C,y,O,M])}const i8=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?sh({element:r.current,padding:o}).fn(n):{}:r?sh({element:r,padding:o}).fn(n):{}}}},gc=(e,t)=>{const n=QE(e);return{name:n.name,fn:n.fn,options:[e,t]}},ch=(e,t)=>{const n=e8(e);return{name:n.name,fn:n.fn,options:[e,t]}},uh=(e,t)=>{const n=t8(e);return{name:n.name,fn:n.fn,options:[e,t]}},a8=(e,t)=>{const n=n8(e);return{name:n.name,fn:n.fn,options:[e,t]}},l8=(e,t)=>{const n=i8(e);return{name:n.name,fn:n.fn,options:[e,t]}},dh={...U},c8=dh.useInsertionEffect||(e=>e());function fh(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return c8(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var yc=typeof document<"u"?g.useLayoutEffect:g.useEffect;let ph=!1,u8=0;const hh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+u8++;function d8(){const[e,t]=U.useState(()=>ph?hh():void 0);return yc(()=>{e==null&&t(hh())},[]),U.useEffect(()=>{ph=!0},[]),e}const f8=dh.useId||d8;let ss;process.env.NODE_ENV!=="production"&&(ss=new Set);function p8(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ss)!=null&&e.has(o))){var s;(s=ss)==null||s.add(o),console.warn(o)}}function h8(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ss)!=null&&e.has(o))){var s;(s=ss)==null||s.add(o),console.error(o)}}function m8(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const b8=U.createContext(null),g8=U.createContext(null),y8=()=>{var e;return((e=U.useContext(b8))==null?void 0:e.id)||null},v8=()=>U.useContext(g8),w8="data-floating-ui-focusable";function x8(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=f8(),s=U.useRef({}),[i]=U.useState(()=>m8()),l=y8()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!be(f)&&h8("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,c]=U.useState(r.reference),u=fh((f,h,m)=>{s.current.openEvent=f?h:void 0,i.emit("openchange",{open:f,event:h,reason:m,nested:l}),n==null||n(f,h,m)}),d=U.useMemo(()=>({setPositionReference:c}),[]),p=U.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return U.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:d}),[t,u,p,i,o,d])}function E8(e){e===void 0&&(e={});const{nodeId:t}=e,n=x8({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=U.useState(null),[l,a]=U.useState(null),u=(o==null?void 0:o.domReference)||s,d=U.useRef(null),p=v8();yc(()=>{u&&(d.current=u)},[u]);const f=lh({...e,elements:{...o,...l&&{reference:l}}}),h=U.useCallback(P=>{const A=be(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),contextElement:P}:P;a(A),f.refs.setReference(A)},[f.refs]),m=U.useCallback(P=>{(be(P)||P===null)&&(d.current=P,i(P)),(be(f.refs.reference.current)||f.refs.reference.current===null||P!==null&&!be(P))&&f.refs.setReference(P)},[f.refs]),x=U.useMemo(()=>({...f.refs,setReference:m,setPositionReference:h,domReference:d}),[f.refs,m,h]),T=U.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),w=U.useMemo(()=>({...f,...r,refs:x,elements:T,nodeId:t}),[f,x,T,t,r]);return yc(()=>{r.dataRef.current.floatingContext=w;const P=p==null?void 0:p.nodesRef.current.find(A=>A.id===t);P&&(P.context=w)}),U.useMemo(()=>({...f,context:w,refs:x,elements:T}),[f,x,T,w])}const mh="active",bh="selected";function vc(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[mh]:i,[bh]:l,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[w8]:""},...s,...t.map(i=>{const l=i?i[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(a=>{let[c,u]=a;if(!(o&&[mh,bh].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),i[c]=function(){for(var p,f=arguments.length,h=new Array(f),m=0;m<f;m++)h[m]=arguments[m];return(p=r.get(c))==null?void 0:p.map(x=>x(...h)).find(x=>x!==void 0)}}}else i[c]=u}),i),{})}}function S8(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),o=U.useCallback(l=>vc(l,e,"reference"),t),s=U.useCallback(l=>vc(l,e,"floating"),n),i=U.useCallback(l=>vc(l,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function gh(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const P8=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:l=4,referenceOverflowThreshold:a=0,scrollRef:c,...u}=dr(e,t),{rects:d,elements:{floating:p}}=t,f=n.current[i],h=(c==null?void 0:c.current)||p,m=p.clientTop||h.clientTop,x=p.clientTop!==0,T=h.clientTop!==0,w=p===h;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||p8('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const P={...t,...await gc(-f.offsetTop-p.clientTop-d.reference.height/2-f.offsetHeight/2-s).fn(t)},A=await mc(gh(P,h.scrollHeight+m+p.clientTop),u),k=await mc(P,{...u,elementContext:"reference"}),B=We(0,A.top),F=P.y+B,E=(h.scrollHeight>h.clientHeight?I=>I:rs)(We(0,h.scrollHeight+(x&&w||T?m*2:0)-B-We(0,A.bottom)));if(h.style.maxHeight=E+"px",h.scrollTop=B,o){const I=h.offsetHeight<f.offsetHeight*En(l,n.current.length)-1||k.top>=-a||k.bottom>=-a;Qr.flushSync(()=>o(I))}return r&&(r.current=await mc(gh({...P,y:F},h.offsetHeight+m+p.clientTop),u)),{y:F}}});function T8(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:l}=t,a=fh(l),c=U.useRef(!1),u=U.useRef(null),d=U.useRef(null);U.useEffect(()=>{if(!o)return;function f(m){if(m.ctrlKey||!h||s.current==null)return;const x=m.deltaY,T=s.current.top>=-.5,w=s.current.bottom>=-.5,P=h.scrollHeight-h.clientHeight,A=x<0?-1:1,k=x<0?"max":"min";h.scrollHeight<=h.clientHeight||(!T&&x>0||!w&&x<0?(m.preventDefault(),Qr.flushSync(()=>{a(B=>B+Math[k](x,P*A))})):/firefox/i.test(oE())&&(h.scrollTop+=x))}const h=(i==null?void 0:i.current)||r.floating;if(n&&h)return h.addEventListener("wheel",f),requestAnimationFrame(()=>{u.current=h.scrollTop,s.current!=null&&(d.current={...s.current})}),()=>{u.current=null,d.current=null,h.removeEventListener("wheel",f)}},[o,n,r.floating,s,i,a]);const p=U.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const f=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!f||!c.current)){if(u.current!==null){const h=f.scrollTop-u.current;(s.current.bottom<-.5&&h<-1||s.current.top<-.5&&h>1)&&Qr.flushSync(()=>a(m=>m+h))}requestAnimationFrame(()=>{u.current=f.scrollTop})}}}),[r.floating,a,s,i]);return U.useMemo(()=>o?{floating:p}:{},[o,p])}let Hr=g.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Hr.displayName="FloatingContext";let wc=g.createContext(null);wc.displayName="PlacementContext";function A8(e){return g.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function N8(){return g.useContext(Hr).setReference}function C8(){return g.useContext(Hr).getReferenceProps}function O8(){let{getFloatingProps:e,slot:t}=g.useContext(Hr);return g.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function $8(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=g.useContext(wc),n=g.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);$e(()=>{t==null||t(n??null)},[t,n]);let r=g.useContext(Hr);return g.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let yh=4;function I8({children:e,enabled:t=!0}){let[n,r]=g.useState(null),[o,s]=g.useState(0),i=g.useRef(null),[l,a]=g.useState(null);M8(l);let c=t&&n!==null&&l!==null,{to:u="bottom",gap:d=0,offset:p=0,padding:f=0,inner:h}=D8(n,l),[m,x="center"]=u.split(" ");$e(()=>{c&&s(0)},[c]);let{refs:T,floatingStyles:w,context:P}=E8({open:c,placement:m==="selection"?x==="center"?"bottom":`bottom-${x}`:x==="center"?`${m}`:`${m}-${x}`,strategy:"absolute",transform:!1,middleware:[gc({mainAxis:m==="selection"?0:d,crossAxis:p}),ch({padding:f}),m!=="selection"&&uh({padding:f}),m==="selection"&&h?P8({...h,padding:f,overflowRef:i,offset:o,minItemsVisible:yh,referenceOverflowThreshold:f,onFallbackChange(I){var $,C;if(!I)return;let D=P.elements.floating;if(!D)return;let y=parseFloat(getComputedStyle(D).scrollPaddingBottom)||0,O=Math.min(yh,D.childElementCount),M=0,S=0;for(let L of(C=($=P.elements.floating)==null?void 0:$.childNodes)!=null?C:[])if(vn(L)){let j=L.offsetTop,z=j+L.clientHeight+y,W=D.scrollTop,_=W+D.clientHeight;if(j>=W&&z<=_)O--;else{S=Math.max(0,Math.min(z,_)-Math.max(j,W)),M=L.clientHeight;break}}O>=1&&s(L=>{let j=M*O-S+y;return L>=j?L:j})}}):null,a8({padding:f,apply({availableWidth:I,availableHeight:$,elements:C}){Object.assign(C.floating.style,{overflow:"auto",maxWidth:`${I}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${$}px)`})}})].filter(Boolean),whileElementsMounted:oh}),[A=m,k=x]=P.placement.split("-");m==="selection"&&(A="selection");let B=g.useMemo(()=>({anchor:[A,k].filter(Boolean).join(" ")}),[A,k]),F=T8(P,{overflowRef:i,onChange:s}),{getReferenceProps:b,getFloatingProps:v}=S8([F]),E=he(I=>{a(I),T.setFloating(I)});return U.createElement(wc.Provider,{value:r},U.createElement(Hr.Provider,{value:{setFloating:E,setReference:T.setReference,styles:w,getReferenceProps:b,getFloatingProps:v,slot:B}},e))}function M8(e){$e(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function D8(e,t){var n,r,o;let s=xc((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=xc((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),l=xc((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:l}}function xc(e,t,n=void 0){let r=ar(),o=he((a,c)=>{if(a==null)return[n,null];if(typeof a=="number")return[a,null];if(typeof a=="string"){if(!c)return[n,null];let u=wh(a,c);return[u,d=>{let p=vh(a);{let f=p.map(h=>window.getComputedStyle(c).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let m=!1;for(let[T,w]of p.entries()){let P=window.getComputedStyle(c).getPropertyValue(w);if(f[T]!==P){f[T]=P,m=!0;break}}if(!m)return;let x=wh(a,c);u!==x&&(d(x),u=x)})}return r.dispose}]}return[n,null]}),s=g.useMemo(()=>o(e,t)[0],[e,t]),[i=s,l]=g.useState();return $e(()=>{let[a,c]=o(e,t);if(l(a),!!c)return c(l)},[e,t]),i}function vh(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...vh(o)]:[r]}return[]}function wh(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function k8({children:e,freeze:t},n){let r=xh(t,e);return g.isValidElement(r)?g.cloneElement(r,{ref:n}):g.createElement(g.Fragment,null,r)}g.forwardRef(k8);function xh(e,t){let[n,r]=g.useState(t);return!e&&n!==t&&r(t),e?n:t}let Ec=g.createContext(null);Ec.displayName="OpenClosedContext";var Ut=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ut||{});function Sc(){return g.useContext(Ec)}function Eh({value:e,children:t}){return g.createElement(Ec.Provider,{value:e},t)}function L8(e){throw new Error("Unexpected object: "+e)}var Ce=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Ce||{});function Si(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{o===-1&&(o=n.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=o+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:L8(e)}}function Sh(e){let t=he(e),n=g.useRef(!1);g.useEffect(()=>(n.current=!1,()=>{n.current=!0,_0(()=>{n.current&&t()})}),[t])}let B8=g.createContext(!1);function F8(){return g.useContext(B8)}function R8(e){let t=F8(),n=g.useContext(Th),[r,o]=g.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Xt.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let l=e.createElement("div");return l.setAttribute("id","headlessui-portal-root"),e.body.appendChild(l)});return g.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),g.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let Ph=g.Fragment,j8=nt(function(e,t){let{ownerDocument:n=null,...r}=e,o=g.useRef(null),s=Pt(X5(p=>{o.current=p}),t),i=tc(o.current),l=n??i,a=R8(l),c=g.useContext(_8),u=ar(),d=ht();return Sh(()=>{var p;a&&a.childNodes.length<=0&&((p=a.parentElement)==null||p.removeChild(a))}),a?Ke.createPortal(g.createElement("div",{"data-headlessui-portal":"",ref:p=>{u.dispose(),c&&p&&u.add(c.register(p))}},d({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:Ph,name:"Portal"})),a):null});function z8(e,t){let n=Pt(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=ht();return r?g.createElement(j8,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:Ph,name:"Portal"})}let U8=g.Fragment,Th=g.createContext(null);function W8(e,t){let{target:n,...r}=e,o={ref:Pt(t)},s=ht();return g.createElement(Th.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:U8,name:"Popover.Group"}))}let _8=g.createContext(null),V8=nt(z8),H8=nt(W8),G8=Object.assign(V8,{Group:H8});const Pi={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function Ah(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function q8(e,t,n){let r=pt();if(t.kind==="Tracked"){let o=function(){s!==Ah(e)&&(r.dispose(),n())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),r.add(()=>i.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}function K8(){let e=typeof document>"u";return"useSyncExternalStore"in U?(t=>t.useSyncExternalStore)(U)(()=>()=>{},()=>!1,()=>!e):!1}function Nh(){let e=K8(),[t,n]=U.useState(Xt.isHandoffComplete);return t&&Xt.isHandoffComplete===!1&&n(!1),U.useEffect(()=>{t!==!0&&n(!0)},[t]),U.useEffect(()=>Xt.handoff(),[]),e?!1:t}function Z8(){let e=g.useRef(!1);return $e(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Ch(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!Jo((t=e.as)!=null?t:$h)||g.Children.count(e.children)===1}let Ti=g.createContext(null);Ti.displayName="TransitionContext";var Y8=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Y8||{});function X8(){let e=g.useContext(Ti);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function J8(){let e=g.useContext(Ai);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Ai=g.createContext(null);Ai.displayName="NestingContext";function Ni(e){return"children"in e?Ni(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Oh(e,t){let n=lr(e),r=g.useRef([]),o=Z8(),s=ar(),i=he((f,h=jn.Hidden)=>{let m=r.current.findIndex(({el:x})=>x===f);m!==-1&&(St(h,{[jn.Unmount](){r.current.splice(m,1)},[jn.Hidden](){r.current[m].state="hidden"}}),s.microTask(()=>{var x;!Ni(r)&&o.current&&((x=n.current)==null||x.call(n))}))}),l=he(f=>{let h=r.current.find(({el:m})=>m===f);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:f,state:"visible"}),()=>i(f,jn.Unmount)}),a=g.useRef([]),c=g.useRef(Promise.resolve()),u=g.useRef({enter:[],leave:[]}),d=he((f,h,m)=>{a.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([x])=>x!==f)),t==null||t.chains.current[h].push([f,new Promise(x=>{a.current.push(x)})]),t==null||t.chains.current[h].push([f,new Promise(x=>{Promise.all(u.current[h].map(([T,w])=>w)).then(()=>x())})]),h==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(h)):m(h)}),p=he((f,h,m)=>{Promise.all(u.current[h].splice(0).map(([x,T])=>T)).then(()=>{var x;(x=a.current.shift())==null||x()}).then(()=>m(h))});return g.useMemo(()=>({children:r,register:l,unregister:i,onStart:d,onStop:p,wait:c,chains:u}),[l,i,r,d,p,u,c])}let $h=g.Fragment,Ih=ii.RenderStrategy;function Q8(e,t){var n,r;let{transition:o=!0,beforeEnter:s,afterEnter:i,beforeLeave:l,afterLeave:a,enter:c,enterFrom:u,enterTo:d,entered:p,leave:f,leaveFrom:h,leaveTo:m,...x}=e,[T,w]=g.useState(null),P=g.useRef(null),A=Ch(e),k=Pt(...A?[P,t,w]:t===null?[]:[t]),B=(n=x.unmount)==null||n?jn.Unmount:jn.Hidden,{show:F,appear:b,initial:v}=X8(),[E,I]=g.useState(F?"visible":"hidden"),$=J8(),{register:C,unregister:D}=$;$e(()=>C(P),[C,P]),$e(()=>{if(B===jn.Hidden&&P.current){if(F&&E!=="visible"){I("visible");return}return St(E,{hidden:()=>D(P),visible:()=>C(P)})}},[E,P,C,D,F,B]);let y=Nh();$e(()=>{if(A&&y&&E==="visible"&&P.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[P,E,y,A]);let O=v&&!b,M=b&&F&&v,S=g.useRef(!1),L=Oh(()=>{S.current||(I("hidden"),D(P))},$),j=he(ee=>{S.current=!0;let fe=ee?"enter":"leave";L.onStart(P,fe,me=>{me==="enter"?s==null||s():me==="leave"&&(l==null||l())})}),z=he(ee=>{let fe=ee?"enter":"leave";S.current=!1,L.onStop(P,fe,me=>{me==="enter"?i==null||i():me==="leave"&&(a==null||a())}),fe==="leave"&&!Ni(L)&&(I("hidden"),D(P))});g.useEffect(()=>{A&&o||(j(F),z(F))},[F,A,o]);let W=!(!o||!A||!y||O),[,_]=Dp(W,T,F,{start:j,end:z}),Z=zn({ref:k,className:((r=zl(x.className,M&&c,M&&u,_.enter&&c,_.enter&&_.closed&&u,_.enter&&!_.closed&&d,_.leave&&f,_.leave&&!_.closed&&h,_.leave&&_.closed&&m,!_.transition&&F&&p))==null?void 0:r.trim())||void 0,...Mp(_)}),q=0;E==="visible"&&(q|=Ut.Open),E==="hidden"&&(q|=Ut.Closed),F&&E==="hidden"&&(q|=Ut.Opening),!F&&E==="visible"&&(q|=Ut.Closing);let H=ht();return g.createElement(Ai.Provider,{value:L},g.createElement(Eh,{value:q},H({ourProps:Z,theirProps:x,defaultTag:$h,features:Ih,visible:E==="visible",name:"Transition.Child"})))}function eS(e,t){let{show:n,appear:r=!1,unmount:o=!0,...s}=e,i=g.useRef(null),l=Ch(e),a=Pt(...l?[i,t]:t===null?[]:[t]);Nh();let c=Sc();if(n===void 0&&c!==null&&(n=(c&Ut.Open)===Ut.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=g.useState(n?"visible":"hidden"),p=Oh(()=>{n||d("hidden")}),[f,h]=g.useState(!0),m=g.useRef([n]);$e(()=>{f!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),h(!1))},[m,n]);let x=g.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);$e(()=>{n?d("visible"):!Ni(p)&&i.current!==null&&d("hidden")},[n,p]);let T={unmount:o},w=he(()=>{var k;f&&h(!1),(k=e.beforeEnter)==null||k.call(e)}),P=he(()=>{var k;f&&h(!1),(k=e.beforeLeave)==null||k.call(e)}),A=ht();return g.createElement(Ai.Provider,{value:p},g.createElement(Ti.Provider,{value:x},A({ourProps:{...T,as:g.Fragment,children:g.createElement(Mh,{ref:a,...T,...s,beforeEnter:w,beforeLeave:P})},theirProps:{},defaultTag:g.Fragment,features:Ih,visible:u==="visible",name:"Transition"})))}function tS(e,t){let n=g.useContext(Ti)!==null,r=Sc()!==null;return g.createElement(g.Fragment,null,!n&&r?g.createElement(Pc,{ref:t,...e}):g.createElement(Mh,{ref:t,...e}))}let Pc=nt(eS),Mh=nt(Q8),nS=nt(tS),Tc=Object.assign(Pc,{Child:nS,Root:Pc}),Dh=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function kh(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!vn(o))return r;let s=!1;for(let l of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),s=!0;let i=s?(n=o.innerText)!=null?n:"":r;return Dh.test(i)&&(i=i.replace(Dh,"")),i}function rS(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():kh(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return kh(e).trim()}function oS(e){let t=g.useRef(""),n=g.useRef("");return he(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=rS(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var sS=Object.defineProperty,iS=(e,t,n)=>t in e?sS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lh=(e,t,n)=>(iS(e,typeof t!="symbol"?t+"":t,n),n),_e=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(_e||{}),_n=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(_n||{}),Ci=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Ci||{}),Bh=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(Bh||{});function Fh(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Sp(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let aS={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Pi.Tracked(Ah(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:Ce.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(s=>r(s.dataRef.current.value));return o!==-1&&(n=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1,buttonPositionState:Pi.Idle}},2(e,t){var n,r,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let l={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===Ce.Nothing)return{...l,activeOptionIndex:null};if(t.focus===Ce.Specific)return{...l,activeOptionIndex:e.options.findIndex(u=>u.id===t.id)};if(t.focus===Ce.Previous){let u=e.activeOptionIndex;if(u!==null){let d=e.options[u].dataRef.current.domRef,p=Si(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((r=d.current)==null?void 0:r.previousElementSibling)===f.current||((o=f.current)==null?void 0:o.previousElementSibling)===null)return{...l,activeOptionIndex:p}}}}else if(t.focus===Ce.Next){let u=e.activeOptionIndex;if(u!==null){let d=e.options[u].dataRef.current.domRef,p=Si(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((s=d.current)==null?void 0:s.nextElementSibling)===f.current||((i=f.current)==null?void 0:i.nextElementSibling)===null)return{...l,activeOptionIndex:p}}}}let a=Fh(e),c=Si(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});return{...l,...a,activeOptionIndex:c}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var l;return!i.dataRef.current.disabled&&((l=i.dataRef.current.textValue)==null?void 0:l.startsWith(r))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==Ce.Nothing&&(r=Si(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=n.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(r=s)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:Ce.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[s,i]of n.entries())if(o.has(i.id)&&(r.push(s),o.delete(i.id),o.size===0))break;if(r.length>0){n=n.slice();for(let s of r.reverse())n.splice(s,1)}return{...e,options:n,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...Fh(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Pi.Moved}}};class Ac extends dp{constructor(t){super(t),Lh(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:i}=this.state.dataRef.current;return St(s,{0:()=>r==null?void 0:r(n),1:()=>{let l=i.slice(),a=l.findIndex(c=>o(c,n));return a===-1?l.push(n):l.splice(a,1),r==null?void 0:r(l)}})},registerOption:Gl(()=>{let n=[],r=new Set;return[(o,s)=>{r.has(s)||(r.add(s),n.push({id:o,dataRef:s}))},()=>(r.clear(),this.send({type:6,options:n.splice(0)}))]}),unregisterOption:Gl(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:Gl(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{var n;if(this.state.activeOptionIndex!==null){let{dataRef:r}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(r.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(n=this.state.buttonElement)==null||n.focus({preventScroll:!0}))},selectOption:n=>{this.send({type:5,value:n})},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:8,element:n})},setOptionsElement:n=>{this.send({type:9,element:n})}}),Lh(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,s=n.options;return o===null||(r=s[o])==null?void 0:r.id},isActive(n,r){var o;let s=n.activeOptionIndex,i=n.options;return s!==null?((o=i[s])==null?void 0:o.id)===r:!1},hasFrozenValue(n){return n.frozenValue},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let n=this.state.id,r=ql.get(null);this.disposables.add(r.on(mp.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(q8(r.buttonElement,r.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(n,r)=>{var o;this.actions.onChange(r.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:n=!1}){return new Ac({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:Ce.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:Pi.Idle})}reduce(t,n){return St(n.type,aS,t,n)}}const Rh=g.createContext(null);function Nc(e){let t=g.useContext(Rh);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,jh),n}return t}function jh({id:e,__demoMode:t=!1}){let n=g.useMemo(()=>Ac.new({id:e,__demoMode:t}),[]);return Sh(()=>n.dispose()),n}let Oi=g.createContext(null);Oi.displayName="ListboxDataContext";function is(e){let t=g.useContext(Oi);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,is),n}return t}let lS=g.Fragment;function cS(e,t){let n=g.useId(),r=jl(),{value:o,defaultValue:s,form:i,name:l,onChange:a,by:c,invalid:u=!1,disabled:d=r||!1,horizontal:p=!1,multiple:f=!1,__demoMode:h=!1,...m}=e;const x=p?"horizontal":"vertical";let T=Pt(t),w=B5(s),[P=f?[]:void 0,A]=L5(o,a,w),k=jh({id:n,__demoMode:h}),B=g.useRef({static:!1,hold:!1}),F=g.useRef(new Map),b=l2(c),v=g.useCallback(W=>St(E.mode,{[_n.Multi]:()=>P.some(_=>b(_,W)),[_n.Single]:()=>b(P,W)}),[P]),E=Rn({value:P,disabled:d,invalid:u,mode:f?_n.Multi:_n.Single,orientation:x,onChange:A,compare:b,isSelected:v,optionsPropsRef:B,listRef:F});$e(()=>{k.state.dataRef.current=E},[E]);let I=rt(k,W=>W.listboxState),$=ql.get(null),C=rt($,g.useCallback(W=>$.selectors.isTop(W,n),[$,n])),[D,y]=rt(k,W=>[W.buttonElement,W.optionsElement]);L2(C,[D,y],(W,_)=>{k.send({type:Bh.CloseListbox}),Ep(_,ec.Loose)||(W.preventDefault(),D==null||D.focus())});let O=Rn({open:I===_e.Open,disabled:d,invalid:u,value:P}),[M,S]=n2({inherit:!0}),L={ref:T},j=g.useCallback(()=>{if(w!==void 0)return A==null?void 0:A(w)},[A,w]),z=ht();return g.createElement(S,{value:M,props:{htmlFor:D==null?void 0:D.id},slot:{open:I===_e.Open,disabled:d}},g.createElement(I8,null,g.createElement(Rh.Provider,{value:k},g.createElement(Oi.Provider,{value:E},g.createElement(Eh,{value:St(I,{[_e.Open]:Ut.Open,[_e.Closed]:Ut.Closed})},l!=null&&P!=null&&g.createElement(_5,{disabled:d,data:{[l]:P},form:i,onReset:j}),z({ourProps:L,theirProps:m,slot:O,defaultTag:lS,name:"Listbox"}))))))}let uS="button";function dS(e,t){let n=g.useId(),r=Y0(),o=is("Listbox.Button"),s=Nc("Listbox.Button"),{id:i=r||`headlessui-listbox-button-${n}`,disabled:l=o.disabled||!1,autoFocus:a=!1,...c}=e,u=Pt(t,N8(),s.actions.setButtonElement),d=C8(),[p,f,h]=rt(s,y=>[y.listboxState,y.buttonElement,y.optionsElement]),m=p===_e.Open;R2(m,{trigger:f,action:g.useCallback(y=>{if(f!=null&&f.contains(y.target))return ui.Ignore;let O=y.target.closest('[role="option"]:not([data-disabled])');return vn(O)?ui.Select(O):h!=null&&h.contains(y.target)?ui.Ignore:ui.Close},[f,h]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let x=he(y=>{switch(y.key){case je.Enter:F5(y.currentTarget);break;case je.Space:case je.ArrowDown:y.preventDefault(),s.actions.openListbox({focus:o.value?Ce.Nothing:Ce.First});break;case je.ArrowUp:y.preventDefault(),s.actions.openListbox({focus:o.value?Ce.Nothing:Ce.Last});break}}),T=he(y=>{switch(y.key){case je.Space:y.preventDefault();break}}),w=u2(y=>{var O;s.state.listboxState===_e.Open?(Ke.flushSync(()=>s.actions.closeListbox()),(O=s.state.buttonElement)==null||O.focus({preventScroll:!0})):(y.preventDefault(),s.actions.openListbox({focus:Ce.Nothing}))}),P=he(y=>y.preventDefault()),A=sp([i]),k=J5(),{isFocusVisible:B,focusProps:F}=x5({autoFocus:a}),{isHovered:b,hoverProps:v}=w5({isDisabled:l}),{pressed:E,pressProps:I}=C5({disabled:l}),$=Rn({open:p===_e.Open,active:E||p===_e.Open,disabled:l,invalid:o.invalid,value:o.value,hover:b,focus:B,autofocus:a}),C=rt(s,y=>y.listboxState===_e.Open),D=H0(d(),{ref:u,id:i,type:j2(e,f),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":C,"aria-labelledby":A,"aria-describedby":k,disabled:l||void 0,autoFocus:a,onKeyDown:x,onKeyUp:T,onKeyPress:P},w,F,v,I);return ht()({ourProps:D,theirProps:c,slot:$,defaultTag:uS,name:"Listbox.Button"})}let zh=g.createContext(!1),fS="div",pS=ii.RenderStrategy|ii.Static;function hS(e,t){let n=g.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:i=!0,transition:l=!1,...a}=e,c=A8(o),[u,d]=g.useState(null);c&&(s=!0);let p=is("Listbox.Options"),f=Nc("Listbox.Options"),[h,m,x,T]=rt(f,H=>[H.listboxState,H.buttonElement,H.optionsElement,H.__demoMode]),w=tc(m),P=tc(x),A=Sc(),[k,B]=Dp(l,u,A!==null?(A&Ut.Open)===Ut.Open:h===_e.Open);S2(k,m,f.actions.closeListbox);let F=T?!1:i&&h===_e.Open;G2(F,P);let b=T?!1:i&&h===_e.Open;E2(b,{allowed:g.useCallback(()=>[m,x],[m,x])});let v=rt(f,f.selectors.didButtonMove)?!1:k,E=rt(f,f.selectors.hasFrozenValue)&&!e.static,I=xh(E,p.value),$=g.useCallback(H=>p.compare(I,H),[p.compare,I]),C=rt(f,H=>{var ee;if(c==null||!((ee=c==null?void 0:c.to)!=null&&ee.includes("selection")))return null;let fe=H.options.findIndex(me=>$(me.dataRef.current.value));return fe===-1&&(fe=0),fe}),D=(()=>{if(c==null)return;if(C===null)return{...c,inner:void 0};let H=Array.from(p.listRef.current.values());return{...c,inner:{listRef:{current:H},index:C}}})(),[y,O]=$8(D),M=O8(),S=Pt(t,c?y:null,f.actions.setOptionsElement,d),L=ar();g.useEffect(()=>{let H=x;H&&h===_e.Open&&(T5(H)||H==null||H.focus({preventScroll:!0}))},[h,x]);let j=he(H=>{var ee;switch(L.dispose(),H.key){case je.Space:if(f.state.searchQuery!=="")return H.preventDefault(),H.stopPropagation(),f.actions.search(H.key);case je.Enter:H.preventDefault(),H.stopPropagation(),f.actions.selectActiveOption();break;case St(p.orientation,{vertical:je.ArrowDown,horizontal:je.ArrowRight}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:Ce.Next});case St(p.orientation,{vertical:je.ArrowUp,horizontal:je.ArrowLeft}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:Ce.Previous});case je.Home:case je.PageUp:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:Ce.First});case je.End:case je.PageDown:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:Ce.Last});case je.Escape:H.preventDefault(),H.stopPropagation(),Ke.flushSync(()=>f.actions.closeListbox()),(ee=f.state.buttonElement)==null||ee.focus({preventScroll:!0});return;case je.Tab:H.preventDefault(),H.stopPropagation(),Ke.flushSync(()=>f.actions.closeListbox()),I2(f.state.buttonElement,H.shiftKey?Ql.Previous:Ql.Next);break;default:H.key.length===1&&(f.actions.search(H.key),L.setTimeout(()=>f.actions.clearSearch(),350));break}}),z=rt(f,H=>{var ee;return(ee=H.buttonElement)==null?void 0:ee.id}),W=Rn({open:h===_e.Open}),_=H0(c?M():{},{id:r,ref:S,"aria-activedescendant":rt(f,f.selectors.activeDescendantId),"aria-multiselectable":p.mode===_n.Multi?!0:void 0,"aria-labelledby":z,"aria-orientation":p.orientation,onKeyDown:j,role:"listbox",tabIndex:h===_e.Open?0:void 0,style:{...a.style,...O,"--button-width":c2(k,m,!0).width},...Mp(B)}),Z=ht(),q=g.useMemo(()=>p.mode===_n.Multi?p:{...p,isSelected:$},[p,$]);return g.createElement(G8,{enabled:s?e.static||k:!1,ownerDocument:w},g.createElement(Oi.Provider,{value:q},Z({ourProps:_,theirProps:a,slot:W,defaultTag:fS,features:pS,visible:v,name:"Listbox.Options"})))}let mS="div";function bS(e,t){let n=g.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,l=g.useContext(zh)===!0,a=is("Listbox.Option"),c=Nc("Listbox.Option"),u=rt(c,E=>c.selectors.isActive(E,r)),d=a.isSelected(s),p=g.useRef(null),f=oS(p),h=lr({disabled:o,value:s,domRef:p,get textValue(){return f()}}),m=Pt(t,p,E=>{E?a.listRef.current.set(r,E):a.listRef.current.delete(r)}),x=rt(c,E=>c.selectors.shouldScrollIntoView(E,r));$e(()=>{if(x)return pt().requestAnimationFrame(()=>{var E,I;(I=(E=p.current)==null?void 0:E.scrollIntoView)==null||I.call(E,{block:"nearest"})})},[x,p]),$e(()=>{if(!l)return c.actions.registerOption(r,h),()=>c.actions.unregisterOption(r)},[h,r,l]);let T=he(E=>{if(o)return E.preventDefault();c.actions.selectOption(s)}),w=he(()=>{if(o)return c.actions.goToOption({focus:Ce.Nothing});c.actions.goToOption({focus:Ce.Specific,id:r})}),P=q2(),A=he(E=>P.update(E)),k=he(E=>{P.wasMoved(E)&&(o||u&&c.state.activationTrigger===Ci.Pointer||c.actions.goToOption({focus:Ce.Specific,id:r},Ci.Pointer))}),B=he(E=>{P.wasMoved(E)&&(o||u&&c.state.activationTrigger===Ci.Pointer&&c.actions.goToOption({focus:Ce.Nothing}))}),F=Rn({active:u,focus:u,selected:d,disabled:o,selectedOption:d&&l}),b=l?{}:{id:r,ref:m,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":d,disabled:void 0,onClick:T,onFocus:w,onPointerEnter:A,onMouseEnter:A,onPointerMove:k,onMouseMove:k,onPointerLeave:B,onMouseLeave:B},v=ht();return!d&&l?null:v({ourProps:b,theirProps:i,slot:F,defaultTag:mS,name:"Listbox.Option"})}let gS=g.Fragment;function yS(e,t){let{options:n,placeholder:r,...o}=e,s={ref:Pt(t)},i=is("ListboxSelectedOption"),l=Rn({}),a=i.value===void 0||i.value===null||i.mode===_n.Multi&&Array.isArray(i.value)&&i.value.length===0,c=ht();return g.createElement(zh.Provider,{value:!0},c({ourProps:s,theirProps:{...o,children:g.createElement(g.Fragment,null,r&&a?r:n)},slot:l,defaultTag:gS,name:"ListboxSelectedOption"}))}let vS=nt(cS),wS=nt(dS),xS=i2,ES=nt(hS),SS=nt(bS),PS=nt(yS),Nt=Object.assign(vS,{Button:wS,Label:xS,Options:ES,Option:SS,SelectedOption:PS});const TS=()=>N.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[N.jsx("g",{clipPath:"url(#clip0_active)",children:N.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#22FD73"})}),N.jsx("defs",{children:N.jsx("clipPath",{id:"clip0_active",children:N.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),AS=()=>N.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[N.jsx("g",{clipPath:"url(#clip0_inactive)",children:N.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#F9F9F9"})}),N.jsx("defs",{children:N.jsx("clipPath",{id:"clip0_inactive",children:N.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),as=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,s)=>s+1);return N.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>N.jsx("div",{className:"flex items-center justify-center",children:o>t-e?N.jsx(TS,{}):N.jsx(AS,{})},o))})};class Wt{}ms(Wt,"FAST",3),ms(Wt,"Medium",2),ms(Wt,"SLOW",1),ms(Wt,"NONE",0);const NS=Object.values({MAINNET:1,SEPOLIA:11155111}),Pn=e=>{const t=typeof e=="string"?parseInt(e,10):e;return NS.includes(t)},CS={USDT:!0},Uh=(e,t)=>{const n=typeof e=="string"?parseInt(e,10):e;return n===1||n===11155111?!1:(n===42161||n===421614)&&t?t.toUpperCase()==="ETH"?!1:!CS[t.toUpperCase()]:!0},OS=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:s="mpc",accountType:i,showChainSpeed:l=!0})=>{const{t:a}=It(),c=u=>i===Ne.PERPETUAL&&Pn(u);return N.jsx("div",{className:`relative ${o}`,children:N.jsx(Nt,{value:t,onChange:n,disabled:r,children:({open:u})=>N.jsxs(N.Fragment,{children:[N.jsxs(Nt.Button,{className:`
|
|
139
|
+
*/var hE=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],dc=hE.join(","),jp=typeof Element>"u",os=jp?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,yi=!jp&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},vi=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):vi(t.parentNode));return i},mE=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},bE=function(t,n,r){if(vi(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(dc));return n&&os.call(t,dc)&&o.unshift(t),o=o.filter(r),o},fc=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!vi(i,!1))if(i.tagName==="SLOT"){var l=i.assignedElements(),a=l.length?l:i.children,c=fc(a,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var u=os.call(i,dc);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),p=!vi(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&p){var f=fc(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else s.unshift.apply(s,i.children)}}return o},zp=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Up=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||mE(t))&&!zp(t)?0:t.tabIndex},gE=function(t,n){var r=Up(t);return r<0&&n&&!zp(t)?0:r},yE=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Wp=function(t){return t.tagName==="INPUT"},vE=function(t){return Wp(t)&&t.type==="hidden"},wE=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},xE=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},EE=function(t){if(!t.name)return!0;var n=t.form||yi(t),r=function(l){return n.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=xE(o,t.form);return!s||s===t},SE=function(t){return Wp(t)&&t.type==="radio"},PE=function(t){return SE(t)&&!EE(t)},TE=function(t){var n,r=t&&yi(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,l,a;for(s=!!((i=o)!==null&&i!==void 0&&(l=i.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!s&&o;){var c,u,d;r=yi(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},_p=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},AE=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=os.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(os.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var c=t.parentElement,u=yi(t);if(c&&!c.shadowRoot&&o(c)===!0)return _p(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=a}if(TE(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return _p(t);return!1},NE=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return os.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},CE=function(t,n){return!(n.disabled||vE(n)||AE(n,t)||wE(n)||NE(n))},Vp=function(t,n){return!(PE(n)||Up(n)<0||!CE(t,n))},OE=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Hp=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,l=i?o.scopeParent:o,a=gE(l,i),c=i?Hp(o.candidates):l;a===0?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:s,tabIndex:a,item:o,isScope:i,content:c})}),r.sort(yE).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Gp=function(t,n){n=n||{};var r;return n.getShadowRoot?r=fc([t],n.includeContainer,{filter:Vp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:OE}):r=bE(t,n.includeContainer,Vp.bind(null,n)),Hp(r)};function qp(e,t,n){let{reference:r,floating:o}=e;const s=Sn(t),i=cc(t),l=lc(i),a=Wn(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[l]/2-o[l]/2;let f;switch(a){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(_r(t)){case"start":f[i]-=p*(n&&c?-1:1);break;case"end":f[i]+=p*(n&&c?-1:1);break}return f}async function Kp(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=dr(t,e),h=Rp(f),x=l[p?d==="floating"?"reference":"floating":d],T=gi(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),w=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),A=await(s.isElement==null?void 0:s.isElement(P))?await(s.getScale==null?void 0:s.getScale(P))||{x:1,y:1}:{x:1,y:1},k=gi(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:P,strategy:a}):w);return{top:(T.top-k.top+h.top)/A.y,bottom:(k.bottom-T.bottom+h.bottom)/A.y,left:(T.left-k.left+h.left)/A.x,right:(k.right-T.right+h.right)/A.x}}const $E=50,ME=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=i.detectOverflow?i:{...i,detectOverflow:Kp},a=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=qp(c,r,a),p=r,f=0;const h={};for(let m=0;m<s.length;m++){const x=s[m];if(!x)continue;const{name:T,fn:w}=x,{x:P,y:A,data:k,reset:B}=await w({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:l,elements:{reference:e,floating:t}});u=P??u,d=A??d,h[T]={...h[T],...k},B&&f<$E&&(f++,typeof B=="object"&&(B.placement&&(p=B.placement),B.rects&&(c=B.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):B.rects),{x:u,y:d}=qp(c,p,a)),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}},IE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:a}=t,{element:c,padding:u=0}=dr(e,t)||{};if(c==null)return{};const d=Rp(u),p={x:n,y:r},f=cc(o),h=lc(f),m=await i.getDimensions(c),x=f==="y",T=x?"top":"left",w=x?"bottom":"right",P=x?"clientHeight":"clientWidth",A=s.reference[h]+s.reference[f]-p[f]-s.floating[h],k=p[f]-s.reference[f],B=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let F=B?B[P]:0;(!F||!await(i.isElement==null?void 0:i.isElement(B)))&&(F=l.floating[P]||s.floating[h]);const b=A/2-k/2,v=F/2-m[h]/2-1,E=En(d[T],v),M=En(d[w],v),$=E,C=F-m[h]-M,D=F/2-m[h]/2+b,y=ac($,D,C),O=!a.arrow&&_r(o)!=null&&D!==y&&s.reference[h]/2-(D<$?E:M)-m[h]/2<0,I=O?D<$?D-$:D-C:0;return{[f]:p[f]+I,data:{[f]:y,centerOffset:D-y-I,...O&&{alignmentOffset:I}},reset:O}}}),DE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...x}=dr(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const T=Wn(o),w=Sn(l),P=Wn(l)===l,A=await(a.isRTL==null?void 0:a.isRTL(c.floating)),k=p||(P||!m?[bi(l)]:lE(l)),B=h!=="none";!p&&B&&k.push(...fE(l,m,h,A));const F=[l,...k],b=await a.detectOverflow(t,x),v=[];let E=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&v.push(b[T]),d){const D=aE(o,i,A);v.push(b[D[0]],b[D[1]])}if(E=[...E,{placement:o,overflows:v}],!v.every(D=>D<=0)){var M,$;const D=(((M=s.flip)==null?void 0:M.index)||0)+1,y=F[D];if(y&&(!(d==="alignment"?w!==Sn(y):!1)||E.every(S=>Sn(S.placement)===w?S.overflows[0]>0:!0)))return{data:{index:D,overflows:E},reset:{placement:y}};let O=($=E.filter(I=>I.overflows[0]<=0).sort((I,S)=>I.overflows[1]-S.overflows[1])[0])==null?void 0:$.placement;if(!O)switch(f){case"bestFit":{var C;const I=(C=E.filter(S=>{if(B){const L=Sn(S.placement);return L===w||L==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(L=>L>0).reduce((L,j)=>L+j,0)]).sort((S,L)=>S[1]-L[1])[0])==null?void 0:C[0];I&&(O=I);break}case"initialPlacement":O=l;break}if(o!==O)return{reset:{placement:O}}}return{}}}},kE=new Set(["left","top"]);async function LE(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Wn(n),l=_r(n),a=Sn(n)==="y",c=kE.has(i)?-1:1,u=s&&a?-1:1,d=dr(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return l&&typeof h=="number"&&(f=l==="end"?h*-1:h),a?{x:f*u,y:p*c}:{x:p*c,y:f*u}}const BE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=t,a=await LE(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:i}}}}},FE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:T=>{let{x:w,y:P}=T;return{x:w,y:P}}},...c}=dr(e,t),u={x:n,y:r},d=await s.detectOverflow(t,c),p=Sn(Wn(o)),f=Lp(p);let h=u[f],m=u[p];if(i){const T=f==="y"?"top":"left",w=f==="y"?"bottom":"right",P=h+d[T],A=h-d[w];h=ac(P,h,A)}if(l){const T=p==="y"?"top":"left",w=p==="y"?"bottom":"right",P=m+d[T],A=m-d[w];m=ac(P,m,A)}const x=a.fn({...t,[f]:h,[p]:m});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[f]:i,[p]:l}}}}}},RE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:l}=t,{apply:a=()=>{},...c}=dr(e,t),u=await i.detectOverflow(t,c),d=Wn(o),p=_r(o),f=Sn(o)==="y",{width:h,height:m}=s.floating;let x,T;d==="top"||d==="bottom"?(x=d,T=p===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(T=d,x=p==="end"?"top":"bottom");const w=m-u.top-u.bottom,P=h-u.left-u.right,A=En(m-u[x],w),k=En(h-u[T],P),B=!t.middlewareData.shift;let F=A,b=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(b=P),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(F=w),B&&!p){const E=We(u.left,0),M=We(u.right,0),$=We(u.top,0),C=We(u.bottom,0);f?b=h-2*(E!==0||M!==0?E+M:We(u.left,u.right)):F=m-2*($!==0||C!==0?$+C:We(u.top,u.bottom))}await a({...t,availableWidth:b,availableHeight:F});const v=await i.getDimensions(l.floating);return h!==v.width||m!==v.height?{reset:{rects:!0}}:{}}}};function Zp(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=st(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=rs(n)!==s||rs(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function pc(e){return be(e)?e:e.contextElement}function Vr(e){const t=pc(e);if(!st(t))return en(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Zp(t);let i=(s?rs(n.width):n.width)/r,l=(s?rs(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const jE=en(0);function Yp(e){const t=ot(e);return!pi()||!t.visualViewport?jE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ot(e)?!1:t}function fr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=pc(e);let i=en(1);t&&(r?be(r)&&(i=Vr(r)):i=Vr(e));const l=zE(s,n,r)?Yp(s):en(0);let a=(o.left+l.x)/i.x,c=(o.top+l.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const p=ot(s),f=r&&be(r)?ot(r):r;let h=p,m=ic(h);for(;m&&r&&f!==h;){const x=Vr(m),T=m.getBoundingClientRect(),w=At(m),P=T.left+(m.clientLeft+parseFloat(w.paddingLeft))*x.x,A=T.top+(m.clientTop+parseFloat(w.paddingTop))*x.y;a*=x.x,c*=x.y,u*=x.x,d*=x.y,a+=P,c+=A,h=ot(m),m=ic(h)}}return gi({width:u,height:d,x:a,y:c})}function wi(e,t){const n=hi(e).scrollLeft;return t?t.left+n:fr(Qt(e)).left+n}function Xp(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-wi(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function UE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Qt(r),l=t?fi(t.floating):!1;if(r===i||l&&s)return n;let a={scrollLeft:0,scrollTop:0},c=en(1);const u=en(0),d=st(r);if((d||!d&&!s)&&((Wr(r)!=="body"||ns(i))&&(a=hi(r)),d)){const f=fr(r);c=Vr(r),u.x=f.x+r.clientLeft,u.y=f.y+r.clientTop}const p=i&&!d&&!s?Xp(i,a):en(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-a.scrollTop*c.y+u.y+p.y}}function WE(e){return Array.from(e.getClientRects())}function _E(e){const t=Qt(e),n=hi(e),r=e.ownerDocument.body,o=We(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=We(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+wi(e);const l=-n.scrollTop;return At(r).direction==="rtl"&&(i+=We(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:l}}const Jp=25;function VE(e,t){const n=ot(e),r=Qt(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,a=0;if(o){s=o.width,i=o.height;const u=pi();(!u||u&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}const c=wi(r);if(c<=0){const u=r.ownerDocument,d=u.body,p=getComputedStyle(d),f=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(r.clientWidth-d.clientWidth-f);h<=Jp&&(s-=h)}else c<=Jp&&(s+=c);return{width:s,height:i,x:l,y:a}}function HE(e,t){const n=fr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=st(e)?Vr(e):en(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,a=o*s.x,c=r*s.y;return{width:i,height:l,x:a,y:c}}function Qp(e,t,n){let r;if(t==="viewport")r=VE(e,n);else if(t==="document")r=_E(Qt(e));else if(be(t))r=HE(t,n);else{const o=Yp(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return gi(r)}function eh(e,t){const n=xn(e);return n===t||!be(n)||wn(n)?!1:At(n).position==="fixed"||eh(n,t)}function GE(e,t){const n=t.get(e);if(n)return n;let r=Un(e,[],!1).filter(l=>be(l)&&Wr(l)!=="body"),o=null;const s=At(e).position==="fixed";let i=s?xn(e):e;for(;be(i)&&!wn(i);){const l=At(i),a=sc(i);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||ns(i)&&!a&&eh(e,i))?r=r.filter(u=>u!==i):o=l,i=xn(i)}return t.set(e,r),r}function qE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?fi(t)?[]:GE(t,this._c):[].concat(n),r],l=Qp(t,i[0],o);let a=l.top,c=l.right,u=l.bottom,d=l.left;for(let p=1;p<i.length;p++){const f=Qp(t,i[p],o);a=We(f.top,a),c=En(f.right,c),u=En(f.bottom,u),d=We(f.left,d)}return{width:c-d,height:u-a,x:d,y:a}}function KE(e){const{width:t,height:n}=Zp(e);return{width:t,height:n}}function ZE(e,t,n){const r=st(t),o=Qt(t),s=n==="fixed",i=fr(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const a=en(0);function c(){a.x=wi(o)}if(r||!r&&!s)if((Wr(t)!=="body"||ns(o))&&(l=hi(t)),r){const f=fr(t,!0,s,t);a.x=f.x+t.clientLeft,a.y=f.y+t.clientTop}else o&&c();s&&!r&&o&&c();const u=o&&!r&&!s?Xp(o,l):en(0),d=i.left+l.scrollLeft-a.x-u.x,p=i.top+l.scrollTop-a.y-u.y;return{x:d,y:p,width:i.width,height:i.height}}function hc(e){return At(e).position==="static"}function th(e,t){if(!st(e)||At(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Qt(e)===n&&(n=n.ownerDocument.body),n}function nh(e,t){const n=ot(e);if(fi(e))return n;if(!st(e)){let o=xn(e);for(;o&&!wn(o);){if(be(o)&&!hc(o))return o;o=xn(o)}return n}let r=th(e,t);for(;r&&tE(r)&&hc(r);)r=th(r,t);return r&&wn(r)&&hc(r)&&!sc(r)?n:r||oE(e)||n}const YE=async function(e){const t=this.getOffsetParent||nh,n=this.getDimensions,r=await n(e.floating);return{reference:ZE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function XE(e){return At(e).direction==="rtl"}const JE={convertOffsetParentRelativeRectToViewportRelativeRect:UE,getDocumentElement:Qt,getClippingRect:qE,getOffsetParent:nh,getElementRects:YE,getClientRects:WE,getDimensions:KE,getScale:Vr,isElement:be,isRTL:XE};function rh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function QE(e,t){let n=null,r;const o=Qt(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:f}=c;if(l||t(),!p||!f)return;const h=mi(d),m=mi(o.clientWidth-(u+p)),x=mi(o.clientHeight-(d+f)),T=mi(u),P={rootMargin:-h+"px "+-m+"px "+-x+"px "+-T+"px",threshold:We(0,En(1,a))||1};let A=!0;function k(B){const F=B[0].intersectionRatio;if(F!==a){if(!A)return i();F?i(!1,F):r=setTimeout(()=>{i(!1,1e-7)},1e3)}F===1&&!rh(c,e.getBoundingClientRect())&&i(),A=!1}try{n=new IntersectionObserver(k,{...P,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,P)}n.observe(e)}return i(!0),s}function oh(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=pc(e),u=o||s?[...c?Un(c):[],...t?Un(t):[]]:[];u.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),s&&T.addEventListener("resize",n)});const d=c&&l?QE(c,n):null;let p=-1,f=null;i&&(f=new ResizeObserver(T=>{let[w]=T;w&&w.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var P;(P=f)==null||P.observe(t)})),n()}),c&&!a&&f.observe(c),t&&f.observe(t));let h,m=a?fr(e):null;a&&x();function x(){const T=fr(e);m&&!rh(m,T)&&n(),m=T,h=requestAnimationFrame(x)}return n(),()=>{var T;u.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),d==null||d(),(T=f)==null||T.disconnect(),f=null,a&&cancelAnimationFrame(h)}}const mc=Kp,e8=BE,t8=FE,n8=DE,r8=RE,sh=IE,o8=(e,t,n)=>{const r=new Map,o={platform:JE,...n},s={...o.platform,_c:r};return ME(e,t,{...o,platform:s})};var s8=typeof document<"u",i8=function(){},xi=s8?g.useLayoutEffect:i8;function Ei(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ei(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ei(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ih(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ah(e,t){const n=ih(e);return Math.round(t*n)/n}function bc(e){const t=U.useRef(e);return xi(()=>{t.current=e}),t}function lh(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:a,open:c}=e,[u,d]=U.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=U.useState(r);Ei(p,r)||f(r);const[h,m]=U.useState(null),[x,T]=U.useState(null),w=U.useCallback(S=>{S!==B.current&&(B.current=S,m(S))},[]),P=U.useCallback(S=>{S!==F.current&&(F.current=S,T(S))},[]),A=s||h,k=i||x,B=U.useRef(null),F=U.useRef(null),b=U.useRef(u),v=a!=null,E=bc(a),M=bc(o),$=bc(c),C=U.useCallback(()=>{if(!B.current||!F.current)return;const S={placement:t,strategy:n,middleware:p};M.current&&(S.platform=M.current),o8(B.current,F.current,S).then(L=>{const j={...L,isPositioned:$.current!==!1};D.current&&!Ei(b.current,j)&&(b.current=j,Qr.flushSync(()=>{d(j)}))})},[p,t,n,M,$]);xi(()=>{c===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,d(S=>({...S,isPositioned:!1})))},[c]);const D=U.useRef(!1);xi(()=>(D.current=!0,()=>{D.current=!1}),[]),xi(()=>{if(A&&(B.current=A),k&&(F.current=k),A&&k){if(E.current)return E.current(A,k,C);C()}},[A,k,C,E,v]);const y=U.useMemo(()=>({reference:B,floating:F,setReference:w,setFloating:P}),[w,P]),O=U.useMemo(()=>({reference:A,floating:k}),[A,k]),I=U.useMemo(()=>{const S={position:n,left:0,top:0};if(!O.floating)return S;const L=ah(O.floating,u.x),j=ah(O.floating,u.y);return l?{...S,transform:"translate("+L+"px, "+j+"px)",...ih(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:j}},[n,l,O.floating,u.x,u.y]);return U.useMemo(()=>({...u,update:C,refs:y,elements:O,floatingStyles:I}),[u,C,y,O,I])}const a8=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?sh({element:r.current,padding:o}).fn(n):{}:r?sh({element:r,padding:o}).fn(n):{}}}},gc=(e,t)=>{const n=e8(e);return{name:n.name,fn:n.fn,options:[e,t]}},ch=(e,t)=>{const n=t8(e);return{name:n.name,fn:n.fn,options:[e,t]}},uh=(e,t)=>{const n=n8(e);return{name:n.name,fn:n.fn,options:[e,t]}},l8=(e,t)=>{const n=r8(e);return{name:n.name,fn:n.fn,options:[e,t]}},c8=(e,t)=>{const n=a8(e);return{name:n.name,fn:n.fn,options:[e,t]}},dh={...U},u8=dh.useInsertionEffect||(e=>e());function fh(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return u8(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var yc=typeof document<"u"?g.useLayoutEffect:g.useEffect;let ph=!1,d8=0;const hh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+d8++;function f8(){const[e,t]=U.useState(()=>ph?hh():void 0);return yc(()=>{e==null&&t(hh())},[]),U.useEffect(()=>{ph=!0},[]),e}const p8=dh.useId||f8;let ss;process.env.NODE_ENV!=="production"&&(ss=new Set);function h8(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ss)!=null&&e.has(o))){var s;(s=ss)==null||s.add(o),console.warn(o)}}function m8(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=ss)!=null&&e.has(o))){var s;(s=ss)==null||s.add(o),console.error(o)}}function b8(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const g8=U.createContext(null),y8=U.createContext(null),v8=()=>{var e;return((e=U.useContext(g8))==null?void 0:e.id)||null},w8=()=>U.useContext(y8),x8="data-floating-ui-focusable";function E8(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=p8(),s=U.useRef({}),[i]=U.useState(()=>b8()),l=v8()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!be(f)&&m8("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,c]=U.useState(r.reference),u=fh((f,h,m)=>{s.current.openEvent=f?h:void 0,i.emit("openchange",{open:f,event:h,reason:m,nested:l}),n==null||n(f,h,m)}),d=U.useMemo(()=>({setPositionReference:c}),[]),p=U.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return U.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:d}),[t,u,p,i,o,d])}function S8(e){e===void 0&&(e={});const{nodeId:t}=e,n=E8({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=U.useState(null),[l,a]=U.useState(null),u=(o==null?void 0:o.domReference)||s,d=U.useRef(null),p=w8();yc(()=>{u&&(d.current=u)},[u]);const f=lh({...e,elements:{...o,...l&&{reference:l}}}),h=U.useCallback(P=>{const A=be(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),contextElement:P}:P;a(A),f.refs.setReference(A)},[f.refs]),m=U.useCallback(P=>{(be(P)||P===null)&&(d.current=P,i(P)),(be(f.refs.reference.current)||f.refs.reference.current===null||P!==null&&!be(P))&&f.refs.setReference(P)},[f.refs]),x=U.useMemo(()=>({...f.refs,setReference:m,setPositionReference:h,domReference:d}),[f.refs,m,h]),T=U.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),w=U.useMemo(()=>({...f,...r,refs:x,elements:T,nodeId:t}),[f,x,T,t,r]);return yc(()=>{r.dataRef.current.floatingContext=w;const P=p==null?void 0:p.nodesRef.current.find(A=>A.id===t);P&&(P.context=w)}),U.useMemo(()=>({...f,context:w,refs:x,elements:T}),[f,x,T,w])}const mh="active",bh="selected";function vc(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[mh]:i,[bh]:l,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[x8]:""},...s,...t.map(i=>{const l=i?i[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(a=>{let[c,u]=a;if(!(o&&[mh,bh].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),i[c]=function(){for(var p,f=arguments.length,h=new Array(f),m=0;m<f;m++)h[m]=arguments[m];return(p=r.get(c))==null?void 0:p.map(x=>x(...h)).find(x=>x!==void 0)}}}else i[c]=u}),i),{})}}function P8(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),o=U.useCallback(l=>vc(l,e,"reference"),t),s=U.useCallback(l=>vc(l,e,"floating"),n),i=U.useCallback(l=>vc(l,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function gh(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const T8=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:s=0,index:i=0,minItemsVisible:l=4,referenceOverflowThreshold:a=0,scrollRef:c,...u}=dr(e,t),{rects:d,elements:{floating:p}}=t,f=n.current[i],h=(c==null?void 0:c.current)||p,m=p.clientTop||h.clientTop,x=p.clientTop!==0,T=h.clientTop!==0,w=p===h;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||h8('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const P={...t,...await gc(-f.offsetTop-p.clientTop-d.reference.height/2-f.offsetHeight/2-s).fn(t)},A=await mc(gh(P,h.scrollHeight+m+p.clientTop),u),k=await mc(P,{...u,elementContext:"reference"}),B=We(0,A.top),F=P.y+B,E=(h.scrollHeight>h.clientHeight?M=>M:rs)(We(0,h.scrollHeight+(x&&w||T?m*2:0)-B-We(0,A.bottom)));if(h.style.maxHeight=E+"px",h.scrollTop=B,o){const M=h.offsetHeight<f.offsetHeight*En(l,n.current.length)-1||k.top>=-a||k.bottom>=-a;Qr.flushSync(()=>o(M))}return r&&(r.current=await mc(gh({...P,y:F},h.offsetHeight+m+p.clientTop),u)),{y:F}}});function A8(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:i,onChange:l}=t,a=fh(l),c=U.useRef(!1),u=U.useRef(null),d=U.useRef(null);U.useEffect(()=>{if(!o)return;function f(m){if(m.ctrlKey||!h||s.current==null)return;const x=m.deltaY,T=s.current.top>=-.5,w=s.current.bottom>=-.5,P=h.scrollHeight-h.clientHeight,A=x<0?-1:1,k=x<0?"max":"min";h.scrollHeight<=h.clientHeight||(!T&&x>0||!w&&x<0?(m.preventDefault(),Qr.flushSync(()=>{a(B=>B+Math[k](x,P*A))})):/firefox/i.test(sE())&&(h.scrollTop+=x))}const h=(i==null?void 0:i.current)||r.floating;if(n&&h)return h.addEventListener("wheel",f),requestAnimationFrame(()=>{u.current=h.scrollTop,s.current!=null&&(d.current={...s.current})}),()=>{u.current=null,d.current=null,h.removeEventListener("wheel",f)}},[o,n,r.floating,s,i,a]);const p=U.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const f=(i==null?void 0:i.current)||r.floating;if(!(!s.current||!f||!c.current)){if(u.current!==null){const h=f.scrollTop-u.current;(s.current.bottom<-.5&&h<-1||s.current.top<-.5&&h>1)&&Qr.flushSync(()=>a(m=>m+h))}requestAnimationFrame(()=>{u.current=f.scrollTop})}}}),[r.floating,a,s,i]);return U.useMemo(()=>o?{floating:p}:{},[o,p])}let Hr=g.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Hr.displayName="FloatingContext";let wc=g.createContext(null);wc.displayName="PlacementContext";function N8(e){return g.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function C8(){return g.useContext(Hr).setReference}function O8(){return g.useContext(Hr).getReferenceProps}function $8(){let{getFloatingProps:e,slot:t}=g.useContext(Hr);return g.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function M8(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=g.useContext(wc),n=g.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var i;return(i=s==null?void 0:s.outerHTML)!=null?i:s})]);$e(()=>{t==null||t(n??null)},[t,n]);let r=g.useContext(Hr);return g.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let yh=4;function I8({children:e,enabled:t=!0}){let[n,r]=g.useState(null),[o,s]=g.useState(0),i=g.useRef(null),[l,a]=g.useState(null);D8(l);let c=t&&n!==null&&l!==null,{to:u="bottom",gap:d=0,offset:p=0,padding:f=0,inner:h}=k8(n,l),[m,x="center"]=u.split(" ");$e(()=>{c&&s(0)},[c]);let{refs:T,floatingStyles:w,context:P}=S8({open:c,placement:m==="selection"?x==="center"?"bottom":`bottom-${x}`:x==="center"?`${m}`:`${m}-${x}`,strategy:"absolute",transform:!1,middleware:[gc({mainAxis:m==="selection"?0:d,crossAxis:p}),ch({padding:f}),m!=="selection"&&uh({padding:f}),m==="selection"&&h?T8({...h,padding:f,overflowRef:i,offset:o,minItemsVisible:yh,referenceOverflowThreshold:f,onFallbackChange(M){var $,C;if(!M)return;let D=P.elements.floating;if(!D)return;let y=parseFloat(getComputedStyle(D).scrollPaddingBottom)||0,O=Math.min(yh,D.childElementCount),I=0,S=0;for(let L of(C=($=P.elements.floating)==null?void 0:$.childNodes)!=null?C:[])if(vn(L)){let j=L.offsetTop,z=j+L.clientHeight+y,W=D.scrollTop,_=W+D.clientHeight;if(j>=W&&z<=_)O--;else{S=Math.max(0,Math.min(z,_)-Math.max(j,W)),I=L.clientHeight;break}}O>=1&&s(L=>{let j=I*O-S+y;return L>=j?L:j})}}):null,l8({padding:f,apply({availableWidth:M,availableHeight:$,elements:C}){Object.assign(C.floating.style,{overflow:"auto",maxWidth:`${M}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${$}px)`})}})].filter(Boolean),whileElementsMounted:oh}),[A=m,k=x]=P.placement.split("-");m==="selection"&&(A="selection");let B=g.useMemo(()=>({anchor:[A,k].filter(Boolean).join(" ")}),[A,k]),F=A8(P,{overflowRef:i,onChange:s}),{getReferenceProps:b,getFloatingProps:v}=P8([F]),E=he(M=>{a(M),T.setFloating(M)});return U.createElement(wc.Provider,{value:r},U.createElement(Hr.Provider,{value:{setFloating:E,setReference:T.setReference,styles:w,getReferenceProps:b,getFloatingProps:v,slot:B}},e))}function D8(e){$e(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function k8(e,t){var n,r,o;let s=xc((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),i=xc((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),l=xc((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:i,padding:l}}function xc(e,t,n=void 0){let r=ar(),o=he((a,c)=>{if(a==null)return[n,null];if(typeof a=="number")return[a,null];if(typeof a=="string"){if(!c)return[n,null];let u=wh(a,c);return[u,d=>{let p=vh(a);{let f=p.map(h=>window.getComputedStyle(c).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let m=!1;for(let[T,w]of p.entries()){let P=window.getComputedStyle(c).getPropertyValue(w);if(f[T]!==P){f[T]=P,m=!0;break}}if(!m)return;let x=wh(a,c);u!==x&&(d(x),u=x)})}return r.dispose}]}return[n,null]}),s=g.useMemo(()=>o(e,t)[0],[e,t]),[i=s,l]=g.useState();return $e(()=>{let[a,c]=o(e,t);if(l(a),!!c)return c(l)},[e,t]),i}function vh(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...vh(o)]:[r]}return[]}function wh(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function L8({children:e,freeze:t},n){let r=xh(t,e);return g.isValidElement(r)?g.cloneElement(r,{ref:n}):g.createElement(g.Fragment,null,r)}g.forwardRef(L8);function xh(e,t){let[n,r]=g.useState(t);return!e&&n!==t&&r(t),e?n:t}let Ec=g.createContext(null);Ec.displayName="OpenClosedContext";var Ut=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ut||{});function Sc(){return g.useContext(Ec)}function Eh({value:e,children:t}){return g.createElement(Ec.Provider,{value:e},t)}function B8(e){throw new Error("Unexpected object: "+e)}var Ce=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Ce||{});function Si(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{o===-1&&(o=n.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=o+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:B8(e)}}function Sh(e){let t=he(e),n=g.useRef(!1);g.useEffect(()=>(n.current=!1,()=>{n.current=!0,_0(()=>{n.current&&t()})}),[t])}let F8=g.createContext(!1);function R8(){return g.useContext(F8)}function j8(e){let t=R8(),n=g.useContext(Th),[r,o]=g.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Xt.isServer)return null;let i=e==null?void 0:e.getElementById("headlessui-portal-root");if(i)return i;if(e===null)return null;let l=e.createElement("div");return l.setAttribute("id","headlessui-portal-root"),e.body.appendChild(l)});return g.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),g.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let Ph=g.Fragment,z8=nt(function(e,t){let{ownerDocument:n=null,...r}=e,o=g.useRef(null),s=Pt(J5(p=>{o.current=p}),t),i=tc(o.current),l=n??i,a=j8(l),c=g.useContext(V8),u=ar(),d=ht();return Sh(()=>{var p;a&&a.childNodes.length<=0&&((p=a.parentElement)==null||p.removeChild(a))}),a?Ke.createPortal(g.createElement("div",{"data-headlessui-portal":"",ref:p=>{u.dispose(),c&&p&&u.add(c.register(p))}},d({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:Ph,name:"Portal"})),a):null});function U8(e,t){let n=Pt(t),{enabled:r=!0,ownerDocument:o,...s}=e,i=ht();return r?g.createElement(z8,{...s,ownerDocument:o,ref:n}):i({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:Ph,name:"Portal"})}let W8=g.Fragment,Th=g.createContext(null);function _8(e,t){let{target:n,...r}=e,o={ref:Pt(t)},s=ht();return g.createElement(Th.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:W8,name:"Popover.Group"}))}let V8=g.createContext(null),H8=nt(U8),G8=nt(_8),q8=Object.assign(H8,{Group:G8});const Pi={Idle:{kind:"Idle"},Tracked:e=>({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function Ah(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function K8(e,t,n){let r=pt();if(t.kind==="Tracked"){let o=function(){s!==Ah(e)&&(r.dispose(),n())},{position:s}=t,i=new ResizeObserver(o);i.observe(e),r.add(()=>i.disconnect()),r.addEventListener(window,"scroll",o,{passive:!0}),r.addEventListener(window,"resize",o)}return()=>r.dispose()}function Z8(){let e=typeof document>"u";return"useSyncExternalStore"in U?(t=>t.useSyncExternalStore)(U)(()=>()=>{},()=>!1,()=>!e):!1}function Nh(){let e=Z8(),[t,n]=U.useState(Xt.isHandoffComplete);return t&&Xt.isHandoffComplete===!1&&n(!1),U.useEffect(()=>{t!==!0&&n(!0)},[t]),U.useEffect(()=>Xt.handoff(),[]),e?!1:t}function Y8(){let e=g.useRef(!1);return $e(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Ch(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!Jo((t=e.as)!=null?t:$h)||g.Children.count(e.children)===1}let Ti=g.createContext(null);Ti.displayName="TransitionContext";var X8=(e=>(e.Visible="visible",e.Hidden="hidden",e))(X8||{});function J8(){let e=g.useContext(Ti);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Q8(){let e=g.useContext(Ai);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Ai=g.createContext(null);Ai.displayName="NestingContext";function Ni(e){return"children"in e?Ni(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Oh(e,t){let n=lr(e),r=g.useRef([]),o=Y8(),s=ar(),i=he((f,h=jn.Hidden)=>{let m=r.current.findIndex(({el:x})=>x===f);m!==-1&&(St(h,{[jn.Unmount](){r.current.splice(m,1)},[jn.Hidden](){r.current[m].state="hidden"}}),s.microTask(()=>{var x;!Ni(r)&&o.current&&((x=n.current)==null||x.call(n))}))}),l=he(f=>{let h=r.current.find(({el:m})=>m===f);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:f,state:"visible"}),()=>i(f,jn.Unmount)}),a=g.useRef([]),c=g.useRef(Promise.resolve()),u=g.useRef({enter:[],leave:[]}),d=he((f,h,m)=>{a.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([x])=>x!==f)),t==null||t.chains.current[h].push([f,new Promise(x=>{a.current.push(x)})]),t==null||t.chains.current[h].push([f,new Promise(x=>{Promise.all(u.current[h].map(([T,w])=>w)).then(()=>x())})]),h==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(h)):m(h)}),p=he((f,h,m)=>{Promise.all(u.current[h].splice(0).map(([x,T])=>T)).then(()=>{var x;(x=a.current.shift())==null||x()}).then(()=>m(h))});return g.useMemo(()=>({children:r,register:l,unregister:i,onStart:d,onStop:p,wait:c,chains:u}),[l,i,r,d,p,u,c])}let $h=g.Fragment,Mh=ii.RenderStrategy;function eS(e,t){var n,r;let{transition:o=!0,beforeEnter:s,afterEnter:i,beforeLeave:l,afterLeave:a,enter:c,enterFrom:u,enterTo:d,entered:p,leave:f,leaveFrom:h,leaveTo:m,...x}=e,[T,w]=g.useState(null),P=g.useRef(null),A=Ch(e),k=Pt(...A?[P,t,w]:t===null?[]:[t]),B=(n=x.unmount)==null||n?jn.Unmount:jn.Hidden,{show:F,appear:b,initial:v}=J8(),[E,M]=g.useState(F?"visible":"hidden"),$=Q8(),{register:C,unregister:D}=$;$e(()=>C(P),[C,P]),$e(()=>{if(B===jn.Hidden&&P.current){if(F&&E!=="visible"){M("visible");return}return St(E,{hidden:()=>D(P),visible:()=>C(P)})}},[E,P,C,D,F,B]);let y=Nh();$e(()=>{if(A&&y&&E==="visible"&&P.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[P,E,y,A]);let O=v&&!b,I=b&&F&&v,S=g.useRef(!1),L=Oh(()=>{S.current||(M("hidden"),D(P))},$),j=he(ee=>{S.current=!0;let fe=ee?"enter":"leave";L.onStart(P,fe,me=>{me==="enter"?s==null||s():me==="leave"&&(l==null||l())})}),z=he(ee=>{let fe=ee?"enter":"leave";S.current=!1,L.onStop(P,fe,me=>{me==="enter"?i==null||i():me==="leave"&&(a==null||a())}),fe==="leave"&&!Ni(L)&&(M("hidden"),D(P))});g.useEffect(()=>{A&&o||(j(F),z(F))},[F,A,o]);let W=!(!o||!A||!y||O),[,_]=Dp(W,T,F,{start:j,end:z}),Z=zn({ref:k,className:((r=zl(x.className,I&&c,I&&u,_.enter&&c,_.enter&&_.closed&&u,_.enter&&!_.closed&&d,_.leave&&f,_.leave&&!_.closed&&h,_.leave&&_.closed&&m,!_.transition&&F&&p))==null?void 0:r.trim())||void 0,...Ip(_)}),q=0;E==="visible"&&(q|=Ut.Open),E==="hidden"&&(q|=Ut.Closed),F&&E==="hidden"&&(q|=Ut.Opening),!F&&E==="visible"&&(q|=Ut.Closing);let H=ht();return g.createElement(Ai.Provider,{value:L},g.createElement(Eh,{value:q},H({ourProps:Z,theirProps:x,defaultTag:$h,features:Mh,visible:E==="visible",name:"Transition.Child"})))}function tS(e,t){let{show:n,appear:r=!1,unmount:o=!0,...s}=e,i=g.useRef(null),l=Ch(e),a=Pt(...l?[i,t]:t===null?[]:[t]);Nh();let c=Sc();if(n===void 0&&c!==null&&(n=(c&Ut.Open)===Ut.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=g.useState(n?"visible":"hidden"),p=Oh(()=>{n||d("hidden")}),[f,h]=g.useState(!0),m=g.useRef([n]);$e(()=>{f!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),h(!1))},[m,n]);let x=g.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);$e(()=>{n?d("visible"):!Ni(p)&&i.current!==null&&d("hidden")},[n,p]);let T={unmount:o},w=he(()=>{var k;f&&h(!1),(k=e.beforeEnter)==null||k.call(e)}),P=he(()=>{var k;f&&h(!1),(k=e.beforeLeave)==null||k.call(e)}),A=ht();return g.createElement(Ai.Provider,{value:p},g.createElement(Ti.Provider,{value:x},A({ourProps:{...T,as:g.Fragment,children:g.createElement(Ih,{ref:a,...T,...s,beforeEnter:w,beforeLeave:P})},theirProps:{},defaultTag:g.Fragment,features:Mh,visible:u==="visible",name:"Transition"})))}function nS(e,t){let n=g.useContext(Ti)!==null,r=Sc()!==null;return g.createElement(g.Fragment,null,!n&&r?g.createElement(Pc,{ref:t,...e}):g.createElement(Ih,{ref:t,...e}))}let Pc=nt(tS),Ih=nt(eS),rS=nt(nS),Tc=Object.assign(Pc,{Child:rS,Root:Pc}),Dh=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function kh(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!vn(o))return r;let s=!1;for(let l of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))l.remove(),s=!0;let i=s?(n=o.innerText)!=null?n:"":r;return Dh.test(i)&&(i=i.replace(Dh,"")),i}function oS(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let s=document.getElementById(o);if(s){let i=s.getAttribute("aria-label");return typeof i=="string"?i.trim():kh(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return kh(e).trim()}function sS(e){let t=g.useRef(""),n=g.useRef("");return he(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=oS(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var iS=Object.defineProperty,aS=(e,t,n)=>t in e?iS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lh=(e,t,n)=>(aS(e,typeof t!="symbol"?t+"":t,n),n),_e=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(_e||{}),_n=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(_n||{}),Ci=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Ci||{}),Bh=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(Bh||{});function Fh(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=Sp(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let lS={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?Pi.Tracked(Ah(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:Ce.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(s=>r(s.dataRef.current.value));return o!==-1&&(n=o),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1,buttonPositionState:Pi.Idle}},2(e,t){var n,r,o,s,i;if(e.dataRef.current.disabled||e.listboxState===1)return e;let l={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===Ce.Nothing)return{...l,activeOptionIndex:null};if(t.focus===Ce.Specific)return{...l,activeOptionIndex:e.options.findIndex(u=>u.id===t.id)};if(t.focus===Ce.Previous){let u=e.activeOptionIndex;if(u!==null){let d=e.options[u].dataRef.current.domRef,p=Si(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((r=d.current)==null?void 0:r.previousElementSibling)===f.current||((o=f.current)==null?void 0:o.previousElementSibling)===null)return{...l,activeOptionIndex:p}}}}else if(t.focus===Ce.Next){let u=e.activeOptionIndex;if(u!==null){let d=e.options[u].dataRef.current.domRef,p=Si(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(p!==null){let f=e.options[p].dataRef.current.domRef;if(((s=d.current)==null?void 0:s.nextElementSibling)===f.current||((i=f.current)==null?void 0:i.nextElementSibling)===null)return{...l,activeOptionIndex:p}}}}let a=Fh(e),c=Si(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});return{...l,...a,activeOptionIndex:c}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var l;return!i.dataRef.current.disabled&&((l=i.dataRef.current.textValue)==null?void 0:l.startsWith(r))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==Ce.Nothing&&(r=Si(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=n.findIndex(i=>o==null?void 0:o(i.dataRef.current.value));s!==-1&&(r=s)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:Ce.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[s,i]of n.entries())if(o.has(i.id)&&(r.push(s),o.delete(i.id),o.size===0))break;if(r.length>0){n=n.slice();for(let s of r.reverse())n.splice(s,1)}return{...e,options:n,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...Fh(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:Pi.Moved}}};class Ac extends dp{constructor(t){super(t),Lh(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:i}=this.state.dataRef.current;return St(s,{0:()=>r==null?void 0:r(n),1:()=>{let l=i.slice(),a=l.findIndex(c=>o(c,n));return a===-1?l.push(n):l.splice(a,1),r==null?void 0:r(l)}})},registerOption:Gl(()=>{let n=[],r=new Set;return[(o,s)=>{r.has(s)||(r.add(s),n.push({id:o,dataRef:s}))},()=>(r.clear(),this.send({type:6,options:n.splice(0)}))]}),unregisterOption:Gl(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:7,options:n.splice(0)})}]}),goToOption:Gl(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{var n;if(this.state.activeOptionIndex!==null){let{dataRef:r}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(r.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(n=this.state.buttonElement)==null||n.focus({preventScroll:!0}))},selectOption:n=>{this.send({type:5,value:n})},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:8,element:n})},setOptionsElement:n=>{this.send({type:9,element:n})}}),Lh(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,s=n.options;return o===null||(r=s[o])==null?void 0:r.id},isActive(n,r){var o;let s=n.activeOptionIndex,i=n.options;return s!==null?((o=i[s])==null?void 0:o.id)===r:!1},hasFrozenValue(n){return n.frozenValue},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let n=this.state.id,r=ql.get(null);this.disposables.add(r.on(mp.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}this.disposables.group(n=>{this.on(1,r=>{r.buttonElement&&(n.dispose(),n.add(K8(r.buttonElement,r.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(n,r)=>{var o;this.actions.onChange(r.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:t,__demoMode:n=!1}){return new Ac({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:Ce.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:Pi.Idle})}reduce(t,n){return St(n.type,lS,t,n)}}const Rh=g.createContext(null);function Nc(e){let t=g.useContext(Rh);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,jh),n}return t}function jh({id:e,__demoMode:t=!1}){let n=g.useMemo(()=>Ac.new({id:e,__demoMode:t}),[]);return Sh(()=>n.dispose()),n}let Oi=g.createContext(null);Oi.displayName="ListboxDataContext";function is(e){let t=g.useContext(Oi);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,is),n}return t}let cS=g.Fragment;function uS(e,t){let n=g.useId(),r=jl(),{value:o,defaultValue:s,form:i,name:l,onChange:a,by:c,invalid:u=!1,disabled:d=r||!1,horizontal:p=!1,multiple:f=!1,__demoMode:h=!1,...m}=e;const x=p?"horizontal":"vertical";let T=Pt(t),w=F5(s),[P=f?[]:void 0,A]=B5(o,a,w),k=jh({id:n,__demoMode:h}),B=g.useRef({static:!1,hold:!1}),F=g.useRef(new Map),b=c2(c),v=g.useCallback(W=>St(E.mode,{[_n.Multi]:()=>P.some(_=>b(_,W)),[_n.Single]:()=>b(P,W)}),[P]),E=Rn({value:P,disabled:d,invalid:u,mode:f?_n.Multi:_n.Single,orientation:x,onChange:A,compare:b,isSelected:v,optionsPropsRef:B,listRef:F});$e(()=>{k.state.dataRef.current=E},[E]);let M=rt(k,W=>W.listboxState),$=ql.get(null),C=rt($,g.useCallback(W=>$.selectors.isTop(W,n),[$,n])),[D,y]=rt(k,W=>[W.buttonElement,W.optionsElement]);B2(C,[D,y],(W,_)=>{k.send({type:Bh.CloseListbox}),Ep(_,ec.Loose)||(W.preventDefault(),D==null||D.focus())});let O=Rn({open:M===_e.Open,disabled:d,invalid:u,value:P}),[I,S]=r2({inherit:!0}),L={ref:T},j=g.useCallback(()=>{if(w!==void 0)return A==null?void 0:A(w)},[A,w]),z=ht();return g.createElement(S,{value:I,props:{htmlFor:D==null?void 0:D.id},slot:{open:M===_e.Open,disabled:d}},g.createElement(I8,null,g.createElement(Rh.Provider,{value:k},g.createElement(Oi.Provider,{value:E},g.createElement(Eh,{value:St(M,{[_e.Open]:Ut.Open,[_e.Closed]:Ut.Closed})},l!=null&&P!=null&&g.createElement(V5,{disabled:d,data:{[l]:P},form:i,onReset:j}),z({ourProps:L,theirProps:m,slot:O,defaultTag:cS,name:"Listbox"}))))))}let dS="button";function fS(e,t){let n=g.useId(),r=Y0(),o=is("Listbox.Button"),s=Nc("Listbox.Button"),{id:i=r||`headlessui-listbox-button-${n}`,disabled:l=o.disabled||!1,autoFocus:a=!1,...c}=e,u=Pt(t,C8(),s.actions.setButtonElement),d=O8(),[p,f,h]=rt(s,y=>[y.listboxState,y.buttonElement,y.optionsElement]),m=p===_e.Open;j2(m,{trigger:f,action:g.useCallback(y=>{if(f!=null&&f.contains(y.target))return ui.Ignore;let O=y.target.closest('[role="option"]:not([data-disabled])');return vn(O)?ui.Select(O):h!=null&&h.contains(y.target)?ui.Ignore:ui.Close},[f,h]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let x=he(y=>{switch(y.key){case je.Enter:R5(y.currentTarget);break;case je.Space:case je.ArrowDown:y.preventDefault(),s.actions.openListbox({focus:o.value?Ce.Nothing:Ce.First});break;case je.ArrowUp:y.preventDefault(),s.actions.openListbox({focus:o.value?Ce.Nothing:Ce.Last});break}}),T=he(y=>{switch(y.key){case je.Space:y.preventDefault();break}}),w=d2(y=>{var O;s.state.listboxState===_e.Open?(Ke.flushSync(()=>s.actions.closeListbox()),(O=s.state.buttonElement)==null||O.focus({preventScroll:!0})):(y.preventDefault(),s.actions.openListbox({focus:Ce.Nothing}))}),P=he(y=>y.preventDefault()),A=sp([i]),k=Q5(),{isFocusVisible:B,focusProps:F}=E5({autoFocus:a}),{isHovered:b,hoverProps:v}=x5({isDisabled:l}),{pressed:E,pressProps:M}=O5({disabled:l}),$=Rn({open:p===_e.Open,active:E||p===_e.Open,disabled:l,invalid:o.invalid,value:o.value,hover:b,focus:B,autofocus:a}),C=rt(s,y=>y.listboxState===_e.Open),D=H0(d(),{ref:u,id:i,type:z2(e,f),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":C,"aria-labelledby":A,"aria-describedby":k,disabled:l||void 0,autoFocus:a,onKeyDown:x,onKeyUp:T,onKeyPress:P},w,F,v,M);return ht()({ourProps:D,theirProps:c,slot:$,defaultTag:dS,name:"Listbox.Button"})}let zh=g.createContext(!1),pS="div",hS=ii.RenderStrategy|ii.Static;function mS(e,t){let n=g.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:i=!0,transition:l=!1,...a}=e,c=N8(o),[u,d]=g.useState(null);c&&(s=!0);let p=is("Listbox.Options"),f=Nc("Listbox.Options"),[h,m,x,T]=rt(f,H=>[H.listboxState,H.buttonElement,H.optionsElement,H.__demoMode]),w=tc(m),P=tc(x),A=Sc(),[k,B]=Dp(l,u,A!==null?(A&Ut.Open)===Ut.Open:h===_e.Open);P2(k,m,f.actions.closeListbox);let F=T?!1:i&&h===_e.Open;q2(F,P);let b=T?!1:i&&h===_e.Open;S2(b,{allowed:g.useCallback(()=>[m,x],[m,x])});let v=rt(f,f.selectors.didButtonMove)?!1:k,E=rt(f,f.selectors.hasFrozenValue)&&!e.static,M=xh(E,p.value),$=g.useCallback(H=>p.compare(M,H),[p.compare,M]),C=rt(f,H=>{var ee;if(c==null||!((ee=c==null?void 0:c.to)!=null&&ee.includes("selection")))return null;let fe=H.options.findIndex(me=>$(me.dataRef.current.value));return fe===-1&&(fe=0),fe}),D=(()=>{if(c==null)return;if(C===null)return{...c,inner:void 0};let H=Array.from(p.listRef.current.values());return{...c,inner:{listRef:{current:H},index:C}}})(),[y,O]=M8(D),I=$8(),S=Pt(t,c?y:null,f.actions.setOptionsElement,d),L=ar();g.useEffect(()=>{let H=x;H&&h===_e.Open&&(A5(H)||H==null||H.focus({preventScroll:!0}))},[h,x]);let j=he(H=>{var ee;switch(L.dispose(),H.key){case je.Space:if(f.state.searchQuery!=="")return H.preventDefault(),H.stopPropagation(),f.actions.search(H.key);case je.Enter:H.preventDefault(),H.stopPropagation(),f.actions.selectActiveOption();break;case St(p.orientation,{vertical:je.ArrowDown,horizontal:je.ArrowRight}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:Ce.Next});case St(p.orientation,{vertical:je.ArrowUp,horizontal:je.ArrowLeft}):return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:Ce.Previous});case je.Home:case je.PageUp:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:Ce.First});case je.End:case je.PageDown:return H.preventDefault(),H.stopPropagation(),f.actions.goToOption({focus:Ce.Last});case je.Escape:H.preventDefault(),H.stopPropagation(),Ke.flushSync(()=>f.actions.closeListbox()),(ee=f.state.buttonElement)==null||ee.focus({preventScroll:!0});return;case je.Tab:H.preventDefault(),H.stopPropagation(),Ke.flushSync(()=>f.actions.closeListbox()),I2(f.state.buttonElement,H.shiftKey?Ql.Previous:Ql.Next);break;default:H.key.length===1&&(f.actions.search(H.key),L.setTimeout(()=>f.actions.clearSearch(),350));break}}),z=rt(f,H=>{var ee;return(ee=H.buttonElement)==null?void 0:ee.id}),W=Rn({open:h===_e.Open}),_=H0(c?I():{},{id:r,ref:S,"aria-activedescendant":rt(f,f.selectors.activeDescendantId),"aria-multiselectable":p.mode===_n.Multi?!0:void 0,"aria-labelledby":z,"aria-orientation":p.orientation,onKeyDown:j,role:"listbox",tabIndex:h===_e.Open?0:void 0,style:{...a.style,...O,"--button-width":u2(k,m,!0).width},...Ip(B)}),Z=ht(),q=g.useMemo(()=>p.mode===_n.Multi?p:{...p,isSelected:$},[p,$]);return g.createElement(q8,{enabled:s?e.static||k:!1,ownerDocument:w},g.createElement(Oi.Provider,{value:q},Z({ourProps:_,theirProps:a,slot:W,defaultTag:pS,features:hS,visible:v,name:"Listbox.Options"})))}let bS="div";function gS(e,t){let n=g.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...i}=e,l=g.useContext(zh)===!0,a=is("Listbox.Option"),c=Nc("Listbox.Option"),u=rt(c,E=>c.selectors.isActive(E,r)),d=a.isSelected(s),p=g.useRef(null),f=sS(p),h=lr({disabled:o,value:s,domRef:p,get textValue(){return f()}}),m=Pt(t,p,E=>{E?a.listRef.current.set(r,E):a.listRef.current.delete(r)}),x=rt(c,E=>c.selectors.shouldScrollIntoView(E,r));$e(()=>{if(x)return pt().requestAnimationFrame(()=>{var E,M;(M=(E=p.current)==null?void 0:E.scrollIntoView)==null||M.call(E,{block:"nearest"})})},[x,p]),$e(()=>{if(!l)return c.actions.registerOption(r,h),()=>c.actions.unregisterOption(r)},[h,r,l]);let T=he(E=>{if(o)return E.preventDefault();c.actions.selectOption(s)}),w=he(()=>{if(o)return c.actions.goToOption({focus:Ce.Nothing});c.actions.goToOption({focus:Ce.Specific,id:r})}),P=K2(),A=he(E=>P.update(E)),k=he(E=>{P.wasMoved(E)&&(o||u&&c.state.activationTrigger===Ci.Pointer||c.actions.goToOption({focus:Ce.Specific,id:r},Ci.Pointer))}),B=he(E=>{P.wasMoved(E)&&(o||u&&c.state.activationTrigger===Ci.Pointer&&c.actions.goToOption({focus:Ce.Nothing}))}),F=Rn({active:u,focus:u,selected:d,disabled:o,selectedOption:d&&l}),b=l?{}:{id:r,ref:m,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":d,disabled:void 0,onClick:T,onFocus:w,onPointerEnter:A,onMouseEnter:A,onPointerMove:k,onMouseMove:k,onPointerLeave:B,onMouseLeave:B},v=ht();return!d&&l?null:v({ourProps:b,theirProps:i,slot:F,defaultTag:bS,name:"Listbox.Option"})}let yS=g.Fragment;function vS(e,t){let{options:n,placeholder:r,...o}=e,s={ref:Pt(t)},i=is("ListboxSelectedOption"),l=Rn({}),a=i.value===void 0||i.value===null||i.mode===_n.Multi&&Array.isArray(i.value)&&i.value.length===0,c=ht();return g.createElement(zh.Provider,{value:!0},c({ourProps:s,theirProps:{...o,children:g.createElement(g.Fragment,null,r&&a?r:n)},slot:l,defaultTag:yS,name:"ListboxSelectedOption"}))}let wS=nt(uS),xS=nt(fS),ES=a2,SS=nt(mS),PS=nt(gS),TS=nt(vS),Nt=Object.assign(wS,{Button:xS,Label:ES,Options:SS,Option:PS,SelectedOption:TS});const AS=()=>N.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[N.jsx("g",{clipPath:"url(#clip0_active)",children:N.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#22FD73"})}),N.jsx("defs",{children:N.jsx("clipPath",{id:"clip0_active",children:N.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),NS=()=>N.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[N.jsx("g",{clipPath:"url(#clip0_inactive)",children:N.jsx("path",{d:"M4.63791 6.91929H2.62541C2.36266 6.91929 2.18141 6.65629 2.27491 6.41091L4.27466 1.16191C4.30172 1.0909 4.34971 1.02978 4.41228 0.986649C4.47485 0.943521 4.54905 0.920422 4.62504 0.92041H7.99954C8.26579 0.92041 8.44729 1.19016 8.34679 1.43679L7.18241 4.29479H9.37441C9.69679 4.29479 9.86879 4.67479 9.65616 4.91704L4.28191 11.0408C4.02066 11.3385 3.53629 11.0805 3.63766 10.6977L4.63791 6.91929Z",fill:"#F9F9F9"})}),N.jsx("defs",{children:N.jsx("clipPath",{id:"clip0_inactive",children:N.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(0 0.0454102)"})})})]}),as=({selectedLevel:e,maxLevel:t,className:n=""})=>{const r=Array.from({length:t},(o,s)=>s+1);return N.jsx("div",{className:`flex items-center ${n}`,children:r.map(o=>N.jsx("div",{className:"flex items-center justify-center",children:o>t-e?N.jsx(AS,{}):N.jsx(NS,{})},o))})};class Wt{}ms(Wt,"FAST",3),ms(Wt,"Medium",2),ms(Wt,"SLOW",1),ms(Wt,"NONE",0);const CS=Object.values({MAINNET:1,SEPOLIA:11155111}),Pn=e=>{const t=typeof e=="string"?parseInt(e,10):e;return CS.includes(t)},OS={USDT:!0},Uh=(e,t)=>{const n=typeof e=="string"?parseInt(e,10):e;return n===1||n===11155111?!1:(n===42161||n===421614)&&t?t.toUpperCase()==="ETH"?!1:!OS[t.toUpperCase()]:!0},$S=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:s="mpc",accountType:i,showChainSpeed:l=!0})=>{const{t:a}=Mt(),c=u=>i===Ne.PERPETUAL&&Pn(u);return N.jsx("div",{className:`relative ${o}`,children:N.jsx(Nt,{value:t,onChange:n,disabled:r,children:({open:u})=>N.jsxs(N.Fragment,{children:[N.jsxs(Nt.Button,{className:`
|
|
140
140
|
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
141
141
|
items-center justify-between flex px-3 rounded-lg
|
|
142
142
|
focus:outline-hidden
|
|
@@ -146,7 +146,7 @@ ${F1(f)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
146
146
|
absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
|
|
147
147
|
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
148
148
|
focus:outline-hidden
|
|
149
|
-
`,children:e.filter(d=>d[s==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(d=>N.jsx(Nt.Option,{value:d,className:({active:p,selected:f})=>`relative cursor-pointer select-none py-3 px-3 ${f?"bg-fill-btn-secondary":p?"bg-fill-input-secondary":""}`,children:({selected:p,active:f})=>N.jsx(N.Fragment,{children:N.jsxs("div",{className:"flex items-center justify-between",children:[N.jsxs("div",{className:"flex items-center space-x-3",children:[d.chainIconUrl?N.jsx("img",{src:d.chainIconUrl,alt:d.chain,className:"w-5 h-5 rounded-full"}):N.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:N.jsx("span",{className:"text-xs text-white font-bold",children:d.chain.charAt(0)})}),N.jsx("div",{className:"flex flex-col",children:N.jsx("span",{className:`text-sm font-medium ${p||f?"text-text-primary":"text-text-tertiary"}`,children:d.chain})})]}),l&&N.jsx("div",{className:"w-12 bg-fill-page-secondary p-1 h-5 flex rounded",children:N.jsx(as,{className:"w-full justify-between",selectedLevel:c(d.chainId)?Wt.SLOW:Wt.FAST,maxLevel:3})})]})})},d.chainId))})})]})})})}
|
|
149
|
+
`,children:e.filter(d=>d[s==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(d=>N.jsx(Nt.Option,{value:d,className:({active:p,selected:f})=>`relative cursor-pointer select-none py-3 px-3 ${f?"bg-fill-btn-secondary":p?"bg-fill-input-secondary":""}`,children:({selected:p,active:f})=>N.jsx(N.Fragment,{children:N.jsxs("div",{className:"flex items-center justify-between",children:[N.jsxs("div",{className:"flex items-center space-x-3",children:[d.chainIconUrl?N.jsx("img",{src:d.chainIconUrl,alt:d.chain,className:"w-5 h-5 rounded-full"}):N.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:N.jsx("span",{className:"text-xs text-white font-bold",children:d.chain.charAt(0)})}),N.jsx("div",{className:"flex flex-col",children:N.jsx("span",{className:`text-sm font-medium ${p||f?"text-text-primary":"text-text-tertiary"}`,children:d.chain})})]}),l&&N.jsx("div",{className:"w-12 bg-fill-page-secondary p-1 h-5 flex rounded",children:N.jsx(as,{className:"w-full justify-between",selectedLevel:c(d.chainId)?Wt.SLOW:Wt.FAST,maxLevel:3})})]})})},d.chainId))})})]})})})},MS=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o="",walletType:s,accountType:i})=>{const{t:l}=Mt(),a=c=>c.token||c.symbol;return N.jsx("div",{className:`relative ${o}`,children:N.jsx(Nt,{value:t,onChange:n,disabled:r,children:({open:c})=>N.jsxs(N.Fragment,{children:[N.jsxs(Nt.Button,{className:`
|
|
150
150
|
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
151
151
|
items-center justify-between flex px-3 rounded-lg
|
|
152
152
|
focus:outline-hidden
|
|
@@ -156,7 +156,7 @@ ${F1(f)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
156
156
|
absolute z-50 mt-1 w-full max-h-[230px] overflow-y-auto rounded-lg
|
|
157
157
|
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
158
158
|
focus:outline-hidden
|
|
159
|
-
`,children:e.map(u=>N.jsx(Nt.Option,{value:u,className:({active:d,selected:p})=>`relative cursor-pointer select-none py-3 px-3 ${p?"bg-fill-btn-secondary":d?"bg-fill-input-secondary":""}`,children:({selected:d,active:p})=>N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("img",{src:u.iconUrl,alt:a(u),className:"w-5 h-5 rounded-full"}),N.jsxs("div",{className:"flex flex-col",children:[N.jsx("span",{className:`text-sm font-medium ${d||p?"text-text-primary":"text-text-tertiary"}`,children:a(u)}),s===gn&&i==="perpetual"&&u.token==="USDC"&&N.jsx("p",{className:"mt-2 text-xs text-text-tertiary whitespace-pre-line",children:l("deposit.defaultSpotNotice")})]})]})},a(u)))})})]})})})},IS=e=>e.map((t,n)=>({asset:t,index:n})).sort((t,n)=>{const r=t.asset.
|
|
159
|
+
`,children:e.map(u=>N.jsx(Nt.Option,{value:u,className:({active:d,selected:p})=>`relative cursor-pointer select-none py-3 px-3 ${p?"bg-fill-btn-secondary":d?"bg-fill-input-secondary":""}`,children:({selected:d,active:p})=>N.jsxs("div",{className:"flex items-center space-x-3",children:[N.jsx("img",{src:u.iconUrl,alt:a(u),className:"w-5 h-5 rounded-full"}),N.jsxs("div",{className:"flex flex-col",children:[N.jsx("span",{className:`text-sm font-medium ${d||p?"text-text-primary":"text-text-tertiary"}`,children:a(u)}),s===gn&&i==="perpetual"&&u.token==="USDC"&&N.jsx("p",{className:"mt-2 text-xs text-text-tertiary whitespace-pre-line",children:l("deposit.defaultSpotNotice")})]})]})},a(u)))})})]})})})},Wh=e=>typeof e=="number"&&Number.isFinite(e),IS=e=>e.map((t,n)=>({asset:t,index:n})).sort((t,n)=>{const r=t.asset.sort,o=n.asset.sort;if(Wh(r)&&Wh(o)){const s=r-o;if(s!==0)return s}return t.index-n.index}).map(({asset:t})=>t),_h=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:s=gn,txType:i="deposit",accountType:l,showChainSpeed:a=!0})=>{const c=g.useCallback(T=>i==="withdraw"?s===gn?T.allowAaWithdraw!==!1:T.allowWithdraw!==!1:s===gn?T.allowAaDeposit!==!1:T.allowDeposit!==!1,[i,s]),u=g.useMemo(()=>{const T=new Set,w=[];for(const P of t)if(c(P))for(const A of P.tokenList||[]){const k=A.symbol||A.token;!k||!(i!=="withdraw"||A.withdrawEnable===!0&&A.pullOff!==!0)||T.has(k)||(T.add(k),w.push({token:k,symbol:k,iconUrl:A.iconUrl,decimals:A.decimals,tokenAddress:A.tokenAddress,sort:A.sort}))}return IS(w)},[t,c,i]),d=T=>{n(T.chainId)},p=T=>{const w=T.symbol||T.token;o(w);const P=[];for(const A of t){if(!c(A))continue;(A.tokenList||[]).some(B=>(B.symbol||B.token)===w)&&P.push(A.chainId)}!P.includes(e.chainId)&&P[0]!==void 0&&n(P[0])},f=g.useMemo(()=>{var P,A;const T=r||((P=u[0])==null?void 0:P.symbol)||((A=u[0])==null?void 0:A.token);if(!T)return[];const w=[];for(const k of t){if(!c(k))continue;const B=(k.tokenList||[]).find(F=>(F.symbol||F.token)===T?i==="withdraw"?F.withdrawEnable===!0&&F.pullOff!==!0:!0:!1);B&&w.push({...k,tokenList:[{token:B.token,symbol:B.symbol,iconUrl:B.iconUrl,decimals:B.decimals,tokenAddress:B.tokenAddress}]})}return w},[t,r,u,c,i]),h=g.useMemo(()=>f.find(T=>T.chainId===e.chainId)||f[0],[f,e.chainId]),m=g.useMemo(()=>u,[u]),x=g.useMemo(()=>{if(m.length!==0)return m.find(T=>T.token===r||T.symbol===r)||m[0]},[m,r]);return g.useEffect(()=>{if(m.length===0)return;if(!m.some(w=>(w.symbol||w.token)===r)){const w=m[0];o(w.symbol||w.token)}},[m,r,o]),g.useEffect(()=>{if(f.length===0)return;f.some(w=>w.chainId===e.chainId)||n(f[0].chainId)},[f,e.chainId,n]),N.jsxs("div",{className:"space-y-4",children:[m.length>0&&x&&N.jsx(MS,{tokens:m,selectedToken:x,onTokenChange:p,walletType:s,accountType:l}),N.jsx($S,{chains:f,selectedChain:h,onChainChange:T=>{const w=t.find(P=>P.chainId===T.chainId);w&&d(w)},walletType:s,accountType:l,showChainSpeed:a,className:"w-full"})]})},DS=({options:e})=>N.jsx(N.Fragment,{children:e.map(t=>N.jsx(Nt.Option,{value:t.value,className:({active:n,selected:r})=>`relative cursor-pointer select-none py-3 px-3 ${r?"bg-fill-btn-secondary":n?"bg-fill-input-secondary":""}`,children:({selected:n,active:r})=>N.jsx("div",{className:"flex items-center justify-between",children:N.jsx("div",{className:"flex items-center space-x-3",children:N.jsx("div",{className:"flex flex-col",children:N.jsx("span",{className:`text-sm font-medium ${n||r?"text-text-primary":"text-text-tertiary"}`,children:t.label})})})})},t.value))}),Vh=({selectedAccount:e,onAccountChange:t,options:n,disabled:r=!1,className:o=""})=>{var f;const{t:s}=Mt(),i=g.useMemo(()=>[{value:"spot",label:s("account.spot")},{value:"perpetual",label:s("account.perp")}],[s]),l=n&&n.length>0?n:i,a=((f=l.find(h=>h.value===(e??"spot")))==null?void 0:f.label)||"",[c,u]=g.useState(e??"spot"),d=e??c,p=h=>{t==null||t(h),e||u(h)};return N.jsx("div",{className:`relative mb-4 ${o}`,children:N.jsx(Nt,{value:d,onChange:p,disabled:r,children:({open:h})=>N.jsxs(N.Fragment,{children:[N.jsxs(Nt.Button,{className:`
|
|
160
160
|
relative w-full h-9 text-text-primary bg-fill-input-primary
|
|
161
161
|
items-center justify-between flex px-3 rounded-lg
|
|
162
162
|
focus:outline-hidden
|
|
@@ -166,7 +166,7 @@ ${F1(f)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
166
166
|
absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
|
|
167
167
|
bg-fill-input-primary border border-line-divider-secondary shadow-lg
|
|
168
168
|
focus:outline-hidden
|
|
169
|
-
`,children:N.jsx(
|
|
169
|
+
`,children:N.jsx(DS,{options:l})})})]})})})};var $i={},kS=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(o){e.addRange(o)}),t&&t.focus()}},LS=kS,Hh={"text/plain":"Text","text/html":"Url",default:"Text"},BS="Copy to clipboard: #{key}, Enter";function FS(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function RS(e,t){var n,r,o,s,i,l,a=!1;t||(t={}),n=t.debug||!1;try{o=LS(),s=document.createRange(),i=document.getSelection(),l=document.createElement("span"),l.textContent=e,l.ariaHidden="true",l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",function(u){if(u.stopPropagation(),t.format)if(u.preventDefault(),typeof u.clipboardData>"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var d=Hh[t.format]||Hh.default;window.clipboardData.setData(d,e)}else u.clipboardData.clearData(),u.clipboardData.setData(t.format,e);t.onCopy&&(u.preventDefault(),t.onCopy(u.clipboardData))}),document.body.appendChild(l),s.selectNodeContents(l),i.addRange(s);var c=document.execCommand("copy");if(!c)throw new Error("copy command was unsuccessful");a=!0}catch(u){n&&console.error("unable to copy using execCommand: ",u),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),a=!0}catch(d){n&&console.error("unable to copy using clipboardData: ",d),n&&console.error("falling back to prompt"),r=FS("message"in t?t.message:BS),window.prompt(r,e)}}finally{i&&(typeof i.removeRange=="function"?i.removeRange(s):i.removeAllRanges()),l&&document.body.removeChild(l),o()}return a}var jS=RS;Object.defineProperty($i,"__esModule",{value:!0}),$i.CopyToClipboard=void 0;var zS=Gh(jS),Mi=Gh(g),US=["text","onCopy","options","children"];function Gh(e){return e&&e.__esModule?e:{default:e}}function Gr(e){"@babel/helpers - typeof";return Gr=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},Gr(e)}function qh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Kh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qh(Object(n),!0).forEach(function(r){Oc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qh(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WS(e,t){if(e==null)return{};var n,r,o=_S(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function _S(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function VS(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Yh(r.key),r)}}function GS(e,t,n){return t&&HS(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qS(e,t,n){return t=Ii(t),KS(e,Zh()?Reflect.construct(t,n||[],Ii(e).constructor):t.apply(e,n))}function KS(e,t){if(t&&(Gr(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZS(e)}function ZS(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Zh=function(){return!!e})()}function Ii(e){return Ii=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ii(e)}function YS(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cc(e,t)}function Cc(e,t){return Cc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Cc(e,t)}function Oc(e,t,n){return(t=Yh(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yh(e){var t=XS(e,"string");return Gr(t)=="symbol"?t:t+""}function XS(e,t){if(Gr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JS=$i.CopyToClipboard=function(e){function t(){var n;VS(this,t);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return n=qS(this,t,[].concat(o)),Oc(n,"onClick",function(i){var l=n.props,a=l.text,c=l.onCopy,u=l.children,d=l.options,p=Mi.default.Children.only(u),f=(0,zS.default)(a,d);c&&c(a,f),p!=null&&p.props&&typeof p.props.onClick=="function"&&p.props.onClick(i)}),n}return YS(t,e),GS(t,[{key:"render",value:function(){var r=this.props;r.text,r.onCopy,r.options;var o=r.children,s=WS(r,US),i=Mi.default.Children.only(o);return Mi.default.cloneElement(i,Kh(Kh({},s),{},{onClick:this.onClick}))}}])}(Mi.default.PureComponent);Oc(JS,"defaultProps",{onCopy:void 0,options:void 0});var QS=$i,$c=QS.CopyToClipboard;$c.CopyToClipboard=$c;var e3=$c;const t3=rb(e3);var n3=Object.defineProperty,Di=Object.getOwnPropertySymbols,Xh=Object.prototype.hasOwnProperty,Jh=Object.prototype.propertyIsEnumerable,Qh=(e,t,n)=>t in e?n3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mc=(e,t)=>{for(var n in t||(t={}))Xh.call(t,n)&&Qh(e,n,t[n]);if(Di)for(var n of Di(t))Jh.call(t,n)&&Qh(e,n,t[n]);return e},Ic=(e,t)=>{var n={};for(var r in e)Xh.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Di)for(var r of Di(e))t.indexOf(r)<0&&Jh.call(e,r)&&(n[r]=e[r]);return n};/**
|
|
170
170
|
* @license QR Code generator library (TypeScript)
|
|
171
171
|
* Copyright (c) Project Nayuki.
|
|
172
172
|
* SPDX-License-Identifier: MIT
|
|
@@ -174,7 +174,7 @@ ${F1(f)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
174
174
|
* @license qrcode.react
|
|
175
175
|
* Copyright (c) Paul O'Shannessy
|
|
176
176
|
* SPDX-License-Identifier: ISC
|
|
177
|
-
*/var n3={L:qr.QrCode.Ecc.LOW,M:qr.QrCode.Ecc.MEDIUM,Q:qr.QrCode.Ecc.QUARTILE,H:qr.QrCode.Ecc.HIGH},Qh=128,em="L",tm="#FFFFFF",nm="#000000",rm=!1,om=1,r3=4,o3=0,s3=.1;function sm(e,t=0){const n=[];return e.forEach(function(r,o){let s=null;r.forEach(function(i,l){if(!i&&s!==null){n.push(`M${s+t} ${o+t}h${l-s}v1H${s+t}z`),s=null;return}if(l===r.length-1){if(!i)return;s===null?n.push(`M${l+t},${o+t} h1v1H${l+t}z`):n.push(`M${s+t},${o+t} h${l+1-s}v1H${s+t}z`);return}i&&s===null&&(s=l)})}),n.join("")}function im(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function i3(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*s3),i=o/t,l=(r.width||s)*i,a=(r.height||s)*i,c=r.x==null?e.length/2-l/2:r.x*i,u=r.y==null?e.length/2-a/2:r.y*i,d=r.opacity==null?1:r.opacity;let p=null;if(r.excavate){let h=Math.floor(c),m=Math.floor(u),x=Math.ceil(l+c-h),T=Math.ceil(a+u-m);p={x:h,y:m,w:x,h:T}}const f=r.crossOrigin;return{x:c,y:u,h:a,w:l,excavation:p,opacity:d,crossOrigin:f}}function a3(e,t){return t!=null?Math.max(Math.floor(t),0):e?r3:o3}function am({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:i,boostLevel:l}){let a=g.useMemo(()=>{const h=(Array.isArray(e)?e:[e]).reduce((m,x)=>(m.push(...qr.QrSegment.makeSegments(x)),m),[]);return qr.QrCode.encodeSegments(h,n3[t],n,void 0,void 0,l)},[e,t,n,l]);const{cells:c,margin:u,numCells:d,calculatedImageSettings:p}=g.useMemo(()=>{let f=a.getModules();const h=a3(r,o),m=f.length+h*2,x=i3(f,i,h,s);return{cells:f,margin:h,numCells:m,calculatedImageSettings:x}},[a,i,s,r,o]);return{qrcode:a,margin:u,cells:c,numCells:d,calculatedImageSettings:p}}var l3=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),c3=g.forwardRef(function(t,n){const r=t,{value:o,size:s=Qh,level:i=em,bgColor:l=tm,fgColor:a=nm,includeMargin:c=rm,minVersion:u=om,boostLevel:d,marginSize:p,imageSettings:f}=r,m=Mc(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:x}=m,T=Mc(m,["style"]),w=f==null?void 0:f.src,P=g.useRef(null),A=g.useRef(null),k=g.useCallback(D=>{P.current=D,typeof n=="function"?n(D):n&&(n.current=D)},[n]),[B,F]=g.useState(!1),{margin:b,cells:v,numCells:E,calculatedImageSettings:I}=am({value:o,level:i,minVersion:u,boostLevel:d,includeMargin:c,marginSize:p,imageSettings:f,size:s});g.useEffect(()=>{if(P.current!=null){const D=P.current,y=D.getContext("2d");if(!y)return;let O=v;const M=A.current,S=I!=null&&M!==null&&M.complete&&M.naturalHeight!==0&&M.naturalWidth!==0;S&&I.excavation!=null&&(O=im(v,I.excavation));const L=window.devicePixelRatio||1;D.height=D.width=s*L;const j=s/E*L;y.scale(j,j),y.fillStyle=l,y.fillRect(0,0,E,E),y.fillStyle=a,l3?y.fill(new Path2D(sm(O,b))):v.forEach(function(z,W){z.forEach(function(_,Z){_&&y.fillRect(Z+b,W+b,1,1)})}),I&&(y.globalAlpha=I.opacity),S&&y.drawImage(M,I.x+b,I.y+b,I.w,I.h)}}),g.useEffect(()=>{F(!1)},[w]);const $=Ic({height:s,width:s},x);let C=null;return w!=null&&(C=g.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{F(!0)},ref:A,crossOrigin:I==null?void 0:I.crossOrigin})),g.createElement(g.Fragment,null,g.createElement("canvas",Ic({style:$,height:s,width:s,ref:k,role:"img"},T)),C)});c3.displayName="QRCodeCanvas";var lm=g.forwardRef(function(t,n){const r=t,{value:o,size:s=Qh,level:i=em,bgColor:l=tm,fgColor:a=nm,includeMargin:c=rm,minVersion:u=om,boostLevel:d,title:p,marginSize:f,imageSettings:h}=r,m=Mc(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:x,cells:T,numCells:w,calculatedImageSettings:P}=am({value:o,level:i,minVersion:u,boostLevel:d,includeMargin:c,marginSize:f,imageSettings:h,size:s});let A=T,k=null;h!=null&&P!=null&&(P.excavation!=null&&(A=im(T,P.excavation)),k=g.createElement("image",{href:h.src,height:P.h,width:P.w,x:P.x+x,y:P.y+x,preserveAspectRatio:"none",opacity:P.opacity,crossOrigin:P.crossOrigin}));const B=sm(A,x);return g.createElement("svg",Ic({height:s,width:s,viewBox:`0 0 ${w} ${w}`,ref:n,role:"img"},m),!!p&&g.createElement("title",null,p),g.createElement("path",{fill:l,d:`M0,0 h${w}v${w}H0z`,shapeRendering:"crispEdges"}),g.createElement("path",{fill:a,d:B,shapeRendering:"crispEdges"}),k)});lm.displayName="QRCodeSVG";function u3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function d3(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function cm(){return/apple/i.test(navigator.vendor)}function f3(){return u3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function p3(){return d3().includes("jsdom/")}const um="data-floating-ui-focusable",h3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Dc(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Kr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&rc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Zr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function kc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function m3(e){return e.matches("html,body")}function tn(e){return(e==null?void 0:e.ownerDocument)||document}function dm(e){return st(e)&&e.matches(h3)}function b3(e){if(!e||p3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function g3(e){return e?e.hasAttribute(um)?e:e.querySelector("["+um+"]")||e:null}function ki(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...ki(e,o.id,n)])}function y3(e){return"nativeEvent"in e}function ls(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var v3=typeof document<"u",w3=function(){},nn=v3?g.useLayoutEffect:w3;const x3={...U};function Li(e){const t=U.useRef(e);return nn(()=>{t.current=e}),t}const E3=x3.useInsertionEffect||(e=>e());function rn(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return E3(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const fm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pm(e,t){const n=Gp(e,fm()),r=n.length;if(r===0)return;const o=Dc(tn(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function S3(e){return pm(tn(e).body,1)||e}function P3(e){return pm(tn(e).body,-1)||e}function Lc(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Kr(n,r)}function T3(e){Gp(e,fm()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function hm(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const A3="data-floating-ui-focusable",mm="active",bm="selected",N3={...U};let gm=!1,C3=0;const ym=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+C3++;function O3(){const[e,t]=U.useState(()=>gm?ym():void 0);return nn(()=>{e==null&&t(ym())},[]),U.useEffect(()=>{gm=!0},[]),e}const Bc=N3.useId||O3;let Fc;process.env.NODE_ENV!=="production"&&(Fc=new Set);function $3(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Fc)!=null&&e.has(o))){var s;(s=Fc)==null||s.add(o),console.error(o)}}function I3(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const M3=U.createContext(null),D3=U.createContext(null),Rc=()=>{var e;return((e=U.useContext(M3))==null?void 0:e.id)||null},jc=()=>U.useContext(D3);function cs(e){return"data-floating-ui-"+e}function Ct(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const vm=cs("safe-polygon");function zc(e,t,n){if(n&&!ls(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function Uc(e){return typeof e=="function"?e():e}function k3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:l=!0,delay:a=0,handleClose:c=null,mouseOnly:u=!1,restMs:d=0,move:p=!0}=t,f=jc(),h=Rc(),m=Li(c),x=Li(a),T=Li(n),w=Li(d),P=U.useRef(),A=U.useRef(-1),k=U.useRef(),B=U.useRef(-1),F=U.useRef(!0),b=U.useRef(!1),v=U.useRef(()=>{}),E=U.useRef(!1),I=rn(()=>{var M;const S=(M=o.current.openEvent)==null?void 0:M.type;return(S==null?void 0:S.includes("mouse"))&&S!=="mousedown"});U.useEffect(()=>{if(!l)return;function M(S){let{open:L}=S;L||(Ct(A),Ct(B),F.current=!0,E.current=!1)}return s.on("openchange",M),()=>{s.off("openchange",M)}},[l,s]),U.useEffect(()=>{if(!l||!m.current||!n)return;function M(L){I()&&r(!1,L,"hover")}const S=tn(i.floating).documentElement;return S.addEventListener("mouseleave",M),()=>{S.removeEventListener("mouseleave",M)}},[i.floating,n,r,l,m,I]);const $=U.useCallback(function(M,S,L){S===void 0&&(S=!0),L===void 0&&(L="hover");const j=zc(x.current,"close",P.current);j&&!k.current?(Ct(A),A.current=window.setTimeout(()=>r(!1,M,L),j)):S&&(Ct(A),r(!1,M,L))},[x,r]),C=rn(()=>{v.current(),k.current=void 0}),D=rn(()=>{if(b.current){const M=tn(i.floating).body;M.style.pointerEvents="",M.removeAttribute(vm),b.current=!1}}),y=rn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);U.useEffect(()=>{if(!l)return;function M(W){if(Ct(A),F.current=!1,u&&!ls(P.current)||Uc(w.current)>0&&!zc(x.current,"open"))return;const _=zc(x.current,"open",P.current);_?A.current=window.setTimeout(()=>{T.current||r(!0,W,"hover")},_):n||r(!0,W,"hover")}function S(W){if(y()){D();return}v.current();const _=tn(i.floating);if(Ct(B),E.current=!1,m.current&&o.current.floatingContext){n||Ct(A),k.current=m.current({...o.current.floatingContext,tree:f,x:W.clientX,y:W.clientY,onClose(){D(),C(),y()||$(W,!0,"safe-polygon")}});const q=k.current;_.addEventListener("mousemove",q),v.current=()=>{_.removeEventListener("mousemove",q)};return}(P.current==="touch"?!Kr(i.floating,W.relatedTarget):!0)&&$(W)}function L(W){y()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:f,x:W.clientX,y:W.clientY,onClose(){D(),C(),y()||$(W)}})(W))}function j(){Ct(A)}function z(W){y()||$(W,!1)}if(be(i.domReference)){const W=i.domReference,_=i.floating;return n&&W.addEventListener("mouseleave",L),p&&W.addEventListener("mousemove",M,{once:!0}),W.addEventListener("mouseenter",M),W.addEventListener("mouseleave",S),_&&(_.addEventListener("mouseleave",L),_.addEventListener("mouseenter",j),_.addEventListener("mouseleave",z)),()=>{n&&W.removeEventListener("mouseleave",L),p&&W.removeEventListener("mousemove",M),W.removeEventListener("mouseenter",M),W.removeEventListener("mouseleave",S),_&&(_.removeEventListener("mouseleave",L),_.removeEventListener("mouseenter",j),_.removeEventListener("mouseleave",z))}}},[i,l,e,u,p,$,C,D,r,n,T,f,x,m,o,y,w]),nn(()=>{var M;if(l&&n&&(M=m.current)!=null&&(M=M.__options)!=null&&M.blockPointerEvents&&I()){b.current=!0;const L=i.floating;if(be(i.domReference)&&L){var S;const j=tn(i.floating).body;j.setAttribute(vm,"");const z=i.domReference,W=f==null||(S=f.nodesRef.current.find(_=>_.id===h))==null||(S=S.context)==null?void 0:S.elements.floating;return W&&(W.style.pointerEvents=""),j.style.pointerEvents="none",z.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{j.style.pointerEvents="",z.style.pointerEvents="",L.style.pointerEvents=""}}}},[l,n,h,i,f,m,I]),nn(()=>{n||(P.current=void 0,E.current=!1,C(),D())},[n,C,D]),U.useEffect(()=>()=>{C(),Ct(A),Ct(B),D()},[l,i.domReference,C,D]);const O=U.useMemo(()=>{function M(S){P.current=S.pointerType}return{onPointerDown:M,onPointerEnter:M,onMouseMove(S){const{nativeEvent:L}=S;function j(){!F.current&&!T.current&&r(!0,L,"hover")}u&&!ls(P.current)||n||Uc(w.current)===0||E.current&&S.movementX**2+S.movementY**2<2||(Ct(B),P.current==="touch"?j():(E.current=!0,B.current=window.setTimeout(j,Uc(w.current))))}}},[u,r,n,T,w]);return U.useMemo(()=>l?{reference:O}:{},[l,O])}const L3={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},wm=U.forwardRef(function(t,n){const[r,o]=U.useState();nn(()=>{cm()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[cs("focus-guard")]:"",style:L3};return N.jsx("span",{...t,...s})}),B3={clipPath:"inset(50%)",position:"fixed",top:0,left:0},xm=U.createContext(null),Em=cs("portal");function F3(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Bc(),o=j3(),[s,i]=U.useState(null),l=U.useRef(null);return nn(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{l.current=null})},[s]),nn(()=>{if(!r||l.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(Em,""),a.appendChild(c),l.current=c,i(c)},[t,r]),nn(()=>{if(n===null||!r||l.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!nc(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const u=document.createElement("div");u.id=r,u.setAttribute(Em,""),a=c||a,a.appendChild(u),l.current=u,i(u)},[t,n,r,o]),s}function R3(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=F3({id:n,root:r}),[i,l]=U.useState(null),a=U.useRef(null),c=U.useRef(null),u=U.useRef(null),d=U.useRef(null),p=i==null?void 0:i.modal,f=i==null?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return U.useEffect(()=>{if(!s||!o||p)return;function m(x){s&&Lc(x)&&(x.type==="focusin"?hm:T3)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,p]),U.useEffect(()=>{s&&(f||hm(s))},[f,s]),N.jsxs(xm.Provider,{value:U.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:l}),[o,s]),children:[h&&s&&N.jsx(wm,{"data-type":"outside",ref:a,onFocus:m=>{if(Lc(m,s)){var x;(x=u.current)==null||x.focus()}else{const T=i?i.domReference:null,w=P3(T);w==null||w.focus()}}}),h&&s&&N.jsx("span",{"aria-owns":s.id,style:B3}),s&&Qr.createPortal(t,s),h&&s&&N.jsx(wm,{"data-type":"outside",ref:c,onFocus:m=>{if(Lc(m,s)){var x;(x=d.current)==null||x.focus()}else{const T=i?i.domReference:null,w=S3(T);w==null||w.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}const j3=()=>U.useContext(xm);function Sm(e){return st(e.target)&&e.target.tagName==="BUTTON"}function z3(e){return st(e.target)&&e.target.tagName==="A"}function Pm(e){return dm(e)}function U3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:l="click",toggle:a=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:d=!0}=t,p=U.useRef(),f=U.useRef(!1),h=U.useMemo(()=>({onPointerDown(m){p.current=m.pointerType},onMouseDown(m){const x=p.current;m.button===0&&l!=="click"&&(ls(x,!0)&&c||(n&&a&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){const x=p.current;if(l==="mousedown"&&p.current){p.current=void 0;return}ls(x,!0)&&c||(n&&a&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){p.current=void 0,!(m.defaultPrevented||!u||Sm(m))&&(m.key===" "&&!Pm(s)&&(m.preventDefault(),f.current=!0),!z3(m)&&m.key==="Enter"&&r(!(n&&a),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||Sm(m)||Pm(s)||m.key===" "&&f.current&&(f.current=!1,r(!(n&&a),m.nativeEvent,"click"))}}),[o,s,l,c,u,r,n,d,a]);return U.useMemo(()=>i?{reference:h}:{},[i,h])}const W3={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},_3={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Tm=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function V3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:l=!0,outsidePress:a=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:f,capture:h}=t,m=jc(),x=rn(typeof a=="function"?a:()=>!1),T=typeof a=="function"?x:a,w=U.useRef(!1),{escapeKey:P,outsidePress:A}=Tm(f),{escapeKey:k,outsidePress:B}=Tm(h),F=U.useRef(!1),b=rn(D=>{var y;if(!n||!i||!l||D.key!=="Escape"||F.current)return;const O=(y=s.current.floatingContext)==null?void 0:y.nodeId,M=m?ki(m.nodesRef.current,O):[];if(!P&&(D.stopPropagation(),M.length>0)){let S=!0;if(M.forEach(L=>{var j;if((j=L.context)!=null&&j.open&&!L.context.dataRef.current.__escapeKeyBubbles){S=!1;return}}),!S)return}r(!1,y3(D)?D.nativeEvent:D,"escape-key")}),v=rn(D=>{var y;const O=()=>{var M;b(D),(M=Zr(D))==null||M.removeEventListener("keydown",O)};(y=Zr(D))==null||y.addEventListener("keydown",O)}),E=rn(D=>{var y;const O=s.current.insideReactTree;s.current.insideReactTree=!1;const M=w.current;if(w.current=!1,c==="click"&&M||O||typeof T=="function"&&!T(D))return;const S=Zr(D),L="["+cs("inert")+"]",j=tn(o.floating).querySelectorAll(L);let z=be(S)?S:null;for(;z&&!wn(z);){const q=xn(z);if(wn(q)||!be(q))break;z=q}if(j.length&&be(S)&&!m3(S)&&!Kr(S,o.floating)&&Array.from(j).every(q=>!Kr(z,q)))return;if(st(S)&&C){const q=wn(S),H=At(S),ee=/auto|scroll/,fe=q||ee.test(H.overflowX),me=q||ee.test(H.overflowY),ye=fe&&S.clientWidth>0&&S.scrollWidth>S.clientWidth,ve=me&&S.clientHeight>0&&S.scrollHeight>S.clientHeight,oe=H.direction==="rtl",V=ve&&(oe?D.offsetX<=S.offsetWidth-S.clientWidth:D.offsetX>S.clientWidth),X=ye&&D.offsetY>S.clientHeight;if(V||X)return}const W=(y=s.current.floatingContext)==null?void 0:y.nodeId,_=m&&ki(m.nodesRef.current,W).some(q=>{var H;return kc(D,(H=q.context)==null?void 0:H.elements.floating)});if(kc(D,o.floating)||kc(D,o.domReference)||_)return;const Z=m?ki(m.nodesRef.current,W):[];if(Z.length>0){let q=!0;if(Z.forEach(H=>{var ee;if((ee=H.context)!=null&&ee.open&&!H.context.dataRef.current.__outsidePressBubbles){q=!1;return}}),!q)return}r(!1,D,"outside-press")}),I=rn(D=>{var y;const O=()=>{var M;E(D),(M=Zr(D))==null||M.removeEventListener(c,O)};(y=Zr(D))==null||y.addEventListener(c,O)});U.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=P,s.current.__outsidePressBubbles=A;let D=-1;function y(j){r(!1,j,"ancestor-scroll")}function O(){window.clearTimeout(D),F.current=!0}function M(){D=window.setTimeout(()=>{F.current=!1},pi()?5:0)}const S=tn(o.floating);l&&(S.addEventListener("keydown",k?v:b,k),S.addEventListener("compositionstart",O),S.addEventListener("compositionend",M)),T&&S.addEventListener(c,B?I:E,B);let L=[];return p&&(be(o.domReference)&&(L=Un(o.domReference)),be(o.floating)&&(L=L.concat(Un(o.floating))),!be(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(Un(o.reference.contextElement)))),L=L.filter(j=>{var z;return j!==((z=S.defaultView)==null?void 0:z.visualViewport)}),L.forEach(j=>{j.addEventListener("scroll",y,{passive:!0})}),()=>{l&&(S.removeEventListener("keydown",k?v:b,k),S.removeEventListener("compositionstart",O),S.removeEventListener("compositionend",M)),T&&S.removeEventListener(c,B?I:E,B),L.forEach(j=>{j.removeEventListener("scroll",y)}),window.clearTimeout(D)}},[s,o,l,T,c,n,r,p,i,P,A,b,k,v,E,B,I]),U.useEffect(()=>{s.current.insideReactTree=!1},[s,T,c]);const $=U.useMemo(()=>({onKeyDown:b,...u&&{[W3[d]]:D=>{r(!1,D.nativeEvent,"reference-press")},...d!=="click"&&{onClick(D){r(!1,D.nativeEvent,"reference-press")}}}}),[b,r,u,d]),C=U.useMemo(()=>{function D(y){y.button===0&&(w.current=!0)}return{onKeyDown:b,onMouseDown:D,onMouseUp:D,[_3[c]]:()=>{s.current.insideReactTree=!0}}},[b,c,s]);return U.useMemo(()=>i?{reference:$,floating:C}:{},[i,$,C])}function H3(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Bc(),s=U.useRef({}),[i]=U.useState(()=>I3()),l=Rc()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!be(f)&&$3("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,c]=U.useState(r.reference),u=rn((f,h,m)=>{s.current.openEvent=f?h:void 0,i.emit("openchange",{open:f,event:h,reason:m,nested:l}),n==null||n(f,h,m)}),d=U.useMemo(()=>({setPositionReference:c}),[]),p=U.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return U.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:d}),[t,u,p,i,o,d])}function G3(e){e===void 0&&(e={});const{nodeId:t}=e,n=H3({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=U.useState(null),[l,a]=U.useState(null),u=(o==null?void 0:o.domReference)||s,d=U.useRef(null),p=jc();nn(()=>{u&&(d.current=u)},[u]);const f=lh({...e,elements:{...o,...l&&{reference:l}}}),h=U.useCallback(P=>{const A=be(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;a(A),f.refs.setReference(A)},[f.refs]),m=U.useCallback(P=>{(be(P)||P===null)&&(d.current=P,i(P)),(be(f.refs.reference.current)||f.refs.reference.current===null||P!==null&&!be(P))&&f.refs.setReference(P)},[f.refs]),x=U.useMemo(()=>({...f.refs,setReference:m,setPositionReference:h,domReference:d}),[f.refs,m,h]),T=U.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),w=U.useMemo(()=>({...f,...r,refs:x,elements:T,nodeId:t}),[f,x,T,t,r]);return nn(()=>{r.dataRef.current.floatingContext=w;const P=p==null?void 0:p.nodesRef.current.find(A=>A.id===t);P&&(P.context=w)}),U.useMemo(()=>({...f,context:w,refs:x,elements:T}),[f,x,T,w])}function Wc(){return f3()&&cm()}function q3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:l=!0,visibleOnly:a=!0}=t,c=U.useRef(!1),u=U.useRef(-1),d=U.useRef(!0);U.useEffect(()=>{if(!l)return;const f=ot(i.domReference);function h(){!n&&st(i.domReference)&&i.domReference===Dc(tn(i.domReference))&&(c.current=!0)}function m(){d.current=!0}function x(){d.current=!1}return f.addEventListener("blur",h),Wc()&&(f.addEventListener("keydown",m,!0),f.addEventListener("pointerdown",x,!0)),()=>{f.removeEventListener("blur",h),Wc()&&(f.removeEventListener("keydown",m,!0),f.removeEventListener("pointerdown",x,!0))}},[i.domReference,n,l]),U.useEffect(()=>{if(!l)return;function f(h){let{reason:m}=h;(m==="reference-press"||m==="escape-key")&&(c.current=!0)}return o.on("openchange",f),()=>{o.off("openchange",f)}},[o,l]),U.useEffect(()=>()=>{Ct(u)},[]);const p=U.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(f){if(c.current)return;const h=Zr(f.nativeEvent);if(a&&be(h)){if(Wc()&&!f.relatedTarget){if(!d.current&&!dm(h))return}else if(!b3(h))return}r(!0,f.nativeEvent,"focus")},onBlur(f){c.current=!1;const h=f.relatedTarget,m=f.nativeEvent,x=be(h)&&h.hasAttribute(cs("focus-guard"))&&h.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var T;const w=Dc(i.domReference?i.domReference.ownerDocument:document);!h&&w===i.domReference||Kr((T=s.current.floatingContext)==null?void 0:T.refs.floating.current,w)||Kr(i.domReference,w)||x||r(!1,m,"focus")})}}),[s,i.domReference,r,a]);return U.useMemo(()=>l?{reference:p}:{},[l,p])}function _c(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[mm]:i,[bm]:l,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[A3]:""},...s,...t.map(i=>{const l=i?i[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(a=>{let[c,u]=a;if(!(o&&[mm,bm].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),i[c]=function(){for(var p,f=arguments.length,h=new Array(f),m=0;m<f;m++)h[m]=arguments[m];return(p=r.get(c))==null?void 0:p.map(x=>x(...h)).find(x=>x!==void 0)}}}else i[c]=u}),i),{})}}function K3(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),o=U.useCallback(l=>_c(l,e,"reference"),t),s=U.useCallback(l=>_c(l,e,"floating"),n),i=U.useCallback(l=>_c(l,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const Z3=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Y3(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:l=!0,role:a="dialog"}=t,c=Bc(),u=((n=s.domReference)==null?void 0:n.id)||c,d=U.useMemo(()=>{var w;return((w=g3(s.floating))==null?void 0:w.id)||i},[s.floating,i]),p=(r=Z3.get(a))!=null?r:a,h=Rc()!=null,m=U.useMemo(()=>p==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:o?d:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?d:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:u},...p==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[p,d,h,o,u,a]),x=U.useMemo(()=>{const w={id:d,...p&&{role:p}};return p==="tooltip"||a==="label"?w:{...w,...p==="menu"&&{"aria-labelledby":u}}},[p,d,u,a]),T=U.useCallback(w=>{let{active:P,selected:A}=w;const k={role:"option",...P&&{id:d+"-fui-option"}};switch(a){case"select":case"combobox":return{...k,"aria-selected":A}}return{}},[d,a]);return U.useMemo(()=>l?{reference:m,floating:x,item:T}:{},[l,m,x,T])}const Am=g.forwardRef(({placement:e,className:t=""},n)=>{const o=(s=>{switch(s.split("-")[0]){case"top":return{bottom:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid #242424"};case"bottom":return{top:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #242424"};case"left":return{right:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderLeft:"4px solid #242424"};case"right":return{left:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderRight:"4px solid #242424"};default:return{}}})(e);return N.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});Am.displayName="TooltipArrow";const Tn=({children:e,content:t,placement:n="top",delay:r=200,showArrow:o=!0,className:s="",disabled:i=!1,maxWidth:l="max-w-xs",trigger:a=["hover","focus"]})=>{const[c,u]=g.useState(!1),d=g.useRef(null),{refs:p,floatingStyles:f,context:h}=G3({open:c&&!i,onOpenChange:u,placement:n,whileElementsMounted:oh,middleware:[gc(o?12:8),uh({fallbackAxisSideDirection:"start",padding:8}),ch({padding:8}),...o?[l8({element:d})]:[]]}),m=k3(h,{enabled:a.includes("hover"),delay:{open:r,close:150}}),x=q3(h,{enabled:a.includes("focus")}),T=U3(h,{enabled:a.includes("click")}),w=V3(h),P=Y3(h,{role:"tooltip"}),{getReferenceProps:A,getFloatingProps:k}=K3([m,x,T,w,P]);return i?N.jsx(N.Fragment,{children:e}):N.jsxs(N.Fragment,{children:[N.jsx("div",{ref:p.setReference,...A(),style:{cursor:"help"},children:e}),c&&N.jsx(R3,{children:N.jsx("div",{className:"edgex-components",children:N.jsxs("div",{ref:p.setFloating,...k(),style:{...f,zIndex:101},className:`
|
|
177
|
+
*/var r3={L:qr.QrCode.Ecc.LOW,M:qr.QrCode.Ecc.MEDIUM,Q:qr.QrCode.Ecc.QUARTILE,H:qr.QrCode.Ecc.HIGH},em=128,tm="L",nm="#FFFFFF",rm="#000000",om=!1,sm=1,o3=4,s3=0,i3=.1;function im(e,t=0){const n=[];return e.forEach(function(r,o){let s=null;r.forEach(function(i,l){if(!i&&s!==null){n.push(`M${s+t} ${o+t}h${l-s}v1H${s+t}z`),s=null;return}if(l===r.length-1){if(!i)return;s===null?n.push(`M${l+t},${o+t} h1v1H${l+t}z`):n.push(`M${s+t},${o+t} h${l+1-s}v1H${s+t}z`);return}i&&s===null&&(s=l)})}),n.join("")}function am(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function a3(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*i3),i=o/t,l=(r.width||s)*i,a=(r.height||s)*i,c=r.x==null?e.length/2-l/2:r.x*i,u=r.y==null?e.length/2-a/2:r.y*i,d=r.opacity==null?1:r.opacity;let p=null;if(r.excavate){let h=Math.floor(c),m=Math.floor(u),x=Math.ceil(l+c-h),T=Math.ceil(a+u-m);p={x:h,y:m,w:x,h:T}}const f=r.crossOrigin;return{x:c,y:u,h:a,w:l,excavation:p,opacity:d,crossOrigin:f}}function l3(e,t){return t!=null?Math.max(Math.floor(t),0):e?o3:s3}function lm({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:i,boostLevel:l}){let a=g.useMemo(()=>{const h=(Array.isArray(e)?e:[e]).reduce((m,x)=>(m.push(...qr.QrSegment.makeSegments(x)),m),[]);return qr.QrCode.encodeSegments(h,r3[t],n,void 0,void 0,l)},[e,t,n,l]);const{cells:c,margin:u,numCells:d,calculatedImageSettings:p}=g.useMemo(()=>{let f=a.getModules();const h=l3(r,o),m=f.length+h*2,x=a3(f,i,h,s);return{cells:f,margin:h,numCells:m,calculatedImageSettings:x}},[a,i,s,r,o]);return{qrcode:a,margin:u,cells:c,numCells:d,calculatedImageSettings:p}}var c3=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),u3=g.forwardRef(function(t,n){const r=t,{value:o,size:s=em,level:i=tm,bgColor:l=nm,fgColor:a=rm,includeMargin:c=om,minVersion:u=sm,boostLevel:d,marginSize:p,imageSettings:f}=r,m=Ic(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:x}=m,T=Ic(m,["style"]),w=f==null?void 0:f.src,P=g.useRef(null),A=g.useRef(null),k=g.useCallback(D=>{P.current=D,typeof n=="function"?n(D):n&&(n.current=D)},[n]),[B,F]=g.useState(!1),{margin:b,cells:v,numCells:E,calculatedImageSettings:M}=lm({value:o,level:i,minVersion:u,boostLevel:d,includeMargin:c,marginSize:p,imageSettings:f,size:s});g.useEffect(()=>{if(P.current!=null){const D=P.current,y=D.getContext("2d");if(!y)return;let O=v;const I=A.current,S=M!=null&&I!==null&&I.complete&&I.naturalHeight!==0&&I.naturalWidth!==0;S&&M.excavation!=null&&(O=am(v,M.excavation));const L=window.devicePixelRatio||1;D.height=D.width=s*L;const j=s/E*L;y.scale(j,j),y.fillStyle=l,y.fillRect(0,0,E,E),y.fillStyle=a,c3?y.fill(new Path2D(im(O,b))):v.forEach(function(z,W){z.forEach(function(_,Z){_&&y.fillRect(Z+b,W+b,1,1)})}),M&&(y.globalAlpha=M.opacity),S&&y.drawImage(I,M.x+b,M.y+b,M.w,M.h)}}),g.useEffect(()=>{F(!1)},[w]);const $=Mc({height:s,width:s},x);let C=null;return w!=null&&(C=g.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{F(!0)},ref:A,crossOrigin:M==null?void 0:M.crossOrigin})),g.createElement(g.Fragment,null,g.createElement("canvas",Mc({style:$,height:s,width:s,ref:k,role:"img"},T)),C)});u3.displayName="QRCodeCanvas";var cm=g.forwardRef(function(t,n){const r=t,{value:o,size:s=em,level:i=tm,bgColor:l=nm,fgColor:a=rm,includeMargin:c=om,minVersion:u=sm,boostLevel:d,title:p,marginSize:f,imageSettings:h}=r,m=Ic(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:x,cells:T,numCells:w,calculatedImageSettings:P}=lm({value:o,level:i,minVersion:u,boostLevel:d,includeMargin:c,marginSize:f,imageSettings:h,size:s});let A=T,k=null;h!=null&&P!=null&&(P.excavation!=null&&(A=am(T,P.excavation)),k=g.createElement("image",{href:h.src,height:P.h,width:P.w,x:P.x+x,y:P.y+x,preserveAspectRatio:"none",opacity:P.opacity,crossOrigin:P.crossOrigin}));const B=im(A,x);return g.createElement("svg",Mc({height:s,width:s,viewBox:`0 0 ${w} ${w}`,ref:n,role:"img"},m),!!p&&g.createElement("title",null,p),g.createElement("path",{fill:l,d:`M0,0 h${w}v${w}H0z`,shapeRendering:"crispEdges"}),g.createElement("path",{fill:a,d:B,shapeRendering:"crispEdges"}),k)});cm.displayName="QRCodeSVG";function d3(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function f3(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function um(){return/apple/i.test(navigator.vendor)}function p3(){return d3().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function h3(){return f3().includes("jsdom/")}const dm="data-floating-ui-focusable",m3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Dc(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Kr(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&rc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Zr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function kc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function b3(e){return e.matches("html,body")}function tn(e){return(e==null?void 0:e.ownerDocument)||document}function fm(e){return st(e)&&e.matches(m3)}function g3(e){if(!e||h3())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function y3(e){return e?e.hasAttribute(dm)?e:e.querySelector("["+dm+"]")||e:null}function ki(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...ki(e,o.id,n)])}function v3(e){return"nativeEvent"in e}function ls(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var w3=typeof document<"u",x3=function(){},nn=w3?g.useLayoutEffect:x3;const E3={...U};function Li(e){const t=U.useRef(e);return nn(()=>{t.current=e}),t}const S3=E3.useInsertionEffect||(e=>e());function rn(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return S3(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const pm=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function hm(e,t){const n=Gp(e,pm()),r=n.length;if(r===0)return;const o=Dc(tn(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function P3(e){return hm(tn(e).body,1)||e}function T3(e){return hm(tn(e).body,-1)||e}function Lc(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Kr(n,r)}function A3(e){Gp(e,pm()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function mm(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const N3="data-floating-ui-focusable",bm="active",gm="selected",C3={...U};let ym=!1,O3=0;const vm=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+O3++;function $3(){const[e,t]=U.useState(()=>ym?vm():void 0);return nn(()=>{e==null&&t(vm())},[]),U.useEffect(()=>{ym=!0},[]),e}const Bc=C3.useId||$3;let Fc;process.env.NODE_ENV!=="production"&&(Fc=new Set);function M3(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Fc)!=null&&e.has(o))){var s;(s=Fc)==null||s.add(o),console.error(o)}}function I3(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const D3=U.createContext(null),k3=U.createContext(null),Rc=()=>{var e;return((e=U.useContext(D3))==null?void 0:e.id)||null},jc=()=>U.useContext(k3);function cs(e){return"data-floating-ui-"+e}function Ct(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const wm=cs("safe-polygon");function zc(e,t,n){if(n&&!ls(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function Uc(e){return typeof e=="function"?e():e}function L3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:l=!0,delay:a=0,handleClose:c=null,mouseOnly:u=!1,restMs:d=0,move:p=!0}=t,f=jc(),h=Rc(),m=Li(c),x=Li(a),T=Li(n),w=Li(d),P=U.useRef(),A=U.useRef(-1),k=U.useRef(),B=U.useRef(-1),F=U.useRef(!0),b=U.useRef(!1),v=U.useRef(()=>{}),E=U.useRef(!1),M=rn(()=>{var I;const S=(I=o.current.openEvent)==null?void 0:I.type;return(S==null?void 0:S.includes("mouse"))&&S!=="mousedown"});U.useEffect(()=>{if(!l)return;function I(S){let{open:L}=S;L||(Ct(A),Ct(B),F.current=!0,E.current=!1)}return s.on("openchange",I),()=>{s.off("openchange",I)}},[l,s]),U.useEffect(()=>{if(!l||!m.current||!n)return;function I(L){M()&&r(!1,L,"hover")}const S=tn(i.floating).documentElement;return S.addEventListener("mouseleave",I),()=>{S.removeEventListener("mouseleave",I)}},[i.floating,n,r,l,m,M]);const $=U.useCallback(function(I,S,L){S===void 0&&(S=!0),L===void 0&&(L="hover");const j=zc(x.current,"close",P.current);j&&!k.current?(Ct(A),A.current=window.setTimeout(()=>r(!1,I,L),j)):S&&(Ct(A),r(!1,I,L))},[x,r]),C=rn(()=>{v.current(),k.current=void 0}),D=rn(()=>{if(b.current){const I=tn(i.floating).body;I.style.pointerEvents="",I.removeAttribute(wm),b.current=!1}}),y=rn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);U.useEffect(()=>{if(!l)return;function I(W){if(Ct(A),F.current=!1,u&&!ls(P.current)||Uc(w.current)>0&&!zc(x.current,"open"))return;const _=zc(x.current,"open",P.current);_?A.current=window.setTimeout(()=>{T.current||r(!0,W,"hover")},_):n||r(!0,W,"hover")}function S(W){if(y()){D();return}v.current();const _=tn(i.floating);if(Ct(B),E.current=!1,m.current&&o.current.floatingContext){n||Ct(A),k.current=m.current({...o.current.floatingContext,tree:f,x:W.clientX,y:W.clientY,onClose(){D(),C(),y()||$(W,!0,"safe-polygon")}});const q=k.current;_.addEventListener("mousemove",q),v.current=()=>{_.removeEventListener("mousemove",q)};return}(P.current==="touch"?!Kr(i.floating,W.relatedTarget):!0)&&$(W)}function L(W){y()||o.current.floatingContext&&(m.current==null||m.current({...o.current.floatingContext,tree:f,x:W.clientX,y:W.clientY,onClose(){D(),C(),y()||$(W)}})(W))}function j(){Ct(A)}function z(W){y()||$(W,!1)}if(be(i.domReference)){const W=i.domReference,_=i.floating;return n&&W.addEventListener("mouseleave",L),p&&W.addEventListener("mousemove",I,{once:!0}),W.addEventListener("mouseenter",I),W.addEventListener("mouseleave",S),_&&(_.addEventListener("mouseleave",L),_.addEventListener("mouseenter",j),_.addEventListener("mouseleave",z)),()=>{n&&W.removeEventListener("mouseleave",L),p&&W.removeEventListener("mousemove",I),W.removeEventListener("mouseenter",I),W.removeEventListener("mouseleave",S),_&&(_.removeEventListener("mouseleave",L),_.removeEventListener("mouseenter",j),_.removeEventListener("mouseleave",z))}}},[i,l,e,u,p,$,C,D,r,n,T,f,x,m,o,y,w]),nn(()=>{var I;if(l&&n&&(I=m.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&M()){b.current=!0;const L=i.floating;if(be(i.domReference)&&L){var S;const j=tn(i.floating).body;j.setAttribute(wm,"");const z=i.domReference,W=f==null||(S=f.nodesRef.current.find(_=>_.id===h))==null||(S=S.context)==null?void 0:S.elements.floating;return W&&(W.style.pointerEvents=""),j.style.pointerEvents="none",z.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{j.style.pointerEvents="",z.style.pointerEvents="",L.style.pointerEvents=""}}}},[l,n,h,i,f,m,M]),nn(()=>{n||(P.current=void 0,E.current=!1,C(),D())},[n,C,D]),U.useEffect(()=>()=>{C(),Ct(A),Ct(B),D()},[l,i.domReference,C,D]);const O=U.useMemo(()=>{function I(S){P.current=S.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(S){const{nativeEvent:L}=S;function j(){!F.current&&!T.current&&r(!0,L,"hover")}u&&!ls(P.current)||n||Uc(w.current)===0||E.current&&S.movementX**2+S.movementY**2<2||(Ct(B),P.current==="touch"?j():(E.current=!0,B.current=window.setTimeout(j,Uc(w.current))))}}},[u,r,n,T,w]);return U.useMemo(()=>l?{reference:O}:{},[l,O])}const B3={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},xm=U.forwardRef(function(t,n){const[r,o]=U.useState();nn(()=>{um()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[cs("focus-guard")]:"",style:B3};return N.jsx("span",{...t,...s})}),F3={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Em=U.createContext(null),Sm=cs("portal");function R3(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Bc(),o=z3(),[s,i]=U.useState(null),l=U.useRef(null);return nn(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{l.current=null})},[s]),nn(()=>{if(!r||l.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(Sm,""),a.appendChild(c),l.current=c,i(c)},[t,r]),nn(()=>{if(n===null||!r||l.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!nc(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const u=document.createElement("div");u.id=r,u.setAttribute(Sm,""),a=c||a,a.appendChild(u),l.current=u,i(u)},[t,n,r,o]),s}function j3(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=R3({id:n,root:r}),[i,l]=U.useState(null),a=U.useRef(null),c=U.useRef(null),u=U.useRef(null),d=U.useRef(null),p=i==null?void 0:i.modal,f=i==null?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return U.useEffect(()=>{if(!s||!o||p)return;function m(x){s&&Lc(x)&&(x.type==="focusin"?mm:A3)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,p]),U.useEffect(()=>{s&&(f||mm(s))},[f,s]),N.jsxs(Em.Provider,{value:U.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:l}),[o,s]),children:[h&&s&&N.jsx(xm,{"data-type":"outside",ref:a,onFocus:m=>{if(Lc(m,s)){var x;(x=u.current)==null||x.focus()}else{const T=i?i.domReference:null,w=T3(T);w==null||w.focus()}}}),h&&s&&N.jsx("span",{"aria-owns":s.id,style:F3}),s&&Qr.createPortal(t,s),h&&s&&N.jsx(xm,{"data-type":"outside",ref:c,onFocus:m=>{if(Lc(m,s)){var x;(x=d.current)==null||x.focus()}else{const T=i?i.domReference:null,w=P3(T);w==null||w.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}const z3=()=>U.useContext(Em);function Pm(e){return st(e.target)&&e.target.tagName==="BUTTON"}function U3(e){return st(e.target)&&e.target.tagName==="A"}function Tm(e){return fm(e)}function W3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:l="click",toggle:a=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:d=!0}=t,p=U.useRef(),f=U.useRef(!1),h=U.useMemo(()=>({onPointerDown(m){p.current=m.pointerType},onMouseDown(m){const x=p.current;m.button===0&&l!=="click"&&(ls(x,!0)&&c||(n&&a&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){const x=p.current;if(l==="mousedown"&&p.current){p.current=void 0;return}ls(x,!0)&&c||(n&&a&&(!(o.current.openEvent&&d)||o.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){p.current=void 0,!(m.defaultPrevented||!u||Pm(m))&&(m.key===" "&&!Tm(s)&&(m.preventDefault(),f.current=!0),!U3(m)&&m.key==="Enter"&&r(!(n&&a),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||Pm(m)||Tm(s)||m.key===" "&&f.current&&(f.current=!1,r(!(n&&a),m.nativeEvent,"click"))}}),[o,s,l,c,u,r,n,d,a]);return U.useMemo(()=>i?{reference:h}:{},[i,h])}const _3={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},V3={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Am=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function H3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:l=!0,outsidePress:a=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:f,capture:h}=t,m=jc(),x=rn(typeof a=="function"?a:()=>!1),T=typeof a=="function"?x:a,w=U.useRef(!1),{escapeKey:P,outsidePress:A}=Am(f),{escapeKey:k,outsidePress:B}=Am(h),F=U.useRef(!1),b=rn(D=>{var y;if(!n||!i||!l||D.key!=="Escape"||F.current)return;const O=(y=s.current.floatingContext)==null?void 0:y.nodeId,I=m?ki(m.nodesRef.current,O):[];if(!P&&(D.stopPropagation(),I.length>0)){let S=!0;if(I.forEach(L=>{var j;if((j=L.context)!=null&&j.open&&!L.context.dataRef.current.__escapeKeyBubbles){S=!1;return}}),!S)return}r(!1,v3(D)?D.nativeEvent:D,"escape-key")}),v=rn(D=>{var y;const O=()=>{var I;b(D),(I=Zr(D))==null||I.removeEventListener("keydown",O)};(y=Zr(D))==null||y.addEventListener("keydown",O)}),E=rn(D=>{var y;const O=s.current.insideReactTree;s.current.insideReactTree=!1;const I=w.current;if(w.current=!1,c==="click"&&I||O||typeof T=="function"&&!T(D))return;const S=Zr(D),L="["+cs("inert")+"]",j=tn(o.floating).querySelectorAll(L);let z=be(S)?S:null;for(;z&&!wn(z);){const q=xn(z);if(wn(q)||!be(q))break;z=q}if(j.length&&be(S)&&!b3(S)&&!Kr(S,o.floating)&&Array.from(j).every(q=>!Kr(z,q)))return;if(st(S)&&C){const q=wn(S),H=At(S),ee=/auto|scroll/,fe=q||ee.test(H.overflowX),me=q||ee.test(H.overflowY),ye=fe&&S.clientWidth>0&&S.scrollWidth>S.clientWidth,ve=me&&S.clientHeight>0&&S.scrollHeight>S.clientHeight,oe=H.direction==="rtl",V=ve&&(oe?D.offsetX<=S.offsetWidth-S.clientWidth:D.offsetX>S.clientWidth),X=ye&&D.offsetY>S.clientHeight;if(V||X)return}const W=(y=s.current.floatingContext)==null?void 0:y.nodeId,_=m&&ki(m.nodesRef.current,W).some(q=>{var H;return kc(D,(H=q.context)==null?void 0:H.elements.floating)});if(kc(D,o.floating)||kc(D,o.domReference)||_)return;const Z=m?ki(m.nodesRef.current,W):[];if(Z.length>0){let q=!0;if(Z.forEach(H=>{var ee;if((ee=H.context)!=null&&ee.open&&!H.context.dataRef.current.__outsidePressBubbles){q=!1;return}}),!q)return}r(!1,D,"outside-press")}),M=rn(D=>{var y;const O=()=>{var I;E(D),(I=Zr(D))==null||I.removeEventListener(c,O)};(y=Zr(D))==null||y.addEventListener(c,O)});U.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=P,s.current.__outsidePressBubbles=A;let D=-1;function y(j){r(!1,j,"ancestor-scroll")}function O(){window.clearTimeout(D),F.current=!0}function I(){D=window.setTimeout(()=>{F.current=!1},pi()?5:0)}const S=tn(o.floating);l&&(S.addEventListener("keydown",k?v:b,k),S.addEventListener("compositionstart",O),S.addEventListener("compositionend",I)),T&&S.addEventListener(c,B?M:E,B);let L=[];return p&&(be(o.domReference)&&(L=Un(o.domReference)),be(o.floating)&&(L=L.concat(Un(o.floating))),!be(o.reference)&&o.reference&&o.reference.contextElement&&(L=L.concat(Un(o.reference.contextElement)))),L=L.filter(j=>{var z;return j!==((z=S.defaultView)==null?void 0:z.visualViewport)}),L.forEach(j=>{j.addEventListener("scroll",y,{passive:!0})}),()=>{l&&(S.removeEventListener("keydown",k?v:b,k),S.removeEventListener("compositionstart",O),S.removeEventListener("compositionend",I)),T&&S.removeEventListener(c,B?M:E,B),L.forEach(j=>{j.removeEventListener("scroll",y)}),window.clearTimeout(D)}},[s,o,l,T,c,n,r,p,i,P,A,b,k,v,E,B,M]),U.useEffect(()=>{s.current.insideReactTree=!1},[s,T,c]);const $=U.useMemo(()=>({onKeyDown:b,...u&&{[_3[d]]:D=>{r(!1,D.nativeEvent,"reference-press")},...d!=="click"&&{onClick(D){r(!1,D.nativeEvent,"reference-press")}}}}),[b,r,u,d]),C=U.useMemo(()=>{function D(y){y.button===0&&(w.current=!0)}return{onKeyDown:b,onMouseDown:D,onMouseUp:D,[V3[c]]:()=>{s.current.insideReactTree=!0}}},[b,c,s]);return U.useMemo(()=>i?{reference:$,floating:C}:{},[i,$,C])}function G3(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Bc(),s=U.useRef({}),[i]=U.useState(()=>I3()),l=Rc()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!be(f)&&M3("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,c]=U.useState(r.reference),u=rn((f,h,m)=>{s.current.openEvent=f?h:void 0,i.emit("openchange",{open:f,event:h,reason:m,nested:l}),n==null||n(f,h,m)}),d=U.useMemo(()=>({setPositionReference:c}),[]),p=U.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return U.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:p,events:i,floatingId:o,refs:d}),[t,u,p,i,o,d])}function q3(e){e===void 0&&(e={});const{nodeId:t}=e,n=G3({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=U.useState(null),[l,a]=U.useState(null),u=(o==null?void 0:o.domReference)||s,d=U.useRef(null),p=jc();nn(()=>{u&&(d.current=u)},[u]);const f=lh({...e,elements:{...o,...l&&{reference:l}}}),h=U.useCallback(P=>{const A=be(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;a(A),f.refs.setReference(A)},[f.refs]),m=U.useCallback(P=>{(be(P)||P===null)&&(d.current=P,i(P)),(be(f.refs.reference.current)||f.refs.reference.current===null||P!==null&&!be(P))&&f.refs.setReference(P)},[f.refs]),x=U.useMemo(()=>({...f.refs,setReference:m,setPositionReference:h,domReference:d}),[f.refs,m,h]),T=U.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),w=U.useMemo(()=>({...f,...r,refs:x,elements:T,nodeId:t}),[f,x,T,t,r]);return nn(()=>{r.dataRef.current.floatingContext=w;const P=p==null?void 0:p.nodesRef.current.find(A=>A.id===t);P&&(P.context=w)}),U.useMemo(()=>({...f,context:w,refs:x,elements:T}),[f,x,T,w])}function Wc(){return p3()&&um()}function K3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:s,elements:i}=e,{enabled:l=!0,visibleOnly:a=!0}=t,c=U.useRef(!1),u=U.useRef(-1),d=U.useRef(!0);U.useEffect(()=>{if(!l)return;const f=ot(i.domReference);function h(){!n&&st(i.domReference)&&i.domReference===Dc(tn(i.domReference))&&(c.current=!0)}function m(){d.current=!0}function x(){d.current=!1}return f.addEventListener("blur",h),Wc()&&(f.addEventListener("keydown",m,!0),f.addEventListener("pointerdown",x,!0)),()=>{f.removeEventListener("blur",h),Wc()&&(f.removeEventListener("keydown",m,!0),f.removeEventListener("pointerdown",x,!0))}},[i.domReference,n,l]),U.useEffect(()=>{if(!l)return;function f(h){let{reason:m}=h;(m==="reference-press"||m==="escape-key")&&(c.current=!0)}return o.on("openchange",f),()=>{o.off("openchange",f)}},[o,l]),U.useEffect(()=>()=>{Ct(u)},[]);const p=U.useMemo(()=>({onMouseLeave(){c.current=!1},onFocus(f){if(c.current)return;const h=Zr(f.nativeEvent);if(a&&be(h)){if(Wc()&&!f.relatedTarget){if(!d.current&&!fm(h))return}else if(!g3(h))return}r(!0,f.nativeEvent,"focus")},onBlur(f){c.current=!1;const h=f.relatedTarget,m=f.nativeEvent,x=be(h)&&h.hasAttribute(cs("focus-guard"))&&h.getAttribute("data-type")==="outside";u.current=window.setTimeout(()=>{var T;const w=Dc(i.domReference?i.domReference.ownerDocument:document);!h&&w===i.domReference||Kr((T=s.current.floatingContext)==null?void 0:T.refs.floating.current,w)||Kr(i.domReference,w)||x||r(!1,m,"focus")})}}),[s,i.domReference,r,a]);return U.useMemo(()=>l?{reference:p}:{},[l,p])}function _c(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[bm]:i,[gm]:l,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1,[N3]:""},...s,...t.map(i=>{const l=i?i[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(a=>{let[c,u]=a;if(!(o&&[bm,gm].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),i[c]=function(){for(var p,f=arguments.length,h=new Array(f),m=0;m<f;m++)h[m]=arguments[m];return(p=r.get(c))==null?void 0:p.map(x=>x(...h)).find(x=>x!==void 0)}}}else i[c]=u}),i),{})}}function Z3(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),o=U.useCallback(l=>_c(l,e,"reference"),t),s=U.useCallback(l=>_c(l,e,"floating"),n),i=U.useCallback(l=>_c(l,e,"item"),r);return U.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const Y3=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function X3(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:s,floatingId:i}=e,{enabled:l=!0,role:a="dialog"}=t,c=Bc(),u=((n=s.domReference)==null?void 0:n.id)||c,d=U.useMemo(()=>{var w;return((w=y3(s.floating))==null?void 0:w.id)||i},[s.floating,i]),p=(r=Y3.get(a))!=null?r:a,h=Rc()!=null,m=U.useMemo(()=>p==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:o?d:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":p==="alertdialog"?"dialog":p,"aria-controls":o?d:void 0,...p==="listbox"&&{role:"combobox"},...p==="menu"&&{id:u},...p==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[p,d,h,o,u,a]),x=U.useMemo(()=>{const w={id:d,...p&&{role:p}};return p==="tooltip"||a==="label"?w:{...w,...p==="menu"&&{"aria-labelledby":u}}},[p,d,u,a]),T=U.useCallback(w=>{let{active:P,selected:A}=w;const k={role:"option",...P&&{id:d+"-fui-option"}};switch(a){case"select":case"combobox":return{...k,"aria-selected":A}}return{}},[d,a]);return U.useMemo(()=>l?{reference:m,floating:x,item:T}:{},[l,m,x,T])}const Nm=g.forwardRef(({placement:e,className:t=""},n)=>{const o=(s=>{switch(s.split("-")[0]){case"top":return{bottom:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid #242424"};case"bottom":return{top:"-4px",left:"50%",transform:"translateX(-50%)",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #242424"};case"left":return{right:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderLeft:"4px solid #242424"};case"right":return{left:"-4px",top:"50%",transform:"translateY(-50%)",borderTop:"4px solid transparent",borderBottom:"4px solid transparent",borderRight:"4px solid #242424"};default:return{}}})(e);return N.jsx("div",{ref:n,className:`absolute w-0 h-0 ${t}`,style:o})});Nm.displayName="TooltipArrow";const Tn=({children:e,content:t,placement:n="top",delay:r=200,showArrow:o=!0,className:s="",disabled:i=!1,maxWidth:l="max-w-xs",trigger:a=["hover","focus"]})=>{const[c,u]=g.useState(!1),d=g.useRef(null),{refs:p,floatingStyles:f,context:h}=q3({open:c&&!i,onOpenChange:u,placement:n,whileElementsMounted:oh,middleware:[gc(o?12:8),uh({fallbackAxisSideDirection:"start",padding:8}),ch({padding:8}),...o?[c8({element:d})]:[]]}),m=L3(h,{enabled:a.includes("hover"),delay:{open:r,close:150}}),x=K3(h,{enabled:a.includes("focus")}),T=W3(h,{enabled:a.includes("click")}),w=H3(h),P=X3(h,{role:"tooltip"}),{getReferenceProps:A,getFloatingProps:k}=Z3([m,x,T,w,P]);return i?N.jsx(N.Fragment,{children:e}):N.jsxs(N.Fragment,{children:[N.jsx("div",{ref:p.setReference,...A(),style:{cursor:"help"},children:e}),c&&N.jsx(j3,{children:N.jsx("div",{className:"edgex-components",children:N.jsxs("div",{ref:p.setFloating,...k(),style:{...f,zIndex:101},className:`
|
|
178
178
|
z-101 px-3 py-2 cursor-help
|
|
179
179
|
bg-fill-page-secondary
|
|
180
180
|
text-text-primary text-sm font-medium
|
|
@@ -182,6 +182,6 @@ ${F1(f)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
|
|
|
182
182
|
relative
|
|
183
183
|
${l}
|
|
184
184
|
${s}
|
|
185
|
-
`,children:[t,o&&N.jsx(
|
|
186
|
-
`)[0]:Z},[d,t,e==null?void 0:e.chain,P,w]),B=(A==null?void 0:A.minDepositSize)||"10",F=g.useMemo(()=>{const z=A==null?void 0:A.depositFeeRate;if(z==null)return"";const W=String(z).trim();return W?`${W}%`:""},[A==null?void 0:A.depositFeeRate]),[b,v]=g.useState("fast"),[E,I]=g.useState(""),[$,C]=g.useState(!1),D=g.useRef(!1),y=x&&$,O=g.useMemo(()=>!!F&&b!=="standard",[F,b]),M=g.useMemo(()=>{const z=Number((e==null?void 0:e.blockTime)??0),W=Number((e==null?void 0:e.txConfirm)??0);if(!Number.isFinite(z)||!Number.isFinite(W))return 0;const _=z*W/60;return Math.trunc(_*100)/100},[e==null?void 0:e.blockTime,e==null?void 0:e.txConfirm]),L=x&&$&&b==="standard"?20:M;g.useEffect(()=>{if(D.current)return;D.current=!0;let z=!1;return C(!1),a?((async()=>{try{const _=await a();if(z)return;const Z=_==null?void 0:_.depositMode;if(!(Z===Vc||Z===Nm)){C(!1);return}v(Z===Vc?"fast":"standard"),I((_==null?void 0:_.destinationPreference)||""),C(!0)}catch(_){console.error("[MPCDeposit] getUserBizConfig failed:",_),C(!1)}})(),()=>{z=!0}):()=>{z=!0}},[a]);const j=g.useCallback(async z=>{if(v(z),!c)return;const W=E||r||"";try{await c({depositMode:z==="fast"?Vc:Nm,destinationPreference:W})}catch(_){console.error("[MPCDeposit] saveUserBizConfig failed:",_)}},[c,E,r]);return N.jsxs(N.Fragment,{children:[y&&N.jsx("div",{className:"bg-fill-input-primary rounded-lg p-1 mt-4 mb-3",children:N.jsxs("div",{className:"grid gap-1 grid-cols-2",children:[N.jsx("button",{type:"button",onClick:()=>{j("fast")},className:`h-[30px] rounded-md text-sm font-medium transition-colors ${b==="fast"?"bg-fill-btn-primary text-text-on-sec-btn":"text-text-primary hover:bg-fill-input-secondary"}`,children:d("deposit.fast")}),N.jsx("button",{type:"button",onClick:()=>{j("standard")},className:`h-[30px] rounded-md text-sm font-medium transition-colors ${b==="standard"?"bg-fill-btn-primary text-text-on-sec-btn":"text-text-primary hover:bg-fill-input-secondary"}`,children:d("deposit.standard")})]})}),N.jsx("div",{className:"flex justify-center mt-4 mb-3",children:n&&N.jsx("div",{className:"bg-white rounded-lg",children:N.jsx(lm,{value:n,size:80,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),n&&N.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[N.jsx("span",{className:"flex-1 text-text-primary text-xs font-medium break-all mr-3",children:n}),N.jsx(e3,{onCopy:()=>{l&&l(n)},text:n,children:N.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[N.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),N.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),N.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[N.jsxs("div",{className:"flex items-start",children:[N.jsx("div",{className:"w-5",children:N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1",children:N.jsx("p",{className:"text-xs text-functional-orange-1",children:k})})]}),y&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"my-2 ml-5 h-px border-b border-dashed border-line-divider-secondary"}),N.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:d("deposit.depositModeSwitchWarning")})]})]}),N.jsxs("div",{className:"text-sm",children:[T&&N.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[N.jsx("span",{className:"text-text-tertiary",children:d("deposit.arrivalTime")}),N.jsx(Tn,{content:N.jsx("div",{className:"grid grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:N.jsx("p",{children:d("deposit.arrivaltimeTooltip2")})}),placement:"top",children:N.jsx("span",{className:"text-text-primary font-medium text-right border-b-2 border-dashed border-line-divider-primary decoration-dashed",children:d("deposit.arrivalEstimated",{v:L})})})]}),O&&N.jsxs("div",{className:`flex justify-between items-center h-[18px] ${T?"mt-1":"mt-4"}`,children:[N.jsx("span",{className:"text-text-tertiary",children:d("withdraw.feeRate")}),N.jsx(Tn,{content:d("deposit.feeRateTooltip"),placement:"top",children:N.jsx("span",{className:"text-text-primary font-medium border-b-2 border-dashed border-line-divider-primary decoration-dashed text-right",children:F})})]}),N.jsxs("div",{className:`flex justify-between items-center h-[18px] ${T||O?"mt-1":"mt-4"}`,children:[N.jsx("span",{className:"text-text-tertiary",children:d("deposit.minDeposit")}),N.jsxs("span",{className:"text-text-primary font-medium text-right",children:[B," ",t]})]}),f&&h!=="USDC"&&N.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[N.jsx("span",{className:"text-text-tertiary",children:d("deposit.maxDeposit")}),N.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]})]})},us=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const s=t?`loading-${t}`:"",i=o?"loading-inline":"";return N.jsx("span",{className:`loading loading-${e} loading-spinner ${s} ${i} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},J3=(e,t)=>Number(e)>Number(t),_t=e=>{if(!e||e===""||isNaN(Number(e)))return"0.00";const t=Number(e);if(t===0)return"0.00";let n=t.toString();n.includes("e")&&(n=t.toFixed(20));const r=n.split("."),o=r[0];let s=r[1]||"";return s.length>6&&(s=s.substring(0,6)),s=s.replace(/0+$/,""),s?(s.length===1&&(s+="0"),o+"."+s):o+".00"},ds=(e,t="0")=>{if(/[^0-9.]/.test(e))return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(e===".")return{isValid:!0,formattedValue:"0."};if((e.match(/\./g)||[]).length>1)return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(!e||e==="")return{isValid:!0,formattedValue:""};const o=e.split(".");if(o.length===2&&o[1].length>6){const a=o[0]+"."+o[1].substring(0,6);return ds(a,t)}const s=parseFloat(e),i=parseFloat(t);return!isNaN(s)&&!isNaN(i)&&s>i?{isValid:!0,formattedValue:_t(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},Q3=(e,t,n)=>{const r=parseFloat(String(e)||"0"),o=parseFloat(String(t)||"0");if(o>0){const s=r-o,i=_t(Math.max(0,s).toString());return N.jsxs("span",{className:"flex items-center gap-1",children:[_t(e),N.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),i," ",n]})}return`${_t(e)} ${n}`},eP=(e,t,n)=>{if(!e||e===""||e==="0"||e==="0.00")return!1;const r=parseFloat(e),o=parseFloat(t);return!(isNaN(r)||isNaN(o)||r>o||!n)},tP=(e,t,n)=>{if(!Uh(e,n))return!1;try{const r=new ke(t||"0"),o=new ke("200000");return r.isNaN()||o.isNaN()?!1:r.gte(o)}catch{return!1}},nP=(e,t,n,r)=>{let o=t||"0";if(!(r==="spot")&&Uh(e,n))try{const i=new ke(o),l=new ke("200000");i.gt(l)&&(o="200000")}catch(i){console.warn("Error calculating max amount limit:",i)}try{const i=new ke(o||"0");return i.isNaN()?o:i.decimalPlaces(6,ke.ROUND_DOWN).toString()}catch{return o}},Cm={accountChains:[],defaultChainId:1,defaultAccountType:"",balances:{}};let it=null;const Om=g.forwardRef((e,t)=>{const[n,r]=g.useState(!1),[o,s]=g.useState(!1),[i,l]=g.useState(Cm),a=g.useCallback(h=>{l(h),r(!0)},[]),c=g.useCallback(h=>{l(m=>({...m,...h}))},[]),u=g.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),d=g.useCallback(h=>{s(h)},[]),p=g.useCallback(()=>n,[n]),f=g.useCallback(()=>o,[o]);return g.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:u,updateDepositOptions:c,setDepositLoading:d,isOpen:p,isLoading:f}),[a,u,c,d,p,f]),g.useEffect(()=>(it={openDeposit:a,closeDeposit:u,updateDepositOptions:c,setDepositLoading:d,isOpen:p,isLoading:f},()=>{it=null}),[a,u,c,d,p,f]),n?N.jsx(Rm,{isOpen:n,isLoading:o,onClose:u,accountChains:i.accountChains,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAccountType:i.defaultAccountType,balances:i.balances,wagmiHooks:i.wagmiHooks,onDeposit:i.onDeposit,onCopy:i.onCopy,getUserBizConfig:i.getUserBizConfig,saveUserBizConfig:i.saveUserBizConfig,onChainChange:h=>{var m;return(m=i.onChainChange)==null?void 0:m.call(i,h)},onTokenChange:h=>{var m;return(m=i.onTokenChange)==null?void 0:m.call(i,h)}}):null});Om.displayName="DepositManager";const $m=e=>{if(!it){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}it.openDeposit(e||Cm)},Im=()=>{if(!it){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}it.closeDeposit()},Mm=e=>{it&&it.updateDepositOptions(e)},Bi=e=>{if(!it){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}it.setDepositLoading(e)},rP=()=>it?it.isOpen():!1,Dm=()=>it?it.isLoading():!1,oP=()=>({openDeposit:$m,closeDeposit:Im,updateDepositOptions:Mm,setDepositLoading:Bi,isOpen:rP,isLoading:Dm}),sP=e=>{const{t}=It(),{isNetworkMismatch:n,depositAmount:r,approved:o,currentTokenBalance:s,selectedToken:i,showLayerZeroTip:l,minDeposit:a=10}=e;return g.useMemo(()=>{if(n)return{text:t("deposit.switchNetwork"),disabled:!0,isNetworkSwitch:!0};const c=parseFloat(r||"0"),u=a,d=eP(r,s||"0",o);return!r||c===0||!o?{text:t(l?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:c<u?{text:t("deposit.minDepositParsed",{amount:u,token:i}),disabled:!0,isNetworkSwitch:!1}:{text:t(l?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!d,isNetworkSwitch:!1}},[n,r,o,s,i,l,a,t])};function iP(e){const{account:t,accountChainId:n,targetChainId:r,tokenInfo:o,amount:s}=e,{useReadContract:i,useWriteContract:l,usePublicClient:a,useSwitchChain:c}=e.wagmiHooks,u=o==null?void 0:o.tokenAddress,d=(o==null?void 0:o.decimals)??18,p=(o==null?void 0:o.approveSpender)||(o==null?void 0:o.contractAddress),f=!u||u.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",{switchChainAsync:h}=c(),{writeContractAsync:m}=l(),x=a(),T=i({address:u,abi:Dr,functionName:"allowance",args:[un(t||""),p],chainId:r,query:{enabled:!!(!f&&t&&r&&u&&p)}}),w=T!=null&&T.isSuccess?T.data:void 0,P=g.useMemo(()=>{if(f)return!0;if(!T.isSuccess||w===void 0||w===0n)return!1;try{const k=K6(String(Number(s||"0")||0),Number(d));return w>=k}catch{return!1}},[f,T.isSuccess,w,s,d]),A=g.useCallback(async()=>{try{if(r&&n&&+n!=+r&&await h({chainId:+r}),!m||!x||!u||!p)return;const B=un(u),F=un(p);if((w||0n)>0n){const E=await m({abi:Dr,address:B,functionName:"approve",args:[F,0n]});await x.waitForTransactionReceipt({hash:E})}const v=await m({abi:Dr,address:B,functionName:"approve",args:[F,Sd]});await x.waitForTransactionReceipt({hash:v}),T!=null&&T.refetch&&await T.refetch()}catch(k){console.error("[useApprove] onApprove failed:",k)}},[r,n,u,p,w,T,m,x,h]);return{approve:P,onApprove:A}}const aP=({token:e,account:t,chainId:n,wagmiHooks:r,onResult:o})=>{var i;const s=(i=r==null?void 0:r.useBalance)==null?void 0:i.call(r,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(r!=null&&r.useBalance)}});return g.useEffect(()=>{o(un(e.tokenAddress),{balance:s})},[s,e.tokenAddress,o]),null},lP=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var w;const s=typeof t=="string"?Number.isFinite(Number(t))?Number(t):void 0:t,i=g.useMemo(()=>{const P="0x0000000000000000000000000000000000000000",A="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(k=>{const B=k.tokenAddress;if(!B)return!1;const F=B.toLowerCase();return!(B===P||F===A)})},[r]),[l,a]=g.useState({}),c=g.useCallback((P,A)=>{a(k=>({...k,[P]:A}))},[]),u=(w=o==null?void 0:o.useBalance)==null?void 0:w.call(o,{address:e,chainId:s,query:{enabled:!!e&&!!s&&!!(o!=null&&o.useBalance)}}),[d,p]=g.useState(0),f=g.useMemo(()=>i.map(P=>g.createElement(aP,{key:`${P.tokenAddress}-${d}`,token:P,account:e,chainId:s,contractAddress:n,wagmiHooks:o,onResult:c})),[i,e,s,n,o,c,d]),h=g.useMemo(()=>{const P=u!=null&&u.data?{value:u.data.value,formatted:u.data.formatted,decimals:u.data.decimals,symbol:u.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},A=i.map(B=>{const F=l[un(B.tokenAddress)],b=F==null?void 0:F.balance,v=b==null?void 0:b.data;return{address:un(B.tokenAddress),value:(v==null?void 0:v.value)||BigInt(0),formatted:(v==null?void 0:v.formatted)||"0",decimals:(v==null?void 0:v.decimals)||B.decimals}}).filter(B=>B.address),k=A.reduce((B,F)=>({...B,[F.address]:{balance:F}}),{});return{balanceList:A,baseTokenBalance:P,combinedData:k}},[u,l,i]),m=g.useCallback(async()=>h,[h]),x=g.useMemo(()=>{const P=(u==null?void 0:u.isLoading)||!1,A=Object.values(l).some(k=>{var B;return(B=k.balance)==null?void 0:B.isLoading});return P||A},[u==null?void 0:u.isLoading,l]),T=g.useCallback(()=>p(P=>P+1),[]);return{multicallRun:m,multicallRefresh:T,multicallResult:h,validErcTokens:i,isLoading:x,queryComponents:f}},km=6,cP=(e,t=km)=>{const n=Number(e);return!Number.isFinite(n)||n<0?t:Math.floor(n)},uP=e=>{if(e==null||e==="")return null;try{const t=new ke(e);return!t.isFinite()||t.isNaN()||t.lte(0)?null:t.decimalPlaces()??0}catch{return null}},Fi=(e,t)=>{if(!e)return e;const n=Math.max(0,Math.floor(t));if(e===".")return n===0?"0":"0.";if((e.match(/\./g)||[]).length!==1)return e;const[o,s=""]=e.split(".");return n===0?o:s.length<=n?e:`${o}.${s.slice(0,n)}`},dP=({address:e,currentActiveChain:t,selectedToken:n,accountType:r,accountId:o,accountKey:s,platformBalance:i,isLoading:l,wagmiHooks:a,onChainChange:c,onDeposit:u})=>{const{t:d}=It(),p=a.useAccount(),f=t.tokenList.find(V=>V.token===n||V.symbol===n),h=t.chainId,m=g.useMemo(()=>{if(!((n||"").toUpperCase()==="USDC"))return!1;const X=Number((t==null?void 0:t.cctpResolvedMaxFee)??0);return Number.isFinite(X)?X!==0:!1},[t==null?void 0:t.cctpResolvedMaxFee,n]),[x,T]=g.useState(""),[w,P]=g.useState(()=>m?"fast":"standard");g.useEffect(()=>{T("")},[n,t.chainId]),g.useEffect(()=>{P(m?"fast":"standard")},[t.chainId,m]);const{multicallResult:A,queryComponents:k}=lP({account:e,chainId:t.chainId,contractAddress:(f==null?void 0:f.contractAddress)||(t==null?void 0:t.contractAddress),tokens:(t==null?void 0:t.tokenList)||[],wagmiHooks:a}),B=g.useMemo(()=>{var X;if(!f)return"0";if(!f.tokenAddress||f.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return A.baseTokenBalance.formatted;const V=A.combinedData[f.tokenAddress];return((X=V==null?void 0:V.balance)==null?void 0:X.formatted)||"0"},[f,A]),F="0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",b="0xceeed84620e5eb9ab1d6dfc316867d2cda332e41",v=g.useMemo(()=>{var V,X;return Mx({chain:Bx,transport:Lx(t.rpcUrl||((V=window==null?void 0:window.ENV)==null?void 0:V.CHAIN_RPC_URL_42161)||((X=window==null?void 0:window.ENV)==null?void 0:X.CHAIN_RPC_URL_421614))})},[t.rpcUrl]),E="1000000000000",{formatted:I}=Fx({client:v,tokenAddress:F,holder:b,decimals:6,fallbackFormatted:E,pollingInterval:12e3}),[$,C]=g.useState(!1),{approve:D,onApprove:y}=iP({account:e,accountChainId:p.chainId,targetChainId:+t.chainId,tokenInfo:f,amount:x,wagmiHooks:a}),O=g.useCallback(async()=>{if(!$)try{C(!0),await y()}catch(V){console.error("Approve failed:",V)}finally{C(!1)}},[$,y]),M=g.useMemo(()=>+p.chainId!=+t.chainId,[p.chainId,t.chainId]),S=g.useCallback(async()=>{c&&c(h)},[c,h]);g.useEffect(()=>{M&&S()},[M,S]);const{showLayerZeroTip:L,layerZeroTipKey:j}=g.useMemo(()=>{const V=+t.chainId==42161||+t.chainId==421614,X=(n==null?void 0:n.toUpperCase())==="USDT",Q=new ke(x||"0"),we=new ke("200000");let Y=!1,se;if(V&&X&&x)if(Q.gte(we))Y=!0,se="deposit.layerZeroDepositTipGte200k";else{const ue=I;if(typeof ue=="string"&&ue.length>0){const Ie=new ke(ue);!Ie.isNaN()&&Q.gte(Ie)&&(Y=!0,se="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:Y,layerZeroTipKey:se}},[t.chainId,n,x,I]),z=g.useCallback(()=>nP(+t.chainId,B||"0",n,r),[B,t==null?void 0:t.chainId,n,r]),W=g.useMemo(()=>{const V=cP(f==null?void 0:f.decimals,km),X=uP((f==null?void 0:f.stepSize)??(f==null?void 0:f.stepsize));return X===null?V:Math.min(V,X)},[f==null?void 0:f.decimals,f==null?void 0:f.stepSize,f==null?void 0:f.stepsize]),_=g.useMemo(()=>r!=="spot"&&tP(+t.chainId,x,n),[r,t==null?void 0:t.chainId,x,n]),Z=g.useMemo(()=>"deposit.maxDepositSplitTip",[]),q=g.useMemo(()=>{const V=Number((t==null?void 0:t.blockTime)??0),X=Number((t==null?void 0:t.txConfirm)??0);if(!Number.isFinite(V)||!Number.isFinite(X))return 0;const Q=V*X/60;return Math.trunc(Q*100)/100},[t==null?void 0:t.blockTime,t==null?void 0:t.txConfirm]),ee=m&&w==="standard"?20:q,fe=g.useMemo(()=>{const V=f==null?void 0:f.depositFeeRate;if(V==null)return"";const X=String(V).trim();return X?`${X}%`:""},[f==null?void 0:f.depositFeeRate]),me=m&&w==="fast"&&!!fe,ye=sP({isNetworkMismatch:M,depositAmount:x,approved:D,currentTokenBalance:B,selectedToken:n,showLayerZeroTip:L,minDeposit:f!=null&&f.minDepositSize?parseFloat(f.minDepositSize):10}),ve=V=>{const X=V.target.value,Q=Fi(X,W),we=z(),Y=ds(Q,we);if(Y.isValid){const se=Fi(Y.formattedValue,W);T(se),Y.errorType}else return Y.errorType==="exceed_balance",void 0},oe=g.useCallback(async()=>{Bi(!0);try{u&&u({amount:x,chainId:h,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:n,depositSpeed:w,accountType:r,accountId:o,key:s})}catch(V){console.error("Deposit error:",V),Bi(!1)}},[u,x,h,f==null?void 0:f.tokenAddress,w,r,o,s,n]);return N.jsxs(N.Fragment,{children:[k,m&&N.jsx("div",{className:"bg-fill-input-primary rounded-lg p-1 my-4",children:N.jsxs("div",{className:"grid gap-1 grid-cols-2",children:[N.jsx("button",{type:"button",onClick:()=>P("fast"),className:`h-[30px] rounded-md text-sm font-medium transition-colors ${w==="fast"?"bg-fill-btn-primary text-text-on-sec-btn":"text-text-primary hover:bg-fill-input-secondary"}`,children:d("deposit.fast")}),N.jsx("button",{type:"button",onClick:()=>P("standard"),className:`h-[30px] rounded-md text-sm font-medium transition-colors ${w==="standard"?"bg-fill-btn-primary text-text-on-sec-btn":"text-text-primary hover:bg-fill-input-secondary"}`,children:d("deposit.standard")})]})}),N.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[N.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[N.jsx("input",{type:"text",placeholder:d("deposit.amount"),value:x,onChange:ve,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-hidden border-none p-0 h-full"}),N.jsx("button",{onClick:()=>{const V=z(),X=Fi(V,W),Q=ds(X,V);T(Fi(Q.formattedValue,W))},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:d("deposit.max")})]}),N.jsx("div",{className:"h-px bg-line-divider-secondary mb-2"}),N.jsxs("div",{className:"flex justify-between items-center",children:[N.jsx(Tn,{content:d("deposit.availableDesc"),children:N.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:d("deposit.available")})}),N.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:Q3(B||"0",x,n)})]})]}),!D&&J3(x||"0",0)&&N.jsxs("div",{className:"flex justify-center flex-col items-center",children:[N.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:d("deposit.enableSystemProWithToken",{token:n,network:t==null?void 0:t.chain})}),N.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:d("deposit.enableTokenDesc",{token:n,network:t==null?void 0:t.chain})}),N.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:O,disabled:$,children:$?N.jsx(us,{size:"xs",inline:!0}):d("deposit.enableWithToken",{token:n})})]}),L&&N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"flex mb-4",children:[N.jsx("div",{className:"w-5",children:N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:d(j||"deposit.layerZeroDepositTip")})]}),N.jsx("div",{className:"my-2 ml-5 h-px border-b border-dashed border-line-divider-secondary"})]}),_&&N.jsxs("div",{className:"flex mb-4",children:[N.jsx("div",{className:"w-5",children:N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:d(Z)})]}),_&&N.jsx("div",{className:"my-2 ml-5 h-px border-b border-dashed border-line-divider-secondary"}),N.jsxs("div",{className:"flex mb-4",children:[N.jsx("div",{className:"w-5",children:!(_||L)&&N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1 text-xs text-functional-orange-1 whitespace-pre-line",children:d("deposit.noPrivateKeyWalletWarning")})]}),N.jsxs("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:[N.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4",children:[N.jsx("span",{className:"text-sm text-text-tertiary",children:d("deposit.arrivalTime")}),N.jsx(Tn,{content:N.jsx("div",{className:"grid grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:N.jsx("p",{children:d("deposit.arrivaltimeTooltip2")})}),placement:"top",children:N.jsx("span",{className:"text-text-primary font-medium text-right border-b-2 border-dashed border-line-divider-primary decoration-dashed text-sm",children:d("deposit.arrivalEstimated",{v:ee})})})]}),me&&N.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[N.jsx("span",{className:"text-sm text-text-tertiary",children:d("withdraw.feeRate")}),N.jsx(Tn,{content:d("deposit.feeRateTooltip"),placement:"top",children:N.jsx("span",{className:"text-sm text-text-primary font-medium border-b-2 border-dashed border-line-divider-primary decoration-dashed text-right",children:fe})})]}),N.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[N.jsx("span",{className:"text-sm text-text-tertiary",children:d("deposit.equity")}),N.jsx("span",{className:"text-sm text-text-primary font-medium",children:x?N.jsxs("span",{className:"flex items-center gap-1",children:[_t(i),N.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),_t((parseFloat(i)+parseFloat(x)).toString())," ",n]}):`${_t(i)} ${n}`})]})]}),N.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${ye.disabled||l?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:oe,disabled:ye.disabled||l,children:[(l||M)&&N.jsx(us,{size:"xs"}),ye.text]})]})},Lm=e=>e.toLocaleUpperCase()===gn?gn:Js,fs=e=>Lm(e.wallet)===gn,Hc=e=>Lm(e.wallet)===Js,Ri=e=>e?e==="perp"?Ne.PERPETUAL:e==="perp-v2"||e==="perp_v2"?Ne.PERPETUALV2:e:"",Bm="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAoCAYAAAABk/85AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABBMSURBVHgBvVt7kBTHef/17N77fRwSiNeBBAGBpVNJERKyoqOSuByiVLAScOKqJKAYJU4F8XCVY8d/cLiSkKSS4pDtKJKRdFhxYoNskTKS4jixFguEICAdiDtAvJb3cRzcg7u9vX1M5/t6puexO7u3Byd+VDOzPT3dPd/39ffqPoFbhJSymS5NVJ6yr7V2YfRRidrlMJWIECKC28Bnv5dslqZskjCeEhA0nvSPJ0SU5hQ1IA/DQGTPqqIIbgMLvjzcbAjxoBRoFlLSeKJWqjEFDY0++p6oCRmFFO2Aufvo1rIIbgFiLI3pA/mD11BZC/fjC0WUSoTKRp58IS80vyZrEylzjTDlLYxHYwgZKUqHNka+Uth4TWtlbWowvkZArjWlqBEikz4SNsmkdZXqB7WDaVrfV1SEje3/WhZFgSiIATbhN8Ai/HigDXkYwYRPJkwaT47PeAJt+RjBhE8PDm+QEGvpW/VLkglMUFeuFja13HvBtHHu1SOp3nktHMa3CmHEqAygDlniWzB2iR8NUVhMaPNWPv5yeo0hZcv4j0cqSsiN7z8XbvPWLlgVXwMz3UJk9I4nLekWmqD6t9WTUEzw1vme8zNqc84wzI0ff6+yLe+s8j2kwTdj/KQ+F1rpA9fxzRMvpTePm9TnhGjd+2chNd78Z2ObiVZrbYJaT4Ur4TYhhbMoPM8z7h3dZD+RVhU1MURrx9bydTlnE1Rpq5w3qTTjDqB/BO2//f10H825GXcAMiXb+z8c6SPiNXuIK7XOt+oE/WbVI2wmKBpLr9632nrbeVWVh7RSthfL5OL2trq+zLmEc8zxXSpN8cEBlFZW49OEGR/A2rcqmiBxxzDQmWgiowlbcO2RpUfStd6XnnpNfOsdVk26NfVFxDcVE/z92CsIsimOMAv04sy5hDIrbLWzlO9f+OJnkDwVwcRygVD9NIhwCcYDTPTBfa/jo3//W/z1OzGcLnsYdwqxaBLJ3rS6l9Z/mpD21ZJk3d4yspZIewjrFW/nfVtdaXXkukxWXePEpm/W9rT/3c+88/GpIBpsBV1e4/uO997B97+5QtUvnGpg4bQQyh9ejvJHlqFk1uO4FcTP7MPQwR2Id/wXdh/vxc/Ll+Hk45txpzByLYXBUwm49HFhMUPYasiRcjw6NyTmTQ9hLpUpDRa5bsYkjp03ceB4Cv93Ig29iiz1IzNtgcMEezWsO9FW0+q0cCYgZSMs1cNXbN/0PA698yOnq+oSgWfmh+lKy6ZuGioeXoayR5YjXDcV+cDSfvO9rRjcs9W6HwHeoolfMqbi6G+8gXjlNNwJmCMS/R1xpONewrvCyuLrld4vfLZI/OXSYiK6kbffSz0mvrMzgTf3JLXb6qwatz/nN3fdNyLMmVHbHngZwJK/Qv/esGQ22AZ4wUxYOM3AvInupKrvmYaiHJYkkSIDe/mC8/tYt4k950yMpCROLmpF96zluBVMrhK4bwJQWWz9HiSh7hoETvbkNiQ3T41gpDul7r06Ah5isYROmWBg06oylnyMBcyIP/77GC5eM7M8J3jcVNt4t57YVqM8Ix09NNLlrG49PNiPliVzcg7WNNnArzVaE2TiV1UEtxuIEROStPTpuw9cTOPwFWX5MEJSf3DpfowFVcUCyz4DLF9goDKHKeq6CXx4ReK1gxJXBl0KsPT3HBzSXjy0+pH2b9t7B6ua764pH1Xqc4GZ8BdbhnD8vDLejoekepd+25IwZB2vAj3SBm9HZZU1qJuUWzW0EyHbPkxhgNRJMuX6xV6kTYv4rHLe7Eg5xGecf+CrGAuWLxDY8YcGnn04N/EZk6qAJXOo7Ze4rauKh84n7ElK+5+tr/mhJBeGChP9dojP4Hf/ZU0FpkxwAzW+Sm1grHtlW8IpgwNc6NGaMzub9dCivIMNkFT9x5Ekjl0jlZLMfp5KWSrnh0dS6In5OTRwV2FGnKX+208beH5RfsIHgZm16XOGUlMjfZbqMSU0BRQbTJc6eP0bFbdFfA3uY9Oqcrtf6bsSo4XFCF4Npgo4Q3ZWMyv67O26gE8OvJt3MJbyMzekYsCcu/yT/8UnJn55Nq3aeDFw9yJcnrcKheDlpSHMv9sfKw7Sitp5XOLf2iVeOiDxzicS/3tGKjswoUz4GDWjVmCyMPHT90YCl6ntXuKZJ0uoFGO8MJVsJHlKov2UYryt87zRmVJFpfUPfH03m89m3AbYMM8OkJxG+viPuwSpIP+H999dmPSz5FZm0OTVQxI7jppKrWXio8sSL7xvSb5X/XScTtr6QCpt73go/M+0wtbnnynFeGPF50vQ9rO4urd4bzqT0oyn/x9kBjwY1EEhEbDlmobUNRMNFLz9Hj37cUfax4Sh+vkoBCzRq3elSQWFFCO+8XNTEXk0vHqI2l0R2PSbhvKMfvBBUqkaSwyl4/loLJwbyqt6/uqlIew/lrTesvjlfOzC+8P4h+cqA9/jPtmT2n+MV4H2sixPSKtB+rGYGdAY1AEb4nyYUmPg6TkGSsJOBtCXrmUwY5gJuyhY6RmyKuMVuY0763wmtvZgrty0mMB1J6+P3l6DGbXyJ2nFxP4B046CYPufAto956pH54aRDx8cS7BrCX/+3yZiZ36BWDi3CB90JlVbw9BRsnQibrp7ICcD7pm9QK0CbyxQWiQw9y6Be8lXnlLhl/ogBjCYCV+iYS4RA05fN7E/BwOUwf0dQ3kyq39qEsFdJgRhcqXVnsHtM5mg30vF0q7Ho77fjbbI/8H9M/IzwJFWx4UUlPuR0h/xBmPKRJ2qtvJFbqCm7rnzOv6CwLw7u6GfW/k1NNYbaL4vhBWPhvH1Xw/jdxeEMK0q/9hmgGDwO/xuqjhYtTExdXDF97Mn5B5DE5+ZxYXvuS4I6ZQJ1wtxvFHnd1XFaHR00wzS9SOd3/kwpSEEK2nnJPWk9Y7lDdFNTV6/6/EnFxHhQ8QAgxhhTXSQXErTDPhQT13QvPidwVjwhDMNbj4meImvMRoT7FnZc/O4h1JitCysJqAmupVW0JnS0WEzzJNZdQRBZVSZAX25XjbP78uqS5E9unot6ZSe6ylVEil3Qqm0dOq9bUdIJ1eaA1l9aoPb5VE3QUwIIr5GEBNmk9BUl7HKMLUfDouY0OaY9Hsa+cDvmaZmmss33U8+DMTs5eYpWgB4FdBtX14GpI7syKqrrRGorXLF9XSsjKRfIiTcxSQovuO6IzddD6Ga3qmnBVeB/sCxtMHNxYQg4nNbb3svE5j4fF9V7joJbnGlufNcEgVAuhJsFqyCOqNJn+qzm0tbHkAki7IFakeAIZZ9FyG7O7I6ZUPLTAiFi/DPp6bg7ct1+Js5ZzBLxOFkV6jN8eFqbDxzL5bc04uv3ncJFWUGeQJp3JfsxNWSYEOsmcCupya0ZgIHYJnE57YMb3vNBKXWKChjI3uBknBCZCbhLFvVGU0hHxbOK4Klsz3a2u5o4bxRPKjOhMNoT2paOHvKJqKskzgKzkrKp49sR2LX+sCOudNYnKS5jIKiZAjRvmLMqRlBSbGdbEsIXIoVYWJFGlVFaQzFQigrNYkBEj8pfRYvVm5APkyu8hM1E5r42tPJ1/6Vt2P41rabTiDmfIN95Zq9327A1LvGlv0cDRe703hi9TXAE/x5DY7tNW5ktrYHdRCkfjS4r9ISi9hM4AUNw1ltZtUm1DNGcbFFfMa96U6MhiB1pJFJ/NHaT58cdlSFzgFJjzvE95vfGMR4o5X6tG2v7UVJrxOlYJiIGPaJtSw7cHMIuNHvLxevmjh1LqVKF3E4aa9eZogmMCPkESZuc7k75bzXcHEvKgIMcSaCiBpE/NHav3w8RFupwklHuEbQTkXQdXskhn0dCYwXLtL3/uhdysUr1WVaW2vuzpieQzT6xuSIVmxbMjspvjc7Z1NeaqgOkrT5k0pbTBq28zJFYQ8D7F75GbfhZcjvsCtaVhrCb/W9gkLgJWo+4o/Wvmp6GVy6+11KvRrWf7dXqY3bBfexvOWGuueATRtvNZrUDFGRSITr9IYMB2O93o5GaP+256VlWQOkyN283ptCVSXtEZdZlB6umoqNb0fV/oDGPy2difJBazcsNky2YjCNhvowrQ6BIaMaz878GIWCdTy7qkFJuELamzTn87+46iRytAoQvpMjQs5vDIlXvlZP9iCMWwEb+y//Y6/siCZFwLkiexVYgV26yJjV9cPJUcOaiGAV5FsFvPEuSrOj1jAt54qKEEm5QLp+DmKPrcfBCcvw36clPrjolhMz/kg94zY8m4oKQxGfwSpoSX9hq4DBUlwo8YPaGzTn6hkV/kgW7j37+VKmBREOv7+hR6mQseL9oyNYRu92RBPK39KpB+m4Qa4Kov+3MfH5zrsnzKvgLDypid7t6xE7tN03EDOFmTMw6QkMl04EGRHsOfARtrz6A1+7P/2DZ/D55kUqE1k6fBU1V/epVSXjlv7nVbB6xl51vRPgVXDhl90wkzpkzzg5Iv0nGr64uALrlldh2iirgaV+665BbH2LDbl7CiIYSvrPmcWhxVkMsGfhc0ljB7ejd8d6RXC2CXz1Hkm5cOIIus8ew9Bw3I4yXVRVVqqIo+6eWZj1wK869cyEkdP7kKDrmzfmYduE/C7peKL/3BBuHB9w4gAb3vBApxOdnP1j95fIRQtKxPyZxaguh2rC0TMT/v2jcTLeI94TENAqx3vEUfWo9ZBhrOj68dRtevAsblFDPrOi9ivN4QHVwijNLaV917pw4tB7iMf8rlxpeSV+5ZEnUdswKee7fEzlOx9VYvvHo8T044jrx/vRFx2y9qjc7K0vV09fLC0CSmQfUXfgDYQ9u15SCH+44R5XlGi9snO675yoyNHzuxjDThkTP5MBlTX1CBcVts23eldhmy3jhcv7exDvtdxOLbkW9AlnJ0wLUCnek9LSlnT3eGOOtvSfPHxl54yHMqaS93AuM6EJdwB9cUSeft2shfpLlE8fZsKMnP6fy7RpKvRuoC267uFcr+rQGzBe2GLuBLlutKvfsy5WUxEpRfoL0Z0zs+KtwHQ0e0VUmFtb8OljS12ZWLz3udBDtFY/9fF4jH2rixd3/2fjQxDmC4A3X595isHNnsE5xKv1u5S+WELdet+z+jSEuaVr5/TFQcRn5N0PICawUV4J648pxhs8oXX2GAp7/rxoLdnylfzHFBh/0HjmOh5DV1zdOXMt6X7r+7wuqvSnj634zQngpOW2qsyozu/LrHaUziQXcN0VGiPfpAQKgH1yroXKn2B8wJLeYscfWXjsRdkYMpItJB/jMh5Lfbgk3BJZGTzepKVnG4mmGyg1sUK19xxVtKNW4VcvfrWUqaIMIbeUGUZLLqn3zQ1jgIcRTyHHXnIe6GCvNRfhM+EyIkTjqbHHNJ4wifCl4dZchM8EMyKdxgZaFc1Ez0b4AgVtI6zUjtc7Us8M9BMbtpQbRmshhNcYEwO8sA90cWFD1mgX75+pcuFM626+3vafqb6YbCaF2Qw2nEI02sLgGY/sFmQ7xaC7hSna93zl9v5MteHpk80U9z9FdqKJyNtIdG8kdtRa+wqil3R3vwlB34WINFOHe3bNjuAW8P/4M203oLS1YgAAAABJRU5ErkJggg==",Fm="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAoCAYAAAABk/85AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0WSURBVHgB1ZsNcFTVFYDPe7thd7NZsonIT6CwQWvAnwTaRNuxQoJ2SqpViW3RiiMgVq2dgcy0dnRqkwz9Ga0dNjOt2BYVi2hpVaSFBmyRRWBajUoIWIlYWERAhWE3xoT87O7rOfftDW/fu+9vEzrTb+bN7rvvvnd2z7n3nHN/ngR5kvh7US2AMkvKKHMBpFkgQRgUPAgJkvg9jtfjkj+yTy6cGgvVbI3BCFAUpRY/ZuExN/sZzh5EEo949tiHR0ySpBiMhG+ivAzQ/5qL/8UoT8rKU1CeDDF4IT95kpvKiY3hsFw0uFxRpBXDynZO3Ddlaaz/g3UtJfXJuJMbUOkkYzkeKwDcy8MjhkcLGiPu6I6bUZ48AnkSyiuAFvijQ3ng0ABM8YVDTYr6w0aEHJgG8piStcGrdpsqJqv4JhgFeVnWgpUhVMWPnjwJ5Tk0hK0Bul8JLFdAbs6jxdsR945vaCmavW6tthCVTy2wGWD05YFqhLU5pbegPOX8yYOXdPJ0WBqge1twlTJ6rVCIJ1AWDc051EjfUfmrwIG8gVQG9hw6DfHTvew8Mi4INeWlEPJ7wQFRNAKTBw3O5I2QKBqh0eyi0ADkcqTg0EZsGbXwP8AfaezwXbKSAmmtVT1SfOexbtj/YZJ910LKr5g4Fg1RAnac+RQ6LljKEoVaq3qzIviDLgeoiqjfw0G1PH4KozDafuc7GGQOAHTEwRoJOiANdfCylDReEpDcFtwLaqbhCsmLiVAq6fY2KPryP8ETusKyTtfJHmiPJ6Cnf4idH/l3J+zZvJF9r7luPlR84Sr2nQxRHSmFGZNCps+a/QNU2hFzWYvrAO7Eo/YycET8E/Q1f8JAs8OiEgXoF6U6Y7GOfN2O7J8GwZo2SJ15Dc6+c6/j+/wVj4Bv2v2m108kz0L7kQT7ZOeHD0H79q34+X5OvXGTJsP8O5ZBqKSUnZMhbpo92eCWGp9Cn7BFLIsUvmoJtrxyyAsyxJJfY694x7SKwR3lGCDxSnCxpMDT4BKufDkwlZ0PHn/WkRHGlC2CwOVPCK/19KdQ8Weg66Me9TxxBt7c3gYH33rD8pkVX7wSaq6tHzZExcTQcHygFkoKErH8BtTOEhgVmrE3tGwwvdyIRojyk2EDJNr8EUn2UCeKgAv0yufYGcHsPr2fH+g/C517YrB/90723SnV6JYqr64Fnz/AzicXj4Plvy9mrVRP07dRaQthVLEwQhIHeOU8Hnh46UN3+igjqAUXmCmRPXhsJV6fCqlTm4X3+mc8At7Sa3LKyM9v6TwJx870QTqjQNdbr8OWp5+AY+8dhHQqBW4gF/V+59vgCwTQPU2Bx/9WBAeO+gz1zofyCRY/JDVQ6/BjuR/ebdkGkO0B2dZ/BFxgpXwtop5A94bm5P6yTXtP2Pr5fPGPmwntvl8ayiPjMZivhvNK3U9MYkIGSqgXsAglezxNigKOMVO+kurGTKg4p2zM5EXsU2sE38UP5tShlk/KZ35+28twcN8+GE3eT39NWL6jBRxBKSdlTZR+EpEL1UDN01Irnv6+mnUle3UXZJboNDMDKC7yfTPlZ85+AL1v1oO35BpDYNUbwVsyJ+f6p9nUsuvt102VPzYUhBu/fh1UXFIOkydNgOMnP4aHV0Zh0cKbWJmW9Rv+AgffOzx83uurNDyPUk3qAVaQ0lo3q1mTQYHZZ5ALs3oOXVuBAb7ZGA/YiN+baGOzmhFwgJ3yM2ePwiAehJkRBk+ut3VbemZ8fjo8+fgvIBQ61+Ta1+xnhrhv2Xdyyjdt+YeqfB+WDfSi8q+AQY9RQ6Q4KyhY1zWBMGhzKKsi90I9ycoIy68XGiBMM64ydoVacEim/yikMc/PKdMonzN4Av3+AWMGlE7sZj3ELdFHf5yj5BMnP4HVa56De5fdllNOrF7zPGQq5kC6uoGdkwH0kPuwUhi1djvlc7ihkn3mdchVCQd1ON0tYxSuAhf0oRsZwsDK7hcon6M3An2nMk+oEtxALbxsUq62Hl65Cm66/jp2aCGjnPgsA5maBshUzgelbCacLZhueKbdCJfSRyfK51Dd1r9a16EpDQPo+mXMgyJWNzK3U93GPjlkhP7//NygfHI7voseGj7nRuDKV5/n3P1wF6OFXEzXocOGct4r0qh8JXQhK0vPuwcGC43D2rk2BlgbA9ewOGHRC2guyYAEVV4r/6/1+fTZ217P3BAxgAbQQsqnkS2HX+eKH35m4TRwCvl9LaqSn4fbMfDqe8Wj0d+h3y9k7odDhhj0jKWunkO40Fwm+XRRwLWD7nnmVXXiTkRC/Myw12yeXx9wRUbg6JXvz/YCvZEKsI4+TTVD5HpWr1nPBi6iXvHqzn+pv/PEu5BB18PJDBnnG638vxvXo2eF60kcCMumlyTn5QrGAidlTtc/zVzPpi3bDb2ip6dXDbzl1TgDdyHIu9fB/xPe7AK6oReQbycfz/w/tn6rgNufbenc/2t9vhYqoykIu15gpmQKuvpe8eyGTWrgvXYRZHpOg3fTT8Hz5ouYBd3CrssFiqEXWLkYu7GBFU0LzQM8nynVkSQXRJNCQjfEjRC47Ak2iNIqnxQ5GH982B1xI5ChtMovyLqmoWyZMpS0NIDY9TwndD3DgReDLQu8eKQr68HTuZXFAirzCAywL24+5cwXXvKJAzTgMosvMVGhBHF0QVIHWMCNYMh2pt6vxghNdkRG0Cu/EOvSwQ2R7tlvKqts4gShkqmVU84vDLyoZG3gzVD+PyYInld/y879xWmDHKsVLFI+KdItNCq2Cu47DwgKM3BUxnXYneACbcDlgVlrBA5XPocbIXVml+mzH1i2wFC29HsPwry5XzLk/Dzwput1y62YCaWwR0gYjIsP74LABcZZVIsFEwaNXN24IqprN7IWysSlShkU6x6QUx9dh34eR2QEvfKHy0u/gn66U/jsmkiJYfWKDaxwzueBFd/NKecxgf2mfVsNz6IBmIJBuS/2Bwj4PzNcp4m1mKhFZqFeYDe9wKE6dnXJ/wsNIENMLqn/LMYCsQNotlN1R7kZjtYIZsqnGNCHwTmV2MWeoyUUKIDq8tKcMu7fRTGBBV40DJPd9RpLPfWk6u4BamJFRzawQKznmRhYQgrd+1jWrwtmPamMgi7VsTMUrRcLiNNuuux6QFGzJCtN4BDaXMWzIy1kGNFEG1c+h7Ilv2bELOIudD1khLaNT+aUU9n8BUtzyijYpr71M3UCTvs70TgUCz6asRJO9cw2yNj7K5MRqg42HR0/N0bgcztOpqPpnvL7BBdo89aL0hJ1HOD3RsEF5wKzsSfo0SufGDz6G7CC/Hv72/vhhyvuNlxjgVeH1HMKU8+XDOUsE0J3VCW3gQhaoHcCVzgFWjpuvtKZ8gmzNWi2cw7ICyEldcmkokit4AIzI2gRKZ8gFzRgYgQ+3UBBl4KvFu2IV4+MqafeFY31pKHu9ruh4Y6FMK+q23AP+eVG96NXx5DrMQm+a/m2xXMjYZ+32Wks4FgZwUz5HJqm0McCgvz9oltvNKSj2sBrhkypJ64B+CQFrirug9smJWFmqQf/moz+WhG22uhmyx0MeUPKbxY/N85bPzG8KP/IM/39P7ptzIAkw3xwASmRFt4Lxn8DpAJ1gGWnfEZmAAcFA+Ad91XDpcrLZxjm+fe89wns7zoCp08eN32kNNgHM6d/Dm6sCMK0wBB4JXVbyvVVZXDR+AD4CwC2CXI+aqUUDIVTxnlgoXyiEf58biu7YXomsbUoKklsg6wreGBOJ16zV74Gu41ZBG1PeWqXumeA1o13vLAejusW7CdPvxiqr62HMvwkysIBtk2RPrWQy4mKN2o4SimtsN2YpUArbJRyNr2Jtya+EtyRz75QMoJorsgOMpx+i4oe2qBFO+T41sSut96A9u1qcL36hgYov1Rd+aKxxLyZ4w2K12K6UyGLk7VeLTSuaN1iuzWxA7Oe2cZiAYkd4bA0NLQj+2bIeWfMhAWxQNU6mo+yldf5YRI6j306bAgO+fnKzxXDFVPC7LsVp7ohNv4u9kaPpTyaL6LshxZwaJqBG4SnpTSnxAZ1NiNrti80DQscb87l5OuO3CD5p7QWz+1i3RKnRSgdtpXHty3y7enk52kgZ6f4LK2SlHUDC1CeBOf1/4ncjhbbKfpEW3CxpL49EoFRRCooSRZMvLWl8NLHcsYgaITFAKMvD9T3yOgFjdwxT8P5lafdByrC2StKbf4IyJ5mrHwnjBDawg5yUWsm+XFzyYKkMO1FI0RAfUtmxPKy0BinGZUvTrNvRnkSUBo+OvKo1dNbNy9Ltmm900UqhsYQ9KZixM29UkE4mRnoboV+b9RM8Xo0hnAtD9QWSIqPmipezzlD5C8vA1Eniue4MoAWtqFLhlp0T1Vo7Qhb3M99TTUp+yZ0pPs/3um94JqOUXpNlQ7aRhPJHtrXVOmgLJ+m1ztG6TXVWtq5wGQpAnmU2SgoT8bPPF9T/S+t/b7McgGVIAAAAABJRU5ErkJggg==",Rm=({isOpen:e,isLoading:t=!1,onClose:n,accountChains:r,defaultChainId:o,defaultSymbol:s,defaultAccountType:i,balances:l,wagmiHooks:a,onDeposit:c,onCopy:u,getUserBizConfig:d,saveUserBizConfig:p,onChainChange:f,onTokenChange:h})=>{const{t:m}=It(),x=g.useMemo(()=>r.map(V=>({...V,key:Ri(V.key)})),[r]),T=g.useMemo(()=>Ri(i),[i]),w=g.useMemo(()=>x.some(V=>V.key===Ne.PERPETUALV2),[x]),P=g.useMemo(()=>{var X;if(!x||x.length===0)return T;const V=x.find(Q=>Q.key===T);return(V==null?void 0:V.key)||((X=x[0])==null?void 0:X.key)||T},[x,T]),[A,k]=g.useState(P),B=g.useCallback(V=>{var X;return((X=x.find(Q=>Q.key===V))==null?void 0:X.chains)||[]},[x]),F=B(P),b=()=>{var ue;if(!F||F.length===0)return{chainId:o||1,token:""};const V=o||((ue=F[0])==null?void 0:ue.chainId),X=F.find(Se=>Se.chainId===V)||F[0],Q=(X==null?void 0:X.tokenList)||[],we=(s||"").toUpperCase();if(we&&Q.length>0){const Se=Q.find(Ie=>(Ie.token||Ie.symbol||"").toUpperCase()===we);if(Se)return{chainId:X.chainId,token:Se.token||Se.symbol||""}}if(we)for(const Se of F){const xe=((Se==null?void 0:Se.tokenList)||[]).find(Ae=>(Ae.token||Ae.symbol||"").toUpperCase()===we);if(xe)return{chainId:Se.chainId,token:xe.token||xe.symbol||""}}const Y=Q.length>0?X:F.find(Se=>(Se.tokenList||[]).length>0)||X,se=((Y==null?void 0:Y.tokenList)||[])[0];return{chainId:(Y==null?void 0:Y.chainId)||X.chainId||1,token:(se==null?void 0:se.token)||(se==null?void 0:se.symbol)||""}},[{chainId:v,token:E}]=g.useState(()=>b()),[I,$]=g.useState(v),C=g.useMemo(()=>x.find(V=>V.key===A)||x[0],[x,A]),D=g.useMemo(()=>(C==null?void 0:C.chains)||[],[C]),y=g.useMemo(()=>{var Y,se;if(!C||!Hc(C.account)||!(A===Ne.SPOT||A===Ne.PERPETUALV2))return!1;const Q=!!((Y=C.walletOptions)!=null&&Y.evm),we=!!((se=C.walletOptions)!=null&&se.mpc);return Q&&we},[C,A]),O=g.useCallback(()=>{var V,X;return(V=C==null?void 0:C.walletOptions)!=null&&V.evm?"evm":(X=C==null?void 0:C.walletOptions)!=null&&X.mpc||C!=null&&C.account&&fs(C.account)?"mpc":"evm"},[C]),[M,S]=g.useState(()=>y?null:O()),L=g.useRef(A),j=g.useRef(y);g.useEffect(()=>{const V=L.current!==A,X=!j.current&&y;if(L.current=A,j.current=y,y){(V||X)&&S(null);return}S(O())},[A,y,O]);const z=g.useMemo(()=>{if(!C)return;if(!y)return C.account;if(!M)return;const V=C.walletOptions;return M==="mpc"?(V==null?void 0:V.mpc)||C.account:(V==null?void 0:V.evm)||C.account},[C,M,y]),W=g.useMemo(()=>z&&fs(z)?gn:Js,[z]),_=D.find(V=>V.chainId===I)||D[0],[Z,q]=g.useState(E),H=g.useCallback(V=>{$(V),f==null||f(V)},[f]),ee=g.useCallback(V=>{q(V),h==null||h(V)},[h]),fe=g.useMemo(()=>{const V=(Z||"").toLowerCase();if(!V)return"0";const X=(l==null?void 0:l[A])||(A===Ne.PERPETUAL?l==null?void 0:l.perp:void 0),Q=X==null?void 0:X[V];return typeof Q=="string"&&Q.length>0?Q:"0"},[l,A,Z]),[me,ye]=g.useState(!1),ve=V=>{V.target===V.currentTarget?ye(!0):ye(!1)},oe=V=>{me&&V.target===V.currentTarget&&n(),ye(!1)};return e?Ke.createPortal(N.jsx("div",{className:"edgex-components",children:N.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:N.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-99 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:ve,onMouseUp:oe,"aria-hidden":"true",children:N.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl border-2 border-solid border-line-divider-secondary",onClick:V=>{V.stopPropagation()},children:[N.jsxs("div",{className:"flex items-center justify-between mb-4",children:[N.jsx("h2",{className:"text-lg font-semibold text-white",children:m("deposit.title")}),N.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:N.jsx(M0,{className:"h-4 w-4"})})]}),N.jsx(_h,{selectedAccount:A,options:x.map(V=>({value:V.key,label:V.key===Ne.SPOT?m("account.spot"):V.key===Ne.PERPETUAL?m(w?"account.perpetual-v1":"account.perp"):V.key===Ne.PERPETUALV2?m("account.perpetual-v2"):V.key})),onAccountChange:V=>{var xe,Ae;const X=V||A;k(X);const Q=B(X);if(!Q||Q.length===0)return;const we=Q.find(lt=>lt.chainId===I),Y=we?we.chainId:Q[0].chainId;$(Y),f==null||f(Y);const se=Q.find(lt=>lt.chainId===Y),ue=(se==null?void 0:se.tokenList)||[],Ie=ue.some(lt=>(lt.symbol||lt.token)===Z)?Z:((xe=ue[0])==null?void 0:xe.symbol)||((Ae=ue[0])==null?void 0:Ae.token)||"";Ie&&(q(Ie),h==null||h(Ie))},className:"w-full"}),N.jsx(Wh,{currentActiveChain:_,chainList:D,onChainChange:H,curSelectToken:Z,onTokenChange:ee,walletType:W,accountType:A}),y&&!M&&N.jsxs("div",{className:"mb-4",children:[N.jsx("div",{className:"h-px w-full bg-[#404040] my-4"}),N.jsx("button",{type:"button",onClick:()=>S("evm"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:m("deposit.connectedWalletTitle")}),N.jsx("div",{className:"flex items-center gap-1 shrink-0",children:N.jsx("img",{src:Bm,className:"w-12 h-5"})})]}),N.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:m("deposit.connectedWalletDesc")})]})}),N.jsxs("div",{className:"flex items-center my-2",children:[N.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"}),N.jsx("span",{className:"mx-4 text-xs text-text-tertiary",children:m("deposit.or")}),N.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"})]}),N.jsx("button",{type:"button",onClick:()=>S("mpc"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:m("deposit.externalWalletTitle")}),N.jsx("div",{className:"flex items-center gap-1 shrink-0",children:N.jsx("img",{src:Fm,className:"w-12 h-5"})})]}),N.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:m("deposit.externalWalletDesc")})]})})]}),(!y||M)&&N.jsxs(N.Fragment,{children:[z&&fs(z)&&N.jsx(X3,{address:z.smartWalletAddress,currentActiveChain:_,selectedToken:Z,accountType:A,accountId:z.accountId,accountKey:C==null?void 0:C.key,onDeposit:c,onCopy:u,getUserBizConfig:d,saveUserBizConfig:p,onClose:n}),z&&Hc(z)&&N.jsx(dP,{address:z.ethAddress,currentActiveChain:_,selectedToken:Z,accountType:A,accountId:z.accountId,accountKey:C==null?void 0:C.key,platformBalance:fe,isLoading:t,wagmiHooks:a,onChainChange:H,onDeposit:c,onClose:n})]})]})})})}),document.body):null},Gc=6,ps=6,jm="#22FD73",fP=(e,t=Gc)=>{const n=Number(e);return!Number.isFinite(n)||n<0?t:Math.floor(n)},pP=e=>{if(e==null||e==="")return null;try{const t=new ke(e);return!t.isFinite()||t.isNaN()||t.lte(0)?null:t.decimalPlaces()??0}catch{return null}},hs=(e,t)=>{if(!e)return e;const n=Math.max(0,Math.floor(t));if(e===".")return n===0?"0":"0.";if((e.match(/\./g)||[]).length!==1)return e;const[o,s=""]=e.split(".");return n===0?o:s.length<=n?e:`${o}.${s.slice(0,n)}`},hP=e=>e?e.length<=ps*2?{start:e,middle:"",end:""}:{start:e.slice(0,ps),middle:e.slice(ps,-ps),end:e.slice(-ps)}:{start:"",middle:"",end:""},mP=({withdrawAmount:e,curSelectToken:t,tokenInfo:n,currentActiveChain:r,platformBalance:o="0",fee:s="0.00",decimals:i=Gc,walletType:l="evm",receiverAddress:a="",accountType:c="perpetual",onWithdrawAmountChange:u,onReceiverAddressChange:d,onAmountChanged:p,showPoolBalanceInsufficientTip:f=!1})=>{const{t:h}=It(),m=g.useRef(null),[x,T]=g.useState(0),w=g.useMemo(()=>{const _=fP((n==null?void 0:n.decimals)??i,Gc),Z=pP((n==null?void 0:n.stepSize)??(n==null?void 0:n.stepsize));return Z===null?_:Math.min(_,Z)},[i,n==null?void 0:n.decimals,n==null?void 0:n.stepSize,n==null?void 0:n.stepsize]),P=g.useMemo(()=>{if(c==="spot"||!Pn(r==null?void 0:r.chainId)){const _=new ke(e||"0").minus(s||"0");if(_.isNegative()||_.isZero())return"0";const Z=Math.min(_.decimalPlaces()??0,18);return _.decimalPlaces(Z,ke.ROUND_DOWN).toString()}return e||"0"},[e,s,r==null?void 0:r.chainId,c]),A=g.useMemo(()=>o||"0",[o]),k=g.useMemo(()=>{const _=(n==null?void 0:n.feeRate)||(n==null?void 0:n.withdrawFeeRate)||(r==null?void 0:r.feeRate)||0;try{return new ke(_||0).times(100).toString()}catch{return"0"}},[n==null?void 0:n.feeRate,n==null?void 0:n.withdrawFeeRate,r==null?void 0:r.feeRate]),B=g.useMemo(()=>k==="0",[k]),F=g.useMemo(()=>(t||"").toUpperCase()==="USDC",[t]),b=g.useMemo(()=>{const _=Number(r==null?void 0:r.chainId),Z=String((r==null?void 0:r.chain)||"").trim().toUpperCase();return _===33431||_===3343||Z==="EDGE"},[r==null?void 0:r.chainId,r==null?void 0:r.chain]),v=g.useMemo(()=>{const _=(t||"").toUpperCase();return _==="USDT"||_==="USDC"},[t]),E=g.useMemo(()=>F&&B,[F,B]),I=g.useMemo(()=>!b&&E,[b,E]),$=g.useMemo(()=>E,[E]),C=g.useMemo(()=>!E,[E]),D=g.useMemo(()=>I,[I]),y=g.useMemo(()=>c===Ne.PERPETUAL&&Pn(r==null?void 0:r.chainId),[c,r==null?void 0:r.chainId]),O=c===Ne.SPOT,M=g.useMemo(()=>Pn(r==null?void 0:r.chainId)?l==="mpc"?"withdraw.noticeDescWithClaim":"withdraw.externalWalletEthNoticeDesc":"withdraw.crossChainTipsWithGas",[r==null?void 0:r.chainId,l]),S=g.useMemo(()=>hP(a),[a]),L=()=>{var _;T(((_=m.current)==null?void 0:_.scrollLeft)??0)};g.useEffect(()=>{L()},[a]);const j=_=>{const Z=_.target.value,q=hs(Z,w),ee=ds(q,A||"0");if(ee.isValid){const fe=hs(ee.formattedValue,w);u(fe),ee.errorType}else return ee.errorType==="exceed_balance",void 0;p==null||p(hs(ee.formattedValue,w))},z=()=>{const _=A||"0",Z=hs(_,w),q=ds(Z,_),H=hs(q.formattedValue,w);u(H),p==null||p(H)},W=()=>{const _=parseFloat(o||"0"),Z=parseFloat(e||"0");if(Z>0){const q=_-Z,H=_t(Math.max(0,q).toString());return N.jsxs("span",{className:"flex items-center gap-1",children:[_t(o||"0"),N.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),H," ",t]})}return`${_t(o||"0")} ${t}`};return N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[N.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[N.jsx("input",{type:"text",placeholder:h("deposit.amount"),value:e,onChange:j,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-hidden border-none p-0 h-full"}),N.jsx("button",{onClick:z,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:h("deposit.max")})]}),N.jsx("div",{className:"h-px bg-line-divider-secondary mb-2"}),N.jsxs("div",{className:"flex justify-between items-center",children:[N.jsx(Tn,{content:h("withdraw.availableDesc"),children:N.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:h("deposit.available")})}),N.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:W()})]})]}),l==="mpc"&&(c==="spot"||!Pn(r==null?void 0:r.chainId))?N.jsxs("div",{className:"relative bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3 overflow-hidden",children:[a?N.jsx("div",{"aria-hidden":"true",className:"absolute inset-y-0 left-3 right-3 flex items-center pointer-events-none overflow-hidden",children:N.jsxs("div",{className:"inline-flex whitespace-pre text-[12px] font-medium",style:{transform:`translateX(-${x}px)`},children:[N.jsx("span",{className:"font-medium",style:{color:jm},children:S.start}),S.middle?N.jsx("span",{className:"text-text-primary font-medium",children:S.middle}):null,S.end?N.jsx("span",{className:"font-medium",style:{color:jm},children:S.end}):null]})}):null,N.jsx("input",{ref:m,type:"text",placeholder:h("withdraw.receiverAddress"),value:a,onChange:_=>{d==null||d(_.target.value),L()},onScroll:L,onClick:L,onKeyUp:L,onSelect:L,className:`relative z-10 flex-1 bg-transparent text-[12px] font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-hidden border-none p-0 h-full ${a?"text-transparent":"text-text-primary"}`,style:a?{caretColor:"var(--color-text-primary, #f9f9f9)"}:void 0})]}):null,c===Ne.PERPETUAL&&N.jsxs("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:[N.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:h(M)}),N.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:h("withdraw.commonWithdraw")})]}),f&&N.jsxs("div",{className:"flex mb-4",children:[N.jsx("div",{className:"w-5",children:N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:h("withdraw.poolBalanceInsufficientTip")})]}),D&&N.jsxs("div",{className:"flex mb-4",children:[N.jsx("div",{className:"w-5",children:N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:h("withdraw.largeWithdrawFeeTip")})]}),N.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[N.jsxs("div",{className:"flex items-center justify-between h-[18px] leading-[18px]",children:[O?N.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:h("withdraw.speed")}):N.jsx(Tn,{content:N.jsxs("div",{children:[N.jsx("div",{children:h("withdraw.speedNote")}),N.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[N.jsx(as,{selectedLevel:Wt.FAST,maxLevel:3}),N.jsx("span",{children:h("withdraw.speedNoteSpeed1")})]}),N.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[N.jsx(as,{selectedLevel:Wt.Medium,maxLevel:3}),N.jsx("span",{children:h("withdraw.speedNoteSpeed2")})]}),N.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[N.jsx(as,{selectedLevel:Wt.SLOW,maxLevel:3}),N.jsx("span",{children:h("withdraw.speedNoteSpeed3")})]})]}),children:N.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:h("withdraw.speed")})}),N.jsx("div",{className:"flex items-center",children:O?N.jsx("span",{className:"text-text-primary text-sm leading-4 font-medium",children:h("deposit.arrivalEstimated",{v:"5"})}):N.jsx(as,{selectedLevel:y?Wt.SLOW:Wt.FAST,maxLevel:3})})]}),(c==="spot"||!Pn(r==null?void 0:r.chainId))&&!$&&N.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[B||!v?N.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:B?h("withdraw.fee"):`${h("withdraw.fee")}/${h("withdraw.feeRate")}`}):N.jsx(Tn,{className:"w-[320px] font-normal flex items-center justify-center",content:N.jsx("span",{className:"flex items-center justify-center text-center",children:h("withdraw.feeCalculationTip")}),children:N.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:`${h("withdraw.fee")}/${h("withdraw.feeRate")}`})}),N.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[s," ",t,!B&&` / ${k}%`]})]}),C&&N.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[N.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:h(Pn(r==null?void 0:r.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),N.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[_t(P)," ",t]})]})]})]})};let at=null;const qc={accountChains:[],defaultAccountType:""},zm=g.forwardRef((e,t)=>{const[n,r]=g.useState(!1),[o,s]=g.useState(!1),[i,l]=g.useState(qc),a=g.useCallback(h=>{l(h||qc),r(!0)},[]),c=g.useCallback(h=>{l(m=>({...m,...h}))},[]),u=g.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),d=g.useCallback(h=>{s(h)},[]),p=g.useCallback(()=>n,[n]),f=g.useCallback(()=>o,[o]);return g.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:c,setWithdrawLoading:d,isOpen:p,isLoading:f}),[a,u,c,d,p,f]),g.useEffect(()=>(at={openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:c,setWithdrawLoading:d,isOpen:p,isLoading:f},()=>{at=null}),[a,u,c,d,p,f]),n?N.jsx(Hm,{isOpen:n,isLoading:o,onClose:u,config:i.config||{symbol:"USDT"},accountChains:i.accountChains,balances:i.balances,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAmount:i.defaultAmount,defaultAccountType:i.defaultAccountType,currentEquity:i.currentEquity??5e3,platformBalance:i.platformBalance||"0",fee:i.fee,wagmiHooks:i.wagmiHooks,onWithdraw:i.onWithdraw,onAccountChange:i.onAccountChange,onChainChange:i.onChainChange,onTokenChange:i.onTokenChange,onAmountChanged:i.onAmountChanged}):null});zm.displayName="WithdrawManager";const Um=e=>{if(!at){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}at.openWithdraw(e||qc)},Wm=()=>{if(!at){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}at.closeWithdraw()},_m=e=>{if(!at){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}at.updateWithdrawOptions(e)},ji=e=>{if(!at){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}at.setWithdrawLoading(e)},bP=()=>at?at.isOpen():!1,Vm=()=>at?at.isLoading():!1,gP=()=>({openWithdraw:Um,closeWithdraw:Wm,updateWithdrawOptions:_m,setWithdrawLoading:ji,isOpen:bP,isLoading:Vm}),yP=({accountChains:e,defaultChainId:t,defaultSymbol:n,defaultAmount:r="",defaultAccountType:o,currentEquity:s,platformBalance:i="0",balances:l,fee:a="0.00",isLoading:c=!1,onWithdraw:u,onClose:d,onChainChange:p,onTokenChange:f,onAmountChanged:h,onAccountChange:m})=>{var we;const{t:x}=It(),T=g.useMemo(()=>e.map(Y=>({...Y,key:Ri(Y.key)})),[e]),w=g.useMemo(()=>Ri(o),[o]),P=g.useMemo(()=>T.some(Y=>Y.key===Ne.PERPETUALV2),[T]),A=g.useMemo(()=>{var se;if(!T||T.length===0)return w;const Y=T.find(ue=>ue.key===w);return(Y==null?void 0:Y.key)||((se=T[0])==null?void 0:se.key)||w},[T,w]),[k,B]=g.useState(A),F=g.useCallback(Y=>{var se;return((se=T.find(ue=>ue.key===Y))==null?void 0:se.chains)||[]},[T]),b=g.useMemo(()=>T.find(Y=>Y.key===k)||T[0],[T,k]),v=g.useMemo(()=>(b==null?void 0:b.chains)||[],[b]),E=g.useMemo(()=>{var Ie,xe;if(!b||!Hc(b.account)||!(k===Ne.SPOT||k===Ne.PERPETUALV2))return!1;const ue=!!((Ie=b.walletOptions)!=null&&Ie.evm),Se=!!((xe=b.walletOptions)!=null&&xe.mpc);return ue&&Se},[b,k]),I=g.useCallback(()=>{var Y,se;return(Y=b==null?void 0:b.walletOptions)!=null&&Y.evm?"evm":(se=b==null?void 0:b.walletOptions)!=null&&se.mpc||b!=null&&b.account&&fs(b.account)?"mpc":"evm"},[b]),[$,C]=g.useState(()=>E?null:I());g.useEffect(()=>{C(E?null:I())},[k,E,I]);const D=g.useMemo(()=>{if(!b)return;if(!E)return b.account;if(!$)return;const Y=b.walletOptions;return $==="mpc"?(Y==null?void 0:Y.mpc)||b.account:(Y==null?void 0:Y.evm)||b.account},[b,E,$]),y=g.useMemo(()=>D&&fs(D)?"mpc":"evm",[D]),O=y==="mpc"?gn:Js,M=g.useMemo(()=>{if(!v||v.length===0)return{chainId:1,tokenSymbol:""};const Y=xe=>{const Ae=xe||[];if(!Ae.length)return"";const Ge="USDC".toUpperCase(),Vn=Ae.find(Ht=>(Ht.token||Ht.symbol||"").toUpperCase()===Ge)||Ae[0];return Vn.token||Vn.symbol||""};if(n){const xe=n==null?void 0:n.toUpperCase();for(const Ae of v){const lt=Ae.tokenList||[];let Ge;if(xe&&(Ge=lt.find(Vt=>(Vt.token||Vt.symbol||"").toUpperCase()===xe)),Ge){const Vt=Ge.token||Ge.symbol||n||"";return{chainId:Ae.chainId,tokenSymbol:Vt}}}}if(t){const xe=v.find(Ge=>Ge.chainId===t)||v[0],Ae=xe.tokenList||[],lt=Y(Ae);return{chainId:xe.chainId,tokenSymbol:lt}}const se="USDC",ue=xe=>Array.isArray(xe.tokenList)&&xe.tokenList.some(Ae=>(Ae.token||Ae.symbol||"").toUpperCase()===se),Se=v.find(ue)||v[0];if(!Se)return{chainId:1,tokenSymbol:""};const Ie=Y(Se.tokenList);return{chainId:Se.chainId,tokenSymbol:Ie}},[v,t,n]),[S,L]=g.useState(()=>M.chainId),[j,z]=g.useState(()=>M.tokenSymbol),[W,_]=g.useState(r),[Z,q]=g.useState(""),H=g.useCallback(Y=>{L(Y),p==null||p(Y)},[p]),ee=g.useCallback(Y=>{z(Y),f==null||f(Y)},[f]),fe=g.useRef(!0),me=g.useRef(j),ye=g.useRef(S);g.useEffect(()=>{if(fe.current){fe.current=!1,me.current=j,ye.current=S;return}(me.current!==j||ye.current!==S)&&(_(""),me.current=j,ye.current=S)},[j,S]);const ve=v&&v.length>0?v.find(Y=>Y.chainId===S)||v[0]:null,oe=(we=ve==null?void 0:ve.tokenList)==null?void 0:we.find(Y=>Y.token===j),V=g.useMemo(()=>{const Y=new ke(W||"0"),se=new ke(a||"0"),ue=Pn(S);return oe!=null&&oe.minWithdrawSize&&Y.lt(oe.minWithdrawSize)?{text:x("withdraw.minWithdrawParsed",{amount:oe.minWithdrawSize,token:oe.symbol||oe.token}),disabled:!0}:!W||Y.isZero()||!ue&&Y.isLessThan(se)?{text:x("withdraw.confirmWithdraw"),disabled:!0}:y==="mpc"&&(!ue||k==="spot")&&!Z.trim()?{text:x("withdraw.invalidReceiverAddress"),disabled:!0}:{text:x("withdraw.confirmWithdraw"),disabled:!1}},[x,S,W,y,Z,a,k,oe]),X=g.useMemo(()=>{const Y=(j||"").toLowerCase();if(!Y)return i||"0";const se=(l==null?void 0:l[k])||(k===Ne.PERPETUAL?l==null?void 0:l.perp:void 0),ue=se==null?void 0:se[Y];return typeof ue=="string"&&ue.length>0?ue:i||"0"},[l,k,j,i]),Q=g.useCallback(async()=>{ji(!0);try{if(u){const se={amount:new ke(W||"0").toString(),chainId:S,tokenAddress:(oe==null?void 0:oe.tokenAddress)||"",coinId:(oe==null?void 0:oe.coinId)||"",tokenSymbol:j,accountType:k,selectedToken:oe};y==="mpc"&&(!Pn(S)||k==="spot")&&(se.receiverAddress=Z),u(se)}}catch{ji(!1)}},[u,k,oe,W,S,j,y,Z]);return!v||v.length===0?N.jsx("div",{className:"text-center py-8",children:N.jsx("p",{className:"text-gray-400",children:"No chains available"})}):ve?N.jsxs(N.Fragment,{children:[N.jsx(_h,{selectedAccount:k,options:T.map(Y=>({value:Y.key,label:Y.key===Ne.SPOT?x("account.spot"):Y.key===Ne.PERPETUAL?x(P?"account.perpetual-v1":"account.perp"):Y.key===Ne.PERPETUALV2?x("account.perpetual-v2"):Y.key})),onAccountChange:Y=>{var Vt,Vn;const se=Y||k;B(se),m==null||m(se);const ue=F(se);if(!ue||ue.length===0)return;const Se=ue.find(Ht=>Ht.chainId===S),Ie=Se?Se.chainId:ue[0].chainId;L(Ie),p==null||p(Ie);const xe=ue.find(Ht=>Ht.chainId===Ie),Ae=(xe==null?void 0:xe.tokenList)||[],Ge=Ae.some(Ht=>(Ht.symbol||Ht.token)===j)?j:((Vt=Ae[0])==null?void 0:Vt.symbol)||((Vn=Ae[0])==null?void 0:Vn.token)||"";Ge&&(z(Ge),f==null||f(Ge))},className:"w-full"}),N.jsx(Wh,{currentActiveChain:ve,chainList:v,onChainChange:H,curSelectToken:j,onTokenChange:ee,walletType:O,accountType:k,showChainSpeed:k!==Ne.SPOT,txType:"withdraw"}),E&&!$&&N.jsxs("div",{className:"mb-4",children:[N.jsx("div",{className:"h-px w-full bg-[#404040] my-4"}),N.jsx("button",{type:"button",onClick:()=>C("evm"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:x("withdraw.connectedWalletTitle")}),N.jsx("div",{className:"flex items-center gap-1 shrink-0",children:N.jsx("img",{src:Bm,className:"w-12 h-5",alt:"EVM"})})]}),N.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:x("withdraw.connectedWalletDesc")})]})}),N.jsxs("div",{className:"flex items-center my-2",children:[N.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"}),N.jsx("span",{className:"mx-4 text-xs text-text-tertiary",children:x("deposit.or")}),N.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"})]}),N.jsx("button",{type:"button",onClick:()=>C("mpc"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:x("withdraw.externalWalletTitle")}),N.jsx("div",{className:"flex items-center gap-1 shrink-0",children:N.jsx("img",{src:Fm,className:"w-12 h-5",alt:"MPC"})})]}),N.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:x("withdraw.externalWalletDesc")})]})})]}),(!E||$)&&N.jsxs(N.Fragment,{children:[N.jsx(mP,{withdrawAmount:W,curSelectToken:j,tokenInfo:oe,curSelectTokenData:{balance:oe==null?void 0:oe.balance,allowance:oe==null?void 0:oe.allowance},currentActiveChain:ve,currentEquity:s||0,decimals:(oe==null?void 0:oe.decimals)??6,platformBalance:X,fee:a,walletType:y,accountType:k,receiverAddress:Z,onWithdrawAmountChange:_,onReceiverAddressChange:q,onAmountChanged:h}),N.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||c?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:Q,disabled:V.disabled||c,children:[c&&N.jsx(us,{size:"xs"}),V.text]})]})]}):N.jsx("div",{className:"text-center py-8",children:N.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Hm=({isOpen:e,isLoading:t=!1,defaultAccountType:n,onClose:r,config:o,accountChains:s,defaultChainId:i,defaultSymbol:l,defaultAmount:a="",currentEquity:c=5e3,platformBalance:u="0",balances:d,fee:p,wagmiHooks:f,onWithdraw:h,onChainChange:m,onTokenChange:x,onAmountChanged:T,onAccountChange:w})=>{const{t:P}=It(),[A,k]=g.useState(!1),B=b=>{b.target===b.currentTarget?k(!0):k(!1)},F=b=>{A&&b.target===b.currentTarget&&r(),k(!1)};return e?Ke.createPortal(N.jsx("div",{className:"edgex-components",children:N.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:N.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-99 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:B,onMouseUp:F,"aria-hidden":"true",children:N.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:b=>{b.stopPropagation()},children:[N.jsxs("div",{className:"flex items-center justify-between mb-4",children:[N.jsx("h2",{className:"text-lg font-semibold text-white",children:P("withdraw.withdraw")}),N.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:r,"aria-label":"Close",children:N.jsx(M0,{className:"h-4 w-4"})})]}),N.jsx(yP,{accountChains:s,defaultChainId:i,defaultSymbol:l,defaultAmount:a,defaultAccountType:n,currentEquity:c,platformBalance:u,balances:d,fee:p,isLoading:t,wagmiHooks:f,onWithdraw:h,onClose:r,onChainChange:m,onTokenChange:x,onAmountChanged:T,onAccountChange:w})]})})})}),document.body):null};le.ChromeLoader=us,le.ComponentProvider=gb,le.DEFAULT_LOCALE=bs,le.Deposit=Rm,le.DepositManager=Om,le.LOCALE_NAMES=hb,le.LoadingSpinner=us,le.SUPPORTED_LOCALES=Ui,le.Tooltip=Tn,le.Withdraw=Hm,le.WithdrawManager=zm,le.closeDeposit=Im,le.closeWithdraw=Wm,le.formatThousands=vb,le.isDepositLoading=Dm,le.isWithdrawLoading=Vm,le.openDeposit=$m,le.openWithdraw=Um,le.setDepositLoading=Bi,le.setWithdrawLoading=ji,le.updateDepositOptions=Mm,le.updateWithdrawOptions=_m,le.useComponentConfig=su,le.useDeposit=Rx,le.useDepositManager=oP,le.useTranslation=It,le.useWithdraw=jx,le.useWithdrawManager=gP,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})});
|
|
185
|
+
`,children:[t,o&&N.jsx(Nm,{ref:d,placement:h.placement||n})]})})})]})},Yr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIcSURBVHgBxZc/T8JAGMafA4mDEXFw0DiQmDi4CP5JHGFx0qizg8QvIHwCZHYAvwEm7mji5CJuJv7DxcWYYMLmIEYXY/R8j6tQaBvuaCm/pOlbSu99+rZ97zlgwDBowvNLCdrF6NJ50891OvNC+wrL3JShgZIAnl+JAj97FKXoMNLl7ySGnQDBHMtcVeFGAM8nKNlnlsI0eoIVuwlhzsmXqcwoURSFK1iVRCSdRDDn5PwC3cutingsJOK60nkiYE0unrdi8uFRIDwFBSJiTKOqzgKMl00teXgS2D0Fto+BiVkoIMYs8Xws4iiAkmeVn/n0oqyA2NQEQI4dytoKMEqfQt/haZmrQ4C8e7/4TtsI4JvwDbYDswCjvXr1yakQMXI2KxCD/8RMAtx2ux5gcjIzBAT8LH8bAQwYbwR8fUAb/vtuEsAr0OX5Eng8o30ZqN1BHzFLAkPGkb4AcdfnObigkbM5HdN3+Qb/ekGdrNu4CMyd8Ag6iElo/QBYzcpYByYsm8QkIFSADmI2nEkAc2sUL0ALHsxZBEjLxA+hSu22tb0+KV9Gd18027M2SybNQui+f53R6g/b+gDLVMi7YQsND+c5dTtzamlE0jiyJLwVYZhSqzO27YRSxFD8v1m4Q4xh74gdBUgRQm2QKsH0Ps82xEs9EndK3sgDlWGkW96naANqSzMSHSy4XprZi2kuTqN09VjrBH9AD4vTgfMHJt+rxIFF7EgAAAAASUVORK5CYII=",Vc="DEPOSIT_MODE_FAST",Cm="DEPOSIT_MODE_NORMAL",J3=({currentActiveChain:e,selectedToken:t,address:n,accountType:r,accountId:o,accountKey:s,onDeposit:i,onCopy:l,getUserBizConfig:a,saveUserBizConfig:c,onClose:u})=>{const{t:d}=Mt(),p=r===Ux,f=!p,h=(t||"").toUpperCase(),m=g.useMemo(()=>{const z=Number(e==null?void 0:e.chainId),W=String((e==null?void 0:e.chain)||"").trim().toUpperCase();return z===33431||z===3343||W==="EDGE"},[e==null?void 0:e.chainId,e==null?void 0:e.chain]),x=g.useMemo(()=>{const z=Number((e==null?void 0:e.cctpResolvedMaxFee)??0);return Number.isFinite(z)?h==="USDC"&&!m&&z!==0:!1},[h,m,e==null?void 0:e.cctpResolvedMaxFee]),T=!(r===Wx&&h==="USDC"),w=g.useMemo(()=>{if(!e)return!1;const z=Number(e.chainId);return!Number.isNaN(z)&&(z===42161||z===421614)},[e]),P=p,A=g.useMemo(()=>{var z;return(z=e==null?void 0:e.tokenList)==null?void 0:z.find(W=>W.token===t||W.symbol===t)},[e,t]),k=g.useMemo(()=>{const z=(t||"").toUpperCase();if(!P&&z==="USDC")return d("deposit.defaultSpotToPerpNotice",{coin:t,v:e==null?void 0:e.chain});const Z=d(P?"deposit.crossChainDepositFeeTip":"deposit.depositAllTip",{coin:t,v:e==null?void 0:e.chain});return P&&(!w||z==="USDC")?String(Z).split(`
|
|
186
|
+
`)[0]:Z},[d,t,e==null?void 0:e.chain,P,w]),B=(A==null?void 0:A.minDepositSize)||"10",F=g.useMemo(()=>{const z=A==null?void 0:A.depositFeeRate;if(z==null)return"";const W=String(z).trim();return W?`${W}%`:""},[A==null?void 0:A.depositFeeRate]),[b,v]=g.useState("fast"),[E,M]=g.useState(""),[$,C]=g.useState(!1),D=g.useRef(!1),y=x&&$,O=g.useMemo(()=>!!F&&b!=="standard",[F,b]),I=g.useMemo(()=>{const z=Number((e==null?void 0:e.blockTime)??0),W=Number((e==null?void 0:e.txConfirm)??0);if(!Number.isFinite(z)||!Number.isFinite(W))return 0;const _=z*W/60;return Math.trunc(_*100)/100},[e==null?void 0:e.blockTime,e==null?void 0:e.txConfirm]),L=x&&$&&b==="standard"?20:I;g.useEffect(()=>{if(D.current)return;D.current=!0;let z=!1;return C(!1),a?((async()=>{try{const _=await a();if(z)return;const Z=_==null?void 0:_.depositMode;if(!(Z===Vc||Z===Cm)){C(!1);return}v(Z===Vc?"fast":"standard"),M((_==null?void 0:_.destinationPreference)||""),C(!0)}catch(_){console.error("[MPCDeposit] getUserBizConfig failed:",_),C(!1)}})(),()=>{z=!0}):()=>{z=!0}},[a]);const j=g.useCallback(async z=>{if(v(z),!c)return;const W=E||r||"";try{await c({depositMode:z==="fast"?Vc:Cm,destinationPreference:W})}catch(_){console.error("[MPCDeposit] saveUserBizConfig failed:",_)}},[c,E,r]);return N.jsxs(N.Fragment,{children:[y&&N.jsx("div",{className:"bg-fill-input-primary rounded-lg p-1 mt-4 mb-3",children:N.jsxs("div",{className:"grid gap-1 grid-cols-2",children:[N.jsx("button",{type:"button",onClick:()=>{j("fast")},className:`h-[30px] rounded-md text-sm font-medium transition-colors ${b==="fast"?"bg-fill-btn-primary text-text-on-sec-btn":"text-text-primary hover:bg-fill-input-secondary"}`,children:d("deposit.fast")}),N.jsx("button",{type:"button",onClick:()=>{j("standard")},className:`h-[30px] rounded-md text-sm font-medium transition-colors ${b==="standard"?"bg-fill-btn-primary text-text-on-sec-btn":"text-text-primary hover:bg-fill-input-secondary"}`,children:d("deposit.standard")})]})}),N.jsx("div",{className:"flex justify-center mt-4 mb-3",children:n&&N.jsx("div",{className:"bg-white rounded-lg",children:N.jsx(cm,{value:n,size:80,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),n&&N.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[N.jsx("span",{className:"flex-1 text-text-primary text-xs font-medium break-all mr-3",children:n}),N.jsx(t3,{onCopy:()=>{l&&l(n)},text:n,children:N.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[N.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),N.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})},"copy")]}),N.jsxs("div",{className:"border-b border-dashed border-line-divider-secondary pb-4",children:[N.jsxs("div",{className:"flex items-start",children:[N.jsx("div",{className:"w-5",children:N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1",children:N.jsx("p",{className:"text-xs text-functional-orange-1",children:k})})]}),y&&N.jsxs(N.Fragment,{children:[N.jsx("div",{className:"my-2 ml-5 h-px border-b border-dashed border-line-divider-secondary"}),N.jsx("div",{className:"flex items-start pl-5 text-functional-orange-1 text-xs",children:d("deposit.depositModeSwitchWarning")})]})]}),N.jsxs("div",{className:"text-sm",children:[T&&N.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[N.jsx("span",{className:"text-text-tertiary",children:d("deposit.arrivalTime")}),N.jsx(Tn,{content:N.jsx("div",{className:"grid grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:N.jsx("p",{children:d("deposit.arrivaltimeTooltip2")})}),placement:"top",children:N.jsx("span",{className:"text-text-primary font-medium text-right border-b-2 border-dashed border-line-divider-primary decoration-dashed",children:d("deposit.arrivalEstimated",{v:L})})})]}),O&&N.jsxs("div",{className:`flex justify-between items-center h-[18px] ${T?"mt-1":"mt-4"}`,children:[N.jsx("span",{className:"text-text-tertiary",children:d("withdraw.feeRate")}),N.jsx(Tn,{content:d("deposit.feeRateTooltip"),placement:"top",children:N.jsx("span",{className:"text-text-primary font-medium border-b-2 border-dashed border-line-divider-primary decoration-dashed text-right",children:F})})]}),N.jsxs("div",{className:`flex justify-between items-center h-[18px] ${T||O?"mt-1":"mt-4"}`,children:[N.jsx("span",{className:"text-text-tertiary",children:d("deposit.minDeposit")}),N.jsxs("span",{className:"text-text-primary font-medium text-right",children:[B," ",t]})]}),f&&h!=="USDC"&&N.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-1",children:[N.jsx("span",{className:"text-text-tertiary",children:d("deposit.maxDeposit")}),N.jsxs("span",{className:"text-text-primary font-medium text-right",children:["200,000 ",t]})]})]})]})},us=({size:e="xs",color:t,className:n="",label:r="Loading...",inline:o=!1})=>{const s=t?`loading-${t}`:"",i=o?"loading-inline":"";return N.jsx("span",{className:`loading loading-${e} loading-spinner ${s} ${i} ${n}`.trim(),"aria-label":r,role:"status","aria-live":"polite"})},Q3=(e,t)=>Number(e)>Number(t),_t=e=>{if(!e||e===""||isNaN(Number(e)))return"0.00";const t=Number(e);if(t===0)return"0.00";let n=t.toString();n.includes("e")&&(n=t.toFixed(20));const r=n.split("."),o=r[0];let s=r[1]||"";return s.length>6&&(s=s.substring(0,6)),s=s.replace(/0+$/,""),s?(s.length===1&&(s+="0"),o+"."+s):o+".00"},ds=(e,t="0")=>{if(/[^0-9.]/.test(e))return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(e===".")return{isValid:!0,formattedValue:"0."};if((e.match(/\./g)||[]).length>1)return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(!e||e==="")return{isValid:!0,formattedValue:""};const o=e.split(".");if(o.length===2&&o[1].length>6){const a=o[0]+"."+o[1].substring(0,6);return ds(a,t)}const s=parseFloat(e),i=parseFloat(t);return!isNaN(s)&&!isNaN(i)&&s>i?{isValid:!0,formattedValue:_t(t),errorType:"auto_adjusted_to_max"}:{isValid:!0,formattedValue:e}},eP=(e,t,n)=>{const r=parseFloat(String(e)||"0"),o=parseFloat(String(t)||"0");if(o>0){const s=r-o,i=_t(Math.max(0,s).toString());return N.jsxs("span",{className:"flex items-center gap-1",children:[_t(e),N.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),i," ",n]})}return`${_t(e)} ${n}`},tP=(e,t,n)=>{if(!e||e===""||e==="0"||e==="0.00")return!1;const r=parseFloat(e),o=parseFloat(t);return!(isNaN(r)||isNaN(o)||r>o||!n)},nP=(e,t,n)=>{if(!Uh(e,n))return!1;try{const r=new ke(t||"0"),o=new ke("200000");return r.isNaN()||o.isNaN()?!1:r.gte(o)}catch{return!1}},rP=(e,t,n,r)=>{let o=t||"0";if(!(r==="spot")&&Uh(e,n))try{const i=new ke(o),l=new ke("200000");i.gt(l)&&(o="200000")}catch(i){console.warn("Error calculating max amount limit:",i)}try{const i=new ke(o||"0");return i.isNaN()?o:i.decimalPlaces(6,ke.ROUND_DOWN).toString()}catch{return o}},Om={accountChains:[],defaultChainId:1,defaultAccountType:"",balances:{}};let it=null;const $m=g.forwardRef((e,t)=>{const[n,r]=g.useState(!1),[o,s]=g.useState(!1),[i,l]=g.useState(Om),a=g.useCallback(h=>{l(h),r(!0)},[]),c=g.useCallback(h=>{l(m=>({...m,...h}))},[]),u=g.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),d=g.useCallback(h=>{s(h)},[]),p=g.useCallback(()=>n,[n]),f=g.useCallback(()=>o,[o]);return g.useImperativeHandle(t,()=>({openDeposit:a,closeDeposit:u,updateDepositOptions:c,setDepositLoading:d,isOpen:p,isLoading:f}),[a,u,c,d,p,f]),g.useEffect(()=>(it={openDeposit:a,closeDeposit:u,updateDepositOptions:c,setDepositLoading:d,isOpen:p,isLoading:f},()=>{it=null}),[a,u,c,d,p,f]),n?N.jsx(jm,{isOpen:n,isLoading:o,onClose:u,accountChains:i.accountChains,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAccountType:i.defaultAccountType,balances:i.balances,wagmiHooks:i.wagmiHooks,onDeposit:i.onDeposit,onCopy:i.onCopy,getUserBizConfig:i.getUserBizConfig,saveUserBizConfig:i.saveUserBizConfig,onChainChange:h=>{var m;return(m=i.onChainChange)==null?void 0:m.call(i,h)},onTokenChange:h=>{var m;return(m=i.onTokenChange)==null?void 0:m.call(i,h)}}):null});$m.displayName="DepositManager";const Mm=e=>{if(!it){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}it.openDeposit(e||Om)},Im=()=>{if(!it){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}it.closeDeposit()},Dm=e=>{it&&it.updateDepositOptions(e)},Bi=e=>{if(!it){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}it.setDepositLoading(e)},oP=()=>it?it.isOpen():!1,km=()=>it?it.isLoading():!1,sP=()=>({openDeposit:Mm,closeDeposit:Im,updateDepositOptions:Dm,setDepositLoading:Bi,isOpen:oP,isLoading:km}),iP=e=>{const{t}=Mt(),{isNetworkMismatch:n,depositAmount:r,approved:o,currentTokenBalance:s,selectedToken:i,showLayerZeroTip:l,minDeposit:a=10}=e;return g.useMemo(()=>{if(n)return{text:t("deposit.switchNetwork"),disabled:!0,isNetworkSwitch:!0};const c=parseFloat(r||"0"),u=a,d=tP(r,s||"0",o);return!r||c===0||!o?{text:t(l?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!0,isNetworkSwitch:!1}:c<u?{text:t("deposit.minDepositParsed",{amount:u,token:i}),disabled:!0,isNetworkSwitch:!1}:{text:t(l?"deposit.layerZeroDepositButton":"deposit.confirmDeposit"),disabled:!d,isNetworkSwitch:!1}},[n,r,o,s,i,l,a,t])};function aP(e){const{account:t,accountChainId:n,targetChainId:r,tokenInfo:o,amount:s}=e,{useReadContract:i,useWriteContract:l,usePublicClient:a,useSwitchChain:c}=e.wagmiHooks,u=o==null?void 0:o.tokenAddress,d=(o==null?void 0:o.decimals)??18,p=(o==null?void 0:o.approveSpender)||(o==null?void 0:o.contractAddress),f=!u||u.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",{switchChainAsync:h}=c(),{writeContractAsync:m}=l(),x=a(),T=i({address:u,abi:Dr,functionName:"allowance",args:[un(t||""),p],chainId:r,query:{enabled:!!(!f&&t&&r&&u&&p)}}),w=T!=null&&T.isSuccess?T.data:void 0,P=g.useMemo(()=>{if(f)return!0;if(!T.isSuccess||w===void 0||w===0n)return!1;try{const k=Z6(String(Number(s||"0")||0),Number(d));return w>=k}catch{return!1}},[f,T.isSuccess,w,s,d]),A=g.useCallback(async()=>{try{if(r&&n&&+n!=+r&&await h({chainId:+r}),!m||!x||!u||!p)return;const B=un(u),F=un(p);if((w||0n)>0n){const E=await m({abi:Dr,address:B,functionName:"approve",args:[F,0n]});await x.waitForTransactionReceipt({hash:E})}const v=await m({abi:Dr,address:B,functionName:"approve",args:[F,Sd]});await x.waitForTransactionReceipt({hash:v}),T!=null&&T.refetch&&await T.refetch()}catch(k){console.error("[useApprove] onApprove failed:",k)}},[r,n,u,p,w,T,m,x,h]);return{approve:P,onApprove:A}}const lP=({token:e,account:t,chainId:n,wagmiHooks:r,onResult:o})=>{var i;const s=(i=r==null?void 0:r.useBalance)==null?void 0:i.call(r,{address:t,token:e.tokenAddress,chainId:n,query:{enabled:!!t&&!!n&&!!e.tokenAddress&&!!(r!=null&&r.useBalance)}});return g.useEffect(()=>{o(un(e.tokenAddress),{balance:s})},[s,e.tokenAddress,o]),null},cP=({account:e,chainId:t,contractAddress:n,tokens:r=[],wagmiHooks:o})=>{var w;const s=typeof t=="string"?Number.isFinite(Number(t))?Number(t):void 0:t,i=g.useMemo(()=>{const P="0x0000000000000000000000000000000000000000",A="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";return r.filter(k=>{const B=k.tokenAddress;if(!B)return!1;const F=B.toLowerCase();return!(B===P||F===A)})},[r]),[l,a]=g.useState({}),c=g.useCallback((P,A)=>{a(k=>({...k,[P]:A}))},[]),u=(w=o==null?void 0:o.useBalance)==null?void 0:w.call(o,{address:e,chainId:s,query:{enabled:!!e&&!!s&&!!(o!=null&&o.useBalance)}}),[d,p]=g.useState(0),f=g.useMemo(()=>i.map(P=>g.createElement(lP,{key:`${P.tokenAddress}-${d}`,token:P,account:e,chainId:s,contractAddress:n,wagmiHooks:o,onResult:c})),[i,e,s,n,o,c,d]),h=g.useMemo(()=>{const P=u!=null&&u.data?{value:u.data.value,formatted:u.data.formatted,decimals:u.data.decimals,symbol:u.data.symbol}:{value:BigInt(0),formatted:"0",decimals:18,symbol:"ETH"},A=i.map(B=>{const F=l[un(B.tokenAddress)],b=F==null?void 0:F.balance,v=b==null?void 0:b.data;return{address:un(B.tokenAddress),value:(v==null?void 0:v.value)||BigInt(0),formatted:(v==null?void 0:v.formatted)||"0",decimals:(v==null?void 0:v.decimals)||B.decimals}}).filter(B=>B.address),k=A.reduce((B,F)=>({...B,[F.address]:{balance:F}}),{});return{balanceList:A,baseTokenBalance:P,combinedData:k}},[u,l,i]),m=g.useCallback(async()=>h,[h]),x=g.useMemo(()=>{const P=(u==null?void 0:u.isLoading)||!1,A=Object.values(l).some(k=>{var B;return(B=k.balance)==null?void 0:B.isLoading});return P||A},[u==null?void 0:u.isLoading,l]),T=g.useCallback(()=>p(P=>P+1),[]);return{multicallRun:m,multicallRefresh:T,multicallResult:h,validErcTokens:i,isLoading:x,queryComponents:f}},Lm=6,uP=(e,t=Lm)=>{const n=Number(e);return!Number.isFinite(n)||n<0?t:Math.floor(n)},dP=e=>{if(e==null||e==="")return null;try{const t=new ke(e);return!t.isFinite()||t.isNaN()||t.lte(0)?null:t.decimalPlaces()??0}catch{return null}},Fi=(e,t)=>{if(!e)return e;const n=Math.max(0,Math.floor(t));if(e===".")return n===0?"0":"0.";if((e.match(/\./g)||[]).length!==1)return e;const[o,s=""]=e.split(".");return n===0?o:s.length<=n?e:`${o}.${s.slice(0,n)}`},fP=({address:e,currentActiveChain:t,selectedToken:n,accountType:r,accountId:o,accountKey:s,platformBalance:i,isLoading:l,wagmiHooks:a,onChainChange:c,onDeposit:u})=>{const{t:d}=Mt(),p=a.useAccount(),f=t.tokenList.find(V=>V.token===n||V.symbol===n),h=t.chainId,m=g.useMemo(()=>{if(!((n||"").toUpperCase()==="USDC"))return!1;const X=Number((t==null?void 0:t.cctpResolvedMaxFee)??0);return Number.isFinite(X)?X!==0:!1},[t==null?void 0:t.cctpResolvedMaxFee,n]),[x,T]=g.useState(""),[w,P]=g.useState(()=>m?"fast":"standard");g.useEffect(()=>{T("")},[n,t.chainId]),g.useEffect(()=>{P(m?"fast":"standard")},[t.chainId,m]);const{multicallResult:A,queryComponents:k}=cP({account:e,chainId:t.chainId,contractAddress:(f==null?void 0:f.contractAddress)||(t==null?void 0:t.contractAddress),tokens:(t==null?void 0:t.tokenList)||[],wagmiHooks:a}),B=g.useMemo(()=>{var X;if(!f)return"0";if(!f.tokenAddress||f.tokenAddress.toLowerCase()==="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee")return A.baseTokenBalance.formatted;const V=A.combinedData[f.tokenAddress];return((X=V==null?void 0:V.balance)==null?void 0:X.formatted)||"0"},[f,A]),F="0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",b="0xceeed84620e5eb9ab1d6dfc316867d2cda332e41",v=g.useMemo(()=>{var V,X;return Dx({chain:Fx,transport:Bx(t.rpcUrl||((V=window==null?void 0:window.ENV)==null?void 0:V.CHAIN_RPC_URL_42161)||((X=window==null?void 0:window.ENV)==null?void 0:X.CHAIN_RPC_URL_421614))})},[t.rpcUrl]),E="1000000000000",{formatted:M}=Rx({client:v,tokenAddress:F,holder:b,decimals:6,fallbackFormatted:E,pollingInterval:12e3}),[$,C]=g.useState(!1),{approve:D,onApprove:y}=aP({account:e,accountChainId:p.chainId,targetChainId:+t.chainId,tokenInfo:f,amount:x,wagmiHooks:a}),O=g.useCallback(async()=>{if(!$)try{C(!0),await y()}catch(V){console.error("Approve failed:",V)}finally{C(!1)}},[$,y]),I=g.useMemo(()=>+p.chainId!=+t.chainId,[p.chainId,t.chainId]),S=g.useCallback(async()=>{c&&c(h)},[c,h]);g.useEffect(()=>{I&&S()},[I,S]);const{showLayerZeroTip:L,layerZeroTipKey:j}=g.useMemo(()=>{const V=+t.chainId==42161||+t.chainId==421614,X=(n==null?void 0:n.toUpperCase())==="USDT",Q=new ke(x||"0"),we=new ke("200000");let Y=!1,se;if(V&&X&&x)if(Q.gte(we))Y=!0,se="deposit.layerZeroDepositTipGte200k";else{const ue=M;if(typeof ue=="string"&&ue.length>0){const Me=new ke(ue);!Me.isNaN()&&Q.gte(Me)&&(Y=!0,se="deposit.layerZeroDepositTipExceedPool")}}return{showLayerZeroTip:Y,layerZeroTipKey:se}},[t.chainId,n,x,M]),z=g.useCallback(()=>rP(+t.chainId,B||"0",n,r),[B,t==null?void 0:t.chainId,n,r]),W=g.useMemo(()=>{const V=uP(f==null?void 0:f.decimals,Lm),X=dP((f==null?void 0:f.stepSize)??(f==null?void 0:f.stepsize));return X===null?V:Math.min(V,X)},[f==null?void 0:f.decimals,f==null?void 0:f.stepSize,f==null?void 0:f.stepsize]),_=g.useMemo(()=>r!=="spot"&&nP(+t.chainId,x,n),[r,t==null?void 0:t.chainId,x,n]),Z=g.useMemo(()=>"deposit.maxDepositSplitTip",[]),q=g.useMemo(()=>{const V=Number((t==null?void 0:t.blockTime)??0),X=Number((t==null?void 0:t.txConfirm)??0);if(!Number.isFinite(V)||!Number.isFinite(X))return 0;const Q=V*X/60;return Math.trunc(Q*100)/100},[t==null?void 0:t.blockTime,t==null?void 0:t.txConfirm]),ee=m&&w==="standard"?20:q,fe=g.useMemo(()=>{const V=f==null?void 0:f.depositFeeRate;if(V==null)return"";const X=String(V).trim();return X?`${X}%`:""},[f==null?void 0:f.depositFeeRate]),me=m&&w==="fast"&&!!fe,ye=iP({isNetworkMismatch:I,depositAmount:x,approved:D,currentTokenBalance:B,selectedToken:n,showLayerZeroTip:L,minDeposit:f!=null&&f.minDepositSize?parseFloat(f.minDepositSize):10}),ve=V=>{const X=V.target.value,Q=Fi(X,W),we=z(),Y=ds(Q,we);if(Y.isValid){const se=Fi(Y.formattedValue,W);T(se),Y.errorType}else return Y.errorType==="exceed_balance",void 0},oe=g.useCallback(async()=>{Bi(!0);try{u&&u({amount:x,chainId:h,tokenAddress:(f==null?void 0:f.tokenAddress)||"",tokenSymbol:n,depositSpeed:w,accountType:r,accountId:o,key:s})}catch(V){console.error("Deposit error:",V),Bi(!1)}},[u,x,h,f==null?void 0:f.tokenAddress,w,r,o,s,n]);return N.jsxs(N.Fragment,{children:[k,m&&N.jsx("div",{className:"bg-fill-input-primary rounded-lg p-1 my-4",children:N.jsxs("div",{className:"grid gap-1 grid-cols-2",children:[N.jsx("button",{type:"button",onClick:()=>P("fast"),className:`h-[30px] rounded-md text-sm font-medium transition-colors ${w==="fast"?"bg-fill-btn-primary text-text-on-sec-btn":"text-text-primary hover:bg-fill-input-secondary"}`,children:d("deposit.fast")}),N.jsx("button",{type:"button",onClick:()=>P("standard"),className:`h-[30px] rounded-md text-sm font-medium transition-colors ${w==="standard"?"bg-fill-btn-primary text-text-on-sec-btn":"text-text-primary hover:bg-fill-input-secondary"}`,children:d("deposit.standard")})]})}),N.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[N.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[N.jsx("input",{type:"text",placeholder:d("deposit.amount"),value:x,onChange:ve,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-hidden border-none p-0 h-full"}),N.jsx("button",{onClick:()=>{const V=z(),X=Fi(V,W),Q=ds(X,V);T(Fi(Q.formattedValue,W))},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:d("deposit.max")})]}),N.jsx("div",{className:"h-px bg-line-divider-secondary mb-2"}),N.jsxs("div",{className:"flex justify-between items-center",children:[N.jsx(Tn,{content:d("deposit.availableDesc"),children:N.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:d("deposit.available")})}),N.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:eP(B||"0",x,n)})]})]}),!D&&Q3(x||"0",0)&&N.jsxs("div",{className:"flex justify-center flex-col items-center",children:[N.jsx("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:d("deposit.enableSystemProWithToken",{token:n,network:t==null?void 0:t.chain})}),N.jsx("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:d("deposit.enableTokenDesc",{token:n,network:t==null?void 0:t.chain})}),N.jsx("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center",onClick:O,disabled:$,children:$?N.jsx(us,{size:"xs",inline:!0}):d("deposit.enableWithToken",{token:n})})]}),L&&N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"flex mb-4",children:[N.jsx("div",{className:"w-5",children:N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:d(j||"deposit.layerZeroDepositTip")})]}),N.jsx("div",{className:"my-2 ml-5 h-px border-b border-dashed border-line-divider-secondary"})]}),_&&N.jsxs("div",{className:"flex mb-4",children:[N.jsx("div",{className:"w-5",children:N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:d(Z)})]}),_&&N.jsx("div",{className:"my-2 ml-5 h-px border-b border-dashed border-line-divider-secondary"}),N.jsxs("div",{className:"flex mb-4",children:[N.jsx("div",{className:"w-5",children:!(_||L)&&N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1 text-xs text-functional-orange-1 whitespace-pre-line",children:d("deposit.noPrivateKeyWalletWarning")})]}),N.jsxs("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:[N.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4",children:[N.jsx("span",{className:"text-sm text-text-tertiary",children:d("deposit.arrivalTime")}),N.jsx(Tn,{content:N.jsx("div",{className:"grid grow max-w-[300px] min-w-[80px] rounded-2xl flex-col gap-[10px]",children:N.jsx("p",{children:d("deposit.arrivaltimeTooltip2")})}),placement:"top",children:N.jsx("span",{className:"text-text-primary font-medium text-right border-b-2 border-dashed border-line-divider-primary decoration-dashed text-sm",children:d("deposit.arrivalEstimated",{v:ee})})})]}),me&&N.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[N.jsx("span",{className:"text-sm text-text-tertiary",children:d("withdraw.feeRate")}),N.jsx(Tn,{content:d("deposit.feeRateTooltip"),placement:"top",children:N.jsx("span",{className:"text-sm text-text-primary font-medium border-b-2 border-dashed border-line-divider-primary decoration-dashed text-right",children:fe})})]}),N.jsxs("div",{className:"flex justify-between items-center h-[18px] leading-4 mt-2",children:[N.jsx("span",{className:"text-sm text-text-tertiary",children:d("deposit.equity")}),N.jsx("span",{className:"text-sm text-text-primary font-medium",children:x?N.jsxs("span",{className:"flex items-center gap-1",children:[_t(i),N.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),_t((parseFloat(i)+parseFloat(x)).toString())," ",n]}):`${_t(i)} ${n}`})]})]}),N.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${ye.disabled||l?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:oe,disabled:ye.disabled||l,children:[(l||I)&&N.jsx(us,{size:"xs"}),ye.text]})]})},Bm=e=>e.toLocaleUpperCase()===gn?gn:Js,fs=e=>Bm(e.wallet)===gn,Hc=e=>Bm(e.wallet)===Js,Ri=e=>e?e==="perp"?Ne.PERPETUAL:e==="perp-v2"||e==="perp_v2"?Ne.PERPETUALV2:e:"",Fm="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAoCAYAAAABk/85AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABBMSURBVHgBvVt7kBTHef/17N77fRwSiNeBBAGBpVNJERKyoqOSuByiVLAScOKqJKAYJU4F8XCVY8d/cLiSkKSS4pDtKJKRdFhxYoNskTKS4jixFguEICAdiDtAvJb3cRzcg7u9vX1M5/t6puexO7u3Byd+VDOzPT3dPd/39ffqPoFbhJSymS5NVJ6yr7V2YfRRidrlMJWIECKC28Bnv5dslqZskjCeEhA0nvSPJ0SU5hQ1IA/DQGTPqqIIbgMLvjzcbAjxoBRoFlLSeKJWqjEFDY0++p6oCRmFFO2Aufvo1rIIbgFiLI3pA/mD11BZC/fjC0WUSoTKRp58IS80vyZrEylzjTDlLYxHYwgZKUqHNka+Uth4TWtlbWowvkZArjWlqBEikz4SNsmkdZXqB7WDaVrfV1SEje3/WhZFgSiIATbhN8Ai/HigDXkYwYRPJkwaT47PeAJt+RjBhE8PDm+QEGvpW/VLkglMUFeuFja13HvBtHHu1SOp3nktHMa3CmHEqAygDlniWzB2iR8NUVhMaPNWPv5yeo0hZcv4j0cqSsiN7z8XbvPWLlgVXwMz3UJk9I4nLekWmqD6t9WTUEzw1vme8zNqc84wzI0ff6+yLe+s8j2kwTdj/KQ+F1rpA9fxzRMvpTePm9TnhGjd+2chNd78Z2ObiVZrbYJaT4Ur4TYhhbMoPM8z7h3dZD+RVhU1MURrx9bydTlnE1Rpq5w3qTTjDqB/BO2//f10H825GXcAMiXb+z8c6SPiNXuIK7XOt+oE/WbVI2wmKBpLr9632nrbeVWVh7RSthfL5OL2trq+zLmEc8zxXSpN8cEBlFZW49OEGR/A2rcqmiBxxzDQmWgiowlbcO2RpUfStd6XnnpNfOsdVk26NfVFxDcVE/z92CsIsimOMAv04sy5hDIrbLWzlO9f+OJnkDwVwcRygVD9NIhwCcYDTPTBfa/jo3//W/z1OzGcLnsYdwqxaBLJ3rS6l9Z/mpD21ZJk3d4yspZIewjrFW/nfVtdaXXkukxWXePEpm/W9rT/3c+88/GpIBpsBV1e4/uO997B97+5QtUvnGpg4bQQyh9ejvJHlqFk1uO4FcTP7MPQwR2Id/wXdh/vxc/Ll+Hk45txpzByLYXBUwm49HFhMUPYasiRcjw6NyTmTQ9hLpUpDRa5bsYkjp03ceB4Cv93Ig29iiz1IzNtgcMEezWsO9FW0+q0cCYgZSMs1cNXbN/0PA698yOnq+oSgWfmh+lKy6ZuGioeXoayR5YjXDcV+cDSfvO9rRjcs9W6HwHeoolfMqbi6G+8gXjlNNwJmCMS/R1xpONewrvCyuLrld4vfLZI/OXSYiK6kbffSz0mvrMzgTf3JLXb6qwatz/nN3fdNyLMmVHbHngZwJK/Qv/esGQ22AZ4wUxYOM3AvInupKrvmYaiHJYkkSIDe/mC8/tYt4k950yMpCROLmpF96zluBVMrhK4bwJQWWz9HiSh7hoETvbkNiQ3T41gpDul7r06Ah5isYROmWBg06oylnyMBcyIP/77GC5eM7M8J3jcVNt4t57YVqM8Ix09NNLlrG49PNiPliVzcg7WNNnArzVaE2TiV1UEtxuIEROStPTpuw9cTOPwFWX5MEJSf3DpfowFVcUCyz4DLF9goDKHKeq6CXx4ReK1gxJXBl0KsPT3HBzSXjy0+pH2b9t7B6ua764pH1Xqc4GZ8BdbhnD8vDLejoekepd+25IwZB2vAj3SBm9HZZU1qJuUWzW0EyHbPkxhgNRJMuX6xV6kTYv4rHLe7Eg5xGecf+CrGAuWLxDY8YcGnn04N/EZk6qAJXOo7Ze4rauKh84n7ElK+5+tr/mhJBeGChP9dojP4Hf/ZU0FpkxwAzW+Sm1grHtlW8IpgwNc6NGaMzub9dCivIMNkFT9x5Ekjl0jlZLMfp5KWSrnh0dS6In5OTRwV2FGnKX+208beH5RfsIHgZm16XOGUlMjfZbqMSU0BRQbTJc6eP0bFbdFfA3uY9Oqcrtf6bsSo4XFCF4Npgo4Q3ZWMyv67O26gE8OvJt3MJbyMzekYsCcu/yT/8UnJn55Nq3aeDFw9yJcnrcKheDlpSHMv9sfKw7Sitp5XOLf2iVeOiDxzicS/3tGKjswoUz4GDWjVmCyMPHT90YCl6ntXuKZJ0uoFGO8MJVsJHlKov2UYryt87zRmVJFpfUPfH03m89m3AbYMM8OkJxG+viPuwSpIP+H999dmPSz5FZm0OTVQxI7jppKrWXio8sSL7xvSb5X/XScTtr6QCpt73go/M+0wtbnnynFeGPF50vQ9rO4urd4bzqT0oyn/x9kBjwY1EEhEbDlmobUNRMNFLz9Hj37cUfax4Sh+vkoBCzRq3elSQWFFCO+8XNTEXk0vHqI2l0R2PSbhvKMfvBBUqkaSwyl4/loLJwbyqt6/uqlIew/lrTesvjlfOzC+8P4h+cqA9/jPtmT2n+MV4H2sixPSKtB+rGYGdAY1AEb4nyYUmPg6TkGSsJOBtCXrmUwY5gJuyhY6RmyKuMVuY0763wmtvZgrty0mMB1J6+P3l6DGbXyJ2nFxP4B046CYPufAto956pH54aRDx8cS7BrCX/+3yZiZ36BWDi3CB90JlVbw9BRsnQibrp7ICcD7pm9QK0CbyxQWiQw9y6Be8lXnlLhl/ogBjCYCV+iYS4RA05fN7E/BwOUwf0dQ3kyq39qEsFdJgRhcqXVnsHtM5mg30vF0q7Ho77fjbbI/8H9M/IzwJFWx4UUlPuR0h/xBmPKRJ2qtvJFbqCm7rnzOv6CwLw7u6GfW/k1NNYbaL4vhBWPhvH1Xw/jdxeEMK0q/9hmgGDwO/xuqjhYtTExdXDF97Mn5B5DE5+ZxYXvuS4I6ZQJ1wtxvFHnd1XFaHR00wzS9SOd3/kwpSEEK2nnJPWk9Y7lDdFNTV6/6/EnFxHhQ8QAgxhhTXSQXErTDPhQT13QvPidwVjwhDMNbj4meImvMRoT7FnZc/O4h1JitCysJqAmupVW0JnS0WEzzJNZdQRBZVSZAX25XjbP78uqS5E9unot6ZSe6ylVEil3Qqm0dOq9bUdIJ1eaA1l9aoPb5VE3QUwIIr5GEBNmk9BUl7HKMLUfDouY0OaY9Hsa+cDvmaZmmss33U8+DMTs5eYpWgB4FdBtX14GpI7syKqrrRGorXLF9XSsjKRfIiTcxSQovuO6IzddD6Ga3qmnBVeB/sCxtMHNxYQg4nNbb3svE5j4fF9V7joJbnGlufNcEgVAuhJsFqyCOqNJn+qzm0tbHkAki7IFakeAIZZ9FyG7O7I6ZUPLTAiFi/DPp6bg7ct1+Js5ZzBLxOFkV6jN8eFqbDxzL5bc04uv3ncJFWUGeQJp3JfsxNWSYEOsmcCupya0ZgIHYJnE57YMb3vNBKXWKChjI3uBknBCZCbhLFvVGU0hHxbOK4Klsz3a2u5o4bxRPKjOhMNoT2paOHvKJqKskzgKzkrKp49sR2LX+sCOudNYnKS5jIKiZAjRvmLMqRlBSbGdbEsIXIoVYWJFGlVFaQzFQigrNYkBEj8pfRYvVm5APkyu8hM1E5r42tPJ1/6Vt2P41rabTiDmfIN95Zq9327A1LvGlv0cDRe703hi9TXAE/x5DY7tNW5ktrYHdRCkfjS4r9ISi9hM4AUNw1ltZtUm1DNGcbFFfMa96U6MhiB1pJFJ/NHaT58cdlSFzgFJjzvE95vfGMR4o5X6tG2v7UVJrxOlYJiIGPaJtSw7cHMIuNHvLxevmjh1LqVKF3E4aa9eZogmMCPkESZuc7k75bzXcHEvKgIMcSaCiBpE/NHav3w8RFupwklHuEbQTkXQdXskhn0dCYwXLtL3/uhdysUr1WVaW2vuzpieQzT6xuSIVmxbMjspvjc7Z1NeaqgOkrT5k0pbTBq28zJFYQ8D7F75GbfhZcjvsCtaVhrCb/W9gkLgJWo+4o/Wvmp6GVy6+11KvRrWf7dXqY3bBfexvOWGuueATRtvNZrUDFGRSITr9IYMB2O93o5GaP+256VlWQOkyN283ptCVSXtEZdZlB6umoqNb0fV/oDGPy2difJBazcsNky2YjCNhvowrQ6BIaMaz878GIWCdTy7qkFJuELamzTn87+46iRytAoQvpMjQs5vDIlXvlZP9iCMWwEb+y//Y6/siCZFwLkiexVYgV26yJjV9cPJUcOaiGAV5FsFvPEuSrOj1jAt54qKEEm5QLp+DmKPrcfBCcvw36clPrjolhMz/kg94zY8m4oKQxGfwSpoSX9hq4DBUlwo8YPaGzTn6hkV/kgW7j37+VKmBREOv7+hR6mQseL9oyNYRu92RBPK39KpB+m4Qa4Kov+3MfH5zrsnzKvgLDypid7t6xE7tN03EDOFmTMw6QkMl04EGRHsOfARtrz6A1+7P/2DZ/D55kUqE1k6fBU1V/epVSXjlv7nVbB6xl51vRPgVXDhl90wkzpkzzg5Iv0nGr64uALrlldh2iirgaV+665BbH2LDbl7CiIYSvrPmcWhxVkMsGfhc0ljB7ejd8d6RXC2CXz1Hkm5cOIIus8ew9Bw3I4yXVRVVqqIo+6eWZj1wK869cyEkdP7kKDrmzfmYduE/C7peKL/3BBuHB9w4gAb3vBApxOdnP1j95fIRQtKxPyZxaguh2rC0TMT/v2jcTLeI94TENAqx3vEUfWo9ZBhrOj68dRtevAsblFDPrOi9ivN4QHVwijNLaV917pw4tB7iMf8rlxpeSV+5ZEnUdswKee7fEzlOx9VYvvHo8T044jrx/vRFx2y9qjc7K0vV09fLC0CSmQfUXfgDYQ9u15SCH+44R5XlGi9snO675yoyNHzuxjDThkTP5MBlTX1CBcVts23eldhmy3jhcv7exDvtdxOLbkW9AlnJ0wLUCnek9LSlnT3eGOOtvSfPHxl54yHMqaS93AuM6EJdwB9cUSeft2shfpLlE8fZsKMnP6fy7RpKvRuoC267uFcr+rQGzBe2GLuBLlutKvfsy5WUxEpRfoL0Z0zs+KtwHQ0e0VUmFtb8OljS12ZWLz3udBDtFY/9fF4jH2rixd3/2fjQxDmC4A3X595isHNnsE5xKv1u5S+WELdet+z+jSEuaVr5/TFQcRn5N0PICawUV4J648pxhs8oXX2GAp7/rxoLdnylfzHFBh/0HjmOh5DV1zdOXMt6X7r+7wuqvSnj634zQngpOW2qsyozu/LrHaUziQXcN0VGiPfpAQKgH1yroXKn2B8wJLeYscfWXjsRdkYMpItJB/jMh5Lfbgk3BJZGTzepKVnG4mmGyg1sUK19xxVtKNW4VcvfrWUqaIMIbeUGUZLLqn3zQ1jgIcRTyHHXnIe6GCvNRfhM+EyIkTjqbHHNJ4wifCl4dZchM8EMyKdxgZaFc1Ez0b4AgVtI6zUjtc7Us8M9BMbtpQbRmshhNcYEwO8sA90cWFD1mgX75+pcuFM626+3vafqb6YbCaF2Qw2nEI02sLgGY/sFmQ7xaC7hSna93zl9v5MteHpk80U9z9FdqKJyNtIdG8kdtRa+wqil3R3vwlB34WINFOHe3bNjuAW8P/4M203oLS1YgAAAABJRU5ErkJggg==",Rm="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAoCAYAAAABk/85AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0WSURBVHgB1ZsNcFTVFYDPe7thd7NZsonIT6CwQWvAnwTaRNuxQoJ2SqpViW3RiiMgVq2dgcy0dnRqkwz9Ga0dNjOt2BYVi2hpVaSFBmyRRWBajUoIWIlYWERAhWE3xoT87O7rOfftDW/fu+9vEzrTb+bN7rvvvnd2z7n3nHN/ngR5kvh7US2AMkvKKHMBpFkgQRgUPAgJkvg9jtfjkj+yTy6cGgvVbI3BCFAUpRY/ZuExN/sZzh5EEo949tiHR0ySpBiMhG+ivAzQ/5qL/8UoT8rKU1CeDDF4IT95kpvKiY3hsFw0uFxRpBXDynZO3Ddlaaz/g3UtJfXJuJMbUOkkYzkeKwDcy8MjhkcLGiPu6I6bUZ48AnkSyiuAFvijQ3ng0ABM8YVDTYr6w0aEHJgG8piStcGrdpsqJqv4JhgFeVnWgpUhVMWPnjwJ5Tk0hK0Bul8JLFdAbs6jxdsR945vaCmavW6tthCVTy2wGWD05YFqhLU5pbegPOX8yYOXdPJ0WBqge1twlTJ6rVCIJ1AWDc051EjfUfmrwIG8gVQG9hw6DfHTvew8Mi4INeWlEPJ7wQFRNAKTBw3O5I2QKBqh0eyi0ADkcqTg0EZsGbXwP8AfaezwXbKSAmmtVT1SfOexbtj/YZJ910LKr5g4Fg1RAnac+RQ6LljKEoVaq3qzIviDLgeoiqjfw0G1PH4KozDafuc7GGQOAHTEwRoJOiANdfCylDReEpDcFtwLaqbhCsmLiVAq6fY2KPryP8ETusKyTtfJHmiPJ6Cnf4idH/l3J+zZvJF9r7luPlR84Sr2nQxRHSmFGZNCps+a/QNU2hFzWYvrAO7Eo/YycET8E/Q1f8JAs8OiEgXoF6U6Y7GOfN2O7J8GwZo2SJ15Dc6+c6/j+/wVj4Bv2v2m108kz0L7kQT7ZOeHD0H79q34+X5OvXGTJsP8O5ZBqKSUnZMhbpo92eCWGp9Cn7BFLIsUvmoJtrxyyAsyxJJfY694x7SKwR3lGCDxSnCxpMDT4BKufDkwlZ0PHn/WkRHGlC2CwOVPCK/19KdQ8Weg66Me9TxxBt7c3gYH33rD8pkVX7wSaq6tHzZExcTQcHygFkoKErH8BtTOEhgVmrE3tGwwvdyIRojyk2EDJNr8EUn2UCeKgAv0yufYGcHsPr2fH+g/C517YrB/90723SnV6JYqr64Fnz/AzicXj4Plvy9mrVRP07dRaQthVLEwQhIHeOU8Hnh46UN3+igjqAUXmCmRPXhsJV6fCqlTm4X3+mc8At7Sa3LKyM9v6TwJx870QTqjQNdbr8OWp5+AY+8dhHQqBW4gF/V+59vgCwTQPU2Bx/9WBAeO+gz1zofyCRY/JDVQ6/BjuR/ebdkGkO0B2dZ/BFxgpXwtop5A94bm5P6yTXtP2Pr5fPGPmwntvl8ayiPjMZivhvNK3U9MYkIGSqgXsAglezxNigKOMVO+kurGTKg4p2zM5EXsU2sE38UP5tShlk/KZ35+28twcN8+GE3eT39NWL6jBRxBKSdlTZR+EpEL1UDN01Irnv6+mnUle3UXZJboNDMDKC7yfTPlZ85+AL1v1oO35BpDYNUbwVsyJ+f6p9nUsuvt102VPzYUhBu/fh1UXFIOkydNgOMnP4aHV0Zh0cKbWJmW9Rv+AgffOzx83uurNDyPUk3qAVaQ0lo3q1mTQYHZZ5ALs3oOXVuBAb7ZGA/YiN+baGOzmhFwgJ3yM2ePwiAehJkRBk+ut3VbemZ8fjo8+fgvIBQ61+Ta1+xnhrhv2Xdyyjdt+YeqfB+WDfSi8q+AQY9RQ6Q4KyhY1zWBMGhzKKsi90I9ycoIy68XGiBMM64ydoVacEim/yikMc/PKdMonzN4Av3+AWMGlE7sZj3ELdFHf5yj5BMnP4HVa56De5fdllNOrF7zPGQq5kC6uoGdkwH0kPuwUhi1djvlc7ihkn3mdchVCQd1ON0tYxSuAhf0oRsZwsDK7hcon6M3An2nMk+oEtxALbxsUq62Hl65Cm66/jp2aCGjnPgsA5maBshUzgelbCacLZhueKbdCJfSRyfK51Dd1r9a16EpDQPo+mXMgyJWNzK3U93GPjlkhP7//NygfHI7voseGj7nRuDKV5/n3P1wF6OFXEzXocOGct4r0qh8JXQhK0vPuwcGC43D2rk2BlgbA9ewOGHRC2guyYAEVV4r/6/1+fTZ217P3BAxgAbQQsqnkS2HX+eKH35m4TRwCvl9LaqSn4fbMfDqe8Wj0d+h3y9k7odDhhj0jKWunkO40Fwm+XRRwLWD7nnmVXXiTkRC/Myw12yeXx9wRUbg6JXvz/YCvZEKsI4+TTVD5HpWr1nPBi6iXvHqzn+pv/PEu5BB18PJDBnnG638vxvXo2eF60kcCMumlyTn5QrGAidlTtc/zVzPpi3bDb2ip6dXDbzl1TgDdyHIu9fB/xPe7AK6oReQbycfz/w/tn6rgNufbenc/2t9vhYqoykIu15gpmQKuvpe8eyGTWrgvXYRZHpOg3fTT8Hz5ouYBd3CrssFiqEXWLkYu7GBFU0LzQM8nynVkSQXRJNCQjfEjRC47Ak2iNIqnxQ5GH982B1xI5ChtMovyLqmoWyZMpS0NIDY9TwndD3DgReDLQu8eKQr68HTuZXFAirzCAywL24+5cwXXvKJAzTgMosvMVGhBHF0QVIHWMCNYMh2pt6vxghNdkRG0Cu/EOvSwQ2R7tlvKqts4gShkqmVU84vDLyoZG3gzVD+PyYInld/y879xWmDHKsVLFI+KdItNCq2Cu47DwgKM3BUxnXYneACbcDlgVlrBA5XPocbIXVml+mzH1i2wFC29HsPwry5XzLk/Dzwput1y62YCaWwR0gYjIsP74LABcZZVIsFEwaNXN24IqprN7IWysSlShkU6x6QUx9dh34eR2QEvfKHy0u/gn66U/jsmkiJYfWKDaxwzueBFd/NKecxgf2mfVsNz6IBmIJBuS/2Bwj4PzNcp4m1mKhFZqFeYDe9wKE6dnXJ/wsNIENMLqn/LMYCsQNotlN1R7kZjtYIZsqnGNCHwTmV2MWeoyUUKIDq8tKcMu7fRTGBBV40DJPd9RpLPfWk6u4BamJFRzawQKznmRhYQgrd+1jWrwtmPamMgi7VsTMUrRcLiNNuuux6QFGzJCtN4BDaXMWzIy1kGNFEG1c+h7Ilv2bELOIudD1khLaNT+aUU9n8BUtzyijYpr71M3UCTvs70TgUCz6asRJO9cw2yNj7K5MRqg42HR0/N0bgcztOpqPpnvL7BBdo89aL0hJ1HOD3RsEF5wKzsSfo0SufGDz6G7CC/Hv72/vhhyvuNlxjgVeH1HMKU8+XDOUsE0J3VCW3gQhaoHcCVzgFWjpuvtKZ8gmzNWi2cw7ICyEldcmkokit4AIzI2gRKZ8gFzRgYgQ+3UBBl4KvFu2IV4+MqafeFY31pKHu9ruh4Y6FMK+q23AP+eVG96NXx5DrMQm+a/m2xXMjYZ+32Wks4FgZwUz5HJqm0McCgvz9oltvNKSj2sBrhkypJ64B+CQFrirug9smJWFmqQf/moz+WhG22uhmyx0MeUPKbxY/N85bPzG8KP/IM/39P7ptzIAkw3xwASmRFt4Lxn8DpAJ1gGWnfEZmAAcFA+Ad91XDpcrLZxjm+fe89wns7zoCp08eN32kNNgHM6d/Dm6sCMK0wBB4JXVbyvVVZXDR+AD4CwC2CXI+aqUUDIVTxnlgoXyiEf58biu7YXomsbUoKklsg6wreGBOJ16zV74Gu41ZBG1PeWqXumeA1o13vLAejusW7CdPvxiqr62HMvwkysIBtk2RPrWQy4mKN2o4SimtsN2YpUArbJRyNr2Jtya+EtyRz75QMoJorsgOMpx+i4oe2qBFO+T41sSut96A9u1qcL36hgYov1Rd+aKxxLyZ4w2K12K6UyGLk7VeLTSuaN1iuzWxA7Oe2cZiAYkd4bA0NLQj+2bIeWfMhAWxQNU6mo+yldf5YRI6j306bAgO+fnKzxXDFVPC7LsVp7ohNv4u9kaPpTyaL6LshxZwaJqBG4SnpTSnxAZ1NiNrti80DQscb87l5OuO3CD5p7QWz+1i3RKnRSgdtpXHty3y7enk52kgZ6f4LK2SlHUDC1CeBOf1/4ncjhbbKfpEW3CxpL49EoFRRCooSRZMvLWl8NLHcsYgaITFAKMvD9T3yOgFjdwxT8P5lafdByrC2StKbf4IyJ5mrHwnjBDawg5yUWsm+XFzyYKkMO1FI0RAfUtmxPKy0BinGZUvTrNvRnkSUBo+OvKo1dNbNy9Ltmm900UqhsYQ9KZixM29UkE4mRnoboV+b9RM8Xo0hnAtD9QWSIqPmipezzlD5C8vA1Eniue4MoAWtqFLhlp0T1Vo7Qhb3M99TTUp+yZ0pPs/3um94JqOUXpNlQ7aRhPJHtrXVOmgLJ+m1ztG6TXVWtq5wGQpAnmU2SgoT8bPPF9T/S+t/b7McgGVIAAAAABJRU5ErkJggg==",jm=({isOpen:e,isLoading:t=!1,onClose:n,accountChains:r,defaultChainId:o,defaultSymbol:s,defaultAccountType:i,balances:l,wagmiHooks:a,onDeposit:c,onCopy:u,getUserBizConfig:d,saveUserBizConfig:p,onChainChange:f,onTokenChange:h})=>{const{t:m}=Mt(),x=g.useMemo(()=>r.map(V=>({...V,key:Ri(V.key)})),[r]),T=g.useMemo(()=>Ri(i),[i]),w=g.useMemo(()=>x.some(V=>V.key===Ne.PERPETUALV2),[x]),P=g.useMemo(()=>{var X;if(!x||x.length===0)return T;const V=x.find(Q=>Q.key===T);return(V==null?void 0:V.key)||((X=x[0])==null?void 0:X.key)||T},[x,T]),[A,k]=g.useState(P),B=g.useCallback(V=>{var X;return((X=x.find(Q=>Q.key===V))==null?void 0:X.chains)||[]},[x]),F=B(P),b=()=>{var ue;if(!F||F.length===0)return{chainId:o||1,token:""};const V=o||((ue=F[0])==null?void 0:ue.chainId),X=F.find(Se=>Se.chainId===V)||F[0],Q=(X==null?void 0:X.tokenList)||[],we=(s||"").toUpperCase();if(we&&Q.length>0){const Se=Q.find(Me=>(Me.token||Me.symbol||"").toUpperCase()===we);if(Se)return{chainId:X.chainId,token:Se.token||Se.symbol||""}}if(we)for(const Se of F){const xe=((Se==null?void 0:Se.tokenList)||[]).find(Ae=>(Ae.token||Ae.symbol||"").toUpperCase()===we);if(xe)return{chainId:Se.chainId,token:xe.token||xe.symbol||""}}const Y=Q.length>0?X:F.find(Se=>(Se.tokenList||[]).length>0)||X,se=((Y==null?void 0:Y.tokenList)||[])[0];return{chainId:(Y==null?void 0:Y.chainId)||X.chainId||1,token:(se==null?void 0:se.token)||(se==null?void 0:se.symbol)||""}},[{chainId:v,token:E}]=g.useState(()=>b()),[M,$]=g.useState(v),C=g.useMemo(()=>x.find(V=>V.key===A)||x[0],[x,A]),D=g.useMemo(()=>(C==null?void 0:C.chains)||[],[C]),y=g.useMemo(()=>{var Y,se;if(!C||!Hc(C.account)||!(A===Ne.SPOT||A===Ne.PERPETUALV2))return!1;const Q=!!((Y=C.walletOptions)!=null&&Y.evm),we=!!((se=C.walletOptions)!=null&&se.mpc);return Q&&we},[C,A]),O=g.useCallback(()=>{var V,X;return(V=C==null?void 0:C.walletOptions)!=null&&V.evm?"evm":(X=C==null?void 0:C.walletOptions)!=null&&X.mpc||C!=null&&C.account&&fs(C.account)?"mpc":"evm"},[C]),[I,S]=g.useState(()=>y?null:O()),L=g.useRef(A),j=g.useRef(y);g.useEffect(()=>{const V=L.current!==A,X=!j.current&&y;if(L.current=A,j.current=y,y){(V||X)&&S(null);return}S(O())},[A,y,O]);const z=g.useMemo(()=>{if(!C)return;if(!y)return C.account;if(!I)return;const V=C.walletOptions;return I==="mpc"?(V==null?void 0:V.mpc)||C.account:(V==null?void 0:V.evm)||C.account},[C,I,y]),W=g.useMemo(()=>z&&fs(z)?gn:Js,[z]),_=D.find(V=>V.chainId===M)||D[0],[Z,q]=g.useState(E),H=g.useCallback(V=>{$(V),f==null||f(V)},[f]),ee=g.useCallback(V=>{q(V),h==null||h(V)},[h]),fe=g.useMemo(()=>{const V=(Z||"").toLowerCase();if(!V)return"0";const X=(l==null?void 0:l[A])||(A===Ne.PERPETUAL?l==null?void 0:l.perp:void 0),Q=X==null?void 0:X[V];return typeof Q=="string"&&Q.length>0?Q:"0"},[l,A,Z]),[me,ye]=g.useState(!1),ve=V=>{V.target===V.currentTarget?ye(!0):ye(!1)},oe=V=>{me&&V.target===V.currentTarget&&n(),ye(!1)};return e?Ke.createPortal(N.jsx("div",{className:"edgex-components",children:N.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:N.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-99 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:ve,onMouseUp:oe,"aria-hidden":"true",children:N.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl border-2 border-solid border-line-divider-secondary",onClick:V=>{V.stopPropagation()},children:[N.jsxs("div",{className:"flex items-center justify-between mb-4",children:[N.jsx("h2",{className:"text-lg font-semibold text-white",children:m("deposit.title")}),N.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:n,"aria-label":"Close",children:N.jsx(I0,{className:"h-4 w-4"})})]}),N.jsx(Vh,{selectedAccount:A,options:x.map(V=>({value:V.key,label:V.key===Ne.SPOT?m("account.spot"):V.key===Ne.PERPETUAL?m(w?"account.perpetual-v1":"account.perp"):V.key===Ne.PERPETUALV2?m("account.perpetual-v2"):V.key})),onAccountChange:V=>{var xe,Ae;const X=V||A;k(X);const Q=B(X);if(!Q||Q.length===0)return;const we=Q.find(lt=>lt.chainId===M),Y=we?we.chainId:Q[0].chainId;$(Y),f==null||f(Y);const se=Q.find(lt=>lt.chainId===Y),ue=(se==null?void 0:se.tokenList)||[],Me=ue.some(lt=>(lt.symbol||lt.token)===Z)?Z:((xe=ue[0])==null?void 0:xe.symbol)||((Ae=ue[0])==null?void 0:Ae.token)||"";Me&&(q(Me),h==null||h(Me))},className:"w-full"}),N.jsx(_h,{currentActiveChain:_,chainList:D,onChainChange:H,curSelectToken:Z,onTokenChange:ee,walletType:W,accountType:A}),y&&!I&&N.jsxs("div",{className:"mb-4",children:[N.jsx("div",{className:"h-px w-full bg-[#404040] my-4"}),N.jsx("button",{type:"button",onClick:()=>S("evm"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:m("deposit.connectedWalletTitle")}),N.jsx("div",{className:"flex items-center gap-1 shrink-0",children:N.jsx("img",{src:Fm,className:"w-12 h-5"})})]}),N.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:m("deposit.connectedWalletDesc")})]})}),N.jsxs("div",{className:"flex items-center my-2",children:[N.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"}),N.jsx("span",{className:"mx-4 text-xs text-text-tertiary",children:m("deposit.or")}),N.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"})]}),N.jsx("button",{type:"button",onClick:()=>S("mpc"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:m("deposit.externalWalletTitle")}),N.jsx("div",{className:"flex items-center gap-1 shrink-0",children:N.jsx("img",{src:Rm,className:"w-12 h-5"})})]}),N.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:m("deposit.externalWalletDesc")})]})})]}),(!y||I)&&N.jsxs(N.Fragment,{children:[z&&fs(z)&&N.jsx(J3,{address:z.smartWalletAddress,currentActiveChain:_,selectedToken:Z,accountType:A,accountId:z.accountId,accountKey:C==null?void 0:C.key,onDeposit:c,onCopy:u,getUserBizConfig:d,saveUserBizConfig:p,onClose:n}),z&&Hc(z)&&N.jsx(fP,{address:z.ethAddress,currentActiveChain:_,selectedToken:Z,accountType:A,accountId:z.accountId,accountKey:C==null?void 0:C.key,platformBalance:fe,isLoading:t,wagmiHooks:a,onChainChange:H,onDeposit:c,onClose:n})]})]})})})}),document.body):null},Gc=6,ps=6,zm="#22FD73",pP=(e,t=Gc)=>{const n=Number(e);return!Number.isFinite(n)||n<0?t:Math.floor(n)},hP=e=>{if(e==null||e==="")return null;try{const t=new ke(e);return!t.isFinite()||t.isNaN()||t.lte(0)?null:t.decimalPlaces()??0}catch{return null}},hs=(e,t)=>{if(!e)return e;const n=Math.max(0,Math.floor(t));if(e===".")return n===0?"0":"0.";if((e.match(/\./g)||[]).length!==1)return e;const[o,s=""]=e.split(".");return n===0?o:s.length<=n?e:`${o}.${s.slice(0,n)}`},mP=e=>e?e.length<=ps*2?{start:e,middle:"",end:""}:{start:e.slice(0,ps),middle:e.slice(ps,-ps),end:e.slice(-ps)}:{start:"",middle:"",end:""},bP=({withdrawAmount:e,curSelectToken:t,tokenInfo:n,currentActiveChain:r,platformBalance:o="0",fee:s="0.00",decimals:i=Gc,walletType:l="evm",receiverAddress:a="",accountType:c="perpetual",onWithdrawAmountChange:u,onReceiverAddressChange:d,onAmountChanged:p,showPoolBalanceInsufficientTip:f=!1})=>{const{t:h}=Mt(),m=g.useRef(null),[x,T]=g.useState(0),w=g.useMemo(()=>{const _=pP((n==null?void 0:n.decimals)??i,Gc),Z=hP((n==null?void 0:n.stepSize)??(n==null?void 0:n.stepsize));return Z===null?_:Math.min(_,Z)},[i,n==null?void 0:n.decimals,n==null?void 0:n.stepSize,n==null?void 0:n.stepsize]),P=g.useMemo(()=>{if(c==="spot"||!Pn(r==null?void 0:r.chainId)){const _=new ke(e||"0").minus(s||"0");if(_.isNegative()||_.isZero())return"0";const Z=Math.min(_.decimalPlaces()??0,18);return _.decimalPlaces(Z,ke.ROUND_DOWN).toString()}return e||"0"},[e,s,r==null?void 0:r.chainId,c]),A=g.useMemo(()=>o||"0",[o]),k=g.useMemo(()=>{const _=(n==null?void 0:n.feeRate)||(n==null?void 0:n.withdrawFeeRate)||(r==null?void 0:r.feeRate)||0;try{return new ke(_||0).times(100).toString()}catch{return"0"}},[n==null?void 0:n.feeRate,n==null?void 0:n.withdrawFeeRate,r==null?void 0:r.feeRate]),B=g.useMemo(()=>k==="0",[k]),F=g.useMemo(()=>(t||"").toUpperCase()==="USDC",[t]),b=g.useMemo(()=>{const _=Number(r==null?void 0:r.chainId),Z=String((r==null?void 0:r.chain)||"").trim().toUpperCase();return _===33431||_===3343||Z==="EDGE"},[r==null?void 0:r.chainId,r==null?void 0:r.chain]),v=g.useMemo(()=>{const _=(t||"").toUpperCase();return _==="USDT"||_==="USDC"},[t]),E=g.useMemo(()=>F&&B,[F,B]),M=g.useMemo(()=>!b&&E,[b,E]),$=g.useMemo(()=>E,[E]),C=g.useMemo(()=>!E,[E]),D=g.useMemo(()=>M,[M]),y=g.useMemo(()=>c===Ne.PERPETUAL&&Pn(r==null?void 0:r.chainId),[c,r==null?void 0:r.chainId]),O=c===Ne.SPOT,I=g.useMemo(()=>Pn(r==null?void 0:r.chainId)?l==="mpc"?"withdraw.noticeDescWithClaim":"withdraw.externalWalletEthNoticeDesc":"withdraw.crossChainTipsWithGas",[r==null?void 0:r.chainId,l]),S=g.useMemo(()=>mP(a),[a]),L=()=>{var _;T(((_=m.current)==null?void 0:_.scrollLeft)??0)};g.useEffect(()=>{L()},[a]);const j=_=>{const Z=_.target.value,q=hs(Z,w),ee=ds(q,A||"0");if(ee.isValid){const fe=hs(ee.formattedValue,w);u(fe),ee.errorType}else return ee.errorType==="exceed_balance",void 0;p==null||p(hs(ee.formattedValue,w))},z=()=>{const _=A||"0",Z=hs(_,w),q=ds(Z,_),H=hs(q.formattedValue,w);u(H),p==null||p(H)},W=()=>{const _=parseFloat(o||"0"),Z=parseFloat(e||"0");if(Z>0){const q=_-Z,H=_t(Math.max(0,q).toString());return N.jsxs("span",{className:"flex items-center gap-1",children:[_t(o||"0"),N.jsx("span",{className:"text-sm font-edgex-harmony text-functional-green-1 leading-[18px] font-medium",children:"→"}),H," ",t]})}return`${_t(o||"0")} ${t}`};return N.jsxs(N.Fragment,{children:[N.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-3 my-4",children:[N.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[N.jsx("input",{type:"text",placeholder:h("deposit.amount"),value:e,onChange:j,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-hidden border-none p-0 h-full"}),N.jsx("button",{onClick:z,className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:h("deposit.max")})]}),N.jsx("div",{className:"h-px bg-line-divider-secondary mb-2"}),N.jsxs("div",{className:"flex justify-between items-center",children:[N.jsx(Tn,{content:h("withdraw.availableDesc"),children:N.jsx("span",{className:"text-text-tertiary text-xs leading-[14px] border-b border-dashed border-line-divider-primary",children:h("deposit.available")})}),N.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:W()})]})]}),l==="mpc"&&(c==="spot"||!Pn(r==null?void 0:r.chainId))?N.jsxs("div",{className:"relative bg-fill-input-primary rounded-lg my-4 h-9 flex items-center px-3 overflow-hidden",children:[a?N.jsx("div",{"aria-hidden":"true",className:"absolute inset-y-0 left-3 right-3 flex items-center pointer-events-none overflow-hidden",children:N.jsxs("div",{className:"inline-flex whitespace-pre text-[12px] font-medium",style:{transform:`translateX(-${x}px)`},children:[N.jsx("span",{className:"font-medium",style:{color:zm},children:S.start}),S.middle?N.jsx("span",{className:"text-text-primary font-medium",children:S.middle}):null,S.end?N.jsx("span",{className:"font-medium",style:{color:zm},children:S.end}):null]})}):null,N.jsx("input",{ref:m,type:"text",placeholder:h("withdraw.receiverAddress"),value:a,onChange:_=>{d==null||d(_.target.value),L()},onScroll:L,onClick:L,onKeyUp:L,onSelect:L,className:`relative z-10 flex-1 bg-transparent text-[12px] font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-hidden border-none p-0 h-full ${a?"text-transparent":"text-text-primary"}`,style:a?{caretColor:"var(--color-text-primary, #f9f9f9)"}:void 0})]}):null,c===Ne.PERPETUAL&&N.jsxs("div",{className:"bg-fill-page-secondary rounded-lg mb-4",children:[N.jsx("p",{className:"text-text-tertiary text-xs leading-[18px]",children:h(I)}),N.jsx("a",{className:"block text-xs leading-[18px] mt-1 text-theme-normal",href:"https://edgex-1.gitbook.io/edgeX-documentation/getting-started/deposits-and-withdrawals/withdrawals",rel:"noreferrer",target:"_blank",children:h("withdraw.commonWithdraw")})]}),f&&N.jsxs("div",{className:"flex mb-4",children:[N.jsx("div",{className:"w-5",children:N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:h("withdraw.poolBalanceInsufficientTip")})]}),D&&N.jsxs("div",{className:"flex mb-4",children:[N.jsx("div",{className:"w-5",children:N.jsx("img",{src:Yr,className:"w-4 h-4",alt:"Warning"})}),N.jsx("div",{className:"flex-1 text-xs text-functional-orange-1",children:h("withdraw.largeWithdrawFeeTip")})]}),N.jsxs("div",{className:"py-4 border-t border-line-divider-secondary border-dashed",children:[N.jsxs("div",{className:"flex items-center justify-between h-[18px] leading-[18px]",children:[O?N.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:h("withdraw.speed")}):N.jsx(Tn,{content:N.jsxs("div",{children:[N.jsx("div",{children:h("withdraw.speedNote")}),N.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[N.jsx(as,{selectedLevel:Wt.FAST,maxLevel:3}),N.jsx("span",{children:h("withdraw.speedNoteSpeed1")})]}),N.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[N.jsx(as,{selectedLevel:Wt.Medium,maxLevel:3}),N.jsx("span",{children:h("withdraw.speedNoteSpeed2")})]}),N.jsxs("div",{className:"flex gap-1 items-center mt-1",children:[N.jsx(as,{selectedLevel:Wt.SLOW,maxLevel:3}),N.jsx("span",{children:h("withdraw.speedNoteSpeed3")})]})]}),children:N.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:h("withdraw.speed")})}),N.jsx("div",{className:"flex items-center",children:O?N.jsx("span",{className:"text-text-primary text-sm leading-4 font-medium",children:h("deposit.arrivalEstimated",{v:"5"})}):N.jsx(as,{selectedLevel:y?Wt.SLOW:Wt.FAST,maxLevel:3})})]}),(c==="spot"||!Pn(r==null?void 0:r.chainId))&&!$&&N.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[B||!v?N.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:B?h("withdraw.fee"):`${h("withdraw.fee")}/${h("withdraw.feeRate")}`}):N.jsx(Tn,{className:"w-[320px] font-normal flex items-center justify-center",content:N.jsx("span",{className:"flex items-center justify-center text-center",children:h("withdraw.feeCalculationTip")}),children:N.jsx("span",{className:"text-text-tertiary text-sm leading-4 border-b border-dashed border-line-divider-primary",children:`${h("withdraw.fee")}/${h("withdraw.feeRate")}`})}),N.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[s," ",t,!B&&` / ${k}%`]})]}),C&&N.jsxs("div",{className:"flex items-center justify-between mt-2 h-[18px]",children:[N.jsx("span",{className:"text-text-tertiary text-sm leading-4",children:h(Pn(r==null?void 0:r.chainId)?"withdraw.withdrawlAmount":"withdraw.amountToReceive")}),N.jsxs("span",{className:"text-text-primary text-sm leading-4 font-medium",children:[_t(P)," ",t]})]})]})]})};let at=null;const qc={accountChains:[],defaultAccountType:""},Um=g.forwardRef((e,t)=>{const[n,r]=g.useState(!1),[o,s]=g.useState(!1),[i,l]=g.useState(qc),a=g.useCallback(h=>{l(h||qc),r(!0)},[]),c=g.useCallback(h=>{l(m=>({...m,...h}))},[]),u=g.useCallback(()=>{r(!1),s(!1),i.onClose&&i.onClose()},[i.onClose]),d=g.useCallback(h=>{s(h)},[]),p=g.useCallback(()=>n,[n]),f=g.useCallback(()=>o,[o]);return g.useImperativeHandle(t,()=>({openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:c,setWithdrawLoading:d,isOpen:p,isLoading:f}),[a,u,c,d,p,f]),g.useEffect(()=>(at={openWithdraw:a,closeWithdraw:u,updateWithdrawOptions:c,setWithdrawLoading:d,isOpen:p,isLoading:f},()=>{at=null}),[a,u,c,d,p,f]),n?N.jsx(Gm,{isOpen:n,isLoading:o,onClose:u,config:i.config||{symbol:"USDT"},accountChains:i.accountChains,balances:i.balances,defaultChainId:i.defaultChainId,defaultSymbol:i.defaultSymbol,defaultAmount:i.defaultAmount,defaultAccountType:i.defaultAccountType,currentEquity:i.currentEquity??5e3,platformBalance:i.platformBalance||"0",fee:i.fee,wagmiHooks:i.wagmiHooks,onWithdraw:i.onWithdraw,onAccountChange:i.onAccountChange,onChainChange:i.onChainChange,onTokenChange:i.onTokenChange,onAmountChanged:i.onAmountChanged}):null});Um.displayName="WithdrawManager";const Wm=e=>{if(!at){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}at.openWithdraw(e||qc)},_m=()=>{if(!at){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}at.closeWithdraw()},Vm=e=>{if(!at){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}at.updateWithdrawOptions(e)},ji=e=>{if(!at){console.error("WithdrawManager not initialized. Make sure to render <WithdrawManager /> in your app.");return}at.setWithdrawLoading(e)},gP=()=>at?at.isOpen():!1,Hm=()=>at?at.isLoading():!1,yP=()=>({openWithdraw:Wm,closeWithdraw:_m,updateWithdrawOptions:Vm,setWithdrawLoading:ji,isOpen:gP,isLoading:Hm}),vP=({accountChains:e,defaultChainId:t,defaultSymbol:n,defaultAmount:r="",defaultAccountType:o,currentEquity:s,platformBalance:i="0",balances:l,fee:a="0.00",isLoading:c=!1,onWithdraw:u,onClose:d,onChainChange:p,onTokenChange:f,onAmountChanged:h,onAccountChange:m})=>{var we;const{t:x}=Mt(),T=g.useMemo(()=>e.map(Y=>({...Y,key:Ri(Y.key)})),[e]),w=g.useMemo(()=>Ri(o),[o]),P=g.useMemo(()=>T.some(Y=>Y.key===Ne.PERPETUALV2),[T]),A=g.useMemo(()=>{var se;if(!T||T.length===0)return w;const Y=T.find(ue=>ue.key===w);return(Y==null?void 0:Y.key)||((se=T[0])==null?void 0:se.key)||w},[T,w]),[k,B]=g.useState(A),F=g.useCallback(Y=>{var se;return((se=T.find(ue=>ue.key===Y))==null?void 0:se.chains)||[]},[T]),b=g.useMemo(()=>T.find(Y=>Y.key===k)||T[0],[T,k]),v=g.useMemo(()=>(b==null?void 0:b.chains)||[],[b]),E=g.useMemo(()=>{var Me,xe;if(!b||!Hc(b.account)||!(k===Ne.SPOT||k===Ne.PERPETUALV2))return!1;const ue=!!((Me=b.walletOptions)!=null&&Me.evm),Se=!!((xe=b.walletOptions)!=null&&xe.mpc);return ue&&Se},[b,k]),M=g.useCallback(()=>{var Y,se;return(Y=b==null?void 0:b.walletOptions)!=null&&Y.evm?"evm":(se=b==null?void 0:b.walletOptions)!=null&&se.mpc||b!=null&&b.account&&fs(b.account)?"mpc":"evm"},[b]),[$,C]=g.useState(()=>E?null:M());g.useEffect(()=>{C(E?null:M())},[k,E,M]);const D=g.useMemo(()=>{if(!b)return;if(!E)return b.account;if(!$)return;const Y=b.walletOptions;return $==="mpc"?(Y==null?void 0:Y.mpc)||b.account:(Y==null?void 0:Y.evm)||b.account},[b,E,$]),y=g.useMemo(()=>D&&fs(D)?"mpc":"evm",[D]),O=y==="mpc"?gn:Js,I=g.useMemo(()=>{if(!v||v.length===0)return{chainId:1,tokenSymbol:""};const Y=xe=>{const Ae=xe||[];if(!Ae.length)return"";const Ge="USDC".toUpperCase(),Vn=Ae.find(Ht=>(Ht.token||Ht.symbol||"").toUpperCase()===Ge)||Ae[0];return Vn.token||Vn.symbol||""};if(n){const xe=n==null?void 0:n.toUpperCase();for(const Ae of v){const lt=Ae.tokenList||[];let Ge;if(xe&&(Ge=lt.find(Vt=>(Vt.token||Vt.symbol||"").toUpperCase()===xe)),Ge){const Vt=Ge.token||Ge.symbol||n||"";return{chainId:Ae.chainId,tokenSymbol:Vt}}}}if(t){const xe=v.find(Ge=>Ge.chainId===t)||v[0],Ae=xe.tokenList||[],lt=Y(Ae);return{chainId:xe.chainId,tokenSymbol:lt}}const se="USDC",ue=xe=>Array.isArray(xe.tokenList)&&xe.tokenList.some(Ae=>(Ae.token||Ae.symbol||"").toUpperCase()===se),Se=v.find(ue)||v[0];if(!Se)return{chainId:1,tokenSymbol:""};const Me=Y(Se.tokenList);return{chainId:Se.chainId,tokenSymbol:Me}},[v,t,n]),[S,L]=g.useState(()=>I.chainId),[j,z]=g.useState(()=>I.tokenSymbol),[W,_]=g.useState(r),[Z,q]=g.useState(""),H=g.useCallback(Y=>{L(Y),p==null||p(Y)},[p]),ee=g.useCallback(Y=>{z(Y),f==null||f(Y)},[f]),fe=g.useRef(!0),me=g.useRef(j),ye=g.useRef(S);g.useEffect(()=>{if(fe.current){fe.current=!1,me.current=j,ye.current=S;return}(me.current!==j||ye.current!==S)&&(_(""),me.current=j,ye.current=S)},[j,S]);const ve=v&&v.length>0?v.find(Y=>Y.chainId===S)||v[0]:null,oe=(we=ve==null?void 0:ve.tokenList)==null?void 0:we.find(Y=>Y.token===j),V=g.useMemo(()=>{const Y=new ke(W||"0"),se=new ke(a||"0"),ue=Pn(S);return oe!=null&&oe.minWithdrawSize&&Y.lt(oe.minWithdrawSize)?{text:x("withdraw.minWithdrawParsed",{amount:oe.minWithdrawSize,token:oe.symbol||oe.token}),disabled:!0}:!W||Y.isZero()||!ue&&Y.isLessThan(se)?{text:x("withdraw.confirmWithdraw"),disabled:!0}:y==="mpc"&&(!ue||k==="spot")&&!Z.trim()?{text:x("withdraw.invalidReceiverAddress"),disabled:!0}:{text:x("withdraw.confirmWithdraw"),disabled:!1}},[x,S,W,y,Z,a,k,oe]),X=g.useMemo(()=>{const Y=(j||"").toLowerCase();if(!Y)return i||"0";const se=(l==null?void 0:l[k])||(k===Ne.PERPETUAL?l==null?void 0:l.perp:void 0),ue=se==null?void 0:se[Y];return typeof ue=="string"&&ue.length>0?ue:i||"0"},[l,k,j,i]),Q=g.useCallback(async()=>{ji(!0);try{if(u){const se={amount:new ke(W||"0").toString(),chainId:S,tokenAddress:(oe==null?void 0:oe.tokenAddress)||"",coinId:(oe==null?void 0:oe.coinId)||"",tokenSymbol:j,accountType:k,selectedToken:oe};y==="mpc"&&(!Pn(S)||k==="spot")&&(se.receiverAddress=Z),u(se)}}catch{ji(!1)}},[u,k,oe,W,S,j,y,Z]);return!v||v.length===0?N.jsx("div",{className:"text-center py-8",children:N.jsx("p",{className:"text-gray-400",children:"No chains available"})}):ve?N.jsxs(N.Fragment,{children:[N.jsx(Vh,{selectedAccount:k,options:T.map(Y=>({value:Y.key,label:Y.key===Ne.SPOT?x("account.spot"):Y.key===Ne.PERPETUAL?x(P?"account.perpetual-v1":"account.perp"):Y.key===Ne.PERPETUALV2?x("account.perpetual-v2"):Y.key})),onAccountChange:Y=>{var Vt,Vn;const se=Y||k;B(se),m==null||m(se);const ue=F(se);if(!ue||ue.length===0)return;const Se=ue.find(Ht=>Ht.chainId===S),Me=Se?Se.chainId:ue[0].chainId;L(Me),p==null||p(Me);const xe=ue.find(Ht=>Ht.chainId===Me),Ae=(xe==null?void 0:xe.tokenList)||[],Ge=Ae.some(Ht=>(Ht.symbol||Ht.token)===j)?j:((Vt=Ae[0])==null?void 0:Vt.symbol)||((Vn=Ae[0])==null?void 0:Vn.token)||"";Ge&&(z(Ge),f==null||f(Ge))},className:"w-full"}),N.jsx(_h,{currentActiveChain:ve,chainList:v,onChainChange:H,curSelectToken:j,onTokenChange:ee,walletType:O,accountType:k,showChainSpeed:k!==Ne.SPOT,txType:"withdraw"}),E&&!$&&N.jsxs("div",{className:"mb-4",children:[N.jsx("div",{className:"h-px w-full bg-[#404040] my-4"}),N.jsx("button",{type:"button",onClick:()=>C("evm"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:x("withdraw.connectedWalletTitle")}),N.jsx("div",{className:"flex items-center gap-1 shrink-0",children:N.jsx("img",{src:Fm,className:"w-12 h-5",alt:"EVM"})})]}),N.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:x("withdraw.connectedWalletDesc")})]})}),N.jsxs("div",{className:"flex items-center my-2",children:[N.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"}),N.jsx("span",{className:"mx-4 text-xs text-text-tertiary",children:x("deposit.or")}),N.jsx("div",{className:"flex-1 border-t border-dashed border-[#242424]"})]}),N.jsx("button",{type:"button",onClick:()=>C("mpc"),className:"w-full text-left rounded-lg px-3 py-[10px] bg-[#303030]",children:N.jsxs("div",{className:"flex flex-col gap-2",children:[N.jsxs("div",{className:"flex items-center justify-between gap-3",children:[N.jsx("div",{className:"text-text-primary font-edgex-harmony text-[14px] font-medium leading-[18px]",children:x("withdraw.externalWalletTitle")}),N.jsx("div",{className:"flex items-center gap-1 shrink-0",children:N.jsx("img",{src:Rm,className:"w-12 h-5",alt:"MPC"})})]}),N.jsx("div",{className:"text-text-secondary font-edgex-harmony text-[12px] font-normal leading-[18px]",children:x("withdraw.externalWalletDesc")})]})})]}),(!E||$)&&N.jsxs(N.Fragment,{children:[N.jsx(bP,{withdrawAmount:W,curSelectToken:j,tokenInfo:oe,curSelectTokenData:{balance:oe==null?void 0:oe.balance,allowance:oe==null?void 0:oe.allowance},currentActiveChain:ve,currentEquity:s||0,decimals:(oe==null?void 0:oe.decimals)??6,platformBalance:X,fee:a,walletType:y,accountType:k,receiverAddress:Z,onWithdrawAmountChange:_,onReceiverAddressChange:q,onAmountChanged:h}),N.jsxs("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors flex items-center justify-center gap-2 ${V.disabled||c?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:Q,disabled:V.disabled||c,children:[c&&N.jsx(us,{size:"xs"}),V.text]})]})]}):N.jsx("div",{className:"text-center py-8",children:N.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Gm=({isOpen:e,isLoading:t=!1,defaultAccountType:n,onClose:r,config:o,accountChains:s,defaultChainId:i,defaultSymbol:l,defaultAmount:a="",currentEquity:c=5e3,platformBalance:u="0",balances:d,fee:p,wagmiHooks:f,onWithdraw:h,onChainChange:m,onTokenChange:x,onAmountChanged:T,onAccountChange:w})=>{const{t:P}=Mt(),[A,k]=g.useState(!1),B=b=>{b.target===b.currentTarget?k(!0):k(!1)},F=b=>{A&&b.target===b.currentTarget&&r(),k(!1)};return e?Ke.createPortal(N.jsx("div",{className:"edgex-components",children:N.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-screen h-screen",style:{zIndex:98},children:N.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-99 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)"},onMouseDown:B,onMouseUp:F,"aria-hidden":"true",children:N.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:b=>{b.stopPropagation()},children:[N.jsxs("div",{className:"flex items-center justify-between mb-4",children:[N.jsx("h2",{className:"text-lg font-semibold text-white",children:P("withdraw.withdraw")}),N.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:r,"aria-label":"Close",children:N.jsx(I0,{className:"h-4 w-4"})})]}),N.jsx(vP,{accountChains:s,defaultChainId:i,defaultSymbol:l,defaultAmount:a,defaultAccountType:n,currentEquity:c,platformBalance:u,balances:d,fee:p,isLoading:t,wagmiHooks:f,onWithdraw:h,onClose:r,onChainChange:m,onTokenChange:x,onAmountChanged:T,onAccountChange:w})]})})})}),document.body):null};le.ChromeLoader=us,le.ComponentProvider=yb,le.DEFAULT_LOCALE=bs,le.Deposit=jm,le.DepositManager=$m,le.LOCALE_NAMES=mb,le.LoadingSpinner=us,le.SUPPORTED_LOCALES=Ui,le.Tooltip=Tn,le.Withdraw=Gm,le.WithdrawManager=Um,le.closeDeposit=Im,le.closeWithdraw=_m,le.formatThousands=wb,le.isDepositLoading=km,le.isWithdrawLoading=Hm,le.openDeposit=Mm,le.openWithdraw=Wm,le.setDepositLoading=Bi,le.setWithdrawLoading=ji,le.updateDepositOptions=Dm,le.updateWithdrawOptions=Vm,le.useComponentConfig=su,le.useDeposit=jx,le.useDepositManager=sP,le.useTranslation=Mt,le.useWithdraw=zx,le.useWithdrawManager=yP,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})});
|
|
187
187
|
//# sourceMappingURL=index.umd.js.map
|