@cetusprotocol/terminal 0.3.0 → 0.3.2
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/cetus-swap.cjs.js +24 -24
- package/dist/cetus-swap.cjs.js.gz +0 -0
- package/dist/cetus-swap.es.js +5194 -5050
- package/dist/cetus-swap.es.js.gz +0 -0
- package/dist/cetus-swap.umd.js +21 -21
- package/dist/cetus-swap.umd.js.gz +0 -0
- package/dist/config/provider.d.ts +3 -1
- package/dist/images/aggregator-source/metastable.png +0 -0
- package/dist/images/aggregator-source/momentum.png +0 -0
- package/dist/images/aggregator-source/obric.png +0 -0
- package/dist/images/aggregator-source/stSui.png +0 -0
- package/dist/images/aggregator-source/steamm.png +0 -0
- package/package.json +2 -2
package/dist/cetus-swap.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var c6=Object.defineProperty;var l6=(e,t,r)=>t in e?c6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var gt=(e,t,r)=>(l6(e,typeof t!="symbol"?t+"":t,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ie=require("react"),ol=require("react-dom"),zr=require("@mysten/dapp-kit");function Lm(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const R=Lm(ie),Bm=Lm(ol);function u6(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Um={exports:{}},dr=Um.exports={},qn,Hn;function cf(){throw new Error("setTimeout has not been defined")}function lf(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?qn=setTimeout:qn=cf}catch{qn=cf}try{typeof clearTimeout=="function"?Hn=clearTimeout:Hn=lf}catch{Hn=lf}})();function Fm(e){if(qn===setTimeout)return setTimeout(e,0);if((qn===cf||!qn)&&setTimeout)return qn=setTimeout,setTimeout(e,0);try{return qn(e,0)}catch{try{return qn.call(null,e,0)}catch{return qn.call(this,e,0)}}}function f6(e){if(Hn===clearTimeout)return clearTimeout(e);if((Hn===lf||!Hn)&&clearTimeout)return Hn=clearTimeout,clearTimeout(e);try{return Hn(e)}catch{try{return Hn.call(null,e)}catch{return Hn.call(this,e)}}}var bi=[],ss=!1,_o,ac=-1;function d6(){!ss||!_o||(ss=!1,_o.length?bi=_o.concat(bi):ac=-1,bi.length&&$m())}function $m(){if(!ss){var e=Fm(d6);ss=!0;for(var t=bi.length;t;){for(_o=bi,bi=[];++ac<t;)_o&&_o[ac].run();ac=-1,t=bi.length}_o=null,ss=!1,f6(e)}}dr.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];bi.push(new Vm(e,t)),bi.length===1&&!ss&&Fm($m)};function Vm(e,t){this.fun=e,this.array=t}Vm.prototype.run=function(){this.fun.apply(null,this.array)};dr.title="browser";dr.browser=!0;dr.env={};dr.argv=[];dr.version="";dr.versions={};function Oi(){}dr.on=Oi;dr.addListener=Oi;dr.once=Oi;dr.off=Oi;dr.removeListener=Oi;dr.removeAllListeners=Oi;dr.emit=Oi;dr.prependListener=Oi;dr.prependOnceListener=Oi;dr.listeners=function(e){return[]};dr.binding=function(e){throw new Error("process.binding is not supported")};dr.cwd=function(){return"/"};dr.chdir=function(e){throw new Error("process.chdir is not supported")};dr.umask=function(){return 0};var h6=Um.exports;const Mn=u6(h6);var Ar=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ta(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zm(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var uf={exports:{}},Bs={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,52 +6,52 @@
|
|
|
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
|
|
10
|
-
`+ce+V}}var xe=!1,pe;{var Le=typeof WeakMap=="function"?WeakMap:Map;pe=new Le}function Ae(V,ae){if(!V||xe)return"";{var fe=pe.get(V);if(fe!==void 0)return fe}var
|
|
11
|
-
`),Jt=
|
|
12
|
-
`),Dt=ot.length-1,Ft=Jt.length-1;Dt>=1&&Ft>=0&&ot[Dt]!==Jt[Ft];)Ft--;for(;Dt>=1&&Ft>=0;Dt--,Ft--)if(ot[Dt]!==Jt[Ft]){if(Dt!==1||Ft!==1)do if(Dt--,Ft--,Ft<0||ot[Dt]!==Jt[Ft]){var
|
|
13
|
-
`+ot[Dt].replace(" at new "," at ");return V.displayName&&
|
|
9
|
+
*/var ih;function p6(){if(ih)return Bs;ih=1;var e=ie,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(a,c,l){var u,d={},p=null,y=null;l!==void 0&&(p=""+l),c.key!==void 0&&(p=""+c.key),c.ref!==void 0&&(y=c.ref);for(u in c)n.call(c,u)&&!o.hasOwnProperty(u)&&(d[u]=c[u]);if(a&&a.defaultProps)for(u in c=a.defaultProps,c)d[u]===void 0&&(d[u]=c[u]);return{$$typeof:t,type:a,key:p,ref:y,props:d,_owner:i.current}}return Bs.Fragment=r,Bs.jsx=s,Bs.jsxs=s,Bs}var Us={},oh;function m6(){return oh||(oh=1,Mn.env.NODE_ENV!=="production"&&function(){var e=ie,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),x=Symbol.iterator,b="@@iterator";function M(V){if(V===null||typeof V!="object")return null;var ae=x&&V[x]||V[b];return typeof ae=="function"?ae:null}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(V){{for(var ae=arguments.length,fe=new Array(ae>1?ae-1:0),Re=1;Re<ae;Re++)fe[Re-1]=arguments[Re];k("error",V,fe)}}function k(V,ae,fe){{var Re=O.ReactDebugCurrentFrame,qe=Re.getStackAddendum();qe!==""&&(ae+="%s",fe=fe.concat([qe]));var Pe=fe.map(function(Fe){return String(Fe)});Pe.unshift("Warning: "+ae),Function.prototype.apply.call(console[V],console,Pe)}}var F=!1,B=!1,W=!1,z=!1,G=!1,re;re=Symbol.for("react.module.reference");function oe(V){return!!(typeof V=="string"||typeof V=="function"||V===n||V===o||G||V===i||V===l||V===u||z||V===y||F||B||W||typeof V=="object"&&V!==null&&(V.$$typeof===p||V.$$typeof===d||V.$$typeof===s||V.$$typeof===a||V.$$typeof===c||V.$$typeof===re||V.getModuleId!==void 0))}function se(V,ae,fe){var Re=V.displayName;if(Re)return Re;var qe=ae.displayName||ae.name||"";return qe!==""?fe+"("+qe+")":fe}function q(V){return V.displayName||"Context"}function L(V){if(V==null)return null;if(typeof V.tag=="number"&&P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof V=="function")return V.displayName||V.name||null;if(typeof V=="string")return V;switch(V){case n:return"Fragment";case r:return"Portal";case o:return"Profiler";case i:return"StrictMode";case l:return"Suspense";case u:return"SuspenseList"}if(typeof V=="object")switch(V.$$typeof){case a:var ae=V;return q(ae)+".Consumer";case s:var fe=V;return q(fe._context)+".Provider";case c:return se(V,V.render,"ForwardRef");case d:var Re=V.displayName||null;return Re!==null?Re:L(V.type)||"Memo";case p:{var qe=V,Pe=qe._payload,Fe=qe._init;try{return L(Fe(Pe))}catch{return null}}}return null}var h=Object.assign,f=0,m,S,T,E,I,C,g;function v(){}v.__reactDisabledLog=!0;function j(){{if(f===0){m=console.log,S=console.info,T=console.warn,E=console.error,I=console.group,C=console.groupCollapsed,g=console.groupEnd;var V={configurable:!0,enumerable:!0,value:v,writable:!0};Object.defineProperties(console,{info:V,log:V,warn:V,error:V,group:V,groupCollapsed:V,groupEnd:V})}f++}}function Q(){{if(f--,f===0){var V={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:h({},V,{value:m}),info:h({},V,{value:S}),warn:h({},V,{value:T}),error:h({},V,{value:E}),group:h({},V,{value:I}),groupCollapsed:h({},V,{value:C}),groupEnd:h({},V,{value:g})})}f<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=O.ReactCurrentDispatcher,ce;function be(V,ae,fe){{if(ce===void 0)try{throw Error()}catch(qe){var Re=qe.stack.trim().match(/\n( *(at )?)/);ce=Re&&Re[1]||""}return`
|
|
10
|
+
`+ce+V}}var xe=!1,pe;{var Le=typeof WeakMap=="function"?WeakMap:Map;pe=new Le}function Ae(V,ae){if(!V||xe)return"";{var fe=pe.get(V);if(fe!==void 0)return fe}var Re;xe=!0;var qe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Pe;Pe=Z.current,Z.current=null,j();try{if(ae){var Fe=function(){throw Error()};if(Object.defineProperty(Fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Fe,[])}catch(Zt){Re=Zt}Reflect.construct(V,[],Fe)}else{try{Fe.call()}catch(Zt){Re=Zt}V.call(Fe.prototype)}}else{try{throw Error()}catch(Zt){Re=Zt}V()}}catch(Zt){if(Zt&&Re&&typeof Zt.stack=="string"){for(var ot=Zt.stack.split(`
|
|
11
|
+
`),Jt=Re.stack.split(`
|
|
12
|
+
`),Dt=ot.length-1,Ft=Jt.length-1;Dt>=1&&Ft>=0&&ot[Dt]!==Jt[Ft];)Ft--;for(;Dt>=1&&Ft>=0;Dt--,Ft--)if(ot[Dt]!==Jt[Ft]){if(Dt!==1||Ft!==1)do if(Dt--,Ft--,Ft<0||ot[Dt]!==Jt[Ft]){var sr=`
|
|
13
|
+
`+ot[Dt].replace(" at new "," at ");return V.displayName&&sr.includes("<anonymous>")&&(sr=sr.replace("<anonymous>",V.displayName)),typeof V=="function"&&pe.set(V,sr),sr}while(Dt>=1&&Ft>=0);break}}}finally{xe=!1,Z.current=Pe,Q(),Error.prepareStackTrace=qe}var Er=V?V.displayName||V.name:"",ur=Er?be(Er):"";return typeof V=="function"&&pe.set(V,ur),ur}function Je(V,ae,fe){return Ae(V,!1)}function dt(V){var ae=V.prototype;return!!(ae&&ae.isReactComponent)}function je(V,ae,fe){if(V==null)return"";if(typeof V=="function")return Ae(V,dt(V));if(typeof V=="string")return be(V);switch(V){case l:return be("Suspense");case u:return be("SuspenseList")}if(typeof V=="object")switch(V.$$typeof){case c:return Je(V.render);case d:return je(V.type,ae,fe);case p:{var Re=V,qe=Re._payload,Pe=Re._init;try{return je(Pe(qe),ae,fe)}catch{}}}return""}var pt=Object.prototype.hasOwnProperty,we={},he=O.ReactDebugCurrentFrame;function Ce(V){if(V){var ae=V._owner,fe=je(V.type,V._source,ae?ae.type:null);he.setExtraStackFrame(fe)}else he.setExtraStackFrame(null)}function Ve(V,ae,fe,Re,qe){{var Pe=Function.call.bind(pt);for(var Fe in V)if(Pe(V,Fe)){var ot=void 0;try{if(typeof V[Fe]!="function"){var Jt=Error((Re||"React class")+": "+fe+" type `"+Fe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof V[Fe]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Jt.name="Invariant Violation",Jt}ot=V[Fe](ae,Fe,Re,fe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Dt){ot=Dt}ot&&!(ot instanceof Error)&&(Ce(qe),P("%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).",Re||"React class",fe,Fe,typeof ot),Ce(null)),ot instanceof Error&&!(ot.message in we)&&(we[ot.message]=!0,Ce(qe),P("Failed %s type: %s",fe,ot.message),Ce(null))}}}var ke=Array.isArray;function Te(V){return ke(V)}function Me(V){{var ae=typeof Symbol=="function"&&Symbol.toStringTag,fe=ae&&V[Symbol.toStringTag]||V.constructor.name||"Object";return fe}}function Ue(V){try{return ut(V),!1}catch{return!0}}function ut(V){return""+V}function ft(V){if(Ue(V))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Me(V)),ut(V)}var ze=O.ReactCurrentOwner,kt={key:!0,ref:!0,__self:!0,__source:!0},_t,Ke,It;It={};function Ut(V){if(pt.call(V,"ref")){var ae=Object.getOwnPropertyDescriptor(V,"ref").get;if(ae&&ae.isReactWarning)return!1}return V.ref!==void 0}function et(V){if(pt.call(V,"key")){var ae=Object.getOwnPropertyDescriptor(V,"key").get;if(ae&&ae.isReactWarning)return!1}return V.key!==void 0}function Et(V,ae){if(typeof V.ref=="string"&&ze.current&&ae&&ze.current.stateNode!==ae){var fe=L(ze.current.type);It[fe]||(P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',L(ze.current.type),V.ref),It[fe]=!0)}}function Ot(V,ae){{var fe=function(){_t||(_t=!0,P("%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)",ae))};fe.isReactWarning=!0,Object.defineProperty(V,"key",{get:fe,configurable:!0})}}function nt(V,ae){{var fe=function(){Ke||(Ke=!0,P("%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)",ae))};fe.isReactWarning=!0,Object.defineProperty(V,"ref",{get:fe,configurable:!0})}}var jt=function(V,ae,fe,Re,qe,Pe,Fe){var ot={$$typeof:t,type:V,key:ae,ref:fe,props:Fe,_owner:Pe};return ot._store={},Object.defineProperty(ot._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ot,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Re}),Object.defineProperty(ot,"_source",{configurable:!1,enumerable:!1,writable:!1,value:qe}),Object.freeze&&(Object.freeze(ot.props),Object.freeze(ot)),ot};function Pt(V,ae,fe,Re,qe){{var Pe,Fe={},ot=null,Jt=null;fe!==void 0&&(ft(fe),ot=""+fe),et(ae)&&(ft(ae.key),ot=""+ae.key),Ut(ae)&&(Jt=ae.ref,Et(ae,qe));for(Pe in ae)pt.call(ae,Pe)&&!kt.hasOwnProperty(Pe)&&(Fe[Pe]=ae[Pe]);if(V&&V.defaultProps){var Dt=V.defaultProps;for(Pe in Dt)Fe[Pe]===void 0&&(Fe[Pe]=Dt[Pe])}if(ot||Jt){var Ft=typeof V=="function"?V.displayName||V.name||"Unknown":V;ot&&Ot(Fe,Ft),Jt&&nt(Fe,Ft)}return jt(V,ot,Jt,qe,Re,ze.current,Fe)}}var tt=O.ReactCurrentOwner,wt=O.ReactDebugCurrentFrame;function Ct(V){if(V){var ae=V._owner,fe=je(V.type,V._source,ae?ae.type:null);wt.setExtraStackFrame(fe)}else wt.setExtraStackFrame(null)}var Ge;Ge=!1;function mt(V){return typeof V=="object"&&V!==null&&V.$$typeof===t}function Nt(){{if(tt.current){var V=L(tt.current.type);if(V)return`
|
|
14
14
|
|
|
15
15
|
Check the render method of \``+V+"`."}return""}}function it(V){{if(V!==void 0){var ae=V.fileName.replace(/^.*[\\\/]/,""),fe=V.lineNumber;return`
|
|
16
16
|
|
|
17
17
|
Check your code at `+ae+":"+fe+"."}return""}}var xt={};function zt(V){{var ae=Nt();if(!ae){var fe=typeof V=="string"?V:V.displayName||V.name;fe&&(ae=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+fe+">.")}return ae}}function N(V,ae){{if(!V._store||V._store.validated||V.key!=null)return;V._store.validated=!0;var fe=zt(ae);if(xt[fe])return;xt[fe]=!0;var
|
|
19
|
+
Check the top-level render call using <`+fe+">.")}return ae}}function N(V,ae){{if(!V._store||V._store.validated||V.key!=null)return;V._store.validated=!0;var fe=zt(ae);if(xt[fe])return;xt[fe]=!0;var Re="";V&&V._owner&&V._owner!==tt.current&&(Re=" It was passed a child from "+L(V._owner.type)+"."),Ct(V),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',fe,Re),Ct(null)}}function _(V,ae){{if(typeof V!="object")return;if(Te(V))for(var fe=0;fe<V.length;fe++){var Re=V[fe];mt(Re)&&N(Re,ae)}else if(mt(V))V._store&&(V._store.validated=!0);else if(V){var qe=M(V);if(typeof qe=="function"&&qe!==V.entries)for(var Pe=qe.call(V),Fe;!(Fe=Pe.next()).done;)mt(Fe.value)&&N(Fe.value,ae)}}}function A(V){{var ae=V.type;if(ae==null||typeof ae=="string")return;var fe;if(typeof ae=="function")fe=ae.propTypes;else if(typeof ae=="object"&&(ae.$$typeof===c||ae.$$typeof===d))fe=ae.propTypes;else return;if(fe){var Re=L(ae);Ve(fe,V.props,"prop",Re,V)}else if(ae.PropTypes!==void 0&&!Ge){Ge=!0;var qe=L(ae);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",qe||"Unknown")}typeof ae.getDefaultProps=="function"&&!ae.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function U(V){{for(var ae=Object.keys(V.props),fe=0;fe<ae.length;fe++){var Re=ae[fe];if(Re!=="children"&&Re!=="key"){Ct(V),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Re),Ct(null);break}}V.ref!==null&&(Ct(V),P("Invalid attribute `ref` supplied to `React.Fragment`."),Ct(null))}}var Y={};function ee(V,ae,fe,Re,qe,Pe){{var Fe=oe(V);if(!Fe){var ot="";(V===void 0||typeof V=="object"&&V!==null&&Object.keys(V).length===0)&&(ot+=" 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 Jt=it(qe);Jt?ot+=Jt:ot+=Nt();var Dt;V===null?Dt="null":Te(V)?Dt="array":V!==void 0&&V.$$typeof===t?(Dt="<"+(L(V.type)||"Unknown")+" />",ot=" Did you accidentally export a JSX literal instead of a component?"):Dt=typeof V,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Dt,ot)}var Ft=Pt(V,ae,fe,qe,Pe);if(Ft==null)return Ft;if(Fe){var sr=ae.children;if(sr!==void 0)if(Re)if(Te(sr)){for(var Er=0;Er<sr.length;Er++)_(sr[Er],V);Object.freeze&&Object.freeze(sr)}else P("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 _(sr,V)}if(pt.call(ae,"key")){var ur=L(V),Zt=Object.keys(ae).filter(function(Vr){return Vr!=="key"}),wr=Zt.length>0?"{key: someKey, "+Zt.join(": ..., ")+": ...}":"{key: someKey}";if(!Y[ur+wr]){var vn=Zt.length>0?"{"+Zt.join(": ..., ")+": ...}":"{}";P(`A props object containing a "key" prop is being spread into JSX:
|
|
20
20
|
let props = %s;
|
|
21
21
|
<%s {...props} />
|
|
22
22
|
React keys must be passed directly to JSX without using spread:
|
|
23
23
|
let props = %s;
|
|
24
|
-
<%s key={someKey} {...props} />`,wr,ur,bn,ur),Y[ur+wr]=!0}}return V===n?U(Ft):A(Ft),Ft}}function ne(V,ae,fe){return ee(V,ae,fe,!0)}function De(V,ae,fe){return ee(V,ae,fe,!1)}var Ze=De,Ne=ne;Us.Fragment=n,Us.jsx=Ze,Us.jsxs=Ne}()),Us}In.env.NODE_ENV==="production"?uf.exports=d6():uf.exports=h6();var w=uf.exports;window._iconfont_svg_string_4776227='<svg><symbol id="icon-link2" viewBox="0 0 1024 1024"><path d="M642.7648 217.6a166.5024 166.5024 0 0 1 166.5024 166.5024v256.256a166.5024 166.5024 0 0 1-166.5024 166.5024H386.5088a92.16 92.16 0 0 1-64.9728-157.5936L506.88 465.2032H429.2096a38.4 38.4 0 0 1-38.0416-33.1776l-0.3584-5.2224a38.4 38.4 0 0 1 38.4-38.4h170.8544l1.4336 0.0512c0.8704 0 1.6896 0.1024 2.56 0.1536l-3.9936-0.2048a38.656 38.656 0 0 1 27.2384 11.3664l1.792 1.9456 1.536 1.8944-3.328-3.84a38.6048 38.6048 0 0 1 11.1616 27.0336v170.8544a38.4 38.4 0 0 1-76.8 0l-0.0512-78.592-185.9584 184.6784a15.36 15.36 0 0 0 7.3216 25.9072l3.584 0.4096h256.2048c49.5616 0 89.7024-40.1408 89.7024-89.7024V384.1024c0-49.5104-40.1408-89.7024-89.7024-89.7024H386.5088c-49.5616 0-89.7024 40.192-89.7024 89.7024V563.2a38.4 38.4 0 0 1-76.8 0V384.1024A166.5024 166.5024 0 0 1 386.5088 217.6h256.256z" ></path></symbol><symbol id="icon-more" viewBox="0 0 1024 1024"><path d="M499.2 217.6m0-64a64 64 0 1 0 0 128 64 64 0 1 0 0-128Z" ></path><path d="M499.2 524.8m0-64a64 64 0 1 0 0 128 64 64 0 1 0 0-128Z" ></path><path d="M499.2 832m0-64a64 64 0 1 0 0 128 64 64 0 1 0 0-128Z" ></path></symbol><symbol id="icon-docs" viewBox="0 0 1024 1024"><path d="M665.6 41.728c65.9456 0 121.2928 45.312 136.6016 106.496 5.0688-2.6624 10.8544-4.096 16.9984-4.096a140.8 140.8 0 0 1 140.8 140.8v563.2a140.8 140.8 0 0 1-140.8 140.8H358.4a140.8512 140.8512 0 0 1-135.4752-102.4H204.8a140.8 140.8 0 0 1-140.8-140.8v-563.2A140.8 140.8 0 0 1 204.8 41.728h460.8z m140.8 177.0496v526.9504a140.8 140.8 0 0 1-140.8 140.8l-358.4 0.1024c11.7248 15.5136 30.3104 25.4976 51.2 25.4976h460.8c35.328 0 64-28.672 64-64v-563.2c0-35.328-28.672-64-64-64a38.3488 38.3488 0 0 1-12.8-2.1504zM665.6 118.528H204.8c-35.328 0-64 28.672-64 64v563.2c0 35.328 28.672 64 64 64h460.8c35.328 0 64-28.672 64-64v-563.2c0-35.328-28.672-64-64-64z m-153.6 281.6a38.4 38.4 0 1 1 0 76.8H256a38.4 38.4 0 1 1 0-76.8h256z m102.4-153.6a38.4 38.4 0 1 1 0 76.8H256a38.4 38.4 0 1 1 0-76.8h358.4z" ></path></symbol><symbol id="icon-link1" viewBox="0 0 1024 1024"><path d="M719.872 268.8l3.738 0.205 0.768 0.051-4.506-0.256a38.502 38.502 0 0 1 28.416 12.544l0.973 1.126a38.554 38.554 0 0 1 1.74 2.253l-2.713-3.379a38.605 38.605 0 0 1 9.984 25.549V563.2a38.4 38.4 0 1 1-76.8 0V394.086L281.856 758.221a38.4 38.4 0 0 1-51.712-56.832L620.646 345.6H463.872a38.4 38.4 0 0 1-38.042-33.178l-0.358-5.222a38.4 38.4 0 0 1 38.4-38.4h256z" ></path></symbol><symbol id="icon-icon-kfckfc" viewBox="0 0 1024 1024"><path d="M53.504 102.912c-0.41 0.563 30.208 42.086 67.84 92.006L299.008 430.9 408.32 576l-7.014 7.885c-3.943 4.352-84.327 90.521-178.432 191.488C128.717 876.595 51.354 960 51.2 960.87c-0.358 0.922 16.077 1.69 39.731 1.536l40.243-0.204 13.21-14.49A217385.626 217385.626 0 0 0 440.32 629.914l4.71-5.479 37.837 50.33L610.048 843.93l89.6 118.63H836.71c114.023 0 136.858-0.358 136.141-2.458-0.563-1.484-35.328-48.025-77.312-103.782-41.984-55.603-90.01-119.398-106.65-141.568-16.793-22.17-66.15-88.064-110.028-146.074-43.879-58.163-79.821-106.598-79.821-107.366 0-1.331 231.782-251.187 310.58-334.746l22.527-23.808h-41.42l-41.217 0.154-48.179 51.814a48197.632 48197.632 0 0 1-144.23 154.88l-95.847 102.912L445.03 258.202 328.55 103.68l-137.062-0.922c-75.418-0.563-137.626-0.41-137.984 0.154z m324.762 166.4c44.8 59.7 113.97 151.5 153.65 204.288 39.732 52.531 127.796 169.677 195.892 259.994 68.045 90.47 124.365 165.376 125.286 166.707 1.178 1.69-12.288 2.253-61.235 2.253h-62.566L605.286 737.69c-286.208-379.802-430.592-571.7-432.332-574.516-1.127-1.69 11.724-2.252 61.081-2.252h62.567l81.664 108.39z" ></path></symbol><symbol id="icon-icon_telegram" viewBox="0 0 1024 1024"><path d="M824.87808 503.6032c55.8592 0 100.096 12.544 133.4272 37.5296 34.2016 26.7264 55.9104 66.7136 64.2048 120.9344h-94.208c-5.8368-27.4944-17.5104-47.5136-34.2016-60.8768-17.5104-13.312-40.8576-19.968-69.2224-19.968-35.0208 0-62.5664 12.4928-82.5856 39.168-19.968 25.856-30.0032 62.5152-30.0032 109.2608 0 47.5136 9.216 85.0432 29.184 111.7184 18.3296 25.856 45.8752 39.2192 82.5856 39.2192 63.3856 0 98.4064-31.6928 105.8816-94.208H1024.19968c-9.984 58.368-32.512 101.7344-66.7136 130.048-33.3824 27.5456-78.3872 41.728-134.2976 41.728-66.7136 0-118.4256-21.7088-155.136-65.024-35.84-41.728-53.3504-95.9488-53.3504-162.6624 0-65.024 17.5104-118.4256 52.5312-159.2832 37.5296-45.056 90.112-67.584 157.6448-67.584z m75.7248-333.6704l-53.76 245.4528a353.792 353.792 0 0 0-12.6464-0.256c-164.096 0-316.3648 113.7664-357.0176 266.752L381.63968 771.9424c-11.6224 10.9056-20.7872 20.1216-41.5744 20.1216l14.1824-205.2608 385.1776-336.7424c16.896-14.5408-3.6352-21.6576-26.112-8.3968L237.76768 532.2752 32.35328 470.1696c-44.288-13.1584-44.544-42.7008 10.0352-64l800.3072-298.9568c36.5568-15.9744 71.8336 8.5504 57.856 62.72z" ></path></symbol><symbol id="icon-icon_medium" viewBox="0 0 1024 1024"><path d="M576.819712 497.6128c-0.7168 169.6768-139.5712 294.7584-293.376 292.3008C127.795712 787.4048-0.357888 656.1792 0.000512 495.2064 0.358912 334.9504 130.611712 204.032 288.819712 204.8c159.9488 0.768 288.2048 131.1744 288 292.8128m27.904-1.536c0.9216-72.9088 12.3904-143.3088 50.1248-207.0528 7.168-12.1856 15.872-23.8592 25.6512-33.9968 44.4928-46.08 99.4816-44.0832 141.312 4.5056 28.8768 33.5872 45.8752 73.216 56.064 115.8656 24.576 102.5536 21.2992 203.5712-19.968 301.6704-11.9808 28.416-28.5184 54.2208-52.9408 73.728-36.2496 29.1328-76.8 29.3888-112.5376-0.3072-39.2704-32.6656-59.4944-77.5168-70.7584-125.696-9.8304-41.984-14.2848-85.248-21.0944-128l4.1472-0.7168M1024.000512 470.5792c-3.1744 93.952-4.9152 159.8976-22.1696 224.0512-3.0208 11.264-6.656 22.7328-12.4928 32.6656-3.8912 6.656-11.776 14.3872-18.3296 14.8992-5.3248 0.4096-14.08-8.192-16.6912-14.6944-7.5776-18.7392-14.848-38.0928-18.6368-57.9584-16.384-86.3744-18.4832-173.7216-10.496-261.0176 3.584-39.424 11.9296-78.4896 19.1488-117.5552 1.792-9.728 6.7584-19.2512 11.776-27.9552 9.728-16.4864 22.3744-16.896 30.9248 0 7.68 15.2576 15.0528 31.744 17.408 48.4864 8.8064 62.0544 15.4112 124.416 19.5584 159.0784" ></path></symbol><symbol id="icon-icon_discord" viewBox="0 0 1024 1024"><path d="M831.8976 213.6064A748.032 748.032 0 0 0 641.7408 153.6c-8.192 14.848-17.7664 34.8672-24.3712 50.7904a694.8864 694.8864 0 0 0-210.688 0c-6.6048-15.872-16.384-35.8912-24.6272-50.7904a745.5744 745.5744 0 0 0-190.3104 60.16C71.424 396.4928 38.8096 574.6176 55.0912 750.2848a758.784 758.784 0 0 0 233.216 120.064c18.7904-26.0096 35.5328-53.6064 49.92-82.688a490.0864 490.0864 0 0 1-78.6432-38.4c6.656-4.9664 13.056-10.0864 19.3024-15.36 151.6544 71.2704 316.416 71.2704 466.2272 0 6.2976 5.2736 12.8 10.3936 19.3024 15.36a488.8576 488.8576 0 0 1-78.848 38.5024c14.4384 28.9792 31.1296 56.6784 49.9712 82.6368a757.2992 757.2992 0 0 0 233.3184-120.1152c19.1488-203.6224-32.6656-380.16-136.96-536.6784zM358.912 642.2528c-45.568 0-82.8416-42.7008-82.8416-94.72 0-51.968 36.5056-94.72 82.8416-94.72 46.336 0 83.6608 42.6496 82.8416 94.72 0.1024 52.0192-36.5056 94.72-82.8416 94.72z m306.176 0c-45.5168 0-82.8416-42.7008-82.8416-94.72 0-51.968 36.5056-94.72 82.8416-94.72 46.336 0 83.6608 42.6496 82.8416 94.72 0 52.0192-36.5056 94.72-82.8416 94.72z" ></path></symbol><symbol id="icon-icon_del" viewBox="0 0 1024 1024"><path d="M512 64a243.2512 243.2512 0 0 1 240.1792 204.8h-1.3312a140.8 140.8 0 0 1 139.1104 162.4576l-63.6928 409.6a140.8 140.8 0 0 1-139.1616 119.1424H336.896a140.8 140.8 0 0 1-139.1616-119.1424l-63.6928-409.6A140.8 140.8 0 0 1 271.8208 268.8a243.2 243.2 0 0 1 240.1792-204.8z m238.848 281.6h-477.696A64 64 0 0 0 209.92 419.4304l63.6928 409.6A64 64 0 0 0 336.896 883.2h350.208a64 64 0 0 0 63.2832-54.1696l63.6928-409.6a64 64 0 0 0-63.232-73.8304zM409.6 473.6a38.4 38.4 0 0 1 38.4 38.4v204.8a38.4 38.4 0 1 1-76.8 0v-204.8A38.4 38.4 0 0 1 409.6 473.6z m204.8 0a38.4 38.4 0 0 1 38.4 38.4v204.8a38.4 38.4 0 1 1-76.8 0v-204.8a38.4 38.4 0 0 1 38.4-38.4z m-102.4-332.8a166.4512 166.4512 0 0 0-160.0512 120.7296l-1.8944 7.2704h323.84l-1.8432-7.2704a166.5024 166.5024 0 0 0-150.6304-120.4736L512 140.8z" ></path></symbol><symbol id="icon-plorer" viewBox="0 0 1024 1024"><path d="M608 62.31l245.453 141.67a192 192 0 0 1 96 166.298v283.444a192 192 0 0 1-96 166.297L608 961.69a192 192 0 0 1-192 0L170.547 820.02a192 192 0 0 1-96-166.297V370.278a192 192 0 0 1 95.949-166.297L415.949 62.31a192 192 0 0 1 192 0z m-153.6 66.51L208.947 270.49a115.2 115.2 0 0 0-57.6 99.84v283.392a115.2 115.2 0 0 0 57.6 99.788L454.4 895.18a115.2 115.2 0 0 0 115.2 0l245.453-141.67a115.2 115.2 0 0 0 57.6-99.84V370.33a115.2 115.2 0 0 0-57.6-99.79L569.6 128.87a115.2 115.2 0 0 0-115.2 0zM726.886 324.3L577.741 764.11c-11.776 34.713-60.826 34.816-72.704 0.051L440.73 575.59l-197.94-71.987c-31.744-11.622-33.536-54.63-5.427-69.785l5.632-2.458 434.586-155.546a38.4 38.4 0 0 1 49.305 48.487z m-98.252 50.586L369.05 467.763l115.2 41.984a38.4 38.4 0 0 1 20.992 18.381l2.252 5.325 33.792 98.97 87.348-257.537z" ></path></symbol><symbol id="icon-disconnect" viewBox="0 0 1024 1024"><path d="M575.357 738.274a38.4 38.4 0 0 1 0 54.306l-72.408 72.408A243.2 243.2 0 1 1 159.012 521.05l72.408-72.408a38.4 38.4 0 1 1 54.306 54.306l-72.408 72.408a166.4 166.4 0 0 0 235.325 235.325l72.408-72.408a38.4 38.4 0 0 1 54.306 0z m-108.612-181.02a38.4 38.4 0 0 1 0 54.307L358.134 720.172a38.4 38.4 0 1 1-54.306-54.306l108.611-108.611a38.4 38.4 0 0 1 54.306 0zM756.376 702.07a38.4 38.4 0 1 1-54.306 54.306L267.624 321.93a38.4 38.4 0 1 1 54.306-54.306L756.376 702.07z m-36.204-398.242a38.4 38.4 0 0 1 0 54.306L611.561 466.745a38.4 38.4 0 1 1-54.306-54.306l108.611-108.611a38.4 38.4 0 0 1 54.306 0z m144.816-144.816a243.2 243.2 0 0 1 0 343.937l-72.408 72.408a38.4 38.4 0 1 1-54.306-54.306l72.408-72.408a166.4 166.4 0 0 0-235.325-235.325l-72.408 72.408a38.4 38.4 0 0 1-54.306-54.306l72.408-72.408a243.2 243.2 0 0 1 343.937 0z" ></path></symbol><symbol id="icon-copy" viewBox="0 0 1024 1024"><path d="M665.6 396.8a140.8 140.8 0 0 1 140.8 140.8v128a140.8 140.8 0 0 1-140.8 140.8h-128a140.8 140.8 0 0 1-140.8-140.8v-128a140.8 140.8 0 0 1 140.8-140.8h128z m0 76.8h-128c-35.328 0-64 28.672-64 64v128c0 35.328 28.672 64 64 64h128c35.328 0 64-28.672 64-64v-128c0-35.328-28.672-64-64-64z" ></path><path d="M537.6 217.6c49.46 0 89.6 40.14 89.6 89.6v25.6a38.4 38.4 0 0 1-76.8 0v-25.6a12.8 12.8 0 0 0-12.8-12.8H307.2a12.8 12.8 0 0 0-12.8 12.8v230.4c0 7.066 5.734 12.8 12.8 12.8h25.6a38.4 38.4 0 0 1 0 76.8h-25.6a89.6 89.6 0 0 1-89.6-89.6V307.2c0-49.46 40.14-89.6 89.6-89.6h230.4z" ></path></symbol><symbol id="icon-link" viewBox="0 0 1024 1024"><path d="M436.992 281.6a38.4 38.4 0 0 1 0 76.8 217.6 217.6 0 1 0 217.6 217.6 38.4 38.4 0 1 1 76.8 0 294.4 294.4 0 1 1-294.4-294.4z m385.28-102.4l3.8912 0.2048 0.6144 0.0512-4.5056-0.256a38.2464 38.2464 0 0 1 28.416 12.544l0.8704 1.024a38.5536 38.5536 0 0 1 2.0992 2.7136l-2.9696-3.7376a38.656 38.656 0 0 1 9.984 25.5488V473.6a38.4 38.4 0 1 1-76.8 0V304.4864l-399.616 364.1344a38.4 38.4 0 0 1-51.712-56.832L723.0464 256H566.272a38.4 38.4 0 0 1-38.0416-33.1776l-0.3584-5.2224a38.4 38.4 0 0 1 38.4-38.4h256z" ></path></symbol><symbol id="icon-unfold" viewBox="0 0 2048 1024"><path d="M565.248 78.131a76.8 76.8 0 0 1 108.544 0l362.086 361.984a25.6 25.6 0 0 0 36.25 0l361.984-361.984a76.8 76.8 0 0 1 108.544 108.544l-361.984 362.189a179.2 179.2 0 0 1-253.44 0L565.248 186.675a76.8 76.8 0 0 1 0-108.544z" ></path></symbol><symbol id="icon-rpc" viewBox="0 0 1024 1024"><path d="M204.8 678.4a140.8 140.8 0 1 1 0 281.6 140.8 140.8 0 0 1 0-281.6z m168.96-573.44a268.8 268.8 0 0 1 207.872 439.245l38.144 38.144a192 192 0 1 1-55.603 53.094l-39.27-39.373A268.8 268.8 0 1 1 373.76 104.96zM204.8 755.2a64 64 0 1 0 0 128 64 64 0 0 0 0-128z m517.12-125.44a115.2 115.2 0 1 0 0 230.4 115.2 115.2 0 0 0 0-230.4z m-348.16-448a192 192 0 1 0 0 384 192 192 0 0 0 0-384zM819.2 64a140.8 140.8 0 1 1 0 281.6 140.8 140.8 0 0 1 0-281.6z m0 76.8a64 64 0 1 0 0 128 64 64 0 0 0 0-128z" ></path></symbol><symbol id="icon-mev" viewBox="0 0 1024 1024"><path d="M651.162 95.488c53.401 56.422 131.84 113.818 235.212 171.674a38.4 38.4 0 0 1 19.456 29.9c12.032 129.024-12.544 251.75-73.625 367.156-60.211 113.817-158.976 226.457-295.936 338.33a38.4 38.4 0 0 1-48.589 0C356.608 895.436 259.328 782.181 196.045 662.681c-64.103-121.19-90.266-243.405-77.824-365.876a38.4 38.4 0 0 1 20.531-30.259C239.923 214.323 319.846 156.98 378.624 94.925c104.96-110.95 169.37-108.442 272.538 0.512z m126.464 196.506l-1.178 0.819a41.933 41.933 0 0 1-10.035 3.84c-4.25 1.024-5.427 1.28-14.695 3.328a122.368 122.368 0 0 0-16.896 4.403c-43.878 16.384-71.168 47.411-83.097 96.666-2.304 9.625-3.328 20.838-3.687 38.4l-0.204 13.516v15.872l0.05 9.728v2.048l0.052 3.482c0.256 35.328 0.154 51.2-1.024 71.424-4.506 79.36-42.291 140.39-108.954 178.483-29.542 16.896-61.9 23.962-99.328 23.91h-8.704a9243.136 9243.136 0 0 0-29.286-0.153h-17.46l-10.034-0.051h-22.938c40.448 50.841 88.371 100.71 143.77 149.504l17.97 15.513 17.511-14.899c101.018-88.064 176.077-175.513 225.28-262.144l9.523-17.408c50.893-96.205 73.063-197.273 66.56-303.974l-3.584-2.407a1479.786 1479.786 0 0 1-49.664-29.9z m-171.52 5.12h-1.127c-15.155 0.102-30.054 3.584-45.107 10.598-46.285 21.504-77.056 71.373-76.39 128.051 0.307 25.703 0.256 51.354 0 87.603l-0.103 10.445c-0.102 14.49-0.512 24.371-1.74 34.816-4.865 42.803-19.661 79.77-43.674 110.285l-1.792 2.15 1.331 0.052h1.331c24.832 0 44.288-4.199 61.03-13.824 44.033-25.19 67.38-62.72 70.4-116.122 1.025-18.022 1.127-32.768 0.871-66.56v-5.478l-0.051-5.223v-21.504c0-5.12 0.051-9.728 0.153-14.49 0.512-22.681 1.895-38.604 5.837-54.937a225.075 225.075 0 0 1 35.687-79.514l4.71-6.246h-11.366z m1.484-136.295l-12.236-12.544c-73.728-77.926-87.245-78.438-160.973-0.563-60.467 63.898-139.674 122.112-237.466 174.95l-3.942 2.048-0.768 17.562c-2.407 88.064 18.176 176.384 61.952 265.42l9.779 19.047c9.267 17.51 19.354 34.919 30.26 52.224l-0.871 0.154c2.406-0.512 2.406-0.512 6.144-0.973 15.104-1.536 29.593-6.86 43.776-15.974 36.454-23.552 56.883-56.576 62.105-102.247 0.82-7.168 1.127-14.848 1.23-26.726l0.102-10.343c0.256-35.84 0.307-61.132 0-86.22-1.024-86.58 46.899-164.199 120.78-198.554a183.552 183.552 0 0 1 77.312-17.766h1.536l53.044 0.256h16.076a775.117 775.117 0 0 1-67.84-59.75z" ></path></symbol><symbol id="icon-caution" viewBox="0 0 1024 1024"><path d="M512 682.666667c-47.146667 0-85.333333-42.112-85.333333-94.037334V94.037333C426.666667 42.112 464.853333 0 512 0s85.333333 42.112 85.333333 94.037333v494.592C597.333333 640.554667 559.146667 682.666667 512 682.666667zM512 1024c-47.146667 0-85.333333-35.2-85.333333-78.592v-98.816C426.666667 803.2 464.853333 768 512 768s85.333333 35.2 85.333333 78.592v98.816C597.333333 988.8 559.146667 1024 512 1024z" ></path></symbol><symbol id="icon-settings" viewBox="0 0 1024 1024"><path d="M608 62.31l245.453 141.67a192 192 0 0 1 96 166.298v283.444a192 192 0 0 1-96 166.297L608 961.69a192 192 0 0 1-192 0L170.547 820.02a192 192 0 0 1-96-166.297V370.278a192 192 0 0 1 95.949-166.297L415.949 62.31a192 192 0 0 1 192 0z m-153.6 66.51L208.947 270.49a115.2 115.2 0 0 0-57.6 99.84v283.392a115.2 115.2 0 0 0 57.6 99.788L454.4 895.18a115.2 115.2 0 0 0 115.2 0l245.453-141.67a115.2 115.2 0 0 0 57.6-99.84V370.33a115.2 115.2 0 0 0-57.6-99.79L569.6 128.87a115.2 115.2 0 0 0-115.2 0z m104.858 211.762a89.6 89.6 0 0 1 77.568 44.8l47.257 81.818a89.6 89.6 0 0 1 0 89.6l-47.257 81.818a89.6 89.6 0 0 1-77.568 44.8h-94.516a89.6 89.6 0 0 1-77.568-44.8L339.917 556.8a89.6 89.6 0 0 1 0-89.6l47.257-81.818a89.6 89.6 0 0 1 77.568-44.8h94.516z m0 76.8h-94.516a12.8 12.8 0 0 0-11.059 6.4L406.426 505.6a12.8 12.8 0 0 0 0 12.8l47.257 81.818a12.8 12.8 0 0 0 11.06 6.4h94.515a12.8 12.8 0 0 0 11.059-6.4l47.257-81.818a12.8 12.8 0 0 0 0-12.8l-47.257-81.818a12.8 12.8 0 0 0-11.06-6.4z" ></path></symbol><symbol id="icon-back" viewBox="0 0 1024 1024"><path d="M67.738 495.616l36.3 32.358 220.468 194.868c13.926 12.236 14.438 33.792 1.024 46.796l-0.41 0.41a31.898 31.898 0 0 1-44.288 0L20.736 518.554a31.744 31.744 0 0 1 0-45.773l260.096-251.597a31.898 31.898 0 0 1 44.288 0l0.46 0.41a31.846 31.846 0 0 1-1.023 46.848l-220.57 194.816-36.352 32.358z" ></path></symbol><symbol id="icon-wallet" viewBox="0 0 1024 1024"><path d="M825.6 115.2A134.4 134.4 0 0 1 960 249.6v384c0 60.877-40.448 112.282-95.949 128.82L864 785.868a140.8 140.8 0 0 1-179.456 135.373l-467.2-133.479A140.8 140.8 0 0 1 115.2 652.288V249.6a134.4 134.4 0 0 1 134.4-134.4h576zM256 225.331c-35.328 0-64 28.672-64 64V652.34c0 28.57 18.944 53.709 46.438 61.543l467.2 133.478a64 64 0 0 0 81.562-61.491v-47.616a38.502 38.502 0 0 1 0-17.306V422.861a64 64 0 0 0-46.438-61.543l-467.2-133.478A64 64 0 0 0 256 225.28zM825.6 192H427.827l334.029 95.437A140.8 140.8 0 0 1 864 422.86v253.645c11.776-10.548 19.2-25.856 19.2-42.906v-384c0-31.795-25.805-57.6-57.6-57.6z m-192 259.226a38.4 38.4 0 0 1 38.4 38.4V633.6a38.4 38.4 0 1 1-76.8 0V489.574a38.4 38.4 0 0 1 38.4-38.4z" ></path></symbol><symbol id="icon-star" viewBox="0 0 1024 1024"><path d="M474.778 72.653a84.992 84.992 0 0 1 113.1 37.683l90.727 179.712c1.024 2.15 3.277 3.686 5.939 4.096l202.906 29.082c18.278 2.56 35.174 11.059 48.128 24.064a83.302 83.302 0 0 1-1.23 119.09l-148.12 142.542a6.605 6.605 0 0 0-2.049 5.939l34.765 195.584c3.277 18.483 0.154 37.58-8.806 54.17a85.043 85.043 0 0 1-114.176 34.457L515.84 804.659a8.55 8.55 0 0 0-7.885 0l-179.968 94.31c-16.589 8.705-35.635 11.674-54.118 8.5a83.968 83.968 0 0 1-68.813-97.28l34.97-195.328a6.605 6.605 0 0 0-2.048-5.94L89.702 466.484a83.61 83.61 0 0 1-24.832-48.128 83.968 83.968 0 0 1 71.732-95.078l204.339-29.184a7.834 7.834 0 0 0 5.939-4.096l89.395-179.251c8.192-16.59 21.76-29.952 38.503-38.093z m36.198 68.25l-2.56 0.767a7.475 7.475 0 0 0-3.43 3.328l-89.344 179.303c-12.39 24.832-36.301 41.933-63.847 45.875l-204.339 29.133c-4.352 0.614-7.168 4.198-6.605 7.885a6.81 6.81 0 0 0 2.048 3.89l148.275 142.49c20.173 19.354 29.338 47.36 24.423 74.804l-34.919 195.379c-0.665 3.584 1.946 7.27 6.247 8.038 1.894 0.307 3.789 0 5.427-0.819l179.968-94.31a85.35 85.35 0 0 1 79.155 0l180.173 94.361c3.994 2.1 9.011 0.615 10.957-3.02a6.4 6.4 0 0 0 0.717-4.199l-34.714-195.533a83.354 83.354 0 0 1 24.371-74.65l148.122-142.591a6.502 6.502 0 0 0 0.102-9.524 8.14 8.14 0 0 0-4.608-2.252l-202.957-29.082c-27.392-3.942-51.2-20.89-63.59-45.517l-90.726-179.712c-1.844-3.635-6.81-5.273-10.906-3.277l2.56-0.768z" ></path></symbol><symbol id="icon-trade" viewBox="0 0 1024 1024"><path d="M1002.93153 563.627l-433.237 432.64a67.243 67.243 0 0 1-29.696 21.93c-0.853 0.171-1.45 0.342-1.963 0.342a61.27 61.27 0 0 1-22.442 4.608c-1.11 0-2.304 0.853-3.414 0.853-2.048 0-3.84-1.365-5.973-1.365a54.87 54.87 0 0 1-13.653-2.987 77.312 77.312 0 0 1-15.275-6.144c-2.987-1.621-5.803-3.67-8.533-5.803-2.56-1.962-5.718-2.816-7.936-5.461L21.34153 563.627a71.68 71.68 0 0 1 0-102.059 72.704 72.704 0 0 1 102.57 0l316.16 315.477V73.472C440.07353 33.109 472.92753 0 513.29053 0a73.387 73.387 0 0 1 73.216 73.472v701.355L900.53153 461.653a72.363 72.363 0 0 1 102.4 102.059z" ></path></symbol><symbol id="icon-verticalslider" viewBox="0 0 1024 1024"><path d="M310.426 441.6a166.4 166.4 0 0 1 38.4 328.346V870.4a38.4 38.4 0 1 1-76.8 0V769.946a166.451 166.451 0 0 1 38.4-328.346z m0 76.8a89.6 89.6 0 1 0 0 179.2 89.6 89.6 0 0 0 0-179.2z m403.2-403.2a38.4 38.4 0 0 1 38.4 38.4v55.654a166.451 166.451 0 0 1-38.4 328.346 166.4 166.4 0 0 1-38.4-328.346V153.6a38.4 38.4 0 0 1 38.4-38.4z m0 166.4a89.6 89.6 0 1 0 0 179.2 89.6 89.6 0 0 0 0-179.2zM310.323 115.2a38.4 38.4 0 0 1 38.4 38.4v146.534a38.4 38.4 0 0 1-76.8 0V153.6a38.4 38.4 0 0 1 38.4-38.4z m403.2 525.26a38.4 38.4 0 0 1 38.4 38.4V870.4a38.4 38.4 0 1 1-76.8 0V678.86a38.4 38.4 0 0 1 38.4-38.4z" ></path></symbol><symbol id="icon-swap" viewBox="0 0 1024 1024"><path d="M321.434 116.224a51.2 51.2 0 0 1 69.888 74.752c-47.77 44.646-87.04 81.818-117.658 111.462l-1.997 1.844h289.229a51.2 51.2 0 0 1 50.842 45.26l0.358 5.94a51.2 51.2 0 0 1-51.2 51.2H154.47a51.763 51.763 0 0 1-52.07-52.839c0.205-11.52 3.123-19.097 7.782-27.136 3.226-5.53 7.22-10.752 12.8-17.203 8.192-9.626 20.992-23.04 38.656-40.704a7171.584 7171.584 0 0 1 159.744-152.576z m509.593 188.058a51.2 51.2 0 0 1 0 102.4h-93.593a51.2 51.2 0 0 1 0-102.4h93.593zM663.194 853.709a51.2 51.2 0 0 1-69.888-74.803c47.77-44.647 87.04-81.818 117.657-111.412l2.048-1.894H153.6a51.2 51.2 0 0 1-50.842-45.21l-0.358-5.99a51.2 51.2 0 0 1 51.2-51.2h676.557c27.904 0 52.582 22.272 52.07 52.838a51.456 51.456 0 0 1-7.782 27.136c-3.226 5.53-7.22 10.752-12.8 17.204-8.192 9.625-20.992 23.04-38.656 40.704a7171.584 7171.584 0 0 1-159.744 152.627z" ></path></symbol><symbol id="icon-star_sel" viewBox="0 0 1024 1024"><path d="M470.63 127.846L381.286 307.2a46.182 46.182 0 0 1-34.918 24.986l-204.34 29.184a45.568 45.568 0 0 0-39.167 51.456 45.344 45.344 0 0 0 13.465 26.01l148.276 142.438c10.905 10.496 15.872 25.6 13.21 40.448l-34.97 195.328a45.568 45.568 0 0 0 37.58 52.633 46.95 46.95 0 0 0 29.748-4.659l179.968-94.31a46.95 46.95 0 0 1 43.52 0l180.121 94.361c22.528 11.827 50.586 3.43 62.618-18.688a44.8 44.8 0 0 0 4.71-29.184L746.394 621.62a45.005 45.005 0 0 1 13.21-40.294l148.12-142.592a44.902 44.902 0 0 0 0.666-64.256 46.54 46.54 0 0 0-26.368-13.21l-202.956-29.081a46.182 46.182 0 0 1-34.765-24.781l-90.727-179.712a46.592 46.592 0 0 0-82.944 0.205z" ></path></symbol><symbol id="icon-tips" viewBox="0 0 1024 1024"><path d="M512 166.4a345.6 345.6 0 1 1 0 691.2 345.6 345.6 0 0 1 0-691.2z m0 76.8a268.8 268.8 0 1 0 0 537.6 268.8 268.8 0 0 0 0-537.6z m0 196.3a38.4 38.4 0 0 1 38.4 38.4v219.29a38.4 38.4 0 1 1-76.8 0V477.9a38.4 38.4 0 0 1 38.4-38.4z m0-153.087a38.4 38.4 0 0 1 38.4 38.4v45.414a38.4 38.4 0 1 1-76.8 0v-45.363a38.4 38.4 0 0 1 38.4-38.4z" ></path></symbol><symbol id="icon-sel" viewBox="0 0 1024 1024"><path d="M783.36 281.2416a51.2 51.2 0 0 1 71.68 73.0624l-407.9616 400.384a51.2 51.2 0 0 1-67.8912 3.4304l-206.3872-165.376a51.2 51.2 0 1 1 64-79.9232l170.9568 137.0112 375.6032-368.64z" ></path></symbol><symbol id="icon-spread" viewBox="0 0 1024 1024"><path d="M143.36 678.4a38.4 38.4 0 0 1 38.4 38.4v112.64c0 7.066 5.734 12.8 12.8 12.8H307.2a38.4 38.4 0 1 1 0 76.8H194.56a89.6 89.6 0 0 1-89.6-89.6V716.8a38.4 38.4 0 0 1 38.4-38.4z m327.68-573.44a38.4 38.4 0 0 1 0 76.8H234.342L842.24 790.477v-242.33a38.4 38.4 0 1 1 76.8 0V829.44a89.6 89.6 0 0 1-89.6 89.6H552.96a38.4 38.4 0 1 1 0-76.8l232.346-0.051L181.76 237.773V471.04a38.4 38.4 0 0 1-76.8 0V194.56c0-49.46 40.14-89.6 89.6-89.6h276.48z m358.4 0c49.46 0 89.6 40.14 89.6 89.6V307.2a38.4 38.4 0 1 1-76.8 0V194.56a12.8 12.8 0 0 0-12.8-12.8H716.8a38.4 38.4 0 1 1 0-76.8h112.64z" ></path></symbol><symbol id="icon-refresh" viewBox="0 0 1024 1024"><path d="M601.446 178.176a344.576 344.576 0 0 1 124.621 62.413 38.4 38.4 0 0 1 5.12 55.45l-94.566 107.878a38.4 38.4 0 1 1-57.754-50.586l65.741-75.11-4.915-2.816a268.646 268.646 0 0 0-43.008-18.535l-15.104-4.505A268.8 268.8 0 1 0 771.635 581.58a38.4 38.4 0 1 1 74.189 19.865 345.6 345.6 0 1 1-244.378-423.27z" ></path></symbol><symbol id="icon-close" viewBox="0 0 1024 1024"><path d="M763.392 256.512a51.2 51.2 0 0 1 0 72.3968L582.2464 509.952l183.1424 183.1424a51.2 51.2 0 0 1-72.3968 72.3968l-183.1424-183.1424-180.992 181.0432a51.2 51.2 0 0 1-72.3968-72.3968L437.504 509.952 258.56 330.9568A51.2 51.2 0 0 1 330.9568 258.56L509.952 437.504l181.0432-180.992a51.2 51.2 0 0 1 72.3968 0z" ></path></symbol><symbol id="icon-alert" viewBox="0 0 1024 1024"><path d="M558.08 125.0816c12.6464 7.5776 23.1936 18.1248 30.72 30.72L959.232 773.12a89.6 89.6 0 0 1-76.8 135.68H141.6192a89.6 89.6 0 0 1-76.8-135.68L435.1488 155.8016a89.6 89.6 0 0 1 122.9312-30.72zM501.0432 195.328L130.6624 812.5952a12.8 12.8 0 0 0 10.9568 19.4048h740.7616a12.8 12.8 0 0 0 10.9568-19.4048L522.9568 195.328a12.8 12.8 0 0 0-21.9136 0zM512 524.8a38.4 38.4 0 0 1 38.4 38.4v153.6a38.4 38.4 0 1 1-76.8 0v-153.6a38.4 38.4 0 0 1 38.4-38.4z m0-204.8a38.4 38.4 0 0 1 38.4 38.4v51.2a38.4 38.4 0 1 1-76.8 0V358.4a38.4 38.4 0 0 1 38.4-38.4z" ></path></symbol><symbol id="icon-arrow" viewBox="0 0 1024 1024"><path d="M572.33 707.67l220.673-220.673a85.333 85.333 0 0 0-60.331-145.664H291.328a85.333 85.333 0 0 0-60.33 145.664L451.668 707.67a85.333 85.333 0 0 0 120.662 0z" ></path></symbol></svg>',(e=>{var t=(r=(r=document.getElementsByTagName("script"))[r.length-1]).getAttribute("data-injectcss"),r=r.getAttribute("data-disable-injectsvg");if(!r){var n,i,o,s,a,c=function(d,p){p.parentNode.insertBefore(d,p)};if(t&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch{}}n=function(){var d,p=document.createElement("div");p.innerHTML=e._iconfont_svg_string_4776227,(p=p.getElementsByTagName("svg")[0])&&(p.setAttribute("aria-hidden","true"),p.style.position="absolute",p.style.width=0,p.style.height=0,p.style.overflow="hidden",p=p,(d=document.body).firstChild?c(p,d.firstChild):d.appendChild(p))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=n,s=e.document,a=!1,u(),s.onreadystatechange=function(){s.readyState=="complete"&&(s.onreadystatechange=null,l())})}function l(){a||(a=!0,o())}function u(){try{s.documentElement.doScroll("left")}catch{return void setTimeout(u,50)}l()}})(window);const p6="1.26.1",m6="1.47.0",g6={"-32700":"ParseError","-32701":"OversizedRequest","-32702":"OversizedResponse","-32600":"InvalidRequest","-32601":"MethodNotFound","-32602":"InvalidParams","-32603":"InternalError","-32604":"ServerBusy","-32000":"CallExecutionFailed","-32001":"UnknownError","-32003":"SubscriptionClosed","-32004":"SubscriptionClosedWithError","-32005":"BatchesNotSupported","-32006":"TooManySubscriptions","-32050":"TransientError","-32002":"TransactionExecutionClientError"};class Vm extends Error{}class zm extends Vm{constructor(t,r){super(t),this.code=r,this.type=g6[r]??"ServerError"}}class v6 extends Vm{constructor(t,r,n){super(t),this.status=r,this.statusText=n}}var qm=e=>{throw TypeError(e)},ld=(e,t,r)=>t.has(e)||qm("Cannot "+r),ar=(e,t,r)=>(ld(e,t,"read from private field"),r?r.call(e):t.get(e)),co=(e,t,r)=>t.has(e)?qm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),as=(e,t,r,n)=>(ld(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Hm=(e,t,r)=>(ld(e,t,"access private method"),r),b6=(e,t,r,n)=>({set _(i){as(e,t,i,r)},get _(){return ar(e,t,n)}}),vo,ea,mi,Eo,ca,cs,Ac,Wm,Gm;function y6(e){const t=new URL(e);return t.protocol=t.protocol.replace("http","ws"),t.toString()}const w6={WebSocketConstructor:typeof WebSocket<"u"?WebSocket:void 0,callTimeout:3e4,reconnectTimeout:3e3,maxReconnects:5};class x6{constructor(t,r={}){if(co(this,Ac),co(this,vo,0),co(this,ea,0),co(this,mi,null),co(this,Eo,null),co(this,ca,new Set),co(this,cs,new Map),this.endpoint=t,this.options={...w6,...r},!this.options.WebSocketConstructor)throw new Error("Missing WebSocket constructor");this.endpoint.startsWith("http")&&(this.endpoint=y6(this.endpoint))}async makeRequest(t,r){const n=await Hm(this,Ac,Wm).call(this);return new Promise((i,o)=>{as(this,vo,ar(this,vo)+1),ar(this,cs).set(ar(this,vo),{resolve:i,reject:o,timeout:setTimeout(()=>{ar(this,cs).delete(ar(this,vo)),o(new Error(`Request timeout: ${t}`))},this.options.callTimeout)}),n.send(JSON.stringify({jsonrpc:"2.0",id:ar(this,vo),method:t,params:r}))}).then(({error:i,result:o})=>{if(i)throw new zm(i.message,i.code);return o})}async subscribe(t){const r=new S6(t);return ar(this,ca).add(r),await r.subscribe(this),()=>r.unsubscribe(this)}}vo=new WeakMap;ea=new WeakMap;mi=new WeakMap;Eo=new WeakMap;ca=new WeakMap;cs=new WeakMap;Ac=new WeakSet;Wm=function(){return ar(this,Eo)?ar(this,Eo):(as(this,Eo,new Promise(e=>{var t;(t=ar(this,mi))==null||t.close(),as(this,mi,new this.options.WebSocketConstructor(this.endpoint)),ar(this,mi).addEventListener("open",()=>{as(this,ea,0),e(ar(this,mi))}),ar(this,mi).addEventListener("close",()=>{b6(this,ea)._++,ar(this,ea)<=this.options.maxReconnects&&setTimeout(()=>{Hm(this,Ac,Gm).call(this)},this.options.reconnectTimeout)}),ar(this,mi).addEventListener("message",({data:r})=>{let n;try{n=JSON.parse(r)}catch(i){console.error(new Error(`Failed to parse RPC message: ${r}`,{cause:i}));return}if("id"in n&&n.id!=null&&ar(this,cs).has(n.id)){const{resolve:i,timeout:o}=ar(this,cs).get(n.id);clearTimeout(o),i(n)}else if("params"in n){const{params:i}=n;ar(this,ca).forEach(o=>{o.subscriptionId===i.subscription&&i.subscription===o.subscriptionId&&o.onMessage(i.result)})}})})),ar(this,Eo))};Gm=async function(){var e;return(e=ar(this,mi))==null||e.close(),as(this,Eo,null),Promise.allSettled([...ar(this,ca)].map(t=>t.subscribe(this)))};class S6{constructor(t){this.subscriptionId=null,this.subscribed=!1,this.input=t}onMessage(t){this.subscribed&&this.input.onMessage(t)}async unsubscribe(t){const{subscriptionId:r}=this;return this.subscribed=!1,r==null?!1:(this.subscriptionId=null,t.makeRequest(this.input.unsubscribe,[r]))}async subscribe(t){this.subscriptionId=null,this.subscribed=!0;const r=await t.makeRequest(this.input.method,this.input.params);this.subscribed&&(this.subscriptionId=r)}}var Km=e=>{throw TypeError(e)},ud=(e,t,r)=>t.has(e)||Km("Cannot "+r),cn=(e,t,r)=>(ud(e,t,"read from private field"),r?r.call(e):t.get(e)),Ha=(e,t,r)=>t.has(e)?Km("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ff=(e,t,r,n)=>(ud(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),_6=(e,t,r)=>(ud(e,t,"access private method"),r),Ks,_n,ta,df,Ym;class E6{constructor(t){Ha(this,df),Ha(this,Ks,0),Ha(this,_n),Ha(this,ta),ff(this,_n,t)}fetch(t,r){const n=cn(this,_n).fetch??fetch;if(!n)throw new Error("The current environment does not support fetch, you can provide a fetch implementation in the options for SuiHTTPTransport.");return n(t,r)}async request(t){var i,o;ff(this,Ks,cn(this,Ks)+1);const r=await this.fetch(((i=cn(this,_n).rpc)==null?void 0:i.url)??cn(this,_n).url,{method:"POST",headers:{"Content-Type":"application/json","Client-Sdk-Type":"typescript","Client-Sdk-Version":p6,"Client-Target-Api-Version":m6,"Client-Request-Method":t.method,...(o=cn(this,_n).rpc)==null?void 0:o.headers},body:JSON.stringify({jsonrpc:"2.0",id:cn(this,Ks),method:t.method,params:t.params})});if(!r.ok)throw new v6(`Unexpected status code: ${r.status}`,r.status,r.statusText);const n=await r.json();if("error"in n&&n.error!=null)throw new zm(n.error.message,n.error.code);return n.result}async subscribe(t){const r=await _6(this,df,Ym).call(this).subscribe(t);return async()=>!!await r()}}Ks=new WeakMap;_n=new WeakMap;ta=new WeakMap;df=new WeakSet;Ym=function(){var e;if(!cn(this,ta)){const t=cn(this,_n).WebSocketConstructor??WebSocket;if(!t)throw new Error("The current environment does not support WebSocket, you can provide a WebSocketConstructor in the options for SuiHTTPTransport.");ff(this,ta,new x6(((e=cn(this,_n).websocket)==null?void 0:e.url)??cn(this,_n).url,{WebSocketConstructor:t,...cn(this,_n).websocket}))}return cn(this,ta)};function Xm(e){switch(e){case"mainnet":return"https://fullnode.mainnet.sui.io:443";case"testnet":return"https://fullnode.testnet.sui.io:443";case"devnet":return"https://fullnode.devnet.sui.io:443";case"localnet":return"http://127.0.0.1:9000";default:throw new Error(`Unknown network: ${e}`)}}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function C6(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Jm(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(r=>typeof r=="string"):t.every(r=>Number.isSafeInteger(r)):!1}function hf(e,t){if(typeof t!="string")throw new Error(`${e}: string expected`);return!0}function Zm(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function pf(e){if(!Array.isArray(e))throw new Error("array expected")}function Qm(e,t){if(!Jm(!0,t))throw new Error(`${e}: array of strings expected`)}function T6(e,t){if(!Jm(!1,t))throw new Error(`${e}: array of numbers expected`)}function A6(...e){const t=o=>o,r=(o,s)=>a=>o(s(a)),n=e.map(o=>o.encode).reduceRight(r,t),i=e.map(o=>o.decode).reduce(r,t);return{encode:n,decode:i}}function M6(e){const t=typeof e=="string"?e.split(""):e,r=t.length;Qm("alphabet",t);const n=new Map(t.map((i,o)=>[i,o]));return{encode:i=>(pf(i),i.map(o=>{if(!Number.isSafeInteger(o)||o<0||o>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${o}". Allowed: ${e}`);return t[o]})),decode:i=>(pf(i),i.map(o=>{hf("alphabet.decode",o);const s=n.get(o);if(s===void 0)throw new Error(`Unknown letter: "${o}". Allowed: ${e}`);return s}))}}function I6(e=""){return hf("join",e),{encode:t=>(Qm("join.decode",t),t.join(e)),decode:t=>(hf("join.decode",t),t.split(e))}}function ih(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(pf(e),!e.length)return[];let n=0;const i=[],o=Array.from(e,a=>{if(Zm(a),a<0||a>=t)throw new Error(`invalid integer: ${a}`);return a}),s=o.length;for(;;){let a=0,c=!0;for(let l=n;l<s;l++){const u=o[l],d=t*a,p=d+u;if(!Number.isSafeInteger(p)||d/t!==a||p-u!==d)throw new Error("convertRadix: carry overflow");const y=p/r;a=p%r;const x=Math.floor(y);if(o[l]=x,!Number.isSafeInteger(x)||x*r+a!==p)throw new Error("convertRadix: carry overflow");if(c)x?c=!1:n=l;else continue}if(i.push(a),c)break}for(let a=0;a<e.length-1&&e[a]===0;a++)i.push(0);return i.reverse()}function R6(e){Zm(e);const t=2**8;return{encode:r=>{if(!C6(r))throw new Error("radix.encode input should be Uint8Array");return ih(Array.from(r),t,e)},decode:r=>(T6("radix.decode",r),Uint8Array.from(ih(r,e,t)))}}const O6=e=>A6(R6(58),M6(e),I6("")),eg=O6("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),jo=e=>eg.encode(e),_i=e=>eg.decode(e),P6=jo,N6=_i;function Sr(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const lu=8192;function yr(e){if(e.length<lu)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=lu){const n=e.slice(r,r+lu);t+=String.fromCharCode(...n)}return btoa(t)}const tg=yr,rg=Sr;function _s(e){var i;const t=e.startsWith("0x")?e.slice(2):e,r=t.length%2===0?t:`0${t}`,n=((i=r.match(/[0-9a-fA-F]{2}/g))==null?void 0:i.map(o=>parseInt(o,16)))??[];if(n.length!==r.length/2)throw new Error(`Invalid hex string ${e}`);return Uint8Array.from(n)}function Ei(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}const ng=Ei,ig=_s;function Mc(e){let t=[],r=0;if(e===0)return[0];for(;e>0;)t[r]=e&127,(e>>=7)&&(t[r]|=128),r+=1;return t}function k6(e){let t=0,r=0,n=0;for(;;){let i=e[n];if(n+=1,t|=(i&127)<<r,!(i&128))break;r+=7}return{value:t,length:n}}class og{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer)}shift(t){return this.bytePosition+=t,this}read8(){let t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){let t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){let t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){let t=this.read32(),n=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let t=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let t=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(t){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,t);return this.shift(t),n}readULEB(){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t),{value:n,length:i}=k6(r);return this.shift(i),n}readVec(t){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(t(this,i,r));return n}}function sg(e,t){switch(t){case"base58":return jo(e);case"base64":return yr(e);case"hex":return Ei(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function j6(e,t){switch(t){case"base58":return _i(e);case"base64":return Sr(e);case"hex":return _s(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function fd(e,t=["<",">"]){const[r,n]=t,i=[];let o="",s=0;for(let a=0;a<e.length;a++){const c=e[a];if(c===r&&s++,c===n&&s--,s===0&&c===","){i.push(o.trim()),o="";continue}o+=c}return i.push(o.trim()),i}class ag{constructor({initialSize:t=1024,maxSize:r=1/0,allocateSize:n=1024}={}){this.bytePosition=0,this.size=t,this.maxSize=r,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(t))}ensureSizeOrGrow(t){const r=this.bytePosition+t;if(r>this.size){const n=Math.min(this.maxSize,this.size+this.allocateSize);if(r>n)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${r}`);this.size=n;const i=new ArrayBuffer(this.size);new Uint8Array(i).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(i)}}shift(t){return this.bytePosition+=t,this}write8(t){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(t)),this.shift(1)}write16(t){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(t),!0),this.shift(2)}write32(t){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(t),!0),this.shift(4)}write64(t){return uu(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return uu(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return uu(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return Mc(t).forEach(r=>this.write8(r)),this}writeVec(t,r){return this.writeULEB(t.length),Array.from(t).forEach((n,i)=>r(this,n,i,t.length)),this}*[Symbol.iterator](){for(let t=0;t<this.bytePosition;t++)yield this.dataView.getUint8(t);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(t){return sg(this.toBytes(),t)}}function uu(e,t){let r=new Uint8Array(t),n=0;for(;e>0;)r[n]=Number(e%BigInt(256)),e=e/BigInt(256),n+=1;return r}var cg=e=>{throw TypeError(e)},lg=(e,t,r)=>t.has(e)||cg("Cannot "+r),En=(e,t,r)=>(lg(e,t,"read from private field"),r?r.call(e):t.get(e)),Ic=(e,t,r)=>t.has(e)?cg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Rc=(e,t,r,n)=>(lg(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),es,Ys,cc,Li;const D6=class ug{constructor(t){Ic(this,es),Ic(this,Ys),this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),Rc(this,es,t.write),Rc(this,Ys,t.serialize??((r,n)=>{const i=new ag({initialSize:this.serializedSize(r)??void 0,...n});return En(this,es).call(this,r,i),i.toBytes()})),this.validate=t.validate??(()=>{})}write(t,r){this.validate(t),En(this,es).call(this,t,r)}serialize(t,r){return this.validate(t),new dg(this,En(this,Ys).call(this,t,r))}parse(t){const r=new og(t);return this.read(r)}fromHex(t){return this.parse(_s(t))}fromBase58(t){return this.parse(_i(t))}fromBase64(t){return this.parse(Sr(t))}transform({name:t,input:r,output:n,validate:i}){return new ug({name:t??this.name,read:o=>n?n(this.read(o)):this.read(o),write:(o,s)=>En(this,es).call(this,r?r(o):o,s),serializedSize:o=>this.serializedSize(r?r(o):o),serialize:(o,s)=>En(this,Ys).call(this,r?r(o):o,s),validate:o=>{i==null||i(o),this.validate(r?r(o):o)}})}};es=new WeakMap;Ys=new WeakMap;let Cn=D6;const fg=Symbol.for("@mysten/serialized-bcs");function sl(e){return!!e&&typeof e=="object"&&e[fg]===!0}class dg{constructor(t,r){Ic(this,cc),Ic(this,Li),Rc(this,cc,t),Rc(this,Li,r)}get[fg](){return!0}toBytes(){return En(this,Li)}toHex(){return Ei(En(this,Li))}toBase64(){return yr(En(this,Li))}toBase58(){return jo(En(this,Li))}parse(){return En(this,cc).parse(En(this,Li))}}cc=new WeakMap;Li=new WeakMap;function Oc({size:e,...t}){return new Cn({...t,serializedSize:()=>e})}function fu({readMethod:e,writeMethod:t,...r}){return Oc({...r,read:n=>n[e](),write:(n,i)=>i[t](n),validate:n=>{var i;if(n<0||n>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${n}. Expected value in range 0-${r.maxValue}`);(i=r.validate)==null||i.call(r,n)}})}function du({readMethod:e,writeMethod:t,...r}){return Oc({...r,read:n=>n[e](),write:(n,i)=>i[t](BigInt(n)),validate:n=>{var o;const i=BigInt(n);if(i<0||i>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${i}. Expected value in range 0-${r.maxValue}`);(o=r.validate)==null||o.call(r,i)}})}function L6({serialize:e,...t}){const r=new Cn({...t,serialize:e,write:(n,i)=>{for(const o of r.serialize(n).toBytes())i.write8(o)}});return r}function B6({toBytes:e,fromBytes:t,...r}){return new Cn({...r,read:n=>{const i=n.readULEB(),o=n.readBytes(i);return t(o)},write:(n,i)=>{const o=e(n);i.writeULEB(o.length);for(let s=0;s<o.length;s++)i.write8(o[s])},serialize:n=>{const i=e(n),o=Mc(i.length),s=new Uint8Array(o.length+i.length);return s.set(o,0),s.set(i,o.length),s},validate:n=>{var i;if(typeof n!="string")throw new TypeError(`Invalid ${r.name} value: ${n}. Expected string`);(i=r.validate)==null||i.call(r,n)}})}function U6(e){let t=null;function r(){return t||(t=e()),t}return new Cn({name:"lazy",read:n=>r().read(n),serializedSize:n=>r().serializedSize(n),write:(n,i)=>r().write(n,i),serialize:(n,i)=>r().serialize(n,i).toBytes()})}const H={u8(e){return fu({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return fu({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return fu({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return du({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return du({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return du({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return Oc({name:"bool",size:1,read:t=>t.read8()===1,write:(t,r)=>r.write8(t?1:0),...e,validate:t=>{var r;if((r=e==null?void 0:e.validate)==null||r.call(e,t),typeof t!="boolean")throw new TypeError(`Expected boolean, found ${typeof t}`)}})},uleb128(e){return L6({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(Mc(t)),...e})},bytes(e,t){return Oc({name:`bytes[${e}]`,size:e,read:r=>r.readBytes(e),write:(r,n)=>{const i=new Uint8Array(r);for(let o=0;o<e;o++)n.write8(i[o]??0)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!r||typeof r!="object"||!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e)throw new TypeError(`Expected array of length ${e}, found ${r.length}`)}})},byteVector(e){return new Cn({name:"bytesVector",read:t=>{const r=t.readULEB();return t.readBytes(r)},write:(t,r)=>{const n=new Uint8Array(t);r.writeULEB(n.length);for(let i=0;i<n.length;i++)r.write8(n[i]??0)},...e,serializedSize:t=>{const r="length"in t?t.length:null;return r==null?null:Mc(r).length+r},validate:t=>{var r;if((r=e==null?void 0:e.validate)==null||r.call(e,t),!t||typeof t!="object"||!("length"in t))throw new TypeError(`Expected array, found ${typeof t}`)}})},string(e){return B6({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new Cn({name:`${t.name}[${e}]`,read:n=>{const i=new Array(e);for(let o=0;o<e;o++)i[o]=t.read(n);return i},write:(n,i)=>{for(const o of n)t.write(o,i)},...r,validate:n=>{var i;if((i=r==null?void 0:r.validate)==null||i.call(r,n),!n||typeof n!="object"||!("length"in n))throw new TypeError(`Expected array, found ${typeof n}`);if(n.length!==e)throw new TypeError(`Expected array of length ${e}, found ${n.length}`)}})},option(e){return H.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:t=>t==null?{None:!0}:{Some:t},output:t=>t.$kind==="Some"?t.Some:null})},vector(e,t){return new Cn({name:`vector<${e.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let o=0;o<n;o++)i[o]=e.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)e.write(i,n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!r||typeof r!="object"||!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(e,t){return new Cn({name:`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<e.length;i++){const o=e[i].serializedSize(r[i]);if(o==null)return null;n+=o}return n},read:r=>{const n=[];for(const i of e)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<e.length;i++)e[i].write(r[i],n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e.length)throw new TypeError(`Expected array of length ${e.length}, found ${r.length}`)}})},struct(e,t,r){const n=Object.entries(t);return new Cn({name:e,serializedSize:i=>{let o=0;for(const[s,a]of n){const c=a.serializedSize(i[s]);if(c==null)return null;o+=c}return o},read:i=>{const o={};for(const[s,a]of n)o[s]=a.read(i);return o},write:(i,o)=>{for(const[s,a]of n)a.write(i[s],o)},...r,validate:i=>{var o;if((o=r==null?void 0:r.validate)==null||o.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})},enum(e,t,r){const n=Object.entries(t);return new Cn({name:e,read:i=>{const o=i.readULEB(),s=n[o];if(!s)throw new TypeError(`Unknown value ${o} for enum ${e}`);const[a,c]=s;return{[a]:(c==null?void 0:c.read(i))??!0,$kind:a}},write:(i,o)=>{const[s,a]=Object.entries(i).filter(([c])=>Object.hasOwn(t,c))[0];for(let c=0;c<n.length;c++){const[l,u]=n[c];if(l===s){o.writeULEB(c),u==null||u.write(a,o);return}}},...r,validate:i=>{var a;if((a=r==null?void 0:r.validate)==null||a.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`);const o=Object.keys(i).filter(c=>i[c]!==void 0&&Object.hasOwn(t,c));if(o.length!==1)throw new TypeError(`Expected object with one key, but found ${o.length} for type ${e}}`);const[s]=o;if(!Object.hasOwn(t,s))throw new TypeError(`Invalid enum variant ${s}`)}})},map(e,t){return H.vector(H.tuple([e,t])).transform({name:`Map<${e.name}, ${t.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,o]of r)n.set(i,o);return n}})},lazy(e){return U6(e)}},F6=Object.freeze(Object.defineProperty({__proto__:null,BcsReader:og,BcsType:Cn,BcsWriter:ag,SerializedBcs:dg,bcs:H,decodeStr:j6,encodeStr:sg,fromB58:N6,fromB64:rg,fromBase58:_i,fromBase64:Sr,fromHEX:ig,fromHex:_s,isSerializedBcs:sl,splitGenericParameters:fd,toB58:P6,toB64:tg,toBase58:jo,toBase64:yr,toHEX:ng,toHex:Ei},Symbol.toStringTag,{value:"Module"}));class hg{constructor({network:t}){this.network=t}$extend(...t){return Object.create(this,Object.fromEntries(t.map(r=>{if("experimental_asClientExtension"in r){const{name:n,register:i}=r.experimental_asClientExtension();return[n,{value:i(this)}]}return[r.name,{value:r.register(this)}]})))}}const pg=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,mg=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,$6=235;function gg(e){return e.length>$6?!1:e.includes("@")?pg.test(e):mg.test(e)}function vg(e,t="at"){const r=e.toLowerCase();let n;if(r.includes("@")){if(!pg.test(r))throw new Error(`Invalid SuiNS name ${e}`);const[i,o]=r.split("@");n=[...i?i.split("."):[],o]}else{if(!mg.test(r))throw new Error(`Invalid SuiNS name ${e}`);n=r.split(".").slice(0,-1)}return t==="dot"?`${n.join(".")}.sui`:`${n.slice(0,-1).join(".")}@${n[n.length-1]}`}const V6=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,z6=/^\d+$/,q6=64,bg="/",dd=e=>{const t=e.split(bg);if(t.length<2||t.length>3)return!1;const[r,n,i]=t;return i!==void 0&&!z6.test(i)||!gg(r)?!1:V6.test(n)&&n.length<q6},H6=e=>{const t=e.split(/::|<|>|,/);for(const r of t)if(r.includes(bg)&&!dd(r))return!1;return!0},W6=32;function mf(e){try{return _i(e).length===W6}catch{return!1}}const al=32;function Wn(e){return K6(e)&&Y6(e)===al}function Xs(e){return Wn(e)}function G6(e){return e.includes("::")?hd(e):e}function hd(e){const[t,r]=e.split("::"),n=dd(t),i=e.slice(t.length+r.length+4),o=i.includes("<")?i.slice(0,i.indexOf("<")):i,s=i.includes("<")?fd(i.slice(i.indexOf("<")+1,i.lastIndexOf(">"))).map(a=>G6(a.trim())):[];return{address:n?t:Bt(t),module:r,name:o,typeParams:s}}function yg(e){const{address:t,module:r,name:n,typeParams:i}=typeof e=="string"?hd(e):e,o=(i==null?void 0:i.length)>0?`<${i.map(s=>typeof s=="string"?s:yg(s)).join(",")}>`:"";return`${t}::${r}::${n}${o}`}function Bt(e,t=!1){let r=e.toLowerCase();return!t&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(al*2,"0")}`}function Jr(e,t=!1){return Bt(e,t)}function K6(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function Y6(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}const X6=/^vector<(.+)>$/,J6=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;let Pc=class ts{static parseFromStr(t,r=!1){if(t==="address")return{address:null};if(t==="bool")return{bool:null};if(t==="u8")return{u8:null};if(t==="u16")return{u16:null};if(t==="u32")return{u32:null};if(t==="u64")return{u64:null};if(t==="u128")return{u128:null};if(t==="u256")return{u256:null};if(t==="signer")return{signer:null};const n=t.match(X6);if(n)return{vector:ts.parseFromStr(n[1],r)};const i=t.match(J6);if(i)return{struct:{address:r?Bt(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:ts.parseStructTypeArgs(i[5],r)}};throw new Error(`Encountered unexpected token when parsing type args for ${t}`)}static parseStructTypeArgs(t,r=!1){return fd(t).map(n=>ts.parseFromStr(n,r))}static tagToString(t){if("bool"in t)return"bool";if("u8"in t)return"u8";if("u16"in t)return"u16";if("u32"in t)return"u32";if("u64"in t)return"u64";if("u128"in t)return"u128";if("u256"in t)return"u256";if("address"in t)return"address";if("signer"in t)return"signer";if("vector"in t)return`vector<${ts.tagToString(t.vector)}>`;if("struct"in t){const r=t.struct,n=r.typeParams.map(ts.tagToString).join(", ");return`${r.address}::${r.module}::${r.name}${n?`<${n}>`:""}`}throw new Error("Invalid TypeTag")}};function Z6(e){return H.u64({name:"unsafe_u64",...e}).transform({input:t=>t,output:t=>Number(t)})}function Q6(e){return H.enum("Option",{None:null,Some:e})}const rr=H.bytes(al).transform({validate:e=>{const t=typeof e=="string"?e:Ei(e);if(!t||!Wn(Bt(t)))throw new Error(`Invalid Sui address ${t}`)},input:e=>typeof e=="string"?_s(Bt(e)):e,output:e=>Bt(Ei(e))}),An=H.vector(H.u8()).transform({name:"ObjectDigest",input:e=>_i(e),output:e=>jo(new Uint8Array(e)),validate:e=>{if(_i(e).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),an=H.struct("SuiObjectRef",{objectId:rr,version:H.u64(),digest:An}),wg=H.struct("SharedObjectRef",{objectId:rr,initialSharedVersion:H.u64(),mutable:H.bool()}),xg=H.enum("ObjectArg",{ImmOrOwnedObject:an,SharedObject:wg,Receiving:an}),Co=H.enum("Owner",{AddressOwner:rr,ObjectOwner:rr,Shared:H.struct("Shared",{initialSharedVersion:H.u64()}),Immutable:null,ConsensusV2:H.struct("ConsensusV2",{authenticator:H.struct("Authenticator",{SingleOwner:H.string()}),startVersion:H.string()})}),Sg=H.enum("CallArg",{Pure:H.struct("Pure",{bytes:H.vector(H.u8()).transform({input:e=>typeof e=="string"?Sr(e):e,output:e=>yr(new Uint8Array(e))})}),Object:xg}),pd=H.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:H.lazy(()=>pd),struct:H.lazy(()=>Mg),u16:null,u32:null,u256:null}),md=pd.transform({input:e=>typeof e=="string"?Pc.parseFromStr(e,!0):e,output:e=>Pc.tagToString(e)}),$n=H.enum("Argument",{GasCoin:null,Input:H.u16(),Result:H.u16(),NestedResult:H.tuple([H.u16(),H.u16()])}),_g=H.struct("ProgrammableMoveCall",{package:rr,module:H.string(),function:H.string(),typeArguments:H.vector(md),arguments:H.vector($n)}),Eg=H.enum("Command",{MoveCall:_g,TransferObjects:H.struct("TransferObjects",{objects:H.vector($n),address:$n}),SplitCoins:H.struct("SplitCoins",{coin:$n,amounts:H.vector($n)}),MergeCoins:H.struct("MergeCoins",{destination:$n,sources:H.vector($n)}),Publish:H.struct("Publish",{modules:H.vector(H.vector(H.u8()).transform({input:e=>typeof e=="string"?Sr(e):e,output:e=>yr(new Uint8Array(e))})),dependencies:H.vector(rr)}),MakeMoveVec:H.struct("MakeMoveVec",{type:Q6(md).transform({input:e=>e===null?{None:!0}:{Some:e},output:e=>e.Some??null}),elements:H.vector($n)}),Upgrade:H.struct("Upgrade",{modules:H.vector(H.vector(H.u8()).transform({input:e=>typeof e=="string"?Sr(e):e,output:e=>yr(new Uint8Array(e))})),dependencies:H.vector(rr),package:rr,ticket:$n})}),Cg=H.struct("ProgrammableTransaction",{inputs:H.vector(Sg),commands:H.vector(Eg)}),Tg=H.enum("TransactionKind",{ProgrammableTransaction:Cg,ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null}),Ag=H.enum("TransactionExpiration",{None:null,Epoch:Z6()}),Mg=H.struct("StructTag",{address:rr,module:H.string(),name:H.string(),typeParams:H.vector(pd)}),Ig=H.struct("GasData",{payment:H.vector(an),owner:rr,price:H.u64(),budget:H.u64()}),Rg=H.struct("TransactionDataV1",{kind:Tg,sender:rr,gasData:Ig,expiration:Ag}),Og=H.enum("TransactionData",{V1:Rg}),Pg=H.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),Ng=H.enum("IntentVersion",{V0:null}),kg=H.enum("AppId",{Sui:null}),jg=H.struct("Intent",{scope:Pg,version:Ng,appId:kg});function Dg(e){return H.struct(`IntentMessage<${e.name}>`,{intent:jg,value:e})}const Lg=H.enum("CompressedSignature",{ED25519:H.fixedArray(64,H.u8()),Secp256k1:H.fixedArray(64,H.u8()),Secp256r1:H.fixedArray(64,H.u8()),ZkLogin:H.vector(H.u8())}),Bg=H.enum("PublicKey",{ED25519:H.fixedArray(32,H.u8()),Secp256k1:H.fixedArray(33,H.u8()),Secp256r1:H.fixedArray(33,H.u8()),ZkLogin:H.vector(H.u8())}),Ug=H.struct("MultiSigPkMap",{pubKey:Bg,weight:H.u8()}),Fg=H.struct("MultiSigPublicKey",{pk_map:H.vector(Ug),threshold:H.u16()}),e4=H.struct("MultiSig",{sigs:H.vector(Lg),bitmap:H.u16(),multisig_pk:Fg}),t4=H.vector(H.u8()).transform({input:e=>typeof e=="string"?Sr(e):e,output:e=>yr(new Uint8Array(e))}),$g=H.struct("SenderSignedTransaction",{intentMessage:Dg(Og),txSignatures:H.vector(t4)}),r4=H.vector($g,{name:"SenderSignedData"}),n4=H.struct("PasskeyAuthenticator",{authenticatorData:H.vector(H.u8()),clientDataJson:H.string(),userSignature:H.vector(H.u8())}),i4=H.enum("PackageUpgradeError",{UnableToFetchPackage:H.struct("UnableToFetchPackage",{packageId:rr}),NotAPackage:H.struct("NotAPackage",{objectId:rr}),IncompatibleUpgrade:null,DigestDoesNotMatch:H.struct("DigestDoesNotMatch",{digest:H.vector(H.u8())}),UnknownUpgradePolicy:H.struct("UnknownUpgradePolicy",{policy:H.u8()}),PackageIDDoesNotMatch:H.struct("PackageIDDoesNotMatch",{packageId:rr,ticketId:rr})}),o4=H.struct("ModuleId",{address:rr,name:H.string()}),oh=H.struct("MoveLocation",{module:o4,function:H.u16(),instruction:H.u16(),functionName:H.option(H.string())}),s4=H.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:H.struct("IndexOutOfBounds",{idx:H.u16()}),SecondaryIndexOutOfBounds:H.struct("SecondaryIndexOutOfBounds",{resultIdx:H.u16(),secondaryIdx:H.u16()}),InvalidResultArity:H.struct("InvalidResultArity",{resultIdx:H.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null}),a4=H.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),c4=H.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:H.struct("MoveObjectTooBig",{objectSize:H.u64(),maxObjectSize:H.u64()}),MovePackageTooBig:H.struct("MovePackageTooBig",{objectSize:H.u64(),maxObjectSize:H.u64()}),CircularObjectOwnership:H.struct("CircularObjectOwnership",{object:rr}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:H.option(oh),MoveAbort:H.tuple([oh,H.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:H.struct("CommandArgumentError",{argIdx:H.u16(),kind:s4}),TypeArgumentError:H.struct("TypeArgumentError",{argumentIdx:H.u16(),kind:a4}),UnusedValueWithoutDrop:H.struct("UnusedValueWithoutDrop",{resultIdx:H.u16(),secondaryIdx:H.u16()}),InvalidPublicFunctionReturnType:H.struct("InvalidPublicFunctionReturnType",{idx:H.u16()}),InvalidTransferObject:null,EffectsTooLarge:H.struct("EffectsTooLarge",{currentSize:H.u64(),maxSize:H.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:H.struct("PackageUpgradeError",{upgradeError:i4}),WrittenObjectsTooLarge:H.struct("WrittenObjectsTooLarge",{currentSize:H.u64(),maxSize:H.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:H.struct("ExecutionCancelledDueToSharedObjectCongestion",{congestedObjects:H.vector(rr)}),AddressDeniedForCoin:H.struct("AddressDeniedForCoin",{address:rr,coinType:H.string()}),CoinTypeGlobalPause:H.struct("CoinTypeGlobalPause",{coinType:H.string()}),ExecutionCancelledDueToRandomnessUnavailable:null}),Vg=H.enum("ExecutionStatus",{Success:null,Failed:H.struct("ExecutionFailed",{error:c4,command:H.option(H.u64())})}),zg=H.struct("GasCostSummary",{computationCost:H.u64(),storageCost:H.u64(),storageRebate:H.u64(),nonRefundableStorageFee:H.u64()}),l4=H.struct("TransactionEffectsV1",{status:Vg,executedEpoch:H.u64(),gasUsed:zg,modifiedAtVersions:H.vector(H.tuple([rr,H.u64()])),sharedObjects:H.vector(an),transactionDigest:An,created:H.vector(H.tuple([an,Co])),mutated:H.vector(H.tuple([an,Co])),unwrapped:H.vector(H.tuple([an,Co])),deleted:H.vector(an),unwrappedThenDeleted:H.vector(an),wrapped:H.vector(an),gasObject:H.tuple([an,Co]),eventsDigest:H.option(An),dependencies:H.vector(An)}),gd=H.tuple([H.u64(),An]),u4=H.enum("ObjectIn",{NotExist:null,Exist:H.tuple([gd,Co])}),f4=H.enum("ObjectOut",{NotExist:null,ObjectWrite:H.tuple([An,Co]),PackageWrite:gd}),d4=H.enum("IDOperation",{None:null,Created:null,Deleted:null}),h4=H.struct("EffectsObjectChange",{inputState:u4,outputState:f4,idOperation:d4}),p4=H.enum("UnchangedSharedKind",{ReadOnlyRoot:gd,MutateDeleted:H.u64(),ReadDeleted:H.u64(),Cancelled:H.u64(),PerEpochConfig:null}),m4=H.struct("TransactionEffectsV2",{status:Vg,executedEpoch:H.u64(),gasUsed:zg,transactionDigest:An,gasObjectIndex:H.option(H.u32()),eventsDigest:H.option(An),dependencies:H.vector(An),lamportVersion:H.u64(),changedObjects:H.vector(H.tuple([rr,h4])),unchangedSharedObjects:H.vector(H.tuple([rr,p4])),auxDataDigest:H.option(An)}),g4=H.enum("TransactionEffects",{V1:l4,V2:m4});function ra(e){switch(e){case"u8":return H.u8();case"u16":return H.u16();case"u32":return H.u32();case"u64":return H.u64();case"u128":return H.u128();case"u256":return H.u256();case"bool":return H.bool();case"string":return H.string();case"id":case"address":return rr}const t=e.match(/^(vector|option)<(.+)>$/);if(t){const[r,n]=t.slice(1);return r==="vector"?H.vector(ra(n)):H.option(ra(n))}throw new Error(`Invalid Pure type name: ${e}`)}const vt={...H,U8:H.u8(),U16:H.u16(),U32:H.u32(),U64:H.u64(),U128:H.u128(),U256:H.u256(),ULEB128:H.uleb128(),Bool:H.bool(),String:H.string(),Address:rr,AppId:kg,Argument:$n,CallArg:Sg,CompressedSignature:Lg,GasData:Ig,Intent:jg,IntentMessage:Dg,IntentScope:Pg,IntentVersion:Ng,MultiSig:e4,MultiSigPkMap:Ug,MultiSigPublicKey:Fg,ObjectArg:xg,ObjectDigest:An,Owner:Co,ProgrammableMoveCall:_g,ProgrammableTransaction:Cg,PublicKey:Bg,SenderSignedData:r4,SenderSignedTransaction:$g,SharedObjectRef:wg,StructTag:Mg,SuiObjectRef:an,Command:Eg,TransactionData:Og,TransactionDataV1:Rg,TransactionExpiration:Ag,TransactionKind:Tg,TypeTag:md,TransactionEffects:g4,PasskeyAuthenticator:n4};function v4(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}var ci;function b4(e){return{lang:(e==null?void 0:e.lang)??(ci==null?void 0:ci.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(ci==null?void 0:ci.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(ci==null?void 0:ci.abortPipeEarly)}}var hu;function y4(e){return hu==null?void 0:hu.get(e)}var pu;function w4(e){return pu==null?void 0:pu.get(e)}var mu;function x4(e,t){var r;return(r=mu==null?void 0:mu.get(e))==null?void 0:r.get(t)}function qg(e){var r,n;const t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&((n=(r=Object.getPrototypeOf(e))==null?void 0:r.constructor)==null?void 0:n.name))??"null":t}function tn(e,t,r,n,i){const o=i&&"input"in i?i.input:r.value,s=(i==null?void 0:i.expected)??e.expects??null,a=(i==null?void 0:i.received)??qg(o),c={kind:e.kind,type:e.type,input:o,expected:s,received:a,message:`Invalid ${t}: ${s?`Expected ${s} but r`:"R"}eceived ${a}`,requirement:e.requirement,path:i==null?void 0:i.path,issues:i==null?void 0:i.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},l=e.kind==="schema",u=(i==null?void 0:i.message)??e.message??x4(e.reference,c.lang)??(l?w4(c.lang):null)??n.message??y4(c.lang);u&&(c.message=typeof u=="function"?u(c):u),l&&(r.typed=!1),r.issues?r.issues.push(c):r.issues=[c]}function S4(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}var _4=class extends Error{constructor(t){super(t[0].message);gt(this,"issues");this.name="ValiError",this.issues=t}};function Aa(e,t){return{kind:"validation",type:"check",reference:Aa,async:!1,expects:null,requirement:e,message:t,_run(r,n){return r.typed&&!this.requirement(r.value)&&tn(this,"input",r,n),r}}}function lr(e){return{kind:"validation",type:"integer",reference:lr,async:!1,expects:null,requirement:Number.isInteger,message:e,_run(t,r){return t.typed&&!this.requirement(t.value)&&tn(this,"integer",t,r),t}}}function cl(e){return{kind:"transformation",type:"transform",reference:cl,async:!1,operation:e,_run(t){return t.value=this.operation(t.value),t}}}function vd(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function gf(e,t){return!e._run({typed:!1,value:t},{abortEarly:!0}).issues}function rt(e,t){return{kind:"schema",type:"array",reference:rt,expects:"Array",async:!1,item:e,message:t,_run(r,n){var o;const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){const a=i[s],c=this.item._run({typed:!1,value:a},n);if(c.issues){const l={type:"array",origin:"value",input:i,key:s,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(o=r.issues)==null||o.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),r.value.push(c.value)}}else tn(this,"type",r,n);return r}}}function bd(e){return{kind:"schema",type:"bigint",reference:bd,expects:"bigint",async:!1,message:e,_run(t,r){return typeof t.value=="bigint"?t.typed=!0:tn(this,"type",t,r),t}}}function ll(e){return{kind:"schema",type:"boolean",reference:ll,expects:"boolean",async:!1,message:e,_run(t,r){return typeof t.value=="boolean"?t.typed=!0:tn(this,"type",t,r),t}}}function la(e){return{kind:"schema",type:"lazy",reference:la,expects:"unknown",async:!1,getter:e,_run(t,r){return this.getter(t.value)._run(t,r)}}}function ct(e,t){return{kind:"schema",type:"literal",reference:ct,expects:qg(e),async:!1,literal:e,message:t,_run(r,n){return r.value===this.literal?r.typed=!0:tn(this,"type",r,n),r}}}function Vt(e,...t){const r={kind:"schema",type:"nullable",reference:Vt,expects:`${e.expects} | null`,async:!1,wrapped:e,_run(n,i){return n.value===null&&("default"in this&&(n.value=vd(this,n,i)),n.value===null)?(n.typed=!0,n):this.wrapped._run(n,i)}};return 0 in t&&(r.default=t[0]),r}function hs(e,...t){const r={kind:"schema",type:"nullish",reference:hs,expects:`${e.expects} | null | undefined`,async:!1,wrapped:e,_run(n,i){return(n.value===null||n.value===void 0)&&("default"in this&&(n.value=vd(this,n,i)),n.value===null||n.value===void 0)?(n.typed=!0,n):this.wrapped._run(n,i)}};return 0 in t&&(r.default=t[0]),r}function ir(e){return{kind:"schema",type:"number",reference:ir,expects:"number",async:!1,message:e,_run(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:tn(this,"type",t,r),t}}}function Ie(e,t){return{kind:"schema",type:"object",reference:Ie,expects:"Object",async:!1,entries:e,message:t,_run(r,n){var o;const i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(const s in this.entries){const a=i[s],c=this.entries[s]._run({typed:!1,value:a},n);if(c.issues){const l={type:"object",origin:"value",input:i,key:s,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(o=r.issues)==null||o.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),(c.value!==void 0||s in i)&&(r.value[s]=c.value)}}else tn(this,"type",r,n);return r}}}function Or(e,...t){const r={kind:"schema",type:"optional",reference:Or,expects:`${e.expects} | undefined`,async:!1,wrapped:e,_run(n,i){return n.value===void 0&&("default"in this&&(n.value=vd(this,n,i)),n.value===void 0)?(n.typed=!0,n):this.wrapped._run(n,i)}};return 0 in t&&(r.default=t[0]),r}function ua(e,t,r){return{kind:"schema",type:"record",reference:ua,expects:"Object",async:!1,key:e,value:t,message:r,_run(n,i){var s,a;const o=n.value;if(o&&typeof o=="object"){n.typed=!0,n.value={};for(const c in o)if(S4(o,c)){const l=o[c],u=this.key._run({typed:!1,value:c},i);if(u.issues){const p={type:"object",origin:"key",input:o,key:c,value:l};for(const y of u.issues)y.path=[p],(s=n.issues)==null||s.push(y);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}const d=this.value._run({typed:!1,value:l},i);if(d.issues){const p={type:"object",origin:"value",input:o,key:c,value:l};for(const y of d.issues)y.path?y.path.unshift(p):y.path=[p],(a=n.issues)==null||a.push(y);if(n.issues||(n.issues=d.issues),i.abortEarly){n.typed=!1;break}}(!u.typed||!d.typed)&&(n.typed=!1),u.typed&&(n.value[u.value]=d.value)}}else tn(this,"type",n,i);return n}}}function yt(e){return{kind:"schema",type:"string",reference:yt,expects:"string",async:!1,message:e,_run(t,r){return typeof t.value=="string"?t.typed=!0:tn(this,"type",t,r),t}}}function yd(e,t){return{kind:"schema",type:"tuple",reference:yd,expects:"Array",async:!1,items:e,message:t,_run(r,n){var o;const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<this.items.length;s++){const a=i[s],c=this.items[s]._run({typed:!1,value:a},n);if(c.issues){const l={type:"array",origin:"value",input:i,key:s,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(o=r.issues)==null||o.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),r.value.push(c.value)}}else tn(this,"type",r,n);return r}}}function sh(e){let t;if(e)for(const r of e)t?t.push(...r.issues):t=r.issues;return t}function Ir(e,t){return{kind:"schema",type:"union",reference:Ir,expects:[...new Set(e.map(r=>r.expects))].join(" | ")||"never",async:!1,options:e,message:t,_run(r,n){let i,o,s;for(const a of this.options){const c=a._run({typed:!1,value:r.value},n);if(c.typed)if(c.issues)o?o.push(c):o=[c];else{i=c;break}else s?s.push(c):s=[c]}if(i)return i;if(o){if(o.length===1)return o[0];tn(this,"type",r,n,{issues:sh(o)}),r.typed=!0}else{if((s==null?void 0:s.length)===1)return s[0];tn(this,"type",r,n,{issues:sh(s)})}return r}}}function Io(){return{kind:"schema",type:"unknown",reference:Io,expects:"unknown",async:!1,_run(e){return e.typed=!0,e}}}function cr(e,t,r){const n=e._run({typed:!1,value:t},b4(r));if(n.issues)throw new _4(n.issues);return n.value}function Wt(...e){return{...e[0],pipe:e,_run(t,r){for(let n=0;n<e.length;n++){if(t.issues&&(e[n].kind==="schema"||e[n].kind==="transformation")){t.typed=!1;break}(!t.issues||!r.abortEarly&&!r.abortPipeEarly)&&(t=e[n]._run(t,r))}return t}}}function Do(e){const t=Object.entries(e).map(([r,n])=>Ie({[r]:n}));return Wt(Ir(t),cl(r=>({...r,$kind:Object.keys(r)[0]})))}const Es=Wt(yt(),cl(e=>Bt(e)),Aa(Wn)),Zr=Es,Ro=yt(),zr=Wt(Ir([yt(),Wt(ir(),lr())]),Aa(e=>{try{return BigInt(e),BigInt(e)>=0&&BigInt(e)<=18446744073709551615n}catch{return!1}},"Invalid u64")),Ki=Ie({objectId:Es,version:zr,digest:yt()}),tr=Wt(Ir([Ie({GasCoin:ct(!0)}),Ie({Input:Wt(ir(),lr()),type:Or(ct("pure"))}),Ie({Input:Wt(ir(),lr()),type:Or(ct("object"))}),Ie({Result:Wt(ir(),lr())}),Ie({NestedResult:yd([Wt(ir(),lr()),Wt(ir(),lr())])})]),cl(e=>({...e,$kind:Object.keys(e)[0]}))),E4=Ie({budget:Vt(zr),price:Vt(zr),owner:Vt(Es),payment:Vt(rt(Ki))}),vf=Ir([ct("address"),ct("bool"),ct("u8"),ct("u16"),ct("u32"),ct("u64"),ct("u128"),ct("u256"),Ie({vector:la(()=>vf)}),Ie({datatype:Ie({package:yt(),module:yt(),type:yt(),typeParameters:rt(la(()=>vf))})}),Ie({typeParameter:Wt(ir(),lr())})]),C4=Ie({ref:Vt(Ir([ct("&"),ct("&mut")])),body:vf}),T4=Ie({package:Zr,module:yt(),function:yt(),typeArguments:rt(yt()),arguments:rt(tr),_argumentTypes:Or(Vt(rt(C4)))}),A4=Ie({name:yt(),inputs:ua(yt(),Ir([tr,rt(tr)])),data:ua(yt(),Io())}),M4=Do({MoveCall:T4,TransferObjects:Ie({objects:rt(tr),address:tr}),SplitCoins:Ie({coin:tr,amounts:rt(tr)}),MergeCoins:Ie({destination:tr,sources:rt(tr)}),Publish:Ie({modules:rt(Ro),dependencies:rt(Zr)}),MakeMoveVec:Ie({type:Vt(yt()),elements:rt(tr)}),Upgrade:Ie({modules:rt(Ro),dependencies:rt(Zr),package:Zr,ticket:tr}),$Intent:A4}),Hg=Do({ImmOrOwnedObject:Ki,SharedObject:Ie({objectId:Zr,initialSharedVersion:zr,mutable:ll()}),Receiving:Ki}),I4=Do({Object:Hg,Pure:Ie({bytes:Ro}),UnresolvedPure:Ie({value:Io()}),UnresolvedObject:Ie({objectId:Zr,version:Or(Vt(zr)),digest:Or(Vt(yt())),initialSharedVersion:Or(Vt(zr))})}),ah=Do({Object:Hg,Pure:Ie({bytes:Ro})}),Wg=Do({None:ct(!0),Epoch:zr}),lc=Ie({version:ct(2),sender:hs(Es),expiration:hs(Wg),gasData:E4,inputs:rt(I4),commands:rt(M4)}),lo={MoveCall(e){const[t,r="",n=""]="target"in e?e.target.split("::"):[e.package,e.module,e.function];return{$kind:"MoveCall",MoveCall:{package:t,module:r,function:n,typeArguments:e.typeArguments??[],arguments:e.arguments??[]}}},TransferObjects(e,t){return{$kind:"TransferObjects",TransferObjects:{objects:e.map(r=>cr(tr,r)),address:cr(tr,t)}}},SplitCoins(e,t){return{$kind:"SplitCoins",SplitCoins:{coin:cr(tr,e),amounts:t.map(r=>cr(tr,r))}}},MergeCoins(e,t){return{$kind:"MergeCoins",MergeCoins:{destination:cr(tr,e),sources:t.map(r=>cr(tr,r))}}},Publish({modules:e,dependencies:t}){return{$kind:"Publish",Publish:{modules:e.map(r=>typeof r=="string"?r:yr(new Uint8Array(r))),dependencies:t.map(r=>Jr(r))}}},Upgrade({modules:e,dependencies:t,package:r,ticket:n}){return{$kind:"Upgrade",Upgrade:{modules:e.map(i=>typeof i=="string"?i:yr(new Uint8Array(i))),dependencies:t.map(i=>Jr(i)),package:r,ticket:cr(tr,n)}}},MakeMoveVec({type:e,elements:t}){return{$kind:"MakeMoveVec",MakeMoveVec:{type:e??null,elements:t.map(r=>cr(tr,r))}}},Intent({name:e,inputs:t={},data:r={}}){return{$kind:"$Intent",$Intent:{name:e,inputs:Object.fromEntries(Object.entries(t).map(([n,i])=>[n,Array.isArray(i)?i.map(o=>cr(tr,o)):cr(tr,i)])),data:r}}}},bf=Ie({digest:yt(),objectId:yt(),version:Ir([Wt(ir(),lr()),yt(),bd()])}),R4=Do({ImmOrOwned:bf,Shared:Ie({objectId:Zr,initialSharedVersion:zr,mutable:ll()}),Receiving:bf}),ch=Do({Object:R4,Pure:rt(Wt(ir(),lr()))}),Gg=Ir([Ie({kind:ct("Input"),index:Wt(ir(),lr()),value:Io(),type:Or(ct("object"))}),Ie({kind:ct("Input"),index:Wt(ir(),lr()),value:Io(),type:ct("pure")})]),O4=Ir([Ie({Epoch:Wt(ir(),lr())}),Ie({None:Vt(ct(!0))})]),lh=Wt(Ir([ir(),yt(),bd()]),Aa(e=>{if(!["string","number","bigint"].includes(typeof e))return!1;try{return BigInt(e),!0}catch{return!1}})),wd=Ir([Ie({bool:Vt(ct(!0))}),Ie({u8:Vt(ct(!0))}),Ie({u64:Vt(ct(!0))}),Ie({u128:Vt(ct(!0))}),Ie({address:Vt(ct(!0))}),Ie({signer:Vt(ct(!0))}),Ie({vector:la(()=>wd)}),Ie({struct:la(()=>P4)}),Ie({u16:Vt(ct(!0))}),Ie({u32:Vt(ct(!0))}),Ie({u256:Vt(ct(!0))})]),P4=Ie({address:yt(),module:yt(),name:yt(),typeParams:rt(wd)}),N4=Ie({budget:Or(lh),price:Or(lh),payment:Or(rt(bf)),owner:Or(yt())}),k4=[Gg,Ie({kind:ct("GasCoin")}),Ie({kind:ct("Result"),index:Wt(ir(),lr())}),Ie({kind:ct("NestedResult"),index:Wt(ir(),lr()),resultIndex:Wt(ir(),lr())})],Ci=Ir([...k4]),j4=Ie({kind:ct("MoveCall"),target:Wt(yt(),Aa(e=>e.split("::").length===3)),typeArguments:rt(yt()),arguments:rt(Ci)}),D4=Ie({kind:ct("TransferObjects"),objects:rt(Ci),address:Ci}),L4=Ie({kind:ct("SplitCoins"),coin:Ci,amounts:rt(Ci)}),B4=Ie({kind:ct("MergeCoins"),destination:Ci,sources:rt(Ci)}),U4=Ie({kind:ct("MakeMoveVec"),type:Ir([Ie({Some:wd}),Ie({None:Vt(ct(!0))})]),objects:rt(Ci)}),F4=Ie({kind:ct("Publish"),modules:rt(rt(Wt(ir(),lr()))),dependencies:rt(yt())}),$4=Ie({kind:ct("Upgrade"),modules:rt(rt(Wt(ir(),lr()))),dependencies:rt(yt()),packageId:yt(),ticket:Ci}),V4=[j4,D4,L4,B4,F4,$4,U4],z4=Ir([...V4]);Ie({version:ct(1),sender:Or(yt()),expiration:hs(O4),gasConfig:N4,inputs:rt(Gg),transactions:rt(z4)});function uh(e){var r;const t=e.inputs.map((n,i)=>{if(n.Object)return{kind:"Input",index:i,value:{Object:n.Object.ImmOrOwnedObject?{ImmOrOwned:n.Object.ImmOrOwnedObject}:n.Object.Receiving?{Receiving:{digest:n.Object.Receiving.digest,version:n.Object.Receiving.version,objectId:n.Object.Receiving.objectId}}:{Shared:{mutable:n.Object.SharedObject.mutable,initialSharedVersion:n.Object.SharedObject.initialSharedVersion,objectId:n.Object.SharedObject.objectId}}},type:"object"};if(n.Pure)return{kind:"Input",index:i,value:{Pure:Array.from(Sr(n.Pure.bytes))},type:"pure"};if(n.UnresolvedPure)return{kind:"Input",type:"pure",index:i,value:n.UnresolvedPure.value};if(n.UnresolvedObject)return{kind:"Input",type:"object",index:i,value:n.UnresolvedObject.objectId};throw new Error("Invalid input")});return{version:1,sender:e.sender??void 0,expiration:((r=e.expiration)==null?void 0:r.$kind)==="Epoch"?{Epoch:Number(e.expiration.Epoch)}:e.expiration?{None:!0}:null,gasConfig:{owner:e.gasData.owner??void 0,budget:e.gasData.budget??void 0,price:e.gasData.price??void 0,payment:e.gasData.payment??void 0},inputs:t,transactions:e.commands.map(n=>{if(n.MakeMoveVec)return{kind:"MakeMoveVec",type:n.MakeMoveVec.type===null?{None:!0}:{Some:Pc.parseFromStr(n.MakeMoveVec.type)},objects:n.MakeMoveVec.elements.map(i=>li(i,t))};if(n.MergeCoins)return{kind:"MergeCoins",destination:li(n.MergeCoins.destination,t),sources:n.MergeCoins.sources.map(i=>li(i,t))};if(n.MoveCall)return{kind:"MoveCall",target:`${n.MoveCall.package}::${n.MoveCall.module}::${n.MoveCall.function}`,typeArguments:n.MoveCall.typeArguments,arguments:n.MoveCall.arguments.map(i=>li(i,t))};if(n.Publish)return{kind:"Publish",modules:n.Publish.modules.map(i=>Array.from(Sr(i))),dependencies:n.Publish.dependencies};if(n.SplitCoins)return{kind:"SplitCoins",coin:li(n.SplitCoins.coin,t),amounts:n.SplitCoins.amounts.map(i=>li(i,t))};if(n.TransferObjects)return{kind:"TransferObjects",objects:n.TransferObjects.objects.map(i=>li(i,t)),address:li(n.TransferObjects.address,t)};if(n.Upgrade)return{kind:"Upgrade",modules:n.Upgrade.modules.map(i=>Array.from(Sr(i))),dependencies:n.Upgrade.dependencies,packageId:n.Upgrade.package,ticket:li(n.Upgrade.ticket,t)};throw new Error(`Unknown transaction ${Object.keys(n)}`)})}}function li(e,t){if(e.$kind==="GasCoin")return{kind:"GasCoin"};if(e.$kind==="Result")return{kind:"Result",index:e.Result};if(e.$kind==="NestedResult")return{kind:"NestedResult",index:e.NestedResult[0],resultIndex:e.NestedResult[1]};if(e.$kind==="Input")return t[e.Input];throw new Error(`Invalid argument ${Object.keys(e)}`)}function q4(e){var t,r,n;return cr(lc,{version:2,sender:e.sender??null,expiration:e.expiration?"Epoch"in e.expiration?{Epoch:e.expiration.Epoch}:{None:!0}:null,gasData:{owner:e.gasConfig.owner??null,budget:((t=e.gasConfig.budget)==null?void 0:t.toString())??null,price:((r=e.gasConfig.price)==null?void 0:r.toString())??null,payment:((n=e.gasConfig.payment)==null?void 0:n.map(i=>({digest:i.digest,objectId:i.objectId,version:i.version.toString()})))??null},inputs:e.inputs.map(i=>{if(i.kind==="Input"){if(gf(ch,i.value)){const o=cr(ch,i.value);if(o.Object){if(o.Object.ImmOrOwned)return{Object:{ImmOrOwnedObject:{objectId:o.Object.ImmOrOwned.objectId,version:String(o.Object.ImmOrOwned.version),digest:o.Object.ImmOrOwned.digest}}};if(o.Object.Shared)return{Object:{SharedObject:{mutable:o.Object.Shared.mutable??null,initialSharedVersion:o.Object.Shared.initialSharedVersion,objectId:o.Object.Shared.objectId}}};if(o.Object.Receiving)return{Object:{Receiving:{digest:o.Object.Receiving.digest,version:String(o.Object.Receiving.version),objectId:o.Object.Receiving.objectId}}};throw new Error("Invalid object input")}return{Pure:{bytes:yr(new Uint8Array(o.Pure))}}}return i.type==="object"?{UnresolvedObject:{objectId:i.value}}:{UnresolvedPure:{value:i.value}}}throw new Error("Invalid input")}),commands:e.transactions.map(i=>{switch(i.kind){case"MakeMoveVec":return{MakeMoveVec:{type:"Some"in i.type?Pc.tagToString(i.type.Some):null,elements:i.objects.map(o=>ui(o))}};case"MergeCoins":return{MergeCoins:{destination:ui(i.destination),sources:i.sources.map(o=>ui(o))}};case"MoveCall":{const[o,s,a]=i.target.split("::");return{MoveCall:{package:o,module:s,function:a,typeArguments:i.typeArguments,arguments:i.arguments.map(c=>ui(c))}}}case"Publish":return{Publish:{modules:i.modules.map(o=>yr(Uint8Array.from(o))),dependencies:i.dependencies}};case"SplitCoins":return{SplitCoins:{coin:ui(i.coin),amounts:i.amounts.map(o=>ui(o))}};case"TransferObjects":return{TransferObjects:{objects:i.objects.map(o=>ui(o)),address:ui(i.address)}};case"Upgrade":return{Upgrade:{modules:i.modules.map(o=>yr(Uint8Array.from(o))),dependencies:i.dependencies,package:i.packageId,ticket:ui(i.ticket)}}}throw new Error(`Unknown transaction ${Object.keys(i)}`)})})}function ui(e){switch(e.kind){case"GasCoin":return{GasCoin:!0};case"Result":return{Result:e.index};case"NestedResult":return{NestedResult:[e.index,e.resultIndex]};case"Input":return{Input:e.index}}}function Ma(e){return Ir(Object.entries(e).map(([t,r])=>Ie({[t]:r})))}const xn=Ma({GasCoin:ct(!0),Input:Wt(ir(),lr()),Result:Wt(ir(),lr()),NestedResult:yd([Wt(ir(),lr()),Wt(ir(),lr())])}),H4=Ie({budget:Vt(zr),price:Vt(zr),owner:Vt(Es),payment:Vt(rt(Ki))}),W4=Ie({package:Zr,module:yt(),function:yt(),typeArguments:rt(yt()),arguments:rt(xn)}),G4=Ie({name:yt(),inputs:ua(yt(),Ir([xn,rt(xn)])),data:ua(yt(),Io())}),K4=Ma({MoveCall:W4,TransferObjects:Ie({objects:rt(xn),address:xn}),SplitCoins:Ie({coin:xn,amounts:rt(xn)}),MergeCoins:Ie({destination:xn,sources:rt(xn)}),Publish:Ie({modules:rt(Ro),dependencies:rt(Zr)}),MakeMoveVec:Ie({type:Vt(yt()),elements:rt(xn)}),Upgrade:Ie({modules:rt(Ro),dependencies:rt(Zr),package:Zr,ticket:xn}),$Intent:G4}),Y4=Ma({ImmOrOwnedObject:Ki,SharedObject:Ie({objectId:Zr,initialSharedVersion:zr,mutable:ll()}),Receiving:Ki}),X4=Ma({Object:Y4,Pure:Ie({bytes:Ro}),UnresolvedPure:Ie({value:Io()}),UnresolvedObject:Ie({objectId:Zr,version:Or(Vt(zr)),digest:Or(Vt(yt())),initialSharedVersion:Or(Vt(zr))})}),J4=Ma({None:ct(!0),Epoch:zr}),Z4=Ie({version:ct(2),sender:hs(Es),expiration:hs(J4),gasData:H4,inputs:rt(X4),commands:rt(K4)});function Q4(e){return{$kind:"Pure",Pure:{bytes:e instanceof Uint8Array?yr(e):e.toBase64()}}}const yi={Pure:Q4,ObjectRef({objectId:e,digest:t,version:r}){return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{digest:t,version:r,objectId:Bt(e)}}}},SharedObjectRef({objectId:e,mutable:t,initialSharedVersion:r}){return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{mutable:t,initialSharedVersion:r,objectId:Bt(e)}}}},ReceivingRef({objectId:e,digest:t,version:r}){return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{digest:t,version:r,objectId:Bt(e)}}}}},Kg="…";function e8(e){if(e.length<=6)return e;const t=e.startsWith("0x")?2:0;return`0x${e.slice(t,t+4)}${Kg}${e.slice(-4)}`}function t8(e){return`${e.slice(0,10)}${Kg}`}const r8=9,n8=BigInt(1e9),Yg="0x1",fa="0x2",i8="0x3",Xg=Jr("0x6"),o8="sui_system",ul=`${fa}::sui::SUI`,s8=Jr("0x5");function gu(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function a8(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Jg(e,...t){if(!a8(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 fh(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 c8(e,t){Jg(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Nc(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}const bo=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function Zg(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const hi=bo?e=>e:e=>Zg(e);function qo(e){for(let t=0;t<e.length;t++)e[t]=Zg(e[t])}function l8(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function na(e){return typeof e=="string"&&(e=l8(e)),Jg(e),e}let u8=class{clone(){return this._cloneInto()}};function f8(e){const t=(n,i)=>e(i).update(na(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}const d8=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);class h8 extends u8{constructor(t,r,n={},i,o,s){if(super(),this.blockLen=t,this.outputLen=r,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,gu(t),gu(r),gu(i),r<0||r>i)throw new Error("outputLen bigger than keyLen");if(n.key!==void 0&&(n.key.length<1||n.key.length>i))throw new Error("key length must be undefined or 1.."+i);if(n.salt!==void 0&&n.salt.length!==o)throw new Error("salt must be undefined or "+o);if(n.personalization!==void 0&&n.personalization.length!==s)throw new Error("personalization must be undefined or "+s);this.buffer=new Uint8Array(t),this.buffer32=Nc(this.buffer)}update(t){fh(this);const{blockLen:r,buffer:n,buffer32:i}=this;t=na(t);const o=t.length,s=t.byteOffset,a=t.buffer;for(let c=0;c<o;){this.pos===r&&(bo||qo(i),this.compress(i,0,!1),bo||qo(i),this.pos=0);const l=Math.min(r-this.pos,o-c),u=s+c;if(l===r&&!(u%4)&&c+l<o){const d=new Uint32Array(a,u,Math.floor((o-c)/4));bo||qo(d);for(let p=0;c+r<o;p+=i.length,c+=r)this.length+=r,this.compress(d,p,!1);bo||qo(d);continue}n.set(t.subarray(c,c+l),this.pos),this.pos+=l,this.length+=l,c+=l}return this}digestInto(t){fh(this),c8(t,this);const{pos:r,buffer32:n}=this;this.finished=!0,this.buffer.subarray(r).fill(0),bo||qo(n),this.compress(n,0,!0),bo||qo(n);const i=Nc(t);this.get().forEach((o,s)=>i[s]=hi(o))}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){const{buffer:r,length:n,finished:i,destroyed:o,outputLen:s,pos:a}=this;return t||(t=new this.constructor({dkLen:s})),t.set(...this.get()),t.length=n,t.finished=i,t.destroyed=o,t.outputLen=s,t.buffer.set(r),t.pos=a,t}}const Wa=BigInt(2**32-1),yf=BigInt(32);function Qg(e,t=!1){return t?{h:Number(e&Wa),l:Number(e>>yf&Wa)}:{h:Number(e>>yf&Wa)|0,l:Number(e&Wa)|0}}function p8(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:s}=Qg(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}const m8=(e,t)=>BigInt(e>>>0)<<yf|BigInt(t>>>0),g8=(e,t,r)=>e>>>r,v8=(e,t,r)=>e<<32-r|t>>>r,b8=(e,t,r)=>e>>>r|t<<32-r,y8=(e,t,r)=>e<<32-r|t>>>r,w8=(e,t,r)=>e<<64-r|t>>>r-32,x8=(e,t,r)=>e>>>r-32|t<<64-r,S8=(e,t)=>t,_8=(e,t)=>e,E8=(e,t,r)=>e<<r|t>>>32-r,C8=(e,t,r)=>t<<r|e>>>32-r,T8=(e,t,r)=>t<<r-32|e>>>64-r,A8=(e,t,r)=>e<<r-32|t>>>64-r;function M8(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}const I8=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),R8=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,O8=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),P8=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,N8=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),k8=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,j8={fromBig:Qg,split:p8,toBig:m8,shrSH:g8,shrSL:v8,rotrSH:b8,rotrSL:y8,rotrBH:w8,rotrBL:x8,rotr32H:S8,rotr32L:_8,rotlSH:E8,rotlSL:C8,rotlBH:T8,rotlBL:A8,add:M8,add3L:I8,add3H:R8,add4L:O8,add4H:P8,add5H:k8,add5L:N8},Lr=j8,mr=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Re=new Uint32Array(32);function ji(e,t,r,n,i,o){const s=i[o],a=i[o+1];let c=Re[2*e],l=Re[2*e+1],u=Re[2*t],d=Re[2*t+1],p=Re[2*r],y=Re[2*r+1],x=Re[2*n],b=Re[2*n+1],M=Lr.add3L(c,u,s);l=Lr.add3H(M,l,d,a),c=M|0,{Dh:b,Dl:x}={Dh:b^l,Dl:x^c},{Dh:b,Dl:x}={Dh:Lr.rotr32H(b,x),Dl:Lr.rotr32L(b,x)},{h:y,l:p}=Lr.add(y,p,b,x),{Bh:d,Bl:u}={Bh:d^y,Bl:u^p},{Bh:d,Bl:u}={Bh:Lr.rotrSH(d,u,24),Bl:Lr.rotrSL(d,u,24)},Re[2*e]=c,Re[2*e+1]=l,Re[2*t]=u,Re[2*t+1]=d,Re[2*r]=p,Re[2*r+1]=y,Re[2*n]=x,Re[2*n+1]=b}function Di(e,t,r,n,i,o){const s=i[o],a=i[o+1];let c=Re[2*e],l=Re[2*e+1],u=Re[2*t],d=Re[2*t+1],p=Re[2*r],y=Re[2*r+1],x=Re[2*n],b=Re[2*n+1],M=Lr.add3L(c,u,s);l=Lr.add3H(M,l,d,a),c=M|0,{Dh:b,Dl:x}={Dh:b^l,Dl:x^c},{Dh:b,Dl:x}={Dh:Lr.rotrSH(b,x,16),Dl:Lr.rotrSL(b,x,16)},{h:y,l:p}=Lr.add(y,p,b,x),{Bh:d,Bl:u}={Bh:d^y,Bl:u^p},{Bh:d,Bl:u}={Bh:Lr.rotrBH(d,u,63),Bl:Lr.rotrBL(d,u,63)},Re[2*e]=c,Re[2*e+1]=l,Re[2*t]=u,Re[2*t+1]=d,Re[2*r]=p,Re[2*r+1]=y,Re[2*n]=x,Re[2*n+1]=b}class D8 extends h8{constructor(t={}){super(128,t.dkLen===void 0?64:t.dkLen,t,64,16,16),this.v0l=mr[0]|0,this.v0h=mr[1]|0,this.v1l=mr[2]|0,this.v1h=mr[3]|0,this.v2l=mr[4]|0,this.v2h=mr[5]|0,this.v3l=mr[6]|0,this.v3h=mr[7]|0,this.v4l=mr[8]|0,this.v4h=mr[9]|0,this.v5l=mr[10]|0,this.v5h=mr[11]|0,this.v6l=mr[12]|0,this.v6h=mr[13]|0,this.v7l=mr[14]|0,this.v7h=mr[15]|0;const r=t.key?t.key.length:0;if(this.v0l^=this.outputLen|r<<8|65536|1<<24,t.salt){const n=Nc(na(t.salt));this.v4l^=hi(n[0]),this.v4h^=hi(n[1]),this.v5l^=hi(n[2]),this.v5h^=hi(n[3])}if(t.personalization){const n=Nc(na(t.personalization));this.v6l^=hi(n[0]),this.v6h^=hi(n[1]),this.v7l^=hi(n[2]),this.v7h^=hi(n[3])}if(t.key){const n=new Uint8Array(this.blockLen);n.set(na(t.key)),this.update(n)}}get(){let{v0l:t,v0h:r,v1l:n,v1h:i,v2l:o,v2h:s,v3l:a,v3h:c,v4l:l,v4h:u,v5l:d,v5h:p,v6l:y,v6h:x,v7l:b,v7h:M}=this;return[t,r,n,i,o,s,a,c,l,u,d,p,y,x,b,M]}set(t,r,n,i,o,s,a,c,l,u,d,p,y,x,b,M){this.v0l=t|0,this.v0h=r|0,this.v1l=n|0,this.v1h=i|0,this.v2l=o|0,this.v2h=s|0,this.v3l=a|0,this.v3h=c|0,this.v4l=l|0,this.v4h=u|0,this.v5l=d|0,this.v5h=p|0,this.v6l=y|0,this.v6h=x|0,this.v7l=b|0,this.v7h=M|0}compress(t,r,n){this.get().forEach((c,l)=>Re[l]=c),Re.set(mr,16);let{h:i,l:o}=Lr.fromBig(BigInt(this.length));Re[24]=mr[8]^o,Re[25]=mr[9]^i,n&&(Re[28]=~Re[28],Re[29]=~Re[29]);let s=0;const a=d8;for(let c=0;c<12;c++)ji(0,4,8,12,t,r+2*a[s++]),Di(0,4,8,12,t,r+2*a[s++]),ji(1,5,9,13,t,r+2*a[s++]),Di(1,5,9,13,t,r+2*a[s++]),ji(2,6,10,14,t,r+2*a[s++]),Di(2,6,10,14,t,r+2*a[s++]),ji(3,7,11,15,t,r+2*a[s++]),Di(3,7,11,15,t,r+2*a[s++]),ji(0,5,10,15,t,r+2*a[s++]),Di(0,5,10,15,t,r+2*a[s++]),ji(1,6,11,12,t,r+2*a[s++]),Di(1,6,11,12,t,r+2*a[s++]),ji(2,7,8,13,t,r+2*a[s++]),Di(2,7,8,13,t,r+2*a[s++]),ji(3,4,9,14,t,r+2*a[s++]),Di(3,4,9,14,t,r+2*a[s++]);this.v0l^=Re[0]^Re[16],this.v0h^=Re[1]^Re[17],this.v1l^=Re[2]^Re[18],this.v1h^=Re[3]^Re[19],this.v2l^=Re[4]^Re[20],this.v2h^=Re[5]^Re[21],this.v3l^=Re[6]^Re[22],this.v3h^=Re[7]^Re[23],this.v4l^=Re[8]^Re[24],this.v4h^=Re[9]^Re[25],this.v5l^=Re[10]^Re[26],this.v5h^=Re[11]^Re[27],this.v6l^=Re[12]^Re[28],this.v6h^=Re[13]^Re[29],this.v7l^=Re[14]^Re[30],this.v7h^=Re[15]^Re[31],Re.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const e1=f8(e=>new D8(e));function L8(e,t,r){const n=vt.Address.serialize(e).toBytes(),i=vt.TypeTag.serialize(t).toBytes(),o=vt.u64().serialize(r.length).toBytes(),s=e1.create({dkLen:32});return s.update(new Uint8Array([240])),s.update(n),s.update(o),s.update(r),s.update(i),`0x${Ei(s.digest().slice(0,32))}`}const B8=Object.freeze(Object.defineProperty({__proto__:null,MIST_PER_SUI:n8,MOVE_STDLIB_ADDRESS:Yg,SUI_ADDRESS_LENGTH:al,SUI_CLOCK_OBJECT_ID:Xg,SUI_DECIMALS:r8,SUI_FRAMEWORK_ADDRESS:fa,SUI_SYSTEM_ADDRESS:i8,SUI_SYSTEM_MODULE_NAME:o8,SUI_SYSTEM_STATE_OBJECT_ID:s8,SUI_TYPE_ARG:ul,deriveDynamicFieldID:L8,formatAddress:e8,formatDigest:t8,fromB64:rg,fromBase58:_i,fromBase64:Sr,fromHEX:ig,fromHex:_s,isValidNamedPackage:dd,isValidNamedType:H6,isValidSuiAddress:Wn,isValidSuiNSName:gg,isValidSuiObjectId:Xs,isValidTransactionDigest:mf,normalizeStructTag:yg,normalizeSuiAddress:Bt,normalizeSuiNSName:vg,normalizeSuiObjectId:Jr,parseStructTag:hd,toB64:tg,toBase58:jo,toBase64:yr,toHEX:ng,toHex:Ei},Symbol.toStringTag,{value:"Module"})),U8="object",F8="ID",$8="ascii",V8="String",z8="string",q8="String",H8="option",W8="Option";function G8(e){const t=typeof e.body=="object"&&"datatype"in e.body?e.body.datatype:null;return!!t&&Bt(t.package)===Bt("0x2")&&t.module==="tx_context"&&t.type==="TxContext"}function wf(e){if(typeof e=="string")switch(e){case"address":return vt.Address;case"bool":return vt.Bool;case"u8":return vt.U8;case"u16":return vt.U16;case"u32":return vt.U32;case"u64":return vt.U64;case"u128":return vt.U128;case"u256":return vt.U256;default:throw new Error(`Unknown type signature ${e}`)}if("vector"in e){if(e.vector==="u8")return vt.vector(vt.U8).transform({input:r=>typeof r=="string"?new TextEncoder().encode(r):r,output:r=>r});const t=wf(e.vector);return t?vt.vector(t):null}if("datatype"in e){const t=Bt(e.datatype.package);if(t===Bt(Yg)){if(e.datatype.module===$8&&e.datatype.type===V8||e.datatype.module===z8&&e.datatype.type===q8)return vt.String;if(e.datatype.module===H8&&e.datatype.type===W8){const r=wf(e.datatype.typeParameters[0]);return r?vt.vector(r):null}}if(t===Bt(fa)&&e.datatype.module===U8&&e.datatype.type===F8)return vt.Address}return null}function K8(e){return typeof e=="object"&&"Reference"in e?{ref:"&",body:ia(e.Reference)}:typeof e=="object"&&"MutableReference"in e?{ref:"&mut",body:ia(e.MutableReference)}:{ref:null,body:ia(e)}}function ia(e){if(typeof e=="string")switch(e){case"Address":return"address";case"Bool":return"bool";case"U8":return"u8";case"U16":return"u16";case"U32":return"u32";case"U64":return"u64";case"U128":return"u128";case"U256":return"u256";default:throw new Error(`Unexpected type ${e}`)}if("Vector"in e)return{vector:ia(e.Vector)};if("Struct"in e)return{datatype:{package:e.Struct.address,module:e.Struct.module,type:e.Struct.name,typeParameters:e.Struct.typeArguments.map(ia)}};if("TypeParameter"in e)return{typeParameter:e.TypeParameter};throw new Error(`Unexpected type ${JSON.stringify(e)}`)}const Y8=50,X8=1000n,J8=5e10;async function Z8(e,t,r){return await n3(e,t),await r3(e,t),t.onlyTransactionKind||(await Q8(e,t),await e3(e,t),await t3(e,t)),await i3(e),await r()}async function Q8(e,t){e.gasConfig.price||(e.gasConfig.price=String(await Ia(t).getReferenceGasPrice()))}async function e3(e,t){if(e.gasConfig.budget)return;const r=await Ia(t).dryRunTransactionBlock({transactionBlock:e.build({overrides:{gasData:{budget:String(J8),payment:[]}}})});if(r.effects.status.status!=="success")throw new Error(`Dry run failed, could not automatically determine a budget: ${r.effects.status.error}`,{cause:r});const n=X8*BigInt(e.gasConfig.price||1n),i=BigInt(r.effects.gasUsed.computationCost)+n,o=i+BigInt(r.effects.gasUsed.storageCost)-BigInt(r.effects.gasUsed.storageRebate);e.gasConfig.budget=String(o>i?o:i)}async function t3(e,t){if(!e.gasConfig.payment){const n=(await Ia(t).getCoins({owner:e.gasConfig.owner||e.sender,coinType:ul})).data.filter(i=>!e.inputs.find(s=>{var a;return(a=s.Object)!=null&&a.ImmOrOwnedObject?i.coinObjectId===s.Object.ImmOrOwnedObject.objectId:!1})).map(i=>({objectId:i.coinObjectId,digest:i.digest,version:i.version}));if(!n.length)throw new Error("No valid gas coins found for the transaction.");e.gasConfig.payment=n.map(i=>cr(Ki,i))}}async function r3(e,t){const r=e.inputs.filter(u=>{var d;return u.UnresolvedObject&&!(u.UnresolvedObject.version||(d=u.UnresolvedObject)!=null&&d.initialSharedVersion)}),n=[...new Set(r.map(u=>Jr(u.UnresolvedObject.objectId)))],i=n.length?c3(n,Y8):[],o=(await Promise.all(i.map(u=>Ia(t).multiGetObjects({ids:u,options:{showOwner:!0}})))).flat(),s=new Map(n.map((u,d)=>[u,o[d]])),a=Array.from(s).filter(([u,d])=>d.error).map(([u,d])=>JSON.stringify(d.error));if(a.length)throw new Error(`The following input objects are invalid: ${a.join(", ")}`);const c=o.map(u=>{if(u.error||!u.data)throw new Error(`Failed to fetch object: ${u.error}`);const d=u.data.owner,p=d&&typeof d=="object"&&"Shared"in d?d.Shared.initial_shared_version:null;return{objectId:u.data.objectId,digest:u.data.digest,version:u.data.version,initialSharedVersion:p}}),l=new Map(n.map((u,d)=>[u,c[d]]));for(const[u,d]of e.inputs.entries()){if(!d.UnresolvedObject)continue;let p;const y=Bt(d.UnresolvedObject.objectId),x=l.get(y);d.UnresolvedObject.initialSharedVersion??(x==null?void 0:x.initialSharedVersion)?p=yi.SharedObjectRef({objectId:y,initialSharedVersion:d.UnresolvedObject.initialSharedVersion||(x==null?void 0:x.initialSharedVersion),mutable:o3(e,u)}):s3(e,u)&&(p=yi.ReceivingRef({objectId:y,digest:d.UnresolvedObject.digest??(x==null?void 0:x.digest),version:d.UnresolvedObject.version??(x==null?void 0:x.version)})),e.inputs[e.inputs.indexOf(d)]=p??yi.ObjectRef({objectId:y,digest:d.UnresolvedObject.digest??(x==null?void 0:x.digest),version:d.UnresolvedObject.version??(x==null?void 0:x.version)})}}async function n3(e,t){const{inputs:r,commands:n}=e,i=[],o=new Set;n.forEach(a=>{if(a.MoveCall){if(a.MoveCall._argumentTypes)return;if(a.MoveCall.arguments.map(u=>u.$kind==="Input"?e.inputs[u.Input]:null).some(u=>(u==null?void 0:u.UnresolvedPure)||(u==null?void 0:u.UnresolvedObject))){const u=`${a.MoveCall.package}::${a.MoveCall.module}::${a.MoveCall.function}`;o.add(u),i.push(a.MoveCall)}}switch(a.$kind){case"SplitCoins":a.SplitCoins.amounts.forEach(c=>{dh(c,vt.U64,e)});break;case"TransferObjects":dh(a.TransferObjects.address,vt.Address,e);break}});const s=new Map;if(o.size>0){const a=Ia(t);await Promise.all([...o].map(async c=>{const[l,u,d]=c.split("::"),p=await a.getNormalizedMoveFunction({package:l,module:u,function:d});s.set(c,p.parameters.map(y=>K8(y)))}))}i.length&&await Promise.all(i.map(async a=>{const c=s.get(`${a.package}::${a.module}::${a.function}`);if(!c)return;const u=c.length>0&&G8(c.at(-1))?c.slice(0,c.length-1):c;a._argumentTypes=u})),n.forEach(a=>{if(!a.MoveCall)return;const c=a.MoveCall,l=`${c.package}::${c.module}::${c.function}`,u=c._argumentTypes;if(u){if(u.length!==a.MoveCall.arguments.length)throw new Error(`Incorrect number of arguments for ${l}`);u.forEach((d,p)=>{var P,k;const y=c.arguments[p];if(y.$kind!=="Input")return;const x=r[y.Input];if(!x.UnresolvedPure&&!x.UnresolvedObject)return;const b=((P=x.UnresolvedPure)==null?void 0:P.value)??((k=x.UnresolvedObject)==null?void 0:k.objectId),M=wf(d.body);if(M){y.type="pure",r[r.indexOf(x)]=yi.Pure(M.serialize(b));return}if(typeof b!="string")throw new Error(`Expect the argument to be an object id string, got ${JSON.stringify(b,null,2)}`);y.type="object";const R=x.UnresolvedPure?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:b}}:x;r[y.Input]=R})}})}function i3(e){e.inputs.forEach((t,r)=>{if(t.$kind!=="Object"&&t.$kind!=="Pure")throw new Error(`Input at index ${r} has not been resolved. Expected a Pure or Object input, but found ${JSON.stringify(t)}`)})}function dh(e,t,r){if(e.$kind!=="Input")return;const n=r.inputs[e.Input];n.$kind==="UnresolvedPure"&&(r.inputs[e.Input]=yi.Pure(t.serialize(n.UnresolvedPure.value)))}function o3(e,t){let r=!1;return e.getInputUses(t,(n,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const o=i.MoveCall.arguments.indexOf(n);r=i.MoveCall._argumentTypes[o].ref!=="&"||r}(i.$kind==="MakeMoveVec"||i.$kind==="MergeCoins"||i.$kind==="SplitCoins")&&(r=!0)}),r}function s3(e,t){let r=!1;return e.getInputUses(t,(n,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const o=i.MoveCall.arguments.indexOf(n);r=a3(i.MoveCall._argumentTypes[o])||r}}),r}function a3(e){return typeof e.body!="object"||!("datatype"in e.body)?!1:e.body.datatype.package==="0x2"&&e.body.datatype.module==="transfer"&&e.body.datatype.type==="Receiving"}function Ia(e){if(!e.client)throw new Error("No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.");return e.client}function c3(e,t){return Array.from({length:Math.ceil(e.length/t)},(r,n)=>e.slice(n*t,n*t+t))}function l3(e){function t(r){return e(r)}return t.system=()=>t("0x5"),t.clock=()=>t("0x6"),t.random=()=>t("0x8"),t.denyList=()=>t("0x403"),t.option=({type:r,value:n})=>i=>i.moveCall({typeArguments:[r],target:`0x1::option::${n===null?"none":"some"}`,arguments:n===null?[]:[i.object(n)]}),t}function u3(e){function t(r,n){if(typeof r=="string")return e(ra(r).serialize(n));if(r instanceof Uint8Array||sl(r))return e(r);throw new Error("tx.pure must be called either a bcs type name, or a serialized bcs value")}return t.u8=r=>e(vt.U8.serialize(r)),t.u16=r=>e(vt.U16.serialize(r)),t.u32=r=>e(vt.U32.serialize(r)),t.u64=r=>e(vt.U64.serialize(r)),t.u128=r=>e(vt.U128.serialize(r)),t.u256=r=>e(vt.U256.serialize(r)),t.bool=r=>e(vt.Bool.serialize(r)),t.string=r=>e(vt.String.serialize(r)),t.address=r=>e(vt.Address.serialize(r)),t.id=t.address,t.vector=(r,n)=>e(vt.vector(ra(r)).serialize(n)),t.option=(r,n)=>e(vt.option(ra(r)).serialize(n)),t}function f3(e,t){const r=Array.from(`${e}::`).map(i=>i.charCodeAt(0)),n=new Uint8Array(r.length+t.length);return n.set(r),n.set(t,r.length),e1(n,{dkLen:32})}function hh(e){return Bt(e).replace("0x","")}class Tn{constructor(t){this.version=2,this.sender=(t==null?void 0:t.sender)??null,this.expiration=(t==null?void 0:t.expiration)??null,this.inputs=(t==null?void 0:t.inputs)??[],this.commands=(t==null?void 0:t.commands)??[],this.gasData=(t==null?void 0:t.gasData)??{budget:null,price:null,owner:null,payment:null}}static fromKindBytes(t){const n=vt.TransactionKind.parse(t).ProgrammableTransaction;if(!n)throw new Error("Unable to deserialize from bytes.");return Tn.restore({version:2,sender:null,expiration:null,gasData:{budget:null,owner:null,payment:null,price:null},inputs:n.inputs,commands:n.commands})}static fromBytes(t){const r=vt.TransactionData.parse(t),n=r==null?void 0:r.V1,i=n.kind.ProgrammableTransaction;if(!n||!i)throw new Error("Unable to deserialize from bytes.");return Tn.restore({version:2,sender:n.sender,expiration:n.expiration,gasData:n.gasData,inputs:i.inputs,commands:i.commands})}static restore(t){return t.version===2?new Tn(cr(lc,t)):new Tn(cr(lc,q4(t)))}static getDigestFromBytes(t){const r=f3("TransactionData",t);return jo(r)}get gasConfig(){return this.gasData}set gasConfig(t){this.gasData=t}build({maxSizeBytes:t=1/0,overrides:r,onlyTransactionKind:n}={}){const i=this.inputs,o=this.commands,s={ProgrammableTransaction:{inputs:i,commands:o}};if(n)return vt.TransactionKind.serialize(s,{maxSize:t}).toBytes();const a=(r==null?void 0:r.expiration)??this.expiration,c=(r==null?void 0:r.sender)??this.sender,l={...this.gasData,...r==null?void 0:r.gasConfig,...r==null?void 0:r.gasData};if(!c)throw new Error("Missing transaction sender");if(!l.budget)throw new Error("Missing gas budget");if(!l.payment)throw new Error("Missing gas payment");if(!l.price)throw new Error("Missing gas price");const u={sender:hh(c),expiration:a||{None:!0},gasData:{payment:l.payment,owner:hh(this.gasData.owner??c),price:BigInt(l.price),budget:BigInt(l.budget)},kind:{ProgrammableTransaction:{inputs:i,commands:o}}};return vt.TransactionData.serialize({V1:u},{maxSize:t}).toBytes()}addInput(t,r){const n=this.inputs.length;return this.inputs.push(r),{Input:n,type:t,$kind:"Input"}}getInputUses(t,r){this.mapArguments((n,i)=>(n.$kind==="Input"&&n.Input===t&&r(n,i),n))}mapArguments(t){for(const r of this.commands)switch(r.$kind){case"MoveCall":r.MoveCall.arguments=r.MoveCall.arguments.map(i=>t(i,r));break;case"TransferObjects":r.TransferObjects.objects=r.TransferObjects.objects.map(i=>t(i,r)),r.TransferObjects.address=t(r.TransferObjects.address,r);break;case"SplitCoins":r.SplitCoins.coin=t(r.SplitCoins.coin,r),r.SplitCoins.amounts=r.SplitCoins.amounts.map(i=>t(i,r));break;case"MergeCoins":r.MergeCoins.destination=t(r.MergeCoins.destination,r),r.MergeCoins.sources=r.MergeCoins.sources.map(i=>t(i,r));break;case"MakeMoveVec":r.MakeMoveVec.elements=r.MakeMoveVec.elements.map(i=>t(i,r));break;case"Upgrade":r.Upgrade.ticket=t(r.Upgrade.ticket,r);break;case"$Intent":const n=r.$Intent.inputs;r.$Intent.inputs={};for(const[i,o]of Object.entries(n))r.$Intent.inputs[i]=Array.isArray(o)?o.map(s=>t(s,r)):t(o,r);break;case"Publish":break;default:throw new Error(`Unexpected transaction kind: ${r.$kind}`)}}replaceCommand(t,r){if(!Array.isArray(r)){this.commands[t]=r;return}const n=r.length-1;this.commands.splice(t,1,...r),n!==0&&this.mapArguments(i=>{switch(i.$kind){case"Result":i.Result>t&&(i.Result+=n);break;case"NestedResult":i.NestedResult[0]>t&&(i.NestedResult[0]+=n);break}return i})}getDigest(){const t=this.build({onlyTransactionKind:!1});return Tn.getDigestFromBytes(t)}snapshot(){return cr(lc,this)}}function ph(e){if(typeof e=="string")return Bt(e);if(e.Object)return e.Object.ImmOrOwnedObject?Bt(e.Object.ImmOrOwnedObject.objectId):e.Object.Receiving?Bt(e.Object.Receiving.objectId):Bt(e.Object.SharedObject.objectId);if(e.UnresolvedObject)return Bt(e.UnresolvedObject.objectId)}var t1=e=>{throw TypeError(e)},xd=(e,t,r)=>t.has(e)||t1("Cannot "+r),Tt=(e,t,r)=>(xd(e,t,"read from private field"),r?r.call(e):t.get(e)),Fs=(e,t,r)=>t.has(e)?t1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),uo=(e,t,r,n)=>(xd(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),pi=(e,t,r)=>(xd(e,t,"access private method"),r),Js,oa,yo,Rt,Sn,uc,Sd,xf,_d;function mh(e,t=1/0){const r={$kind:"Result",Result:e},n=[],i=o=>n[o]??(n[o]={$kind:"NestedResult",NestedResult:[e,o]});return new Proxy(r,{set(){throw new Error("The transaction result is a proxy, and does not support setting properties directly")},get(o,s){if(s in o)return Reflect.get(o,s);if(s===Symbol.iterator)return function*(){let c=0;for(;c<t;)yield i(c),c++};if(typeof s=="symbol")return;const a=parseInt(s,10);if(!(Number.isNaN(a)||a<0))return i(a)}})}const r1=Symbol.for("@mysten/transaction");function n1(e){return!!e&&typeof e=="object"&&e[r1]===!0}const gh={buildPlugins:new Map,serializationPlugins:new Map},vu=Symbol.for("@mysten/transaction/registry");function $s(){try{const e=globalThis;return e[vu]||(e[vu]=gh),e[vu]}catch{return gh}}const d3=class Sf{constructor(){Fs(this,Sn),Fs(this,Js),Fs(this,oa),Fs(this,yo,new Map),Fs(this,Rt),this.object=l3(r=>{var o,s;if(typeof r=="function")return this.object(r(this));if(typeof r=="object"&&gf(tr,r))return r;const n=ph(r),i=Tt(this,Rt).inputs.find(a=>n===ph(a));return(o=i==null?void 0:i.Object)!=null&&o.SharedObject&&typeof r=="object"&&((s=r.Object)!=null&&s.SharedObject)&&(i.Object.SharedObject.mutable=i.Object.SharedObject.mutable||r.Object.SharedObject.mutable),i?{$kind:"Input",Input:Tt(this,Rt).inputs.indexOf(i),type:"object"}:Tt(this,Rt).addInput("object",typeof r=="string"?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:Bt(r)}}:r)});const t=$s();uo(this,Rt,new Tn),uo(this,oa,[...t.buildPlugins.values()]),uo(this,Js,[...t.serializationPlugins.values()])}static fromKind(t){const r=new Sf;return uo(r,Rt,Tn.fromKindBytes(typeof t=="string"?Sr(t):t)),r}static from(t){const r=new Sf;return n1(t)?uo(r,Rt,new Tn(t.getData())):typeof t!="string"||!t.startsWith("{")?uo(r,Rt,Tn.fromBytes(typeof t=="string"?Sr(t):t)):uo(r,Rt,Tn.restore(JSON.parse(t))),r}static registerGlobalSerializationPlugin(t,r){$s().serializationPlugins.set(t,r??t)}static unregisterGlobalSerializationPlugin(t){$s().serializationPlugins.delete(t)}static registerGlobalBuildPlugin(t,r){$s().buildPlugins.set(t,r??t)}static unregisterGlobalBuildPlugin(t){$s().buildPlugins.delete(t)}addSerializationPlugin(t){Tt(this,Js).push(t)}addBuildPlugin(t){Tt(this,oa).push(t)}addIntentResolver(t,r){if(Tt(this,yo).has(t)&&Tt(this,yo).get(t)!==r)throw new Error(`Intent resolver for ${t} already exists`);Tt(this,yo).set(t,r)}setSender(t){Tt(this,Rt).sender=t}setSenderIfNotSet(t){Tt(this,Rt).sender||(Tt(this,Rt).sender=t)}setExpiration(t){Tt(this,Rt).expiration=t?cr(Wg,t):null}setGasPrice(t){Tt(this,Rt).gasConfig.price=String(t)}setGasBudget(t){Tt(this,Rt).gasConfig.budget=String(t)}setGasBudgetIfNotSet(t){Tt(this,Rt).gasData.budget==null&&(Tt(this,Rt).gasConfig.budget=String(t))}setGasOwner(t){Tt(this,Rt).gasConfig.owner=t}setGasPayment(t){Tt(this,Rt).gasConfig.payment=t.map(r=>cr(Ki,r))}get blockData(){return uh(Tt(this,Rt).snapshot())}getData(){return Tt(this,Rt).snapshot()}get[r1](){return!0}get pure(){return Object.defineProperty(this,"pure",{enumerable:!1,value:u3(t=>sl(t)?Tt(this,Rt).addInput("pure",{$kind:"Pure",Pure:{bytes:t.toBase64()}}):Tt(this,Rt).addInput("pure",gf(ah,t)?cr(ah,t):t instanceof Uint8Array?yi.Pure(t):{$kind:"UnresolvedPure",UnresolvedPure:{value:t}}))}),this.pure}get gas(){return{$kind:"GasCoin",GasCoin:!0}}objectRef(...t){return this.object(yi.ObjectRef(...t))}receivingRef(...t){return this.object(yi.ReceivingRef(...t))}sharedObjectRef(...t){return this.object(yi.SharedObjectRef(...t))}add(t){if(typeof t=="function")return t(this);const r=Tt(this,Rt).commands.push(t);return mh(r-1)}splitCoins(t,r){const n=lo.SplitCoins(typeof t=="string"?this.object(t):pi(this,Sn,Sd).call(this,t),r.map(o=>typeof o=="number"||typeof o=="bigint"||typeof o=="string"?this.pure.u64(o):pi(this,Sn,uc).call(this,o))),i=Tt(this,Rt).commands.push(n);return mh(i-1,r.length)}mergeCoins(t,r){return this.add(lo.MergeCoins(this.object(t),r.map(n=>this.object(n))))}publish({modules:t,dependencies:r}){return this.add(lo.Publish({modules:t,dependencies:r}))}upgrade({modules:t,dependencies:r,package:n,ticket:i}){return this.add(lo.Upgrade({modules:t,dependencies:r,package:n,ticket:this.object(i)}))}moveCall({arguments:t,...r}){return this.add(lo.MoveCall({...r,arguments:t==null?void 0:t.map(n=>pi(this,Sn,uc).call(this,n))}))}transferObjects(t,r){return this.add(lo.TransferObjects(t.map(n=>this.object(n)),typeof r=="string"?this.pure.address(r):pi(this,Sn,uc).call(this,r)))}makeMoveVec({type:t,elements:r}){return this.add(lo.MakeMoveVec({type:t,elements:r.map(n=>this.object(n))}))}serialize(){return JSON.stringify(uh(Tt(this,Rt).snapshot()))}async toJSON(t={}){return await this.prepareForSerialization(t),JSON.stringify(cr(Z4,Tt(this,Rt).snapshot()),(r,n)=>typeof n=="bigint"?n.toString():n,2)}async sign(t){const{signer:r,...n}=t,i=await this.build(n);return r.signTransaction(i)}async build(t={}){return await this.prepareForSerialization(t),await pi(this,Sn,xf).call(this,t),Tt(this,Rt).build({onlyTransactionKind:t.onlyTransactionKind})}async getDigest(t={}){return await pi(this,Sn,xf).call(this,t),Tt(this,Rt).getDigest()}async prepareForSerialization(t){var i;const r=new Set;for(const o of Tt(this,Rt).commands)o.$Intent&&r.add(o.$Intent.name);const n=[...Tt(this,Js)];for(const o of r)if(!((i=t.supportedIntents)!=null&&i.includes(o))){if(!Tt(this,yo).has(o))throw new Error(`Missing intent resolver for ${o}`);n.push(Tt(this,yo).get(o))}await pi(this,Sn,_d).call(this,n,t)}};Js=new WeakMap;oa=new WeakMap;yo=new WeakMap;Rt=new WeakMap;Sn=new WeakSet;uc=function(e){return sl(e)?this.pure(e):pi(this,Sn,Sd).call(this,e)};Sd=function(e){return typeof e=="function"?cr(tr,e(this)):cr(tr,e)};xf=async function(e){if(!e.onlyTransactionKind&&!Tt(this,Rt).sender)throw new Error("Missing transaction sender");await pi(this,Sn,_d).call(this,[...Tt(this,oa),Z8],e)};_d=async function(e,t){const r=n=>{if(n>=e.length)return()=>{};const i=e[n];return async()=>{const o=r(n+1);let s=!1,a=!1;if(await i(Tt(this,Rt),t,async()=>{if(s)throw new Error(`next() was call multiple times in TransactionPlugin ${n}`);s=!0,await o(),a=!0}),!s)throw new Error(`next() was not called in TransactionPlugin ${n}`);if(!a)throw new Error(`next() was not awaited in TransactionPlugin ${n}`)}};await r(0)()};let To=d3;class h3 extends hg{constructor(){super(...arguments),this.core=this}}class p3 extends Error{}class Vi extends p3{constructor(t,r){super(r),this.code=t}static fromResponse(t,r){switch(t.code){case"notExists":return new Vi(t.code,`Object ${t.object_id} does not exist`);case"dynamicFieldNotFound":return new Vi(t.code,`Dynamic field not found for object ${t.parent_object_id}`);case"deleted":return new Vi(t.code,`Object ${t.object_id} has been deleted`);case"displayError":return new Vi(t.code,`Display error: ${t.error}`);case"unknown":default:return new Vi(t.code,`Unknown error while loading object${r?` ${r}`:""}`)}}}var i1=e=>{throw TypeError(e)},o1=(e,t,r)=>t.has(e)||i1("Cannot "+r),fi=(e,t,r)=>(o1(e,t,"read from private field"),r?r.call(e):t.get(e)),m3=(e,t,r)=>t.has(e)?i1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),g3=(e,t,r,n)=>(o1(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),sn;class v3 extends h3{constructor(t){super({network:t.network}),m3(this,sn),g3(this,sn,t)}async getObjects(t){const r=v4(t.objectIds,50),n=[];for(const i of r){const o=await fi(this,sn).multiGetObjects({ids:i,options:{showOwner:!0,showType:!0}});for(const[s,a]of o.entries())a.error?n.push(Vi.fromResponse(a.error,i[s])):n.push(vh(a.data))}return{objects:n}}async getOwnedObjects(t){const r=await fi(this,sn).getOwnedObjects({owner:t.address,limit:t.limit,cursor:t.cursor});return{objects:r.data.map(n=>{if(n.error)throw Vi.fromResponse(n.error);return vh(n.data)}),hasNextPage:r.hasNextPage,cursor:r.nextCursor??null}}async getCoins(t){const r=await fi(this,sn).getCoins({owner:t.address,coinType:t.coinType});return{objects:r.data.map(n=>({id:n.coinObjectId,version:n.version,digest:n.digest,balance:BigInt(n.balance),type:`0x2::coin::Coin<${n.coinType}>`,content:w3.serialize({id:n.coinObjectId,balance:{value:n.balance}}).toBytes(),owner:{$kind:"ObjectOwner",ObjectOwner:t.address}})),hasNextPage:r.hasNextPage,cursor:r.nextCursor??null}}async getBalance(t){const r=await fi(this,sn).getBalance({owner:t.address,coinType:t.coinType});return{balance:{coinType:r.coinType,balance:BigInt(r.totalBalance)}}}async getAllBalances(t){return{balances:(await fi(this,sn).getAllBalances({owner:t.address})).map(n=>({coinType:n.coinType,balance:BigInt(n.totalBalance)})),hasNextPage:!1,cursor:null}}async getTransaction(t){const r=await fi(this,sn).getTransactionBlock({digest:t.digest,options:{showRawInput:!0,showObjectChanges:!0,showRawEffects:!0,showEvents:!0}});return{transaction:bh(r)}}async executeTransaction(t){const r=await fi(this,sn).executeTransactionBlock({transactionBlock:t.transaction,signature:t.signatures,options:{showEffects:!0,showEvents:!0}});return{transaction:bh(r)}}async dryRunTransaction(t){const r=To.from(t.transaction),n=await fi(this,sn).dryRunTransactionBlock({transactionBlock:t.transaction});return{transaction:{digest:await r.getDigest(),effects:n.effects,signatures:[],bcs:t.transaction}}}async getReferenceGasPrice(){return{referenceGasPrice:await fi(this,sn).getReferenceGasPrice()}}}sn=new WeakMap;function vh(e){var t;return{id:e.objectId,version:e.version,digest:e.digest,type:e.type,content:((t=e.bcs)==null?void 0:t.dataType)==="moveObject"?Sr(e.bcs.bcsBytes):new Uint8Array,owner:b3(e.owner)}}function b3(e){if(e==="Immutable")return{$kind:"Immutable",Immutable:!0};if("ConsensusV2"in e)return{$kind:"ConsensusV2",ConsensusV2Owner:{authenticator:{$kind:"SingleOwner",SingleOwner:e.ConsensusV2.authenticator.SingleOwner},startVersion:e.ConsensusV2.start_version}};if("AddressOwner"in e)return{$kind:"AddressOwner",AddressOwner:e.AddressOwner};if("ObjectOwner"in e)return{$kind:"ObjectOwner",ObjectOwner:e.ObjectOwner};if("Shared"in e)return{$kind:"Shared",Shared:{initialSharedVersion:e.Shared.initial_shared_version}};throw new Error(`Unknown owner type: ${JSON.stringify(e)}`)}function bh(e){const t=vt.SenderSignedData.parse(Sr(e.rawTransaction))[0];return{digest:e.digest,effects:new Uint8Array(e.rawEffects),bcs:vt.TransactionData.serialize(t.intentMessage.value).toBytes(),signatures:t.txSignatures}}const y3=vt.struct("Balance",{value:vt.u64()}),w3=vt.struct("Coin",{id:vt.Address,balance:y3}),x3=Symbol.for("@mysten/SuiClient");class ps extends hg{constructor(t){super({network:t.network??"unknown"}),this.core=new v3(this),this.transport=t.transport??new E6({url:t.url})}get[x3](){return!0}async getRpcApiVersion(){return(await this.transport.request({method:"rpc.discover",params:[]})).info.version}async getCoins(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getCoins",params:[t.owner,t.coinType,t.cursor,t.limit]})}async getAllCoins(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getAllCoins",params:[t.owner,t.cursor,t.limit]})}async getBalance(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getBalance",params:[t.owner,t.coinType]})}async getAllBalances(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getAllBalances",params:[t.owner]})}async getCoinMetadata(t){return await this.transport.request({method:"suix_getCoinMetadata",params:[t.coinType]})}async getTotalSupply(t){return await this.transport.request({method:"suix_getTotalSupply",params:[t.coinType]})}async call(t,r){return await this.transport.request({method:t,params:r})}async getMoveFunctionArgTypes(t){return await this.transport.request({method:"sui_getMoveFunctionArgTypes",params:[t.package,t.module,t.function]})}async getNormalizedMoveModulesByPackage(t){return await this.transport.request({method:"sui_getNormalizedMoveModulesByPackage",params:[t.package]})}async getNormalizedMoveModule(t){return await this.transport.request({method:"sui_getNormalizedMoveModule",params:[t.package,t.module]})}async getNormalizedMoveFunction(t){return await this.transport.request({method:"sui_getNormalizedMoveFunction",params:[t.package,t.module,t.function]})}async getNormalizedMoveStruct(t){return await this.transport.request({method:"sui_getNormalizedMoveStruct",params:[t.package,t.module,t.struct]})}async getOwnedObjects(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getOwnedObjects",params:[t.owner,{filter:t.filter,options:t.options},t.cursor,t.limit]})}async getObject(t){if(!t.id||!Xs(Jr(t.id)))throw new Error("Invalid Sui Object id");return await this.transport.request({method:"sui_getObject",params:[t.id,t.options]})}async tryGetPastObject(t){return await this.transport.request({method:"sui_tryGetPastObject",params:[t.id,t.version,t.options]})}async multiGetObjects(t){if(t.ids.forEach(n=>{if(!n||!Xs(Jr(n)))throw new Error(`Invalid Sui Object id ${n}`)}),t.ids.length!==new Set(t.ids).size)throw new Error(`Duplicate object ids in batch call ${t.ids}`);return await this.transport.request({method:"sui_multiGetObjects",params:[t.ids,t.options]})}async queryTransactionBlocks(t){return await this.transport.request({method:"suix_queryTransactionBlocks",params:[{filter:t.filter,options:t.options},t.cursor,t.limit,(t.order||"descending")==="descending"]})}async getTransactionBlock(t){if(!mf(t.digest))throw new Error("Invalid Transaction digest");return await this.transport.request({method:"sui_getTransactionBlock",params:[t.digest,t.options]})}async multiGetTransactionBlocks(t){if(t.digests.forEach(n=>{if(!mf(n))throw new Error(`Invalid Transaction digest ${n}`)}),t.digests.length!==new Set(t.digests).size)throw new Error(`Duplicate digests in batch call ${t.digests}`);return await this.transport.request({method:"sui_multiGetTransactionBlocks",params:[t.digests,t.options]})}async executeTransactionBlock({transactionBlock:t,signature:r,options:n,requestType:i}){const o=await this.transport.request({method:"sui_executeTransactionBlock",params:[typeof t=="string"?t:yr(t),Array.isArray(r)?r:[r],n]});if(i==="WaitForLocalExecution")try{await this.waitForTransaction({digest:o.digest})}catch{}return o}async signAndExecuteTransaction({transaction:t,signer:r,...n}){let i;t instanceof Uint8Array?i=t:(t.setSenderIfNotSet(r.toSuiAddress()),i=await t.build({client:this}));const{signature:o,bytes:s}=await r.signTransaction(i);return this.executeTransactionBlock({transactionBlock:s,signature:o,...n})}async getTotalTransactionBlocks(){const t=await this.transport.request({method:"sui_getTotalTransactionBlocks",params:[]});return BigInt(t)}async getReferenceGasPrice(){const t=await this.transport.request({method:"suix_getReferenceGasPrice",params:[]});return BigInt(t)}async getStakes(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getStakes",params:[t.owner]})}async getStakesByIds(t){return t.stakedSuiIds.forEach(r=>{if(!r||!Xs(Jr(r)))throw new Error(`Invalid Sui Stake id ${r}`)}),await this.transport.request({method:"suix_getStakesByIds",params:[t.stakedSuiIds]})}async getLatestSuiSystemState(){return await this.transport.request({method:"suix_getLatestSuiSystemState",params:[]})}async queryEvents(t){return await this.transport.request({method:"suix_queryEvents",params:[t.query,t.cursor,t.limit,(t.order||"descending")==="descending"]})}async subscribeEvent(t){return this.transport.subscribe({method:"suix_subscribeEvent",unsubscribe:"suix_unsubscribeEvent",params:[t.filter],onMessage:t.onMessage})}async subscribeTransaction(t){return this.transport.subscribe({method:"suix_subscribeTransaction",unsubscribe:"suix_unsubscribeTransaction",params:[t.filter],onMessage:t.onMessage})}async devInspectTransactionBlock(t){var n;let r;if(n1(t.transactionBlock))t.transactionBlock.setSenderIfNotSet(t.sender),r=yr(await t.transactionBlock.build({client:this,onlyTransactionKind:!0}));else if(typeof t.transactionBlock=="string")r=t.transactionBlock;else if(t.transactionBlock instanceof Uint8Array)r=yr(t.transactionBlock);else throw new Error("Unknown transaction block format.");return await this.transport.request({method:"sui_devInspectTransactionBlock",params:[t.sender,r,(n=t.gasPrice)==null?void 0:n.toString(),t.epoch]})}async dryRunTransactionBlock(t){return await this.transport.request({method:"sui_dryRunTransactionBlock",params:[typeof t.transactionBlock=="string"?t.transactionBlock:yr(t.transactionBlock)]})}async getDynamicFields(t){if(!t.parentId||!Xs(Jr(t.parentId)))throw new Error("Invalid Sui Object id");return await this.transport.request({method:"suix_getDynamicFields",params:[t.parentId,t.cursor,t.limit]})}async getDynamicFieldObject(t){return await this.transport.request({method:"suix_getDynamicFieldObject",params:[t.parentId,t.name]})}async getLatestCheckpointSequenceNumber(){const t=await this.transport.request({method:"sui_getLatestCheckpointSequenceNumber",params:[]});return String(t)}async getCheckpoint(t){return await this.transport.request({method:"sui_getCheckpoint",params:[t.id]})}async getCheckpoints(t){return await this.transport.request({method:"sui_getCheckpoints",params:[t.cursor,t==null?void 0:t.limit,t.descendingOrder]})}async getCommitteeInfo(t){return await this.transport.request({method:"suix_getCommitteeInfo",params:[t==null?void 0:t.epoch]})}async getNetworkMetrics(){return await this.transport.request({method:"suix_getNetworkMetrics",params:[]})}async getAddressMetrics(){return await this.transport.request({method:"suix_getLatestAddressMetrics",params:[]})}async getEpochMetrics(t){return await this.transport.request({method:"suix_getEpochMetrics",params:[t==null?void 0:t.cursor,t==null?void 0:t.limit,t==null?void 0:t.descendingOrder]})}async getAllEpochAddressMetrics(t){return await this.transport.request({method:"suix_getAllEpochAddressMetrics",params:[t==null?void 0:t.descendingOrder]})}async getEpochs(t){return await this.transport.request({method:"suix_getEpochs",params:[t==null?void 0:t.cursor,t==null?void 0:t.limit,t==null?void 0:t.descendingOrder]})}async getMoveCallMetrics(){return await this.transport.request({method:"suix_getMoveCallMetrics",params:[]})}async getCurrentEpoch(){return await this.transport.request({method:"suix_getCurrentEpoch",params:[]})}async getValidatorsApy(){return await this.transport.request({method:"suix_getValidatorsApy",params:[]})}async getChainIdentifier(){const t=await this.getCheckpoint({id:"0"}),r=_i(t.digest);return Ei(r.slice(0,4))}async resolveNameServiceAddress(t){return await this.transport.request({method:"suix_resolveNameServiceAddress",params:[t.name]})}async resolveNameServiceNames({format:t="dot",...r}){const{nextCursor:n,hasNextPage:i,data:o}=await this.transport.request({method:"suix_resolveNameServiceNames",params:[r.address,r.cursor,r.limit]});return{hasNextPage:i,nextCursor:n,data:o.map(s=>vg(s,t))}}async getProtocolConfig(t){return await this.transport.request({method:"sui_getProtocolConfig",params:[t==null?void 0:t.version]})}async waitForTransaction({signal:t,timeout:r=60*1e3,pollInterval:n=2*1e3,...i}){const o=AbortSignal.timeout(r),s=new Promise((a,c)=>{o.addEventListener("abort",()=>c(o.reason))});for(s.catch(()=>{});!o.aborted;){t==null||t.throwIfAborted();try{return await this.getTransactionBlock(i)}catch{await Promise.race([new Promise(c=>setTimeout(c,n)),s])}}throw o.throwIfAborted(),new Error("Unexpected error while waiting for transaction block.")}experimental_asClientExtension(){return{name:"jsonRPC",register:()=>this}}}var _f={},fl={},Ed={},dl={},Cd={},hl={};Object.defineProperty(hl,"__esModule",{value:!0});hl.Convert=void 0;class S3{static toPriceFeed(t){return bu(t,gi("PriceFeed"))}static priceFeedToJson(t){return yu(t,gi("PriceFeed"))}static toPrice(t){return bu(t,gi("Price"))}static priceToJson(t){return yu(t,gi("Price"))}static toPriceFeedMetadata(t){return bu(t,gi("PriceFeedMetadata"))}static priceFeedMetadataToJson(t){return yu(t,gi("PriceFeedMetadata"))}}hl.Convert=S3;function di(e,t,r=""){throw Error(r?`Invalid value for key "${r}". Expected type ${JSON.stringify(e)} but got ${JSON.stringify(t)}`:`Invalid value ${JSON.stringify(t)} for type ${JSON.stringify(e)}`)}function _3(e){if(e.jsonToJS===void 0){const t={};e.props.forEach(r=>t[r.json]={key:r.js,typ:r.typ}),e.jsonToJS=t}return e.jsonToJS}function E3(e){if(e.jsToJSON===void 0){const t={};e.props.forEach(r=>t[r.js]={key:r.json,typ:r.typ}),e.jsToJSON=t}return e.jsToJSON}function ns(e,t,r,n=""){function i(u,d){return typeof u==typeof d?d:di(u,d,n)}function o(u,d){const p=u.length;for(let y=0;y<p;y++){const x=u[y];try{return ns(d,x,r)}catch{}}return di(u,d)}function s(u,d){return u.indexOf(d)!==-1?d:di(u,d)}function a(u,d){return Array.isArray(d)?d.map(p=>ns(p,u,r)):di("array",d)}function c(u){if(u===null)return null;const d=new Date(u);return isNaN(d.valueOf())?di("Date",u):d}function l(u,d,p){if(p===null||typeof p!="object"||Array.isArray(p))return di("object",p);const y={};return Object.getOwnPropertyNames(u).forEach(x=>{const b=u[x],M=Object.prototype.hasOwnProperty.call(p,x)?p[x]:void 0;y[b.key]=ns(M,b.typ,r,b.key)}),Object.getOwnPropertyNames(p).forEach(x=>{Object.prototype.hasOwnProperty.call(u,x)||(y[x]=ns(p[x],d,r,x))}),y}if(t==="any")return e;if(t===null)return e===null?e:di(t,e);if(t===!1)return di(t,e);for(;typeof t=="object"&&t.ref!==void 0;)t=C3[t.ref];return Array.isArray(t)?s(t,e):typeof t=="object"?t.hasOwnProperty("unionMembers")?o(t.unionMembers,e):t.hasOwnProperty("arrayItems")?a(t.arrayItems,e):t.hasOwnProperty("props")?l(r(t),t.additional,e):di(t,e):t===Date&&typeof e!="number"?c(e):i(t,e)}function bu(e,t){return ns(e,t,_3)}function yu(e,t){return ns(e,t,E3)}function fo(...e){return{unionMembers:e}}function wu(e,t){return{props:e,additional:t}}function gi(e){return{ref:e}}const C3={PriceFeed:wu([{json:"ema_price",js:"ema_price",typ:gi("Price")},{json:"id",js:"id",typ:""},{json:"metadata",js:"metadata",typ:fo(void 0,gi("PriceFeedMetadata"))},{json:"price",js:"price",typ:gi("Price")},{json:"vaa",js:"vaa",typ:fo(void 0,"")}],"any"),Price:wu([{json:"conf",js:"conf",typ:""},{json:"expo",js:"expo",typ:0},{json:"price",js:"price",typ:""},{json:"publish_time",js:"publish_time",typ:0}],"any"),PriceFeedMetadata:wu([{json:"attestation_time",js:"attestation_time",typ:fo(void 0,0)},{json:"emitter_chain",js:"emitter_chain",typ:0},{json:"prev_publish_time",js:"prev_publish_time",typ:fo(void 0,0)},{json:"price_service_receive_time",js:"price_service_receive_time",typ:fo(void 0,0)},{json:"sequence_number",js:"sequence_number",typ:fo(void 0,0)},{json:"slot",js:"slot",typ:fo(void 0,0)}],"any")};var Ra={};(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},r={};r.byteLength=u,r.toByteArray=p,r.fromByteArray=b;for(var n=[],i=[],o=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63;function l(P){var k=P.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var F=P.indexOf("=");F===-1&&(F=k);var B=F===k?0:4-F%4;return[F,B]}function u(P){var k=l(P),F=k[0],B=k[1];return(F+B)*3/4-B}function d(P,k,F){return(k+F)*3/4-F}function p(P){var k,F=l(P),B=F[0],W=F[1],z=new o(d(P,B,W)),G=0,re=W>0?B-4:B,oe;for(oe=0;oe<re;oe+=4)k=i[P.charCodeAt(oe)]<<18|i[P.charCodeAt(oe+1)]<<12|i[P.charCodeAt(oe+2)]<<6|i[P.charCodeAt(oe+3)],z[G++]=k>>16&255,z[G++]=k>>8&255,z[G++]=k&255;return W===2&&(k=i[P.charCodeAt(oe)]<<2|i[P.charCodeAt(oe+1)]>>4,z[G++]=k&255),W===1&&(k=i[P.charCodeAt(oe)]<<10|i[P.charCodeAt(oe+1)]<<4|i[P.charCodeAt(oe+2)]>>2,z[G++]=k>>8&255,z[G++]=k&255),z}function y(P){return n[P>>18&63]+n[P>>12&63]+n[P>>6&63]+n[P&63]}function x(P,k,F){for(var B,W=[],z=k;z<F;z+=3)B=(P[z]<<16&16711680)+(P[z+1]<<8&65280)+(P[z+2]&255),W.push(y(B));return W.join("")}function b(P){for(var k,F=P.length,B=F%3,W=[],z=16383,G=0,re=F-B;G<re;G+=z)W.push(x(P,G,G+z>re?re:G+z));return B===1?(k=P[F-1],W.push(n[k>>2]+n[k<<4&63]+"==")):B===2&&(k=(P[F-2]<<8)+P[F-1],W.push(n[k>>10]+n[k>>4&63]+n[k<<2&63]+"=")),W.join("")}var M={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */M.read=function(P,k,F,B,W){var z,G,re=W*8-B-1,oe=(1<<re)-1,se=oe>>1,q=-7,L=F?W-1:0,h=F?-1:1,f=P[k+L];for(L+=h,z=f&(1<<-q)-1,f>>=-q,q+=re;q>0;z=z*256+P[k+L],L+=h,q-=8);for(G=z&(1<<-q)-1,z>>=-q,q+=B;q>0;G=G*256+P[k+L],L+=h,q-=8);if(z===0)z=1-se;else{if(z===oe)return G?NaN:(f?-1:1)*(1/0);G=G+Math.pow(2,B),z=z-se}return(f?-1:1)*G*Math.pow(2,z-B)},M.write=function(P,k,F,B,W,z){var G,re,oe,se=z*8-W-1,q=(1<<se)-1,L=q>>1,h=W===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=B?0:z-1,m=B?1:-1,S=k<0||k===0&&1/k<0?1:0;for(k=Math.abs(k),isNaN(k)||k===1/0?(re=isNaN(k)?1:0,G=q):(G=Math.floor(Math.log(k)/Math.LN2),k*(oe=Math.pow(2,-G))<1&&(G--,oe*=2),G+L>=1?k+=h/oe:k+=h*Math.pow(2,1-L),k*oe>=2&&(G++,oe/=2),G+L>=q?(re=0,G=q):G+L>=1?(re=(k*oe-1)*Math.pow(2,W),G=G+L):(re=k*Math.pow(2,L-1)*Math.pow(2,W),G=0));W>=8;P[F+f]=re&255,f+=m,re/=256,W-=8);for(G=G<<W|re,se+=W;se>0;P[F+f]=G&255,f+=m,G/=256,se-=8);P[F+f-m]|=S*128};/*!
|
|
24
|
+
<%s key={someKey} {...props} />`,wr,ur,vn,ur),Y[ur+wr]=!0}}return V===n?U(Ft):A(Ft),Ft}}function ne(V,ae,fe){return ee(V,ae,fe,!0)}function De(V,ae,fe){return ee(V,ae,fe,!1)}var Ze=De,Ne=ne;Us.Fragment=n,Us.jsx=Ze,Us.jsxs=Ne}()),Us}Mn.env.NODE_ENV==="production"?uf.exports=p6():uf.exports=m6();var w=uf.exports;window._iconfont_svg_string_4776227='<svg><symbol id="icon-link2" viewBox="0 0 1024 1024"><path d="M642.7648 217.6a166.5024 166.5024 0 0 1 166.5024 166.5024v256.256a166.5024 166.5024 0 0 1-166.5024 166.5024H386.5088a92.16 92.16 0 0 1-64.9728-157.5936L506.88 465.2032H429.2096a38.4 38.4 0 0 1-38.0416-33.1776l-0.3584-5.2224a38.4 38.4 0 0 1 38.4-38.4h170.8544l1.4336 0.0512c0.8704 0 1.6896 0.1024 2.56 0.1536l-3.9936-0.2048a38.656 38.656 0 0 1 27.2384 11.3664l1.792 1.9456 1.536 1.8944-3.328-3.84a38.6048 38.6048 0 0 1 11.1616 27.0336v170.8544a38.4 38.4 0 0 1-76.8 0l-0.0512-78.592-185.9584 184.6784a15.36 15.36 0 0 0 7.3216 25.9072l3.584 0.4096h256.2048c49.5616 0 89.7024-40.1408 89.7024-89.7024V384.1024c0-49.5104-40.1408-89.7024-89.7024-89.7024H386.5088c-49.5616 0-89.7024 40.192-89.7024 89.7024V563.2a38.4 38.4 0 0 1-76.8 0V384.1024A166.5024 166.5024 0 0 1 386.5088 217.6h256.256z" ></path></symbol><symbol id="icon-more" viewBox="0 0 1024 1024"><path d="M499.2 217.6m0-64a64 64 0 1 0 0 128 64 64 0 1 0 0-128Z" ></path><path d="M499.2 524.8m0-64a64 64 0 1 0 0 128 64 64 0 1 0 0-128Z" ></path><path d="M499.2 832m0-64a64 64 0 1 0 0 128 64 64 0 1 0 0-128Z" ></path></symbol><symbol id="icon-docs" viewBox="0 0 1024 1024"><path d="M665.6 41.728c65.9456 0 121.2928 45.312 136.6016 106.496 5.0688-2.6624 10.8544-4.096 16.9984-4.096a140.8 140.8 0 0 1 140.8 140.8v563.2a140.8 140.8 0 0 1-140.8 140.8H358.4a140.8512 140.8512 0 0 1-135.4752-102.4H204.8a140.8 140.8 0 0 1-140.8-140.8v-563.2A140.8 140.8 0 0 1 204.8 41.728h460.8z m140.8 177.0496v526.9504a140.8 140.8 0 0 1-140.8 140.8l-358.4 0.1024c11.7248 15.5136 30.3104 25.4976 51.2 25.4976h460.8c35.328 0 64-28.672 64-64v-563.2c0-35.328-28.672-64-64-64a38.3488 38.3488 0 0 1-12.8-2.1504zM665.6 118.528H204.8c-35.328 0-64 28.672-64 64v563.2c0 35.328 28.672 64 64 64h460.8c35.328 0 64-28.672 64-64v-563.2c0-35.328-28.672-64-64-64z m-153.6 281.6a38.4 38.4 0 1 1 0 76.8H256a38.4 38.4 0 1 1 0-76.8h256z m102.4-153.6a38.4 38.4 0 1 1 0 76.8H256a38.4 38.4 0 1 1 0-76.8h358.4z" ></path></symbol><symbol id="icon-link1" viewBox="0 0 1024 1024"><path d="M719.872 268.8l3.738 0.205 0.768 0.051-4.506-0.256a38.502 38.502 0 0 1 28.416 12.544l0.973 1.126a38.554 38.554 0 0 1 1.74 2.253l-2.713-3.379a38.605 38.605 0 0 1 9.984 25.549V563.2a38.4 38.4 0 1 1-76.8 0V394.086L281.856 758.221a38.4 38.4 0 0 1-51.712-56.832L620.646 345.6H463.872a38.4 38.4 0 0 1-38.042-33.178l-0.358-5.222a38.4 38.4 0 0 1 38.4-38.4h256z" ></path></symbol><symbol id="icon-icon-kfckfc" viewBox="0 0 1024 1024"><path d="M53.504 102.912c-0.41 0.563 30.208 42.086 67.84 92.006L299.008 430.9 408.32 576l-7.014 7.885c-3.943 4.352-84.327 90.521-178.432 191.488C128.717 876.595 51.354 960 51.2 960.87c-0.358 0.922 16.077 1.69 39.731 1.536l40.243-0.204 13.21-14.49A217385.626 217385.626 0 0 0 440.32 629.914l4.71-5.479 37.837 50.33L610.048 843.93l89.6 118.63H836.71c114.023 0 136.858-0.358 136.141-2.458-0.563-1.484-35.328-48.025-77.312-103.782-41.984-55.603-90.01-119.398-106.65-141.568-16.793-22.17-66.15-88.064-110.028-146.074-43.879-58.163-79.821-106.598-79.821-107.366 0-1.331 231.782-251.187 310.58-334.746l22.527-23.808h-41.42l-41.217 0.154-48.179 51.814a48197.632 48197.632 0 0 1-144.23 154.88l-95.847 102.912L445.03 258.202 328.55 103.68l-137.062-0.922c-75.418-0.563-137.626-0.41-137.984 0.154z m324.762 166.4c44.8 59.7 113.97 151.5 153.65 204.288 39.732 52.531 127.796 169.677 195.892 259.994 68.045 90.47 124.365 165.376 125.286 166.707 1.178 1.69-12.288 2.253-61.235 2.253h-62.566L605.286 737.69c-286.208-379.802-430.592-571.7-432.332-574.516-1.127-1.69 11.724-2.252 61.081-2.252h62.567l81.664 108.39z" ></path></symbol><symbol id="icon-icon_telegram" viewBox="0 0 1024 1024"><path d="M824.87808 503.6032c55.8592 0 100.096 12.544 133.4272 37.5296 34.2016 26.7264 55.9104 66.7136 64.2048 120.9344h-94.208c-5.8368-27.4944-17.5104-47.5136-34.2016-60.8768-17.5104-13.312-40.8576-19.968-69.2224-19.968-35.0208 0-62.5664 12.4928-82.5856 39.168-19.968 25.856-30.0032 62.5152-30.0032 109.2608 0 47.5136 9.216 85.0432 29.184 111.7184 18.3296 25.856 45.8752 39.2192 82.5856 39.2192 63.3856 0 98.4064-31.6928 105.8816-94.208H1024.19968c-9.984 58.368-32.512 101.7344-66.7136 130.048-33.3824 27.5456-78.3872 41.728-134.2976 41.728-66.7136 0-118.4256-21.7088-155.136-65.024-35.84-41.728-53.3504-95.9488-53.3504-162.6624 0-65.024 17.5104-118.4256 52.5312-159.2832 37.5296-45.056 90.112-67.584 157.6448-67.584z m75.7248-333.6704l-53.76 245.4528a353.792 353.792 0 0 0-12.6464-0.256c-164.096 0-316.3648 113.7664-357.0176 266.752L381.63968 771.9424c-11.6224 10.9056-20.7872 20.1216-41.5744 20.1216l14.1824-205.2608 385.1776-336.7424c16.896-14.5408-3.6352-21.6576-26.112-8.3968L237.76768 532.2752 32.35328 470.1696c-44.288-13.1584-44.544-42.7008 10.0352-64l800.3072-298.9568c36.5568-15.9744 71.8336 8.5504 57.856 62.72z" ></path></symbol><symbol id="icon-icon_medium" viewBox="0 0 1024 1024"><path d="M576.819712 497.6128c-0.7168 169.6768-139.5712 294.7584-293.376 292.3008C127.795712 787.4048-0.357888 656.1792 0.000512 495.2064 0.358912 334.9504 130.611712 204.032 288.819712 204.8c159.9488 0.768 288.2048 131.1744 288 292.8128m27.904-1.536c0.9216-72.9088 12.3904-143.3088 50.1248-207.0528 7.168-12.1856 15.872-23.8592 25.6512-33.9968 44.4928-46.08 99.4816-44.0832 141.312 4.5056 28.8768 33.5872 45.8752 73.216 56.064 115.8656 24.576 102.5536 21.2992 203.5712-19.968 301.6704-11.9808 28.416-28.5184 54.2208-52.9408 73.728-36.2496 29.1328-76.8 29.3888-112.5376-0.3072-39.2704-32.6656-59.4944-77.5168-70.7584-125.696-9.8304-41.984-14.2848-85.248-21.0944-128l4.1472-0.7168M1024.000512 470.5792c-3.1744 93.952-4.9152 159.8976-22.1696 224.0512-3.0208 11.264-6.656 22.7328-12.4928 32.6656-3.8912 6.656-11.776 14.3872-18.3296 14.8992-5.3248 0.4096-14.08-8.192-16.6912-14.6944-7.5776-18.7392-14.848-38.0928-18.6368-57.9584-16.384-86.3744-18.4832-173.7216-10.496-261.0176 3.584-39.424 11.9296-78.4896 19.1488-117.5552 1.792-9.728 6.7584-19.2512 11.776-27.9552 9.728-16.4864 22.3744-16.896 30.9248 0 7.68 15.2576 15.0528 31.744 17.408 48.4864 8.8064 62.0544 15.4112 124.416 19.5584 159.0784" ></path></symbol><symbol id="icon-icon_discord" viewBox="0 0 1024 1024"><path d="M831.8976 213.6064A748.032 748.032 0 0 0 641.7408 153.6c-8.192 14.848-17.7664 34.8672-24.3712 50.7904a694.8864 694.8864 0 0 0-210.688 0c-6.6048-15.872-16.384-35.8912-24.6272-50.7904a745.5744 745.5744 0 0 0-190.3104 60.16C71.424 396.4928 38.8096 574.6176 55.0912 750.2848a758.784 758.784 0 0 0 233.216 120.064c18.7904-26.0096 35.5328-53.6064 49.92-82.688a490.0864 490.0864 0 0 1-78.6432-38.4c6.656-4.9664 13.056-10.0864 19.3024-15.36 151.6544 71.2704 316.416 71.2704 466.2272 0 6.2976 5.2736 12.8 10.3936 19.3024 15.36a488.8576 488.8576 0 0 1-78.848 38.5024c14.4384 28.9792 31.1296 56.6784 49.9712 82.6368a757.2992 757.2992 0 0 0 233.3184-120.1152c19.1488-203.6224-32.6656-380.16-136.96-536.6784zM358.912 642.2528c-45.568 0-82.8416-42.7008-82.8416-94.72 0-51.968 36.5056-94.72 82.8416-94.72 46.336 0 83.6608 42.6496 82.8416 94.72 0.1024 52.0192-36.5056 94.72-82.8416 94.72z m306.176 0c-45.5168 0-82.8416-42.7008-82.8416-94.72 0-51.968 36.5056-94.72 82.8416-94.72 46.336 0 83.6608 42.6496 82.8416 94.72 0 52.0192-36.5056 94.72-82.8416 94.72z" ></path></symbol><symbol id="icon-icon_del" viewBox="0 0 1024 1024"><path d="M512 64a243.2512 243.2512 0 0 1 240.1792 204.8h-1.3312a140.8 140.8 0 0 1 139.1104 162.4576l-63.6928 409.6a140.8 140.8 0 0 1-139.1616 119.1424H336.896a140.8 140.8 0 0 1-139.1616-119.1424l-63.6928-409.6A140.8 140.8 0 0 1 271.8208 268.8a243.2 243.2 0 0 1 240.1792-204.8z m238.848 281.6h-477.696A64 64 0 0 0 209.92 419.4304l63.6928 409.6A64 64 0 0 0 336.896 883.2h350.208a64 64 0 0 0 63.2832-54.1696l63.6928-409.6a64 64 0 0 0-63.232-73.8304zM409.6 473.6a38.4 38.4 0 0 1 38.4 38.4v204.8a38.4 38.4 0 1 1-76.8 0v-204.8A38.4 38.4 0 0 1 409.6 473.6z m204.8 0a38.4 38.4 0 0 1 38.4 38.4v204.8a38.4 38.4 0 1 1-76.8 0v-204.8a38.4 38.4 0 0 1 38.4-38.4z m-102.4-332.8a166.4512 166.4512 0 0 0-160.0512 120.7296l-1.8944 7.2704h323.84l-1.8432-7.2704a166.5024 166.5024 0 0 0-150.6304-120.4736L512 140.8z" ></path></symbol><symbol id="icon-plorer" viewBox="0 0 1024 1024"><path d="M608 62.31l245.453 141.67a192 192 0 0 1 96 166.298v283.444a192 192 0 0 1-96 166.297L608 961.69a192 192 0 0 1-192 0L170.547 820.02a192 192 0 0 1-96-166.297V370.278a192 192 0 0 1 95.949-166.297L415.949 62.31a192 192 0 0 1 192 0z m-153.6 66.51L208.947 270.49a115.2 115.2 0 0 0-57.6 99.84v283.392a115.2 115.2 0 0 0 57.6 99.788L454.4 895.18a115.2 115.2 0 0 0 115.2 0l245.453-141.67a115.2 115.2 0 0 0 57.6-99.84V370.33a115.2 115.2 0 0 0-57.6-99.79L569.6 128.87a115.2 115.2 0 0 0-115.2 0zM726.886 324.3L577.741 764.11c-11.776 34.713-60.826 34.816-72.704 0.051L440.73 575.59l-197.94-71.987c-31.744-11.622-33.536-54.63-5.427-69.785l5.632-2.458 434.586-155.546a38.4 38.4 0 0 1 49.305 48.487z m-98.252 50.586L369.05 467.763l115.2 41.984a38.4 38.4 0 0 1 20.992 18.381l2.252 5.325 33.792 98.97 87.348-257.537z" ></path></symbol><symbol id="icon-disconnect" viewBox="0 0 1024 1024"><path d="M575.357 738.274a38.4 38.4 0 0 1 0 54.306l-72.408 72.408A243.2 243.2 0 1 1 159.012 521.05l72.408-72.408a38.4 38.4 0 1 1 54.306 54.306l-72.408 72.408a166.4 166.4 0 0 0 235.325 235.325l72.408-72.408a38.4 38.4 0 0 1 54.306 0z m-108.612-181.02a38.4 38.4 0 0 1 0 54.307L358.134 720.172a38.4 38.4 0 1 1-54.306-54.306l108.611-108.611a38.4 38.4 0 0 1 54.306 0zM756.376 702.07a38.4 38.4 0 1 1-54.306 54.306L267.624 321.93a38.4 38.4 0 1 1 54.306-54.306L756.376 702.07z m-36.204-398.242a38.4 38.4 0 0 1 0 54.306L611.561 466.745a38.4 38.4 0 1 1-54.306-54.306l108.611-108.611a38.4 38.4 0 0 1 54.306 0z m144.816-144.816a243.2 243.2 0 0 1 0 343.937l-72.408 72.408a38.4 38.4 0 1 1-54.306-54.306l72.408-72.408a166.4 166.4 0 0 0-235.325-235.325l-72.408 72.408a38.4 38.4 0 0 1-54.306-54.306l72.408-72.408a243.2 243.2 0 0 1 343.937 0z" ></path></symbol><symbol id="icon-copy" viewBox="0 0 1024 1024"><path d="M665.6 396.8a140.8 140.8 0 0 1 140.8 140.8v128a140.8 140.8 0 0 1-140.8 140.8h-128a140.8 140.8 0 0 1-140.8-140.8v-128a140.8 140.8 0 0 1 140.8-140.8h128z m0 76.8h-128c-35.328 0-64 28.672-64 64v128c0 35.328 28.672 64 64 64h128c35.328 0 64-28.672 64-64v-128c0-35.328-28.672-64-64-64z" ></path><path d="M537.6 217.6c49.46 0 89.6 40.14 89.6 89.6v25.6a38.4 38.4 0 0 1-76.8 0v-25.6a12.8 12.8 0 0 0-12.8-12.8H307.2a12.8 12.8 0 0 0-12.8 12.8v230.4c0 7.066 5.734 12.8 12.8 12.8h25.6a38.4 38.4 0 0 1 0 76.8h-25.6a89.6 89.6 0 0 1-89.6-89.6V307.2c0-49.46 40.14-89.6 89.6-89.6h230.4z" ></path></symbol><symbol id="icon-link" viewBox="0 0 1024 1024"><path d="M436.992 281.6a38.4 38.4 0 0 1 0 76.8 217.6 217.6 0 1 0 217.6 217.6 38.4 38.4 0 1 1 76.8 0 294.4 294.4 0 1 1-294.4-294.4z m385.28-102.4l3.8912 0.2048 0.6144 0.0512-4.5056-0.256a38.2464 38.2464 0 0 1 28.416 12.544l0.8704 1.024a38.5536 38.5536 0 0 1 2.0992 2.7136l-2.9696-3.7376a38.656 38.656 0 0 1 9.984 25.5488V473.6a38.4 38.4 0 1 1-76.8 0V304.4864l-399.616 364.1344a38.4 38.4 0 0 1-51.712-56.832L723.0464 256H566.272a38.4 38.4 0 0 1-38.0416-33.1776l-0.3584-5.2224a38.4 38.4 0 0 1 38.4-38.4h256z" ></path></symbol><symbol id="icon-unfold" viewBox="0 0 2048 1024"><path d="M565.248 78.131a76.8 76.8 0 0 1 108.544 0l362.086 361.984a25.6 25.6 0 0 0 36.25 0l361.984-361.984a76.8 76.8 0 0 1 108.544 108.544l-361.984 362.189a179.2 179.2 0 0 1-253.44 0L565.248 186.675a76.8 76.8 0 0 1 0-108.544z" ></path></symbol><symbol id="icon-rpc" viewBox="0 0 1024 1024"><path d="M204.8 678.4a140.8 140.8 0 1 1 0 281.6 140.8 140.8 0 0 1 0-281.6z m168.96-573.44a268.8 268.8 0 0 1 207.872 439.245l38.144 38.144a192 192 0 1 1-55.603 53.094l-39.27-39.373A268.8 268.8 0 1 1 373.76 104.96zM204.8 755.2a64 64 0 1 0 0 128 64 64 0 0 0 0-128z m517.12-125.44a115.2 115.2 0 1 0 0 230.4 115.2 115.2 0 0 0 0-230.4z m-348.16-448a192 192 0 1 0 0 384 192 192 0 0 0 0-384zM819.2 64a140.8 140.8 0 1 1 0 281.6 140.8 140.8 0 0 1 0-281.6z m0 76.8a64 64 0 1 0 0 128 64 64 0 0 0 0-128z" ></path></symbol><symbol id="icon-mev" viewBox="0 0 1024 1024"><path d="M651.162 95.488c53.401 56.422 131.84 113.818 235.212 171.674a38.4 38.4 0 0 1 19.456 29.9c12.032 129.024-12.544 251.75-73.625 367.156-60.211 113.817-158.976 226.457-295.936 338.33a38.4 38.4 0 0 1-48.589 0C356.608 895.436 259.328 782.181 196.045 662.681c-64.103-121.19-90.266-243.405-77.824-365.876a38.4 38.4 0 0 1 20.531-30.259C239.923 214.323 319.846 156.98 378.624 94.925c104.96-110.95 169.37-108.442 272.538 0.512z m126.464 196.506l-1.178 0.819a41.933 41.933 0 0 1-10.035 3.84c-4.25 1.024-5.427 1.28-14.695 3.328a122.368 122.368 0 0 0-16.896 4.403c-43.878 16.384-71.168 47.411-83.097 96.666-2.304 9.625-3.328 20.838-3.687 38.4l-0.204 13.516v15.872l0.05 9.728v2.048l0.052 3.482c0.256 35.328 0.154 51.2-1.024 71.424-4.506 79.36-42.291 140.39-108.954 178.483-29.542 16.896-61.9 23.962-99.328 23.91h-8.704a9243.136 9243.136 0 0 0-29.286-0.153h-17.46l-10.034-0.051h-22.938c40.448 50.841 88.371 100.71 143.77 149.504l17.97 15.513 17.511-14.899c101.018-88.064 176.077-175.513 225.28-262.144l9.523-17.408c50.893-96.205 73.063-197.273 66.56-303.974l-3.584-2.407a1479.786 1479.786 0 0 1-49.664-29.9z m-171.52 5.12h-1.127c-15.155 0.102-30.054 3.584-45.107 10.598-46.285 21.504-77.056 71.373-76.39 128.051 0.307 25.703 0.256 51.354 0 87.603l-0.103 10.445c-0.102 14.49-0.512 24.371-1.74 34.816-4.865 42.803-19.661 79.77-43.674 110.285l-1.792 2.15 1.331 0.052h1.331c24.832 0 44.288-4.199 61.03-13.824 44.033-25.19 67.38-62.72 70.4-116.122 1.025-18.022 1.127-32.768 0.871-66.56v-5.478l-0.051-5.223v-21.504c0-5.12 0.051-9.728 0.153-14.49 0.512-22.681 1.895-38.604 5.837-54.937a225.075 225.075 0 0 1 35.687-79.514l4.71-6.246h-11.366z m1.484-136.295l-12.236-12.544c-73.728-77.926-87.245-78.438-160.973-0.563-60.467 63.898-139.674 122.112-237.466 174.95l-3.942 2.048-0.768 17.562c-2.407 88.064 18.176 176.384 61.952 265.42l9.779 19.047c9.267 17.51 19.354 34.919 30.26 52.224l-0.871 0.154c2.406-0.512 2.406-0.512 6.144-0.973 15.104-1.536 29.593-6.86 43.776-15.974 36.454-23.552 56.883-56.576 62.105-102.247 0.82-7.168 1.127-14.848 1.23-26.726l0.102-10.343c0.256-35.84 0.307-61.132 0-86.22-1.024-86.58 46.899-164.199 120.78-198.554a183.552 183.552 0 0 1 77.312-17.766h1.536l53.044 0.256h16.076a775.117 775.117 0 0 1-67.84-59.75z" ></path></symbol><symbol id="icon-caution" viewBox="0 0 1024 1024"><path d="M512 682.666667c-47.146667 0-85.333333-42.112-85.333333-94.037334V94.037333C426.666667 42.112 464.853333 0 512 0s85.333333 42.112 85.333333 94.037333v494.592C597.333333 640.554667 559.146667 682.666667 512 682.666667zM512 1024c-47.146667 0-85.333333-35.2-85.333333-78.592v-98.816C426.666667 803.2 464.853333 768 512 768s85.333333 35.2 85.333333 78.592v98.816C597.333333 988.8 559.146667 1024 512 1024z" ></path></symbol><symbol id="icon-settings" viewBox="0 0 1024 1024"><path d="M608 62.31l245.453 141.67a192 192 0 0 1 96 166.298v283.444a192 192 0 0 1-96 166.297L608 961.69a192 192 0 0 1-192 0L170.547 820.02a192 192 0 0 1-96-166.297V370.278a192 192 0 0 1 95.949-166.297L415.949 62.31a192 192 0 0 1 192 0z m-153.6 66.51L208.947 270.49a115.2 115.2 0 0 0-57.6 99.84v283.392a115.2 115.2 0 0 0 57.6 99.788L454.4 895.18a115.2 115.2 0 0 0 115.2 0l245.453-141.67a115.2 115.2 0 0 0 57.6-99.84V370.33a115.2 115.2 0 0 0-57.6-99.79L569.6 128.87a115.2 115.2 0 0 0-115.2 0z m104.858 211.762a89.6 89.6 0 0 1 77.568 44.8l47.257 81.818a89.6 89.6 0 0 1 0 89.6l-47.257 81.818a89.6 89.6 0 0 1-77.568 44.8h-94.516a89.6 89.6 0 0 1-77.568-44.8L339.917 556.8a89.6 89.6 0 0 1 0-89.6l47.257-81.818a89.6 89.6 0 0 1 77.568-44.8h94.516z m0 76.8h-94.516a12.8 12.8 0 0 0-11.059 6.4L406.426 505.6a12.8 12.8 0 0 0 0 12.8l47.257 81.818a12.8 12.8 0 0 0 11.06 6.4h94.515a12.8 12.8 0 0 0 11.059-6.4l47.257-81.818a12.8 12.8 0 0 0 0-12.8l-47.257-81.818a12.8 12.8 0 0 0-11.06-6.4z" ></path></symbol><symbol id="icon-back" viewBox="0 0 1024 1024"><path d="M67.738 495.616l36.3 32.358 220.468 194.868c13.926 12.236 14.438 33.792 1.024 46.796l-0.41 0.41a31.898 31.898 0 0 1-44.288 0L20.736 518.554a31.744 31.744 0 0 1 0-45.773l260.096-251.597a31.898 31.898 0 0 1 44.288 0l0.46 0.41a31.846 31.846 0 0 1-1.023 46.848l-220.57 194.816-36.352 32.358z" ></path></symbol><symbol id="icon-wallet" viewBox="0 0 1024 1024"><path d="M825.6 115.2A134.4 134.4 0 0 1 960 249.6v384c0 60.877-40.448 112.282-95.949 128.82L864 785.868a140.8 140.8 0 0 1-179.456 135.373l-467.2-133.479A140.8 140.8 0 0 1 115.2 652.288V249.6a134.4 134.4 0 0 1 134.4-134.4h576zM256 225.331c-35.328 0-64 28.672-64 64V652.34c0 28.57 18.944 53.709 46.438 61.543l467.2 133.478a64 64 0 0 0 81.562-61.491v-47.616a38.502 38.502 0 0 1 0-17.306V422.861a64 64 0 0 0-46.438-61.543l-467.2-133.478A64 64 0 0 0 256 225.28zM825.6 192H427.827l334.029 95.437A140.8 140.8 0 0 1 864 422.86v253.645c11.776-10.548 19.2-25.856 19.2-42.906v-384c0-31.795-25.805-57.6-57.6-57.6z m-192 259.226a38.4 38.4 0 0 1 38.4 38.4V633.6a38.4 38.4 0 1 1-76.8 0V489.574a38.4 38.4 0 0 1 38.4-38.4z" ></path></symbol><symbol id="icon-star" viewBox="0 0 1024 1024"><path d="M474.778 72.653a84.992 84.992 0 0 1 113.1 37.683l90.727 179.712c1.024 2.15 3.277 3.686 5.939 4.096l202.906 29.082c18.278 2.56 35.174 11.059 48.128 24.064a83.302 83.302 0 0 1-1.23 119.09l-148.12 142.542a6.605 6.605 0 0 0-2.049 5.939l34.765 195.584c3.277 18.483 0.154 37.58-8.806 54.17a85.043 85.043 0 0 1-114.176 34.457L515.84 804.659a8.55 8.55 0 0 0-7.885 0l-179.968 94.31c-16.589 8.705-35.635 11.674-54.118 8.5a83.968 83.968 0 0 1-68.813-97.28l34.97-195.328a6.605 6.605 0 0 0-2.048-5.94L89.702 466.484a83.61 83.61 0 0 1-24.832-48.128 83.968 83.968 0 0 1 71.732-95.078l204.339-29.184a7.834 7.834 0 0 0 5.939-4.096l89.395-179.251c8.192-16.59 21.76-29.952 38.503-38.093z m36.198 68.25l-2.56 0.767a7.475 7.475 0 0 0-3.43 3.328l-89.344 179.303c-12.39 24.832-36.301 41.933-63.847 45.875l-204.339 29.133c-4.352 0.614-7.168 4.198-6.605 7.885a6.81 6.81 0 0 0 2.048 3.89l148.275 142.49c20.173 19.354 29.338 47.36 24.423 74.804l-34.919 195.379c-0.665 3.584 1.946 7.27 6.247 8.038 1.894 0.307 3.789 0 5.427-0.819l179.968-94.31a85.35 85.35 0 0 1 79.155 0l180.173 94.361c3.994 2.1 9.011 0.615 10.957-3.02a6.4 6.4 0 0 0 0.717-4.199l-34.714-195.533a83.354 83.354 0 0 1 24.371-74.65l148.122-142.591a6.502 6.502 0 0 0 0.102-9.524 8.14 8.14 0 0 0-4.608-2.252l-202.957-29.082c-27.392-3.942-51.2-20.89-63.59-45.517l-90.726-179.712c-1.844-3.635-6.81-5.273-10.906-3.277l2.56-0.768z" ></path></symbol><symbol id="icon-trade" viewBox="0 0 1024 1024"><path d="M1002.93153 563.627l-433.237 432.64a67.243 67.243 0 0 1-29.696 21.93c-0.853 0.171-1.45 0.342-1.963 0.342a61.27 61.27 0 0 1-22.442 4.608c-1.11 0-2.304 0.853-3.414 0.853-2.048 0-3.84-1.365-5.973-1.365a54.87 54.87 0 0 1-13.653-2.987 77.312 77.312 0 0 1-15.275-6.144c-2.987-1.621-5.803-3.67-8.533-5.803-2.56-1.962-5.718-2.816-7.936-5.461L21.34153 563.627a71.68 71.68 0 0 1 0-102.059 72.704 72.704 0 0 1 102.57 0l316.16 315.477V73.472C440.07353 33.109 472.92753 0 513.29053 0a73.387 73.387 0 0 1 73.216 73.472v701.355L900.53153 461.653a72.363 72.363 0 0 1 102.4 102.059z" ></path></symbol><symbol id="icon-verticalslider" viewBox="0 0 1024 1024"><path d="M310.426 441.6a166.4 166.4 0 0 1 38.4 328.346V870.4a38.4 38.4 0 1 1-76.8 0V769.946a166.451 166.451 0 0 1 38.4-328.346z m0 76.8a89.6 89.6 0 1 0 0 179.2 89.6 89.6 0 0 0 0-179.2z m403.2-403.2a38.4 38.4 0 0 1 38.4 38.4v55.654a166.451 166.451 0 0 1-38.4 328.346 166.4 166.4 0 0 1-38.4-328.346V153.6a38.4 38.4 0 0 1 38.4-38.4z m0 166.4a89.6 89.6 0 1 0 0 179.2 89.6 89.6 0 0 0 0-179.2zM310.323 115.2a38.4 38.4 0 0 1 38.4 38.4v146.534a38.4 38.4 0 0 1-76.8 0V153.6a38.4 38.4 0 0 1 38.4-38.4z m403.2 525.26a38.4 38.4 0 0 1 38.4 38.4V870.4a38.4 38.4 0 1 1-76.8 0V678.86a38.4 38.4 0 0 1 38.4-38.4z" ></path></symbol><symbol id="icon-swap" viewBox="0 0 1024 1024"><path d="M321.434 116.224a51.2 51.2 0 0 1 69.888 74.752c-47.77 44.646-87.04 81.818-117.658 111.462l-1.997 1.844h289.229a51.2 51.2 0 0 1 50.842 45.26l0.358 5.94a51.2 51.2 0 0 1-51.2 51.2H154.47a51.763 51.763 0 0 1-52.07-52.839c0.205-11.52 3.123-19.097 7.782-27.136 3.226-5.53 7.22-10.752 12.8-17.203 8.192-9.626 20.992-23.04 38.656-40.704a7171.584 7171.584 0 0 1 159.744-152.576z m509.593 188.058a51.2 51.2 0 0 1 0 102.4h-93.593a51.2 51.2 0 0 1 0-102.4h93.593zM663.194 853.709a51.2 51.2 0 0 1-69.888-74.803c47.77-44.647 87.04-81.818 117.657-111.412l2.048-1.894H153.6a51.2 51.2 0 0 1-50.842-45.21l-0.358-5.99a51.2 51.2 0 0 1 51.2-51.2h676.557c27.904 0 52.582 22.272 52.07 52.838a51.456 51.456 0 0 1-7.782 27.136c-3.226 5.53-7.22 10.752-12.8 17.204-8.192 9.625-20.992 23.04-38.656 40.704a7171.584 7171.584 0 0 1-159.744 152.627z" ></path></symbol><symbol id="icon-star_sel" viewBox="0 0 1024 1024"><path d="M470.63 127.846L381.286 307.2a46.182 46.182 0 0 1-34.918 24.986l-204.34 29.184a45.568 45.568 0 0 0-39.167 51.456 45.344 45.344 0 0 0 13.465 26.01l148.276 142.438c10.905 10.496 15.872 25.6 13.21 40.448l-34.97 195.328a45.568 45.568 0 0 0 37.58 52.633 46.95 46.95 0 0 0 29.748-4.659l179.968-94.31a46.95 46.95 0 0 1 43.52 0l180.121 94.361c22.528 11.827 50.586 3.43 62.618-18.688a44.8 44.8 0 0 0 4.71-29.184L746.394 621.62a45.005 45.005 0 0 1 13.21-40.294l148.12-142.592a44.902 44.902 0 0 0 0.666-64.256 46.54 46.54 0 0 0-26.368-13.21l-202.956-29.081a46.182 46.182 0 0 1-34.765-24.781l-90.727-179.712a46.592 46.592 0 0 0-82.944 0.205z" ></path></symbol><symbol id="icon-tips" viewBox="0 0 1024 1024"><path d="M512 166.4a345.6 345.6 0 1 1 0 691.2 345.6 345.6 0 0 1 0-691.2z m0 76.8a268.8 268.8 0 1 0 0 537.6 268.8 268.8 0 0 0 0-537.6z m0 196.3a38.4 38.4 0 0 1 38.4 38.4v219.29a38.4 38.4 0 1 1-76.8 0V477.9a38.4 38.4 0 0 1 38.4-38.4z m0-153.087a38.4 38.4 0 0 1 38.4 38.4v45.414a38.4 38.4 0 1 1-76.8 0v-45.363a38.4 38.4 0 0 1 38.4-38.4z" ></path></symbol><symbol id="icon-sel" viewBox="0 0 1024 1024"><path d="M783.36 281.2416a51.2 51.2 0 0 1 71.68 73.0624l-407.9616 400.384a51.2 51.2 0 0 1-67.8912 3.4304l-206.3872-165.376a51.2 51.2 0 1 1 64-79.9232l170.9568 137.0112 375.6032-368.64z" ></path></symbol><symbol id="icon-spread" viewBox="0 0 1024 1024"><path d="M143.36 678.4a38.4 38.4 0 0 1 38.4 38.4v112.64c0 7.066 5.734 12.8 12.8 12.8H307.2a38.4 38.4 0 1 1 0 76.8H194.56a89.6 89.6 0 0 1-89.6-89.6V716.8a38.4 38.4 0 0 1 38.4-38.4z m327.68-573.44a38.4 38.4 0 0 1 0 76.8H234.342L842.24 790.477v-242.33a38.4 38.4 0 1 1 76.8 0V829.44a89.6 89.6 0 0 1-89.6 89.6H552.96a38.4 38.4 0 1 1 0-76.8l232.346-0.051L181.76 237.773V471.04a38.4 38.4 0 0 1-76.8 0V194.56c0-49.46 40.14-89.6 89.6-89.6h276.48z m358.4 0c49.46 0 89.6 40.14 89.6 89.6V307.2a38.4 38.4 0 1 1-76.8 0V194.56a12.8 12.8 0 0 0-12.8-12.8H716.8a38.4 38.4 0 1 1 0-76.8h112.64z" ></path></symbol><symbol id="icon-refresh" viewBox="0 0 1024 1024"><path d="M601.446 178.176a344.576 344.576 0 0 1 124.621 62.413 38.4 38.4 0 0 1 5.12 55.45l-94.566 107.878a38.4 38.4 0 1 1-57.754-50.586l65.741-75.11-4.915-2.816a268.646 268.646 0 0 0-43.008-18.535l-15.104-4.505A268.8 268.8 0 1 0 771.635 581.58a38.4 38.4 0 1 1 74.189 19.865 345.6 345.6 0 1 1-244.378-423.27z" ></path></symbol><symbol id="icon-close" viewBox="0 0 1024 1024"><path d="M763.392 256.512a51.2 51.2 0 0 1 0 72.3968L582.2464 509.952l183.1424 183.1424a51.2 51.2 0 0 1-72.3968 72.3968l-183.1424-183.1424-180.992 181.0432a51.2 51.2 0 0 1-72.3968-72.3968L437.504 509.952 258.56 330.9568A51.2 51.2 0 0 1 330.9568 258.56L509.952 437.504l181.0432-180.992a51.2 51.2 0 0 1 72.3968 0z" ></path></symbol><symbol id="icon-alert" viewBox="0 0 1024 1024"><path d="M558.08 125.0816c12.6464 7.5776 23.1936 18.1248 30.72 30.72L959.232 773.12a89.6 89.6 0 0 1-76.8 135.68H141.6192a89.6 89.6 0 0 1-76.8-135.68L435.1488 155.8016a89.6 89.6 0 0 1 122.9312-30.72zM501.0432 195.328L130.6624 812.5952a12.8 12.8 0 0 0 10.9568 19.4048h740.7616a12.8 12.8 0 0 0 10.9568-19.4048L522.9568 195.328a12.8 12.8 0 0 0-21.9136 0zM512 524.8a38.4 38.4 0 0 1 38.4 38.4v153.6a38.4 38.4 0 1 1-76.8 0v-153.6a38.4 38.4 0 0 1 38.4-38.4z m0-204.8a38.4 38.4 0 0 1 38.4 38.4v51.2a38.4 38.4 0 1 1-76.8 0V358.4a38.4 38.4 0 0 1 38.4-38.4z" ></path></symbol><symbol id="icon-arrow" viewBox="0 0 1024 1024"><path d="M572.33 707.67l220.673-220.673a85.333 85.333 0 0 0-60.331-145.664H291.328a85.333 85.333 0 0 0-60.33 145.664L451.668 707.67a85.333 85.333 0 0 0 120.662 0z" ></path></symbol></svg>',(e=>{var t=(r=(r=document.getElementsByTagName("script"))[r.length-1]).getAttribute("data-injectcss"),r=r.getAttribute("data-disable-injectsvg");if(!r){var n,i,o,s,a,c=function(d,p){p.parentNode.insertBefore(d,p)};if(t&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch{}}n=function(){var d,p=document.createElement("div");p.innerHTML=e._iconfont_svg_string_4776227,(p=p.getElementsByTagName("svg")[0])&&(p.setAttribute("aria-hidden","true"),p.style.position="absolute",p.style.width=0,p.style.height=0,p.style.overflow="hidden",p=p,(d=document.body).firstChild?c(p,d.firstChild):d.appendChild(p))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=n,s=e.document,a=!1,u(),s.onreadystatechange=function(){s.readyState=="complete"&&(s.onreadystatechange=null,l())})}function l(){a||(a=!0,o())}function u(){try{s.documentElement.doScroll("left")}catch{return void setTimeout(u,50)}l()}})(window);const g6="1.26.1",v6="1.47.0",b6={"-32700":"ParseError","-32701":"OversizedRequest","-32702":"OversizedResponse","-32600":"InvalidRequest","-32601":"MethodNotFound","-32602":"InvalidParams","-32603":"InternalError","-32604":"ServerBusy","-32000":"CallExecutionFailed","-32001":"UnknownError","-32003":"SubscriptionClosed","-32004":"SubscriptionClosedWithError","-32005":"BatchesNotSupported","-32006":"TooManySubscriptions","-32050":"TransientError","-32002":"TransactionExecutionClientError"};class qm extends Error{}class Hm extends qm{constructor(t,r){super(t),this.code=r,this.type=b6[r]??"ServerError"}}class y6 extends qm{constructor(t,r,n){super(t),this.status=r,this.statusText=n}}var Wm=e=>{throw TypeError(e)},ld=(e,t,r)=>t.has(e)||Wm("Cannot "+r),ar=(e,t,r)=>(ld(e,t,"read from private field"),r?r.call(e):t.get(e)),co=(e,t,r)=>t.has(e)?Wm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),as=(e,t,r,n)=>(ld(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Gm=(e,t,r)=>(ld(e,t,"access private method"),r),w6=(e,t,r,n)=>({set _(i){as(e,t,i,r)},get _(){return ar(e,t,n)}}),vo,ea,mi,Eo,ca,cs,Ac,Km,Ym;function x6(e){const t=new URL(e);return t.protocol=t.protocol.replace("http","ws"),t.toString()}const S6={WebSocketConstructor:typeof WebSocket<"u"?WebSocket:void 0,callTimeout:3e4,reconnectTimeout:3e3,maxReconnects:5};class _6{constructor(t,r={}){if(co(this,Ac),co(this,vo,0),co(this,ea,0),co(this,mi,null),co(this,Eo,null),co(this,ca,new Set),co(this,cs,new Map),this.endpoint=t,this.options={...S6,...r},!this.options.WebSocketConstructor)throw new Error("Missing WebSocket constructor");this.endpoint.startsWith("http")&&(this.endpoint=x6(this.endpoint))}async makeRequest(t,r){const n=await Gm(this,Ac,Km).call(this);return new Promise((i,o)=>{as(this,vo,ar(this,vo)+1),ar(this,cs).set(ar(this,vo),{resolve:i,reject:o,timeout:setTimeout(()=>{ar(this,cs).delete(ar(this,vo)),o(new Error(`Request timeout: ${t}`))},this.options.callTimeout)}),n.send(JSON.stringify({jsonrpc:"2.0",id:ar(this,vo),method:t,params:r}))}).then(({error:i,result:o})=>{if(i)throw new Hm(i.message,i.code);return o})}async subscribe(t){const r=new E6(t);return ar(this,ca).add(r),await r.subscribe(this),()=>r.unsubscribe(this)}}vo=new WeakMap;ea=new WeakMap;mi=new WeakMap;Eo=new WeakMap;ca=new WeakMap;cs=new WeakMap;Ac=new WeakSet;Km=function(){return ar(this,Eo)?ar(this,Eo):(as(this,Eo,new Promise(e=>{var t;(t=ar(this,mi))==null||t.close(),as(this,mi,new this.options.WebSocketConstructor(this.endpoint)),ar(this,mi).addEventListener("open",()=>{as(this,ea,0),e(ar(this,mi))}),ar(this,mi).addEventListener("close",()=>{w6(this,ea)._++,ar(this,ea)<=this.options.maxReconnects&&setTimeout(()=>{Gm(this,Ac,Ym).call(this)},this.options.reconnectTimeout)}),ar(this,mi).addEventListener("message",({data:r})=>{let n;try{n=JSON.parse(r)}catch(i){console.error(new Error(`Failed to parse RPC message: ${r}`,{cause:i}));return}if("id"in n&&n.id!=null&&ar(this,cs).has(n.id)){const{resolve:i,timeout:o}=ar(this,cs).get(n.id);clearTimeout(o),i(n)}else if("params"in n){const{params:i}=n;ar(this,ca).forEach(o=>{o.subscriptionId===i.subscription&&i.subscription===o.subscriptionId&&o.onMessage(i.result)})}})})),ar(this,Eo))};Ym=async function(){var e;return(e=ar(this,mi))==null||e.close(),as(this,Eo,null),Promise.allSettled([...ar(this,ca)].map(t=>t.subscribe(this)))};class E6{constructor(t){this.subscriptionId=null,this.subscribed=!1,this.input=t}onMessage(t){this.subscribed&&this.input.onMessage(t)}async unsubscribe(t){const{subscriptionId:r}=this;return this.subscribed=!1,r==null?!1:(this.subscriptionId=null,t.makeRequest(this.input.unsubscribe,[r]))}async subscribe(t){this.subscriptionId=null,this.subscribed=!0;const r=await t.makeRequest(this.input.method,this.input.params);this.subscribed&&(this.subscriptionId=r)}}var Xm=e=>{throw TypeError(e)},ud=(e,t,r)=>t.has(e)||Xm("Cannot "+r),cn=(e,t,r)=>(ud(e,t,"read from private field"),r?r.call(e):t.get(e)),Ha=(e,t,r)=>t.has(e)?Xm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ff=(e,t,r,n)=>(ud(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),C6=(e,t,r)=>(ud(e,t,"access private method"),r),Ks,Sn,ta,df,Jm;class T6{constructor(t){Ha(this,df),Ha(this,Ks,0),Ha(this,Sn),Ha(this,ta),ff(this,Sn,t)}fetch(t,r){const n=cn(this,Sn).fetch??fetch;if(!n)throw new Error("The current environment does not support fetch, you can provide a fetch implementation in the options for SuiHTTPTransport.");return n(t,r)}async request(t){var i,o;ff(this,Ks,cn(this,Ks)+1);const r=await this.fetch(((i=cn(this,Sn).rpc)==null?void 0:i.url)??cn(this,Sn).url,{method:"POST",headers:{"Content-Type":"application/json","Client-Sdk-Type":"typescript","Client-Sdk-Version":g6,"Client-Target-Api-Version":v6,"Client-Request-Method":t.method,...(o=cn(this,Sn).rpc)==null?void 0:o.headers},body:JSON.stringify({jsonrpc:"2.0",id:cn(this,Ks),method:t.method,params:t.params})});if(!r.ok)throw new y6(`Unexpected status code: ${r.status}`,r.status,r.statusText);const n=await r.json();if("error"in n&&n.error!=null)throw new Hm(n.error.message,n.error.code);return n.result}async subscribe(t){const r=await C6(this,df,Jm).call(this).subscribe(t);return async()=>!!await r()}}Ks=new WeakMap;Sn=new WeakMap;ta=new WeakMap;df=new WeakSet;Jm=function(){var e;if(!cn(this,ta)){const t=cn(this,Sn).WebSocketConstructor??WebSocket;if(!t)throw new Error("The current environment does not support WebSocket, you can provide a WebSocketConstructor in the options for SuiHTTPTransport.");ff(this,ta,new _6(((e=cn(this,Sn).websocket)==null?void 0:e.url)??cn(this,Sn).url,{WebSocketConstructor:t,...cn(this,Sn).websocket}))}return cn(this,ta)};function Zm(e){switch(e){case"mainnet":return"https://fullnode.mainnet.sui.io:443";case"testnet":return"https://fullnode.testnet.sui.io:443";case"devnet":return"https://fullnode.devnet.sui.io:443";case"localnet":return"http://127.0.0.1:9000";default:throw new Error(`Unknown network: ${e}`)}}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function A6(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Qm(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(r=>typeof r=="string"):t.every(r=>Number.isSafeInteger(r)):!1}function hf(e,t){if(typeof t!="string")throw new Error(`${e}: string expected`);return!0}function eg(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function pf(e){if(!Array.isArray(e))throw new Error("array expected")}function tg(e,t){if(!Qm(!0,t))throw new Error(`${e}: array of strings expected`)}function M6(e,t){if(!Qm(!1,t))throw new Error(`${e}: array of numbers expected`)}function I6(...e){const t=o=>o,r=(o,s)=>a=>o(s(a)),n=e.map(o=>o.encode).reduceRight(r,t),i=e.map(o=>o.decode).reduce(r,t);return{encode:n,decode:i}}function O6(e){const t=typeof e=="string"?e.split(""):e,r=t.length;tg("alphabet",t);const n=new Map(t.map((i,o)=>[i,o]));return{encode:i=>(pf(i),i.map(o=>{if(!Number.isSafeInteger(o)||o<0||o>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${o}". Allowed: ${e}`);return t[o]})),decode:i=>(pf(i),i.map(o=>{hf("alphabet.decode",o);const s=n.get(o);if(s===void 0)throw new Error(`Unknown letter: "${o}". Allowed: ${e}`);return s}))}}function R6(e=""){return hf("join",e),{encode:t=>(tg("join.decode",t),t.join(e)),decode:t=>(hf("join.decode",t),t.split(e))}}function sh(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(pf(e),!e.length)return[];let n=0;const i=[],o=Array.from(e,a=>{if(eg(a),a<0||a>=t)throw new Error(`invalid integer: ${a}`);return a}),s=o.length;for(;;){let a=0,c=!0;for(let l=n;l<s;l++){const u=o[l],d=t*a,p=d+u;if(!Number.isSafeInteger(p)||d/t!==a||p-u!==d)throw new Error("convertRadix: carry overflow");const y=p/r;a=p%r;const x=Math.floor(y);if(o[l]=x,!Number.isSafeInteger(x)||x*r+a!==p)throw new Error("convertRadix: carry overflow");if(c)x?c=!1:n=l;else continue}if(i.push(a),c)break}for(let a=0;a<e.length-1&&e[a]===0;a++)i.push(0);return i.reverse()}function P6(e){eg(e);const t=2**8;return{encode:r=>{if(!A6(r))throw new Error("radix.encode input should be Uint8Array");return sh(Array.from(r),t,e)},decode:r=>(M6("radix.decode",r),Uint8Array.from(sh(r,e,t)))}}const N6=e=>I6(P6(58),O6(e),R6("")),rg=N6("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),jo=e=>rg.encode(e),_i=e=>rg.decode(e),k6=jo,j6=_i;function Sr(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const lu=8192;function yr(e){if(e.length<lu)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=lu){const n=e.slice(r,r+lu);t+=String.fromCharCode(...n)}return btoa(t)}const ng=yr,ig=Sr;function _s(e){var i;const t=e.startsWith("0x")?e.slice(2):e,r=t.length%2===0?t:`0${t}`,n=((i=r.match(/[0-9a-fA-F]{2}/g))==null?void 0:i.map(o=>parseInt(o,16)))??[];if(n.length!==r.length/2)throw new Error(`Invalid hex string ${e}`);return Uint8Array.from(n)}function Ei(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}const og=Ei,sg=_s;function Mc(e){let t=[],r=0;if(e===0)return[0];for(;e>0;)t[r]=e&127,(e>>=7)&&(t[r]|=128),r+=1;return t}function D6(e){let t=0,r=0,n=0;for(;;){let i=e[n];if(n+=1,t|=(i&127)<<r,!(i&128))break;r+=7}return{value:t,length:n}}class ag{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer)}shift(t){return this.bytePosition+=t,this}read8(){let t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){let t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){let t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){let t=this.read32(),n=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let t=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let t=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(t){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,t);return this.shift(t),n}readULEB(){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t),{value:n,length:i}=D6(r);return this.shift(i),n}readVec(t){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(t(this,i,r));return n}}function cg(e,t){switch(t){case"base58":return jo(e);case"base64":return yr(e);case"hex":return Ei(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function L6(e,t){switch(t){case"base58":return _i(e);case"base64":return Sr(e);case"hex":return _s(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function fd(e,t=["<",">"]){const[r,n]=t,i=[];let o="",s=0;for(let a=0;a<e.length;a++){const c=e[a];if(c===r&&s++,c===n&&s--,s===0&&c===","){i.push(o.trim()),o="";continue}o+=c}return i.push(o.trim()),i}class lg{constructor({initialSize:t=1024,maxSize:r=1/0,allocateSize:n=1024}={}){this.bytePosition=0,this.size=t,this.maxSize=r,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(t))}ensureSizeOrGrow(t){const r=this.bytePosition+t;if(r>this.size){const n=Math.min(this.maxSize,this.size+this.allocateSize);if(r>n)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${r}`);this.size=n;const i=new ArrayBuffer(this.size);new Uint8Array(i).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(i)}}shift(t){return this.bytePosition+=t,this}write8(t){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(t)),this.shift(1)}write16(t){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(t),!0),this.shift(2)}write32(t){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(t),!0),this.shift(4)}write64(t){return uu(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return uu(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return uu(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return Mc(t).forEach(r=>this.write8(r)),this}writeVec(t,r){return this.writeULEB(t.length),Array.from(t).forEach((n,i)=>r(this,n,i,t.length)),this}*[Symbol.iterator](){for(let t=0;t<this.bytePosition;t++)yield this.dataView.getUint8(t);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(t){return cg(this.toBytes(),t)}}function uu(e,t){let r=new Uint8Array(t),n=0;for(;e>0;)r[n]=Number(e%BigInt(256)),e=e/BigInt(256),n+=1;return r}var ug=e=>{throw TypeError(e)},fg=(e,t,r)=>t.has(e)||ug("Cannot "+r),_n=(e,t,r)=>(fg(e,t,"read from private field"),r?r.call(e):t.get(e)),Ic=(e,t,r)=>t.has(e)?ug("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Oc=(e,t,r,n)=>(fg(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),es,Ys,cc,Li;const B6=class dg{constructor(t){Ic(this,es),Ic(this,Ys),this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),Oc(this,es,t.write),Oc(this,Ys,t.serialize??((r,n)=>{const i=new lg({initialSize:this.serializedSize(r)??void 0,...n});return _n(this,es).call(this,r,i),i.toBytes()})),this.validate=t.validate??(()=>{})}write(t,r){this.validate(t),_n(this,es).call(this,t,r)}serialize(t,r){return this.validate(t),new pg(this,_n(this,Ys).call(this,t,r))}parse(t){const r=new ag(t);return this.read(r)}fromHex(t){return this.parse(_s(t))}fromBase58(t){return this.parse(_i(t))}fromBase64(t){return this.parse(Sr(t))}transform({name:t,input:r,output:n,validate:i}){return new dg({name:t??this.name,read:o=>n?n(this.read(o)):this.read(o),write:(o,s)=>_n(this,es).call(this,r?r(o):o,s),serializedSize:o=>this.serializedSize(r?r(o):o),serialize:(o,s)=>_n(this,Ys).call(this,r?r(o):o,s),validate:o=>{i==null||i(o),this.validate(r?r(o):o)}})}};es=new WeakMap;Ys=new WeakMap;let En=B6;const hg=Symbol.for("@mysten/serialized-bcs");function sl(e){return!!e&&typeof e=="object"&&e[hg]===!0}class pg{constructor(t,r){Ic(this,cc),Ic(this,Li),Oc(this,cc,t),Oc(this,Li,r)}get[hg](){return!0}toBytes(){return _n(this,Li)}toHex(){return Ei(_n(this,Li))}toBase64(){return yr(_n(this,Li))}toBase58(){return jo(_n(this,Li))}parse(){return _n(this,cc).parse(_n(this,Li))}}cc=new WeakMap;Li=new WeakMap;function Rc({size:e,...t}){return new En({...t,serializedSize:()=>e})}function fu({readMethod:e,writeMethod:t,...r}){return Rc({...r,read:n=>n[e](),write:(n,i)=>i[t](n),validate:n=>{var i;if(n<0||n>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${n}. Expected value in range 0-${r.maxValue}`);(i=r.validate)==null||i.call(r,n)}})}function du({readMethod:e,writeMethod:t,...r}){return Rc({...r,read:n=>n[e](),write:(n,i)=>i[t](BigInt(n)),validate:n=>{var o;const i=BigInt(n);if(i<0||i>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${i}. Expected value in range 0-${r.maxValue}`);(o=r.validate)==null||o.call(r,i)}})}function U6({serialize:e,...t}){const r=new En({...t,serialize:e,write:(n,i)=>{for(const o of r.serialize(n).toBytes())i.write8(o)}});return r}function F6({toBytes:e,fromBytes:t,...r}){return new En({...r,read:n=>{const i=n.readULEB(),o=n.readBytes(i);return t(o)},write:(n,i)=>{const o=e(n);i.writeULEB(o.length);for(let s=0;s<o.length;s++)i.write8(o[s])},serialize:n=>{const i=e(n),o=Mc(i.length),s=new Uint8Array(o.length+i.length);return s.set(o,0),s.set(i,o.length),s},validate:n=>{var i;if(typeof n!="string")throw new TypeError(`Invalid ${r.name} value: ${n}. Expected string`);(i=r.validate)==null||i.call(r,n)}})}function $6(e){let t=null;function r(){return t||(t=e()),t}return new En({name:"lazy",read:n=>r().read(n),serializedSize:n=>r().serializedSize(n),write:(n,i)=>r().write(n,i),serialize:(n,i)=>r().serialize(n,i).toBytes()})}const H={u8(e){return fu({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return fu({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return fu({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return du({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return du({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return du({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return Rc({name:"bool",size:1,read:t=>t.read8()===1,write:(t,r)=>r.write8(t?1:0),...e,validate:t=>{var r;if((r=e==null?void 0:e.validate)==null||r.call(e,t),typeof t!="boolean")throw new TypeError(`Expected boolean, found ${typeof t}`)}})},uleb128(e){return U6({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(Mc(t)),...e})},bytes(e,t){return Rc({name:`bytes[${e}]`,size:e,read:r=>r.readBytes(e),write:(r,n)=>{const i=new Uint8Array(r);for(let o=0;o<e;o++)n.write8(i[o]??0)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!r||typeof r!="object"||!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e)throw new TypeError(`Expected array of length ${e}, found ${r.length}`)}})},byteVector(e){return new En({name:"bytesVector",read:t=>{const r=t.readULEB();return t.readBytes(r)},write:(t,r)=>{const n=new Uint8Array(t);r.writeULEB(n.length);for(let i=0;i<n.length;i++)r.write8(n[i]??0)},...e,serializedSize:t=>{const r="length"in t?t.length:null;return r==null?null:Mc(r).length+r},validate:t=>{var r;if((r=e==null?void 0:e.validate)==null||r.call(e,t),!t||typeof t!="object"||!("length"in t))throw new TypeError(`Expected array, found ${typeof t}`)}})},string(e){return F6({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new En({name:`${t.name}[${e}]`,read:n=>{const i=new Array(e);for(let o=0;o<e;o++)i[o]=t.read(n);return i},write:(n,i)=>{for(const o of n)t.write(o,i)},...r,validate:n=>{var i;if((i=r==null?void 0:r.validate)==null||i.call(r,n),!n||typeof n!="object"||!("length"in n))throw new TypeError(`Expected array, found ${typeof n}`);if(n.length!==e)throw new TypeError(`Expected array of length ${e}, found ${n.length}`)}})},option(e){return H.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:t=>t==null?{None:!0}:{Some:t},output:t=>t.$kind==="Some"?t.Some:null})},vector(e,t){return new En({name:`vector<${e.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let o=0;o<n;o++)i[o]=e.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)e.write(i,n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!r||typeof r!="object"||!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(e,t){return new En({name:`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<e.length;i++){const o=e[i].serializedSize(r[i]);if(o==null)return null;n+=o}return n},read:r=>{const n=[];for(const i of e)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<e.length;i++)e[i].write(r[i],n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e.length)throw new TypeError(`Expected array of length ${e.length}, found ${r.length}`)}})},struct(e,t,r){const n=Object.entries(t);return new En({name:e,serializedSize:i=>{let o=0;for(const[s,a]of n){const c=a.serializedSize(i[s]);if(c==null)return null;o+=c}return o},read:i=>{const o={};for(const[s,a]of n)o[s]=a.read(i);return o},write:(i,o)=>{for(const[s,a]of n)a.write(i[s],o)},...r,validate:i=>{var o;if((o=r==null?void 0:r.validate)==null||o.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})},enum(e,t,r){const n=Object.entries(t);return new En({name:e,read:i=>{const o=i.readULEB(),s=n[o];if(!s)throw new TypeError(`Unknown value ${o} for enum ${e}`);const[a,c]=s;return{[a]:(c==null?void 0:c.read(i))??!0,$kind:a}},write:(i,o)=>{const[s,a]=Object.entries(i).filter(([c])=>Object.hasOwn(t,c))[0];for(let c=0;c<n.length;c++){const[l,u]=n[c];if(l===s){o.writeULEB(c),u==null||u.write(a,o);return}}},...r,validate:i=>{var a;if((a=r==null?void 0:r.validate)==null||a.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`);const o=Object.keys(i).filter(c=>i[c]!==void 0&&Object.hasOwn(t,c));if(o.length!==1)throw new TypeError(`Expected object with one key, but found ${o.length} for type ${e}}`);const[s]=o;if(!Object.hasOwn(t,s))throw new TypeError(`Invalid enum variant ${s}`)}})},map(e,t){return H.vector(H.tuple([e,t])).transform({name:`Map<${e.name}, ${t.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,o]of r)n.set(i,o);return n}})},lazy(e){return $6(e)}},V6=Object.freeze(Object.defineProperty({__proto__:null,BcsReader:ag,BcsType:En,BcsWriter:lg,SerializedBcs:pg,bcs:H,decodeStr:L6,encodeStr:cg,fromB58:j6,fromB64:ig,fromBase58:_i,fromBase64:Sr,fromHEX:sg,fromHex:_s,isSerializedBcs:sl,splitGenericParameters:fd,toB58:k6,toB64:ng,toBase58:jo,toBase64:yr,toHEX:og,toHex:Ei},Symbol.toStringTag,{value:"Module"}));class mg{constructor({network:t}){this.network=t}$extend(...t){return Object.create(this,Object.fromEntries(t.map(r=>{if("experimental_asClientExtension"in r){const{name:n,register:i}=r.experimental_asClientExtension();return[n,{value:i(this)}]}return[r.name,{value:r.register(this)}]})))}}const gg=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,vg=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,z6=235;function bg(e){return e.length>z6?!1:e.includes("@")?gg.test(e):vg.test(e)}function yg(e,t="at"){const r=e.toLowerCase();let n;if(r.includes("@")){if(!gg.test(r))throw new Error(`Invalid SuiNS name ${e}`);const[i,o]=r.split("@");n=[...i?i.split("."):[],o]}else{if(!vg.test(r))throw new Error(`Invalid SuiNS name ${e}`);n=r.split(".").slice(0,-1)}return t==="dot"?`${n.join(".")}.sui`:`${n.slice(0,-1).join(".")}@${n[n.length-1]}`}const q6=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,H6=/^\d+$/,W6=64,wg="/",dd=e=>{const t=e.split(wg);if(t.length<2||t.length>3)return!1;const[r,n,i]=t;return i!==void 0&&!H6.test(i)||!bg(r)?!1:q6.test(n)&&n.length<W6},G6=e=>{const t=e.split(/::|<|>|,/);for(const r of t)if(r.includes(wg)&&!dd(r))return!1;return!0},K6=32;function mf(e){try{return _i(e).length===K6}catch{return!1}}const al=32;function Wn(e){return X6(e)&&J6(e)===al}function Xs(e){return Wn(e)}function Y6(e){return e.includes("::")?hd(e):e}function hd(e){const[t,r]=e.split("::"),n=dd(t),i=e.slice(t.length+r.length+4),o=i.includes("<")?i.slice(0,i.indexOf("<")):i,s=i.includes("<")?fd(i.slice(i.indexOf("<")+1,i.lastIndexOf(">"))).map(a=>Y6(a.trim())):[];return{address:n?t:Bt(t),module:r,name:o,typeParams:s}}function xg(e){const{address:t,module:r,name:n,typeParams:i}=typeof e=="string"?hd(e):e,o=(i==null?void 0:i.length)>0?`<${i.map(s=>typeof s=="string"?s:xg(s)).join(",")}>`:"";return`${t}::${r}::${n}${o}`}function Bt(e,t=!1){let r=e.toLowerCase();return!t&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(al*2,"0")}`}function Jr(e,t=!1){return Bt(e,t)}function X6(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function J6(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}const Z6=/^vector<(.+)>$/,Q6=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;let Pc=class ts{static parseFromStr(t,r=!1){if(t==="address")return{address:null};if(t==="bool")return{bool:null};if(t==="u8")return{u8:null};if(t==="u16")return{u16:null};if(t==="u32")return{u32:null};if(t==="u64")return{u64:null};if(t==="u128")return{u128:null};if(t==="u256")return{u256:null};if(t==="signer")return{signer:null};const n=t.match(Z6);if(n)return{vector:ts.parseFromStr(n[1],r)};const i=t.match(Q6);if(i)return{struct:{address:r?Bt(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:ts.parseStructTypeArgs(i[5],r)}};throw new Error(`Encountered unexpected token when parsing type args for ${t}`)}static parseStructTypeArgs(t,r=!1){return fd(t).map(n=>ts.parseFromStr(n,r))}static tagToString(t){if("bool"in t)return"bool";if("u8"in t)return"u8";if("u16"in t)return"u16";if("u32"in t)return"u32";if("u64"in t)return"u64";if("u128"in t)return"u128";if("u256"in t)return"u256";if("address"in t)return"address";if("signer"in t)return"signer";if("vector"in t)return`vector<${ts.tagToString(t.vector)}>`;if("struct"in t){const r=t.struct,n=r.typeParams.map(ts.tagToString).join(", ");return`${r.address}::${r.module}::${r.name}${n?`<${n}>`:""}`}throw new Error("Invalid TypeTag")}};function e4(e){return H.u64({name:"unsafe_u64",...e}).transform({input:t=>t,output:t=>Number(t)})}function t4(e){return H.enum("Option",{None:null,Some:e})}const nr=H.bytes(al).transform({validate:e=>{const t=typeof e=="string"?e:Ei(e);if(!t||!Wn(Bt(t)))throw new Error(`Invalid Sui address ${t}`)},input:e=>typeof e=="string"?_s(Bt(e)):e,output:e=>Bt(Ei(e))}),Tn=H.vector(H.u8()).transform({name:"ObjectDigest",input:e=>_i(e),output:e=>jo(new Uint8Array(e)),validate:e=>{if(_i(e).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),an=H.struct("SuiObjectRef",{objectId:nr,version:H.u64(),digest:Tn}),Sg=H.struct("SharedObjectRef",{objectId:nr,initialSharedVersion:H.u64(),mutable:H.bool()}),_g=H.enum("ObjectArg",{ImmOrOwnedObject:an,SharedObject:Sg,Receiving:an}),Co=H.enum("Owner",{AddressOwner:nr,ObjectOwner:nr,Shared:H.struct("Shared",{initialSharedVersion:H.u64()}),Immutable:null,ConsensusV2:H.struct("ConsensusV2",{authenticator:H.struct("Authenticator",{SingleOwner:H.string()}),startVersion:H.string()})}),Eg=H.enum("CallArg",{Pure:H.struct("Pure",{bytes:H.vector(H.u8()).transform({input:e=>typeof e=="string"?Sr(e):e,output:e=>yr(new Uint8Array(e))})}),Object:_g}),pd=H.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:H.lazy(()=>pd),struct:H.lazy(()=>Og),u16:null,u32:null,u256:null}),md=pd.transform({input:e=>typeof e=="string"?Pc.parseFromStr(e,!0):e,output:e=>Pc.tagToString(e)}),$n=H.enum("Argument",{GasCoin:null,Input:H.u16(),Result:H.u16(),NestedResult:H.tuple([H.u16(),H.u16()])}),Cg=H.struct("ProgrammableMoveCall",{package:nr,module:H.string(),function:H.string(),typeArguments:H.vector(md),arguments:H.vector($n)}),Tg=H.enum("Command",{MoveCall:Cg,TransferObjects:H.struct("TransferObjects",{objects:H.vector($n),address:$n}),SplitCoins:H.struct("SplitCoins",{coin:$n,amounts:H.vector($n)}),MergeCoins:H.struct("MergeCoins",{destination:$n,sources:H.vector($n)}),Publish:H.struct("Publish",{modules:H.vector(H.vector(H.u8()).transform({input:e=>typeof e=="string"?Sr(e):e,output:e=>yr(new Uint8Array(e))})),dependencies:H.vector(nr)}),MakeMoveVec:H.struct("MakeMoveVec",{type:t4(md).transform({input:e=>e===null?{None:!0}:{Some:e},output:e=>e.Some??null}),elements:H.vector($n)}),Upgrade:H.struct("Upgrade",{modules:H.vector(H.vector(H.u8()).transform({input:e=>typeof e=="string"?Sr(e):e,output:e=>yr(new Uint8Array(e))})),dependencies:H.vector(nr),package:nr,ticket:$n})}),Ag=H.struct("ProgrammableTransaction",{inputs:H.vector(Eg),commands:H.vector(Tg)}),Mg=H.enum("TransactionKind",{ProgrammableTransaction:Ag,ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null}),Ig=H.enum("TransactionExpiration",{None:null,Epoch:e4()}),Og=H.struct("StructTag",{address:nr,module:H.string(),name:H.string(),typeParams:H.vector(pd)}),Rg=H.struct("GasData",{payment:H.vector(an),owner:nr,price:H.u64(),budget:H.u64()}),Pg=H.struct("TransactionDataV1",{kind:Mg,sender:nr,gasData:Rg,expiration:Ig}),Ng=H.enum("TransactionData",{V1:Pg}),kg=H.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),jg=H.enum("IntentVersion",{V0:null}),Dg=H.enum("AppId",{Sui:null}),Lg=H.struct("Intent",{scope:kg,version:jg,appId:Dg});function Bg(e){return H.struct(`IntentMessage<${e.name}>`,{intent:Lg,value:e})}const Ug=H.enum("CompressedSignature",{ED25519:H.fixedArray(64,H.u8()),Secp256k1:H.fixedArray(64,H.u8()),Secp256r1:H.fixedArray(64,H.u8()),ZkLogin:H.vector(H.u8())}),Fg=H.enum("PublicKey",{ED25519:H.fixedArray(32,H.u8()),Secp256k1:H.fixedArray(33,H.u8()),Secp256r1:H.fixedArray(33,H.u8()),ZkLogin:H.vector(H.u8())}),$g=H.struct("MultiSigPkMap",{pubKey:Fg,weight:H.u8()}),Vg=H.struct("MultiSigPublicKey",{pk_map:H.vector($g),threshold:H.u16()}),r4=H.struct("MultiSig",{sigs:H.vector(Ug),bitmap:H.u16(),multisig_pk:Vg}),n4=H.vector(H.u8()).transform({input:e=>typeof e=="string"?Sr(e):e,output:e=>yr(new Uint8Array(e))}),zg=H.struct("SenderSignedTransaction",{intentMessage:Bg(Ng),txSignatures:H.vector(n4)}),i4=H.vector(zg,{name:"SenderSignedData"}),o4=H.struct("PasskeyAuthenticator",{authenticatorData:H.vector(H.u8()),clientDataJson:H.string(),userSignature:H.vector(H.u8())}),s4=H.enum("PackageUpgradeError",{UnableToFetchPackage:H.struct("UnableToFetchPackage",{packageId:nr}),NotAPackage:H.struct("NotAPackage",{objectId:nr}),IncompatibleUpgrade:null,DigestDoesNotMatch:H.struct("DigestDoesNotMatch",{digest:H.vector(H.u8())}),UnknownUpgradePolicy:H.struct("UnknownUpgradePolicy",{policy:H.u8()}),PackageIDDoesNotMatch:H.struct("PackageIDDoesNotMatch",{packageId:nr,ticketId:nr})}),a4=H.struct("ModuleId",{address:nr,name:H.string()}),ah=H.struct("MoveLocation",{module:a4,function:H.u16(),instruction:H.u16(),functionName:H.option(H.string())}),c4=H.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:H.struct("IndexOutOfBounds",{idx:H.u16()}),SecondaryIndexOutOfBounds:H.struct("SecondaryIndexOutOfBounds",{resultIdx:H.u16(),secondaryIdx:H.u16()}),InvalidResultArity:H.struct("InvalidResultArity",{resultIdx:H.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null}),l4=H.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),u4=H.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:H.struct("MoveObjectTooBig",{objectSize:H.u64(),maxObjectSize:H.u64()}),MovePackageTooBig:H.struct("MovePackageTooBig",{objectSize:H.u64(),maxObjectSize:H.u64()}),CircularObjectOwnership:H.struct("CircularObjectOwnership",{object:nr}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:H.option(ah),MoveAbort:H.tuple([ah,H.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:H.struct("CommandArgumentError",{argIdx:H.u16(),kind:c4}),TypeArgumentError:H.struct("TypeArgumentError",{argumentIdx:H.u16(),kind:l4}),UnusedValueWithoutDrop:H.struct("UnusedValueWithoutDrop",{resultIdx:H.u16(),secondaryIdx:H.u16()}),InvalidPublicFunctionReturnType:H.struct("InvalidPublicFunctionReturnType",{idx:H.u16()}),InvalidTransferObject:null,EffectsTooLarge:H.struct("EffectsTooLarge",{currentSize:H.u64(),maxSize:H.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:H.struct("PackageUpgradeError",{upgradeError:s4}),WrittenObjectsTooLarge:H.struct("WrittenObjectsTooLarge",{currentSize:H.u64(),maxSize:H.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:H.struct("ExecutionCancelledDueToSharedObjectCongestion",{congestedObjects:H.vector(nr)}),AddressDeniedForCoin:H.struct("AddressDeniedForCoin",{address:nr,coinType:H.string()}),CoinTypeGlobalPause:H.struct("CoinTypeGlobalPause",{coinType:H.string()}),ExecutionCancelledDueToRandomnessUnavailable:null}),qg=H.enum("ExecutionStatus",{Success:null,Failed:H.struct("ExecutionFailed",{error:u4,command:H.option(H.u64())})}),Hg=H.struct("GasCostSummary",{computationCost:H.u64(),storageCost:H.u64(),storageRebate:H.u64(),nonRefundableStorageFee:H.u64()}),f4=H.struct("TransactionEffectsV1",{status:qg,executedEpoch:H.u64(),gasUsed:Hg,modifiedAtVersions:H.vector(H.tuple([nr,H.u64()])),sharedObjects:H.vector(an),transactionDigest:Tn,created:H.vector(H.tuple([an,Co])),mutated:H.vector(H.tuple([an,Co])),unwrapped:H.vector(H.tuple([an,Co])),deleted:H.vector(an),unwrappedThenDeleted:H.vector(an),wrapped:H.vector(an),gasObject:H.tuple([an,Co]),eventsDigest:H.option(Tn),dependencies:H.vector(Tn)}),gd=H.tuple([H.u64(),Tn]),d4=H.enum("ObjectIn",{NotExist:null,Exist:H.tuple([gd,Co])}),h4=H.enum("ObjectOut",{NotExist:null,ObjectWrite:H.tuple([Tn,Co]),PackageWrite:gd}),p4=H.enum("IDOperation",{None:null,Created:null,Deleted:null}),m4=H.struct("EffectsObjectChange",{inputState:d4,outputState:h4,idOperation:p4}),g4=H.enum("UnchangedSharedKind",{ReadOnlyRoot:gd,MutateDeleted:H.u64(),ReadDeleted:H.u64(),Cancelled:H.u64(),PerEpochConfig:null}),v4=H.struct("TransactionEffectsV2",{status:qg,executedEpoch:H.u64(),gasUsed:Hg,transactionDigest:Tn,gasObjectIndex:H.option(H.u32()),eventsDigest:H.option(Tn),dependencies:H.vector(Tn),lamportVersion:H.u64(),changedObjects:H.vector(H.tuple([nr,m4])),unchangedSharedObjects:H.vector(H.tuple([nr,g4])),auxDataDigest:H.option(Tn)}),b4=H.enum("TransactionEffects",{V1:f4,V2:v4});function ra(e){switch(e){case"u8":return H.u8();case"u16":return H.u16();case"u32":return H.u32();case"u64":return H.u64();case"u128":return H.u128();case"u256":return H.u256();case"bool":return H.bool();case"string":return H.string();case"id":case"address":return nr}const t=e.match(/^(vector|option)<(.+)>$/);if(t){const[r,n]=t.slice(1);return r==="vector"?H.vector(ra(n)):H.option(ra(n))}throw new Error(`Invalid Pure type name: ${e}`)}const vt={...H,U8:H.u8(),U16:H.u16(),U32:H.u32(),U64:H.u64(),U128:H.u128(),U256:H.u256(),ULEB128:H.uleb128(),Bool:H.bool(),String:H.string(),Address:nr,AppId:Dg,Argument:$n,CallArg:Eg,CompressedSignature:Ug,GasData:Rg,Intent:Lg,IntentMessage:Bg,IntentScope:kg,IntentVersion:jg,MultiSig:r4,MultiSigPkMap:$g,MultiSigPublicKey:Vg,ObjectArg:_g,ObjectDigest:Tn,Owner:Co,ProgrammableMoveCall:Cg,ProgrammableTransaction:Ag,PublicKey:Fg,SenderSignedData:i4,SenderSignedTransaction:zg,SharedObjectRef:Sg,StructTag:Og,SuiObjectRef:an,Command:Tg,TransactionData:Ng,TransactionDataV1:Pg,TransactionExpiration:Ig,TransactionKind:Mg,TypeTag:md,TransactionEffects:b4,PasskeyAuthenticator:o4};function y4(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}var ci;function w4(e){return{lang:(e==null?void 0:e.lang)??(ci==null?void 0:ci.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(ci==null?void 0:ci.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(ci==null?void 0:ci.abortPipeEarly)}}var hu;function x4(e){return hu==null?void 0:hu.get(e)}var pu;function S4(e){return pu==null?void 0:pu.get(e)}var mu;function _4(e,t){var r;return(r=mu==null?void 0:mu.get(e))==null?void 0:r.get(t)}function Wg(e){var r,n;const t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&((n=(r=Object.getPrototypeOf(e))==null?void 0:r.constructor)==null?void 0:n.name))??"null":t}function tn(e,t,r,n,i){const o=i&&"input"in i?i.input:r.value,s=(i==null?void 0:i.expected)??e.expects??null,a=(i==null?void 0:i.received)??Wg(o),c={kind:e.kind,type:e.type,input:o,expected:s,received:a,message:`Invalid ${t}: ${s?`Expected ${s} but r`:"R"}eceived ${a}`,requirement:e.requirement,path:i==null?void 0:i.path,issues:i==null?void 0:i.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},l=e.kind==="schema",u=(i==null?void 0:i.message)??e.message??_4(e.reference,c.lang)??(l?S4(c.lang):null)??n.message??x4(c.lang);u&&(c.message=typeof u=="function"?u(c):u),l&&(r.typed=!1),r.issues?r.issues.push(c):r.issues=[c]}function E4(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}var C4=class extends Error{constructor(t){super(t[0].message);gt(this,"issues");this.name="ValiError",this.issues=t}};function Aa(e,t){return{kind:"validation",type:"check",reference:Aa,async:!1,expects:null,requirement:e,message:t,_run(r,n){return r.typed&&!this.requirement(r.value)&&tn(this,"input",r,n),r}}}function lr(e){return{kind:"validation",type:"integer",reference:lr,async:!1,expects:null,requirement:Number.isInteger,message:e,_run(t,r){return t.typed&&!this.requirement(t.value)&&tn(this,"integer",t,r),t}}}function cl(e){return{kind:"transformation",type:"transform",reference:cl,async:!1,operation:e,_run(t){return t.value=this.operation(t.value),t}}}function vd(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function gf(e,t){return!e._run({typed:!1,value:t},{abortEarly:!0}).issues}function rt(e,t){return{kind:"schema",type:"array",reference:rt,expects:"Array",async:!1,item:e,message:t,_run(r,n){var o;const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){const a=i[s],c=this.item._run({typed:!1,value:a},n);if(c.issues){const l={type:"array",origin:"value",input:i,key:s,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(o=r.issues)==null||o.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),r.value.push(c.value)}}else tn(this,"type",r,n);return r}}}function bd(e){return{kind:"schema",type:"bigint",reference:bd,expects:"bigint",async:!1,message:e,_run(t,r){return typeof t.value=="bigint"?t.typed=!0:tn(this,"type",t,r),t}}}function ll(e){return{kind:"schema",type:"boolean",reference:ll,expects:"boolean",async:!1,message:e,_run(t,r){return typeof t.value=="boolean"?t.typed=!0:tn(this,"type",t,r),t}}}function la(e){return{kind:"schema",type:"lazy",reference:la,expects:"unknown",async:!1,getter:e,_run(t,r){return this.getter(t.value)._run(t,r)}}}function lt(e,t){return{kind:"schema",type:"literal",reference:lt,expects:Wg(e),async:!1,literal:e,message:t,_run(r,n){return r.value===this.literal?r.typed=!0:tn(this,"type",r,n),r}}}function Vt(e,...t){const r={kind:"schema",type:"nullable",reference:Vt,expects:`${e.expects} | null`,async:!1,wrapped:e,_run(n,i){return n.value===null&&("default"in this&&(n.value=vd(this,n,i)),n.value===null)?(n.typed=!0,n):this.wrapped._run(n,i)}};return 0 in t&&(r.default=t[0]),r}function hs(e,...t){const r={kind:"schema",type:"nullish",reference:hs,expects:`${e.expects} | null | undefined`,async:!1,wrapped:e,_run(n,i){return(n.value===null||n.value===void 0)&&("default"in this&&(n.value=vd(this,n,i)),n.value===null||n.value===void 0)?(n.typed=!0,n):this.wrapped._run(n,i)}};return 0 in t&&(r.default=t[0]),r}function or(e){return{kind:"schema",type:"number",reference:or,expects:"number",async:!1,message:e,_run(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:tn(this,"type",t,r),t}}}function Ie(e,t){return{kind:"schema",type:"object",reference:Ie,expects:"Object",async:!1,entries:e,message:t,_run(r,n){var o;const i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(const s in this.entries){const a=i[s],c=this.entries[s]._run({typed:!1,value:a},n);if(c.issues){const l={type:"object",origin:"value",input:i,key:s,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(o=r.issues)==null||o.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),(c.value!==void 0||s in i)&&(r.value[s]=c.value)}}else tn(this,"type",r,n);return r}}}function Pr(e,...t){const r={kind:"schema",type:"optional",reference:Pr,expects:`${e.expects} | undefined`,async:!1,wrapped:e,_run(n,i){return n.value===void 0&&("default"in this&&(n.value=vd(this,n,i)),n.value===void 0)?(n.typed=!0,n):this.wrapped._run(n,i)}};return 0 in t&&(r.default=t[0]),r}function ua(e,t,r){return{kind:"schema",type:"record",reference:ua,expects:"Object",async:!1,key:e,value:t,message:r,_run(n,i){var s,a;const o=n.value;if(o&&typeof o=="object"){n.typed=!0,n.value={};for(const c in o)if(E4(o,c)){const l=o[c],u=this.key._run({typed:!1,value:c},i);if(u.issues){const p={type:"object",origin:"key",input:o,key:c,value:l};for(const y of u.issues)y.path=[p],(s=n.issues)==null||s.push(y);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}const d=this.value._run({typed:!1,value:l},i);if(d.issues){const p={type:"object",origin:"value",input:o,key:c,value:l};for(const y of d.issues)y.path?y.path.unshift(p):y.path=[p],(a=n.issues)==null||a.push(y);if(n.issues||(n.issues=d.issues),i.abortEarly){n.typed=!1;break}}(!u.typed||!d.typed)&&(n.typed=!1),u.typed&&(n.value[u.value]=d.value)}}else tn(this,"type",n,i);return n}}}function yt(e){return{kind:"schema",type:"string",reference:yt,expects:"string",async:!1,message:e,_run(t,r){return typeof t.value=="string"?t.typed=!0:tn(this,"type",t,r),t}}}function yd(e,t){return{kind:"schema",type:"tuple",reference:yd,expects:"Array",async:!1,items:e,message:t,_run(r,n){var o;const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<this.items.length;s++){const a=i[s],c=this.items[s]._run({typed:!1,value:a},n);if(c.issues){const l={type:"array",origin:"value",input:i,key:s,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(o=r.issues)==null||o.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),r.value.push(c.value)}}else tn(this,"type",r,n);return r}}}function ch(e){let t;if(e)for(const r of e)t?t.push(...r.issues):t=r.issues;return t}function Or(e,t){return{kind:"schema",type:"union",reference:Or,expects:[...new Set(e.map(r=>r.expects))].join(" | ")||"never",async:!1,options:e,message:t,_run(r,n){let i,o,s;for(const a of this.options){const c=a._run({typed:!1,value:r.value},n);if(c.typed)if(c.issues)o?o.push(c):o=[c];else{i=c;break}else s?s.push(c):s=[c]}if(i)return i;if(o){if(o.length===1)return o[0];tn(this,"type",r,n,{issues:ch(o)}),r.typed=!0}else{if((s==null?void 0:s.length)===1)return s[0];tn(this,"type",r,n,{issues:ch(s)})}return r}}}function Io(){return{kind:"schema",type:"unknown",reference:Io,expects:"unknown",async:!1,_run(e){return e.typed=!0,e}}}function cr(e,t,r){const n=e._run({typed:!1,value:t},w4(r));if(n.issues)throw new C4(n.issues);return n.value}function Wt(...e){return{...e[0],pipe:e,_run(t,r){for(let n=0;n<e.length;n++){if(t.issues&&(e[n].kind==="schema"||e[n].kind==="transformation")){t.typed=!1;break}(!t.issues||!r.abortEarly&&!r.abortPipeEarly)&&(t=e[n]._run(t,r))}return t}}}function Do(e){const t=Object.entries(e).map(([r,n])=>Ie({[r]:n}));return Wt(Or(t),cl(r=>({...r,$kind:Object.keys(r)[0]})))}const Es=Wt(yt(),cl(e=>Bt(e)),Aa(Wn)),Zr=Es,Oo=yt(),qr=Wt(Or([yt(),Wt(or(),lr())]),Aa(e=>{try{return BigInt(e),BigInt(e)>=0&&BigInt(e)<=18446744073709551615n}catch{return!1}},"Invalid u64")),Ki=Ie({objectId:Es,version:qr,digest:yt()}),rr=Wt(Or([Ie({GasCoin:lt(!0)}),Ie({Input:Wt(or(),lr()),type:Pr(lt("pure"))}),Ie({Input:Wt(or(),lr()),type:Pr(lt("object"))}),Ie({Result:Wt(or(),lr())}),Ie({NestedResult:yd([Wt(or(),lr()),Wt(or(),lr())])})]),cl(e=>({...e,$kind:Object.keys(e)[0]}))),T4=Ie({budget:Vt(qr),price:Vt(qr),owner:Vt(Es),payment:Vt(rt(Ki))}),vf=Or([lt("address"),lt("bool"),lt("u8"),lt("u16"),lt("u32"),lt("u64"),lt("u128"),lt("u256"),Ie({vector:la(()=>vf)}),Ie({datatype:Ie({package:yt(),module:yt(),type:yt(),typeParameters:rt(la(()=>vf))})}),Ie({typeParameter:Wt(or(),lr())})]),A4=Ie({ref:Vt(Or([lt("&"),lt("&mut")])),body:vf}),M4=Ie({package:Zr,module:yt(),function:yt(),typeArguments:rt(yt()),arguments:rt(rr),_argumentTypes:Pr(Vt(rt(A4)))}),I4=Ie({name:yt(),inputs:ua(yt(),Or([rr,rt(rr)])),data:ua(yt(),Io())}),O4=Do({MoveCall:M4,TransferObjects:Ie({objects:rt(rr),address:rr}),SplitCoins:Ie({coin:rr,amounts:rt(rr)}),MergeCoins:Ie({destination:rr,sources:rt(rr)}),Publish:Ie({modules:rt(Oo),dependencies:rt(Zr)}),MakeMoveVec:Ie({type:Vt(yt()),elements:rt(rr)}),Upgrade:Ie({modules:rt(Oo),dependencies:rt(Zr),package:Zr,ticket:rr}),$Intent:I4}),Gg=Do({ImmOrOwnedObject:Ki,SharedObject:Ie({objectId:Zr,initialSharedVersion:qr,mutable:ll()}),Receiving:Ki}),R4=Do({Object:Gg,Pure:Ie({bytes:Oo}),UnresolvedPure:Ie({value:Io()}),UnresolvedObject:Ie({objectId:Zr,version:Pr(Vt(qr)),digest:Pr(Vt(yt())),initialSharedVersion:Pr(Vt(qr))})}),lh=Do({Object:Gg,Pure:Ie({bytes:Oo})}),Kg=Do({None:lt(!0),Epoch:qr}),lc=Ie({version:lt(2),sender:hs(Es),expiration:hs(Kg),gasData:T4,inputs:rt(R4),commands:rt(O4)}),lo={MoveCall(e){const[t,r="",n=""]="target"in e?e.target.split("::"):[e.package,e.module,e.function];return{$kind:"MoveCall",MoveCall:{package:t,module:r,function:n,typeArguments:e.typeArguments??[],arguments:e.arguments??[]}}},TransferObjects(e,t){return{$kind:"TransferObjects",TransferObjects:{objects:e.map(r=>cr(rr,r)),address:cr(rr,t)}}},SplitCoins(e,t){return{$kind:"SplitCoins",SplitCoins:{coin:cr(rr,e),amounts:t.map(r=>cr(rr,r))}}},MergeCoins(e,t){return{$kind:"MergeCoins",MergeCoins:{destination:cr(rr,e),sources:t.map(r=>cr(rr,r))}}},Publish({modules:e,dependencies:t}){return{$kind:"Publish",Publish:{modules:e.map(r=>typeof r=="string"?r:yr(new Uint8Array(r))),dependencies:t.map(r=>Jr(r))}}},Upgrade({modules:e,dependencies:t,package:r,ticket:n}){return{$kind:"Upgrade",Upgrade:{modules:e.map(i=>typeof i=="string"?i:yr(new Uint8Array(i))),dependencies:t.map(i=>Jr(i)),package:r,ticket:cr(rr,n)}}},MakeMoveVec({type:e,elements:t}){return{$kind:"MakeMoveVec",MakeMoveVec:{type:e??null,elements:t.map(r=>cr(rr,r))}}},Intent({name:e,inputs:t={},data:r={}}){return{$kind:"$Intent",$Intent:{name:e,inputs:Object.fromEntries(Object.entries(t).map(([n,i])=>[n,Array.isArray(i)?i.map(o=>cr(rr,o)):cr(rr,i)])),data:r}}}},bf=Ie({digest:yt(),objectId:yt(),version:Or([Wt(or(),lr()),yt(),bd()])}),P4=Do({ImmOrOwned:bf,Shared:Ie({objectId:Zr,initialSharedVersion:qr,mutable:ll()}),Receiving:bf}),uh=Do({Object:P4,Pure:rt(Wt(or(),lr()))}),Yg=Or([Ie({kind:lt("Input"),index:Wt(or(),lr()),value:Io(),type:Pr(lt("object"))}),Ie({kind:lt("Input"),index:Wt(or(),lr()),value:Io(),type:lt("pure")})]),N4=Or([Ie({Epoch:Wt(or(),lr())}),Ie({None:Vt(lt(!0))})]),fh=Wt(Or([or(),yt(),bd()]),Aa(e=>{if(!["string","number","bigint"].includes(typeof e))return!1;try{return BigInt(e),!0}catch{return!1}})),wd=Or([Ie({bool:Vt(lt(!0))}),Ie({u8:Vt(lt(!0))}),Ie({u64:Vt(lt(!0))}),Ie({u128:Vt(lt(!0))}),Ie({address:Vt(lt(!0))}),Ie({signer:Vt(lt(!0))}),Ie({vector:la(()=>wd)}),Ie({struct:la(()=>k4)}),Ie({u16:Vt(lt(!0))}),Ie({u32:Vt(lt(!0))}),Ie({u256:Vt(lt(!0))})]),k4=Ie({address:yt(),module:yt(),name:yt(),typeParams:rt(wd)}),j4=Ie({budget:Pr(fh),price:Pr(fh),payment:Pr(rt(bf)),owner:Pr(yt())}),D4=[Yg,Ie({kind:lt("GasCoin")}),Ie({kind:lt("Result"),index:Wt(or(),lr())}),Ie({kind:lt("NestedResult"),index:Wt(or(),lr()),resultIndex:Wt(or(),lr())})],Ci=Or([...D4]),L4=Ie({kind:lt("MoveCall"),target:Wt(yt(),Aa(e=>e.split("::").length===3)),typeArguments:rt(yt()),arguments:rt(Ci)}),B4=Ie({kind:lt("TransferObjects"),objects:rt(Ci),address:Ci}),U4=Ie({kind:lt("SplitCoins"),coin:Ci,amounts:rt(Ci)}),F4=Ie({kind:lt("MergeCoins"),destination:Ci,sources:rt(Ci)}),$4=Ie({kind:lt("MakeMoveVec"),type:Or([Ie({Some:wd}),Ie({None:Vt(lt(!0))})]),objects:rt(Ci)}),V4=Ie({kind:lt("Publish"),modules:rt(rt(Wt(or(),lr()))),dependencies:rt(yt())}),z4=Ie({kind:lt("Upgrade"),modules:rt(rt(Wt(or(),lr()))),dependencies:rt(yt()),packageId:yt(),ticket:Ci}),q4=[L4,B4,U4,F4,V4,z4,$4],H4=Or([...q4]);Ie({version:lt(1),sender:Pr(yt()),expiration:hs(N4),gasConfig:j4,inputs:rt(Yg),transactions:rt(H4)});function dh(e){var r;const t=e.inputs.map((n,i)=>{if(n.Object)return{kind:"Input",index:i,value:{Object:n.Object.ImmOrOwnedObject?{ImmOrOwned:n.Object.ImmOrOwnedObject}:n.Object.Receiving?{Receiving:{digest:n.Object.Receiving.digest,version:n.Object.Receiving.version,objectId:n.Object.Receiving.objectId}}:{Shared:{mutable:n.Object.SharedObject.mutable,initialSharedVersion:n.Object.SharedObject.initialSharedVersion,objectId:n.Object.SharedObject.objectId}}},type:"object"};if(n.Pure)return{kind:"Input",index:i,value:{Pure:Array.from(Sr(n.Pure.bytes))},type:"pure"};if(n.UnresolvedPure)return{kind:"Input",type:"pure",index:i,value:n.UnresolvedPure.value};if(n.UnresolvedObject)return{kind:"Input",type:"object",index:i,value:n.UnresolvedObject.objectId};throw new Error("Invalid input")});return{version:1,sender:e.sender??void 0,expiration:((r=e.expiration)==null?void 0:r.$kind)==="Epoch"?{Epoch:Number(e.expiration.Epoch)}:e.expiration?{None:!0}:null,gasConfig:{owner:e.gasData.owner??void 0,budget:e.gasData.budget??void 0,price:e.gasData.price??void 0,payment:e.gasData.payment??void 0},inputs:t,transactions:e.commands.map(n=>{if(n.MakeMoveVec)return{kind:"MakeMoveVec",type:n.MakeMoveVec.type===null?{None:!0}:{Some:Pc.parseFromStr(n.MakeMoveVec.type)},objects:n.MakeMoveVec.elements.map(i=>li(i,t))};if(n.MergeCoins)return{kind:"MergeCoins",destination:li(n.MergeCoins.destination,t),sources:n.MergeCoins.sources.map(i=>li(i,t))};if(n.MoveCall)return{kind:"MoveCall",target:`${n.MoveCall.package}::${n.MoveCall.module}::${n.MoveCall.function}`,typeArguments:n.MoveCall.typeArguments,arguments:n.MoveCall.arguments.map(i=>li(i,t))};if(n.Publish)return{kind:"Publish",modules:n.Publish.modules.map(i=>Array.from(Sr(i))),dependencies:n.Publish.dependencies};if(n.SplitCoins)return{kind:"SplitCoins",coin:li(n.SplitCoins.coin,t),amounts:n.SplitCoins.amounts.map(i=>li(i,t))};if(n.TransferObjects)return{kind:"TransferObjects",objects:n.TransferObjects.objects.map(i=>li(i,t)),address:li(n.TransferObjects.address,t)};if(n.Upgrade)return{kind:"Upgrade",modules:n.Upgrade.modules.map(i=>Array.from(Sr(i))),dependencies:n.Upgrade.dependencies,packageId:n.Upgrade.package,ticket:li(n.Upgrade.ticket,t)};throw new Error(`Unknown transaction ${Object.keys(n)}`)})}}function li(e,t){if(e.$kind==="GasCoin")return{kind:"GasCoin"};if(e.$kind==="Result")return{kind:"Result",index:e.Result};if(e.$kind==="NestedResult")return{kind:"NestedResult",index:e.NestedResult[0],resultIndex:e.NestedResult[1]};if(e.$kind==="Input")return t[e.Input];throw new Error(`Invalid argument ${Object.keys(e)}`)}function W4(e){var t,r,n;return cr(lc,{version:2,sender:e.sender??null,expiration:e.expiration?"Epoch"in e.expiration?{Epoch:e.expiration.Epoch}:{None:!0}:null,gasData:{owner:e.gasConfig.owner??null,budget:((t=e.gasConfig.budget)==null?void 0:t.toString())??null,price:((r=e.gasConfig.price)==null?void 0:r.toString())??null,payment:((n=e.gasConfig.payment)==null?void 0:n.map(i=>({digest:i.digest,objectId:i.objectId,version:i.version.toString()})))??null},inputs:e.inputs.map(i=>{if(i.kind==="Input"){if(gf(uh,i.value)){const o=cr(uh,i.value);if(o.Object){if(o.Object.ImmOrOwned)return{Object:{ImmOrOwnedObject:{objectId:o.Object.ImmOrOwned.objectId,version:String(o.Object.ImmOrOwned.version),digest:o.Object.ImmOrOwned.digest}}};if(o.Object.Shared)return{Object:{SharedObject:{mutable:o.Object.Shared.mutable??null,initialSharedVersion:o.Object.Shared.initialSharedVersion,objectId:o.Object.Shared.objectId}}};if(o.Object.Receiving)return{Object:{Receiving:{digest:o.Object.Receiving.digest,version:String(o.Object.Receiving.version),objectId:o.Object.Receiving.objectId}}};throw new Error("Invalid object input")}return{Pure:{bytes:yr(new Uint8Array(o.Pure))}}}return i.type==="object"?{UnresolvedObject:{objectId:i.value}}:{UnresolvedPure:{value:i.value}}}throw new Error("Invalid input")}),commands:e.transactions.map(i=>{switch(i.kind){case"MakeMoveVec":return{MakeMoveVec:{type:"Some"in i.type?Pc.tagToString(i.type.Some):null,elements:i.objects.map(o=>ui(o))}};case"MergeCoins":return{MergeCoins:{destination:ui(i.destination),sources:i.sources.map(o=>ui(o))}};case"MoveCall":{const[o,s,a]=i.target.split("::");return{MoveCall:{package:o,module:s,function:a,typeArguments:i.typeArguments,arguments:i.arguments.map(c=>ui(c))}}}case"Publish":return{Publish:{modules:i.modules.map(o=>yr(Uint8Array.from(o))),dependencies:i.dependencies}};case"SplitCoins":return{SplitCoins:{coin:ui(i.coin),amounts:i.amounts.map(o=>ui(o))}};case"TransferObjects":return{TransferObjects:{objects:i.objects.map(o=>ui(o)),address:ui(i.address)}};case"Upgrade":return{Upgrade:{modules:i.modules.map(o=>yr(Uint8Array.from(o))),dependencies:i.dependencies,package:i.packageId,ticket:ui(i.ticket)}}}throw new Error(`Unknown transaction ${Object.keys(i)}`)})})}function ui(e){switch(e.kind){case"GasCoin":return{GasCoin:!0};case"Result":return{Result:e.index};case"NestedResult":return{NestedResult:[e.index,e.resultIndex]};case"Input":return{Input:e.index}}}function Ma(e){return Or(Object.entries(e).map(([t,r])=>Ie({[t]:r})))}const wn=Ma({GasCoin:lt(!0),Input:Wt(or(),lr()),Result:Wt(or(),lr()),NestedResult:yd([Wt(or(),lr()),Wt(or(),lr())])}),G4=Ie({budget:Vt(qr),price:Vt(qr),owner:Vt(Es),payment:Vt(rt(Ki))}),K4=Ie({package:Zr,module:yt(),function:yt(),typeArguments:rt(yt()),arguments:rt(wn)}),Y4=Ie({name:yt(),inputs:ua(yt(),Or([wn,rt(wn)])),data:ua(yt(),Io())}),X4=Ma({MoveCall:K4,TransferObjects:Ie({objects:rt(wn),address:wn}),SplitCoins:Ie({coin:wn,amounts:rt(wn)}),MergeCoins:Ie({destination:wn,sources:rt(wn)}),Publish:Ie({modules:rt(Oo),dependencies:rt(Zr)}),MakeMoveVec:Ie({type:Vt(yt()),elements:rt(wn)}),Upgrade:Ie({modules:rt(Oo),dependencies:rt(Zr),package:Zr,ticket:wn}),$Intent:Y4}),J4=Ma({ImmOrOwnedObject:Ki,SharedObject:Ie({objectId:Zr,initialSharedVersion:qr,mutable:ll()}),Receiving:Ki}),Z4=Ma({Object:J4,Pure:Ie({bytes:Oo}),UnresolvedPure:Ie({value:Io()}),UnresolvedObject:Ie({objectId:Zr,version:Pr(Vt(qr)),digest:Pr(Vt(yt())),initialSharedVersion:Pr(Vt(qr))})}),Q4=Ma({None:lt(!0),Epoch:qr}),e8=Ie({version:lt(2),sender:hs(Es),expiration:hs(Q4),gasData:G4,inputs:rt(Z4),commands:rt(X4)});function t8(e){return{$kind:"Pure",Pure:{bytes:e instanceof Uint8Array?yr(e):e.toBase64()}}}const yi={Pure:t8,ObjectRef({objectId:e,digest:t,version:r}){return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{digest:t,version:r,objectId:Bt(e)}}}},SharedObjectRef({objectId:e,mutable:t,initialSharedVersion:r}){return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{mutable:t,initialSharedVersion:r,objectId:Bt(e)}}}},ReceivingRef({objectId:e,digest:t,version:r}){return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{digest:t,version:r,objectId:Bt(e)}}}}},Xg="…";function r8(e){if(e.length<=6)return e;const t=e.startsWith("0x")?2:0;return`0x${e.slice(t,t+4)}${Xg}${e.slice(-4)}`}function n8(e){return`${e.slice(0,10)}${Xg}`}const i8=9,o8=BigInt(1e9),Jg="0x1",fa="0x2",s8="0x3",Zg=Jr("0x6"),a8="sui_system",ul=`${fa}::sui::SUI`,c8=Jr("0x5");function gu(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function l8(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Qg(e,...t){if(!l8(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 hh(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 u8(e,t){Qg(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Nc(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}const bo=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function e1(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const hi=bo?e=>e:e=>e1(e);function qo(e){for(let t=0;t<e.length;t++)e[t]=e1(e[t])}function f8(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function na(e){return typeof e=="string"&&(e=f8(e)),Qg(e),e}let d8=class{clone(){return this._cloneInto()}};function h8(e){const t=(n,i)=>e(i).update(na(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}const p8=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);class m8 extends d8{constructor(t,r,n={},i,o,s){if(super(),this.blockLen=t,this.outputLen=r,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,gu(t),gu(r),gu(i),r<0||r>i)throw new Error("outputLen bigger than keyLen");if(n.key!==void 0&&(n.key.length<1||n.key.length>i))throw new Error("key length must be undefined or 1.."+i);if(n.salt!==void 0&&n.salt.length!==o)throw new Error("salt must be undefined or "+o);if(n.personalization!==void 0&&n.personalization.length!==s)throw new Error("personalization must be undefined or "+s);this.buffer=new Uint8Array(t),this.buffer32=Nc(this.buffer)}update(t){hh(this);const{blockLen:r,buffer:n,buffer32:i}=this;t=na(t);const o=t.length,s=t.byteOffset,a=t.buffer;for(let c=0;c<o;){this.pos===r&&(bo||qo(i),this.compress(i,0,!1),bo||qo(i),this.pos=0);const l=Math.min(r-this.pos,o-c),u=s+c;if(l===r&&!(u%4)&&c+l<o){const d=new Uint32Array(a,u,Math.floor((o-c)/4));bo||qo(d);for(let p=0;c+r<o;p+=i.length,c+=r)this.length+=r,this.compress(d,p,!1);bo||qo(d);continue}n.set(t.subarray(c,c+l),this.pos),this.pos+=l,this.length+=l,c+=l}return this}digestInto(t){hh(this),u8(t,this);const{pos:r,buffer32:n}=this;this.finished=!0,this.buffer.subarray(r).fill(0),bo||qo(n),this.compress(n,0,!0),bo||qo(n);const i=Nc(t);this.get().forEach((o,s)=>i[s]=hi(o))}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){const{buffer:r,length:n,finished:i,destroyed:o,outputLen:s,pos:a}=this;return t||(t=new this.constructor({dkLen:s})),t.set(...this.get()),t.length=n,t.finished=i,t.destroyed=o,t.outputLen=s,t.buffer.set(r),t.pos=a,t}}const Wa=BigInt(2**32-1),yf=BigInt(32);function t1(e,t=!1){return t?{h:Number(e&Wa),l:Number(e>>yf&Wa)}:{h:Number(e>>yf&Wa)|0,l:Number(e&Wa)|0}}function g8(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:s}=t1(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}const v8=(e,t)=>BigInt(e>>>0)<<yf|BigInt(t>>>0),b8=(e,t,r)=>e>>>r,y8=(e,t,r)=>e<<32-r|t>>>r,w8=(e,t,r)=>e>>>r|t<<32-r,x8=(e,t,r)=>e<<32-r|t>>>r,S8=(e,t,r)=>e<<64-r|t>>>r-32,_8=(e,t,r)=>e>>>r-32|t<<64-r,E8=(e,t)=>t,C8=(e,t)=>e,T8=(e,t,r)=>e<<r|t>>>32-r,A8=(e,t,r)=>t<<r|e>>>32-r,M8=(e,t,r)=>t<<r-32|e>>>64-r,I8=(e,t,r)=>e<<r-32|t>>>64-r;function O8(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}const R8=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),P8=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,N8=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),k8=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,j8=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),D8=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,L8={fromBig:t1,split:g8,toBig:v8,shrSH:b8,shrSL:y8,rotrSH:w8,rotrSL:x8,rotrBH:S8,rotrBL:_8,rotr32H:E8,rotr32L:C8,rotlSH:T8,rotlSL:A8,rotlBH:M8,rotlBL:I8,add:O8,add3L:R8,add3H:P8,add4L:N8,add4H:k8,add5H:D8,add5L:j8},Br=L8,mr=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Oe=new Uint32Array(32);function ji(e,t,r,n,i,o){const s=i[o],a=i[o+1];let c=Oe[2*e],l=Oe[2*e+1],u=Oe[2*t],d=Oe[2*t+1],p=Oe[2*r],y=Oe[2*r+1],x=Oe[2*n],b=Oe[2*n+1],M=Br.add3L(c,u,s);l=Br.add3H(M,l,d,a),c=M|0,{Dh:b,Dl:x}={Dh:b^l,Dl:x^c},{Dh:b,Dl:x}={Dh:Br.rotr32H(b,x),Dl:Br.rotr32L(b,x)},{h:y,l:p}=Br.add(y,p,b,x),{Bh:d,Bl:u}={Bh:d^y,Bl:u^p},{Bh:d,Bl:u}={Bh:Br.rotrSH(d,u,24),Bl:Br.rotrSL(d,u,24)},Oe[2*e]=c,Oe[2*e+1]=l,Oe[2*t]=u,Oe[2*t+1]=d,Oe[2*r]=p,Oe[2*r+1]=y,Oe[2*n]=x,Oe[2*n+1]=b}function Di(e,t,r,n,i,o){const s=i[o],a=i[o+1];let c=Oe[2*e],l=Oe[2*e+1],u=Oe[2*t],d=Oe[2*t+1],p=Oe[2*r],y=Oe[2*r+1],x=Oe[2*n],b=Oe[2*n+1],M=Br.add3L(c,u,s);l=Br.add3H(M,l,d,a),c=M|0,{Dh:b,Dl:x}={Dh:b^l,Dl:x^c},{Dh:b,Dl:x}={Dh:Br.rotrSH(b,x,16),Dl:Br.rotrSL(b,x,16)},{h:y,l:p}=Br.add(y,p,b,x),{Bh:d,Bl:u}={Bh:d^y,Bl:u^p},{Bh:d,Bl:u}={Bh:Br.rotrBH(d,u,63),Bl:Br.rotrBL(d,u,63)},Oe[2*e]=c,Oe[2*e+1]=l,Oe[2*t]=u,Oe[2*t+1]=d,Oe[2*r]=p,Oe[2*r+1]=y,Oe[2*n]=x,Oe[2*n+1]=b}class B8 extends m8{constructor(t={}){super(128,t.dkLen===void 0?64:t.dkLen,t,64,16,16),this.v0l=mr[0]|0,this.v0h=mr[1]|0,this.v1l=mr[2]|0,this.v1h=mr[3]|0,this.v2l=mr[4]|0,this.v2h=mr[5]|0,this.v3l=mr[6]|0,this.v3h=mr[7]|0,this.v4l=mr[8]|0,this.v4h=mr[9]|0,this.v5l=mr[10]|0,this.v5h=mr[11]|0,this.v6l=mr[12]|0,this.v6h=mr[13]|0,this.v7l=mr[14]|0,this.v7h=mr[15]|0;const r=t.key?t.key.length:0;if(this.v0l^=this.outputLen|r<<8|65536|1<<24,t.salt){const n=Nc(na(t.salt));this.v4l^=hi(n[0]),this.v4h^=hi(n[1]),this.v5l^=hi(n[2]),this.v5h^=hi(n[3])}if(t.personalization){const n=Nc(na(t.personalization));this.v6l^=hi(n[0]),this.v6h^=hi(n[1]),this.v7l^=hi(n[2]),this.v7h^=hi(n[3])}if(t.key){const n=new Uint8Array(this.blockLen);n.set(na(t.key)),this.update(n)}}get(){let{v0l:t,v0h:r,v1l:n,v1h:i,v2l:o,v2h:s,v3l:a,v3h:c,v4l:l,v4h:u,v5l:d,v5h:p,v6l:y,v6h:x,v7l:b,v7h:M}=this;return[t,r,n,i,o,s,a,c,l,u,d,p,y,x,b,M]}set(t,r,n,i,o,s,a,c,l,u,d,p,y,x,b,M){this.v0l=t|0,this.v0h=r|0,this.v1l=n|0,this.v1h=i|0,this.v2l=o|0,this.v2h=s|0,this.v3l=a|0,this.v3h=c|0,this.v4l=l|0,this.v4h=u|0,this.v5l=d|0,this.v5h=p|0,this.v6l=y|0,this.v6h=x|0,this.v7l=b|0,this.v7h=M|0}compress(t,r,n){this.get().forEach((c,l)=>Oe[l]=c),Oe.set(mr,16);let{h:i,l:o}=Br.fromBig(BigInt(this.length));Oe[24]=mr[8]^o,Oe[25]=mr[9]^i,n&&(Oe[28]=~Oe[28],Oe[29]=~Oe[29]);let s=0;const a=p8;for(let c=0;c<12;c++)ji(0,4,8,12,t,r+2*a[s++]),Di(0,4,8,12,t,r+2*a[s++]),ji(1,5,9,13,t,r+2*a[s++]),Di(1,5,9,13,t,r+2*a[s++]),ji(2,6,10,14,t,r+2*a[s++]),Di(2,6,10,14,t,r+2*a[s++]),ji(3,7,11,15,t,r+2*a[s++]),Di(3,7,11,15,t,r+2*a[s++]),ji(0,5,10,15,t,r+2*a[s++]),Di(0,5,10,15,t,r+2*a[s++]),ji(1,6,11,12,t,r+2*a[s++]),Di(1,6,11,12,t,r+2*a[s++]),ji(2,7,8,13,t,r+2*a[s++]),Di(2,7,8,13,t,r+2*a[s++]),ji(3,4,9,14,t,r+2*a[s++]),Di(3,4,9,14,t,r+2*a[s++]);this.v0l^=Oe[0]^Oe[16],this.v0h^=Oe[1]^Oe[17],this.v1l^=Oe[2]^Oe[18],this.v1h^=Oe[3]^Oe[19],this.v2l^=Oe[4]^Oe[20],this.v2h^=Oe[5]^Oe[21],this.v3l^=Oe[6]^Oe[22],this.v3h^=Oe[7]^Oe[23],this.v4l^=Oe[8]^Oe[24],this.v4h^=Oe[9]^Oe[25],this.v5l^=Oe[10]^Oe[26],this.v5h^=Oe[11]^Oe[27],this.v6l^=Oe[12]^Oe[28],this.v6h^=Oe[13]^Oe[29],this.v7l^=Oe[14]^Oe[30],this.v7h^=Oe[15]^Oe[31],Oe.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const r1=h8(e=>new B8(e));function U8(e,t,r){const n=vt.Address.serialize(e).toBytes(),i=vt.TypeTag.serialize(t).toBytes(),o=vt.u64().serialize(r.length).toBytes(),s=r1.create({dkLen:32});return s.update(new Uint8Array([240])),s.update(n),s.update(o),s.update(r),s.update(i),`0x${Ei(s.digest().slice(0,32))}`}const F8=Object.freeze(Object.defineProperty({__proto__:null,MIST_PER_SUI:o8,MOVE_STDLIB_ADDRESS:Jg,SUI_ADDRESS_LENGTH:al,SUI_CLOCK_OBJECT_ID:Zg,SUI_DECIMALS:i8,SUI_FRAMEWORK_ADDRESS:fa,SUI_SYSTEM_ADDRESS:s8,SUI_SYSTEM_MODULE_NAME:a8,SUI_SYSTEM_STATE_OBJECT_ID:c8,SUI_TYPE_ARG:ul,deriveDynamicFieldID:U8,formatAddress:r8,formatDigest:n8,fromB64:ig,fromBase58:_i,fromBase64:Sr,fromHEX:sg,fromHex:_s,isValidNamedPackage:dd,isValidNamedType:G6,isValidSuiAddress:Wn,isValidSuiNSName:bg,isValidSuiObjectId:Xs,isValidTransactionDigest:mf,normalizeStructTag:xg,normalizeSuiAddress:Bt,normalizeSuiNSName:yg,normalizeSuiObjectId:Jr,parseStructTag:hd,toB64:ng,toBase58:jo,toBase64:yr,toHEX:og,toHex:Ei},Symbol.toStringTag,{value:"Module"})),$8="object",V8="ID",z8="ascii",q8="String",H8="string",W8="String",G8="option",K8="Option";function Y8(e){const t=typeof e.body=="object"&&"datatype"in e.body?e.body.datatype:null;return!!t&&Bt(t.package)===Bt("0x2")&&t.module==="tx_context"&&t.type==="TxContext"}function wf(e){if(typeof e=="string")switch(e){case"address":return vt.Address;case"bool":return vt.Bool;case"u8":return vt.U8;case"u16":return vt.U16;case"u32":return vt.U32;case"u64":return vt.U64;case"u128":return vt.U128;case"u256":return vt.U256;default:throw new Error(`Unknown type signature ${e}`)}if("vector"in e){if(e.vector==="u8")return vt.vector(vt.U8).transform({input:r=>typeof r=="string"?new TextEncoder().encode(r):r,output:r=>r});const t=wf(e.vector);return t?vt.vector(t):null}if("datatype"in e){const t=Bt(e.datatype.package);if(t===Bt(Jg)){if(e.datatype.module===z8&&e.datatype.type===q8||e.datatype.module===H8&&e.datatype.type===W8)return vt.String;if(e.datatype.module===G8&&e.datatype.type===K8){const r=wf(e.datatype.typeParameters[0]);return r?vt.vector(r):null}}if(t===Bt(fa)&&e.datatype.module===$8&&e.datatype.type===V8)return vt.Address}return null}function X8(e){return typeof e=="object"&&"Reference"in e?{ref:"&",body:ia(e.Reference)}:typeof e=="object"&&"MutableReference"in e?{ref:"&mut",body:ia(e.MutableReference)}:{ref:null,body:ia(e)}}function ia(e){if(typeof e=="string")switch(e){case"Address":return"address";case"Bool":return"bool";case"U8":return"u8";case"U16":return"u16";case"U32":return"u32";case"U64":return"u64";case"U128":return"u128";case"U256":return"u256";default:throw new Error(`Unexpected type ${e}`)}if("Vector"in e)return{vector:ia(e.Vector)};if("Struct"in e)return{datatype:{package:e.Struct.address,module:e.Struct.module,type:e.Struct.name,typeParameters:e.Struct.typeArguments.map(ia)}};if("TypeParameter"in e)return{typeParameter:e.TypeParameter};throw new Error(`Unexpected type ${JSON.stringify(e)}`)}const J8=50,Z8=1000n,Q8=5e10;async function e3(e,t,r){return await o3(e,t),await i3(e,t),t.onlyTransactionKind||(await t3(e,t),await r3(e,t),await n3(e,t)),await s3(e),await r()}async function t3(e,t){e.gasConfig.price||(e.gasConfig.price=String(await Ia(t).getReferenceGasPrice()))}async function r3(e,t){if(e.gasConfig.budget)return;const r=await Ia(t).dryRunTransactionBlock({transactionBlock:e.build({overrides:{gasData:{budget:String(Q8),payment:[]}}})});if(r.effects.status.status!=="success")throw new Error(`Dry run failed, could not automatically determine a budget: ${r.effects.status.error}`,{cause:r});const n=Z8*BigInt(e.gasConfig.price||1n),i=BigInt(r.effects.gasUsed.computationCost)+n,o=i+BigInt(r.effects.gasUsed.storageCost)-BigInt(r.effects.gasUsed.storageRebate);e.gasConfig.budget=String(o>i?o:i)}async function n3(e,t){if(!e.gasConfig.payment){const n=(await Ia(t).getCoins({owner:e.gasConfig.owner||e.sender,coinType:ul})).data.filter(i=>!e.inputs.find(s=>{var a;return(a=s.Object)!=null&&a.ImmOrOwnedObject?i.coinObjectId===s.Object.ImmOrOwnedObject.objectId:!1})).map(i=>({objectId:i.coinObjectId,digest:i.digest,version:i.version}));if(!n.length)throw new Error("No valid gas coins found for the transaction.");e.gasConfig.payment=n.map(i=>cr(Ki,i))}}async function i3(e,t){const r=e.inputs.filter(u=>{var d;return u.UnresolvedObject&&!(u.UnresolvedObject.version||(d=u.UnresolvedObject)!=null&&d.initialSharedVersion)}),n=[...new Set(r.map(u=>Jr(u.UnresolvedObject.objectId)))],i=n.length?u3(n,J8):[],o=(await Promise.all(i.map(u=>Ia(t).multiGetObjects({ids:u,options:{showOwner:!0}})))).flat(),s=new Map(n.map((u,d)=>[u,o[d]])),a=Array.from(s).filter(([u,d])=>d.error).map(([u,d])=>JSON.stringify(d.error));if(a.length)throw new Error(`The following input objects are invalid: ${a.join(", ")}`);const c=o.map(u=>{if(u.error||!u.data)throw new Error(`Failed to fetch object: ${u.error}`);const d=u.data.owner,p=d&&typeof d=="object"&&"Shared"in d?d.Shared.initial_shared_version:null;return{objectId:u.data.objectId,digest:u.data.digest,version:u.data.version,initialSharedVersion:p}}),l=new Map(n.map((u,d)=>[u,c[d]]));for(const[u,d]of e.inputs.entries()){if(!d.UnresolvedObject)continue;let p;const y=Bt(d.UnresolvedObject.objectId),x=l.get(y);d.UnresolvedObject.initialSharedVersion??(x==null?void 0:x.initialSharedVersion)?p=yi.SharedObjectRef({objectId:y,initialSharedVersion:d.UnresolvedObject.initialSharedVersion||(x==null?void 0:x.initialSharedVersion),mutable:a3(e,u)}):c3(e,u)&&(p=yi.ReceivingRef({objectId:y,digest:d.UnresolvedObject.digest??(x==null?void 0:x.digest),version:d.UnresolvedObject.version??(x==null?void 0:x.version)})),e.inputs[e.inputs.indexOf(d)]=p??yi.ObjectRef({objectId:y,digest:d.UnresolvedObject.digest??(x==null?void 0:x.digest),version:d.UnresolvedObject.version??(x==null?void 0:x.version)})}}async function o3(e,t){const{inputs:r,commands:n}=e,i=[],o=new Set;n.forEach(a=>{if(a.MoveCall){if(a.MoveCall._argumentTypes)return;if(a.MoveCall.arguments.map(u=>u.$kind==="Input"?e.inputs[u.Input]:null).some(u=>(u==null?void 0:u.UnresolvedPure)||(u==null?void 0:u.UnresolvedObject))){const u=`${a.MoveCall.package}::${a.MoveCall.module}::${a.MoveCall.function}`;o.add(u),i.push(a.MoveCall)}}switch(a.$kind){case"SplitCoins":a.SplitCoins.amounts.forEach(c=>{ph(c,vt.U64,e)});break;case"TransferObjects":ph(a.TransferObjects.address,vt.Address,e);break}});const s=new Map;if(o.size>0){const a=Ia(t);await Promise.all([...o].map(async c=>{const[l,u,d]=c.split("::"),p=await a.getNormalizedMoveFunction({package:l,module:u,function:d});s.set(c,p.parameters.map(y=>X8(y)))}))}i.length&&await Promise.all(i.map(async a=>{const c=s.get(`${a.package}::${a.module}::${a.function}`);if(!c)return;const u=c.length>0&&Y8(c.at(-1))?c.slice(0,c.length-1):c;a._argumentTypes=u})),n.forEach(a=>{if(!a.MoveCall)return;const c=a.MoveCall,l=`${c.package}::${c.module}::${c.function}`,u=c._argumentTypes;if(u){if(u.length!==a.MoveCall.arguments.length)throw new Error(`Incorrect number of arguments for ${l}`);u.forEach((d,p)=>{var P,k;const y=c.arguments[p];if(y.$kind!=="Input")return;const x=r[y.Input];if(!x.UnresolvedPure&&!x.UnresolvedObject)return;const b=((P=x.UnresolvedPure)==null?void 0:P.value)??((k=x.UnresolvedObject)==null?void 0:k.objectId),M=wf(d.body);if(M){y.type="pure",r[r.indexOf(x)]=yi.Pure(M.serialize(b));return}if(typeof b!="string")throw new Error(`Expect the argument to be an object id string, got ${JSON.stringify(b,null,2)}`);y.type="object";const O=x.UnresolvedPure?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:b}}:x;r[y.Input]=O})}})}function s3(e){e.inputs.forEach((t,r)=>{if(t.$kind!=="Object"&&t.$kind!=="Pure")throw new Error(`Input at index ${r} has not been resolved. Expected a Pure or Object input, but found ${JSON.stringify(t)}`)})}function ph(e,t,r){if(e.$kind!=="Input")return;const n=r.inputs[e.Input];n.$kind==="UnresolvedPure"&&(r.inputs[e.Input]=yi.Pure(t.serialize(n.UnresolvedPure.value)))}function a3(e,t){let r=!1;return e.getInputUses(t,(n,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const o=i.MoveCall.arguments.indexOf(n);r=i.MoveCall._argumentTypes[o].ref!=="&"||r}(i.$kind==="MakeMoveVec"||i.$kind==="MergeCoins"||i.$kind==="SplitCoins")&&(r=!0)}),r}function c3(e,t){let r=!1;return e.getInputUses(t,(n,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const o=i.MoveCall.arguments.indexOf(n);r=l3(i.MoveCall._argumentTypes[o])||r}}),r}function l3(e){return typeof e.body!="object"||!("datatype"in e.body)?!1:e.body.datatype.package==="0x2"&&e.body.datatype.module==="transfer"&&e.body.datatype.type==="Receiving"}function Ia(e){if(!e.client)throw new Error("No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.");return e.client}function u3(e,t){return Array.from({length:Math.ceil(e.length/t)},(r,n)=>e.slice(n*t,n*t+t))}function f3(e){function t(r){return e(r)}return t.system=()=>t("0x5"),t.clock=()=>t("0x6"),t.random=()=>t("0x8"),t.denyList=()=>t("0x403"),t.option=({type:r,value:n})=>i=>i.moveCall({typeArguments:[r],target:`0x1::option::${n===null?"none":"some"}`,arguments:n===null?[]:[i.object(n)]}),t}function d3(e){function t(r,n){if(typeof r=="string")return e(ra(r).serialize(n));if(r instanceof Uint8Array||sl(r))return e(r);throw new Error("tx.pure must be called either a bcs type name, or a serialized bcs value")}return t.u8=r=>e(vt.U8.serialize(r)),t.u16=r=>e(vt.U16.serialize(r)),t.u32=r=>e(vt.U32.serialize(r)),t.u64=r=>e(vt.U64.serialize(r)),t.u128=r=>e(vt.U128.serialize(r)),t.u256=r=>e(vt.U256.serialize(r)),t.bool=r=>e(vt.Bool.serialize(r)),t.string=r=>e(vt.String.serialize(r)),t.address=r=>e(vt.Address.serialize(r)),t.id=t.address,t.vector=(r,n)=>e(vt.vector(ra(r)).serialize(n)),t.option=(r,n)=>e(vt.option(ra(r)).serialize(n)),t}function h3(e,t){const r=Array.from(`${e}::`).map(i=>i.charCodeAt(0)),n=new Uint8Array(r.length+t.length);return n.set(r),n.set(t,r.length),r1(n,{dkLen:32})}function mh(e){return Bt(e).replace("0x","")}class Cn{constructor(t){this.version=2,this.sender=(t==null?void 0:t.sender)??null,this.expiration=(t==null?void 0:t.expiration)??null,this.inputs=(t==null?void 0:t.inputs)??[],this.commands=(t==null?void 0:t.commands)??[],this.gasData=(t==null?void 0:t.gasData)??{budget:null,price:null,owner:null,payment:null}}static fromKindBytes(t){const n=vt.TransactionKind.parse(t).ProgrammableTransaction;if(!n)throw new Error("Unable to deserialize from bytes.");return Cn.restore({version:2,sender:null,expiration:null,gasData:{budget:null,owner:null,payment:null,price:null},inputs:n.inputs,commands:n.commands})}static fromBytes(t){const r=vt.TransactionData.parse(t),n=r==null?void 0:r.V1,i=n.kind.ProgrammableTransaction;if(!n||!i)throw new Error("Unable to deserialize from bytes.");return Cn.restore({version:2,sender:n.sender,expiration:n.expiration,gasData:n.gasData,inputs:i.inputs,commands:i.commands})}static restore(t){return t.version===2?new Cn(cr(lc,t)):new Cn(cr(lc,W4(t)))}static getDigestFromBytes(t){const r=h3("TransactionData",t);return jo(r)}get gasConfig(){return this.gasData}set gasConfig(t){this.gasData=t}build({maxSizeBytes:t=1/0,overrides:r,onlyTransactionKind:n}={}){const i=this.inputs,o=this.commands,s={ProgrammableTransaction:{inputs:i,commands:o}};if(n)return vt.TransactionKind.serialize(s,{maxSize:t}).toBytes();const a=(r==null?void 0:r.expiration)??this.expiration,c=(r==null?void 0:r.sender)??this.sender,l={...this.gasData,...r==null?void 0:r.gasConfig,...r==null?void 0:r.gasData};if(!c)throw new Error("Missing transaction sender");if(!l.budget)throw new Error("Missing gas budget");if(!l.payment)throw new Error("Missing gas payment");if(!l.price)throw new Error("Missing gas price");const u={sender:mh(c),expiration:a||{None:!0},gasData:{payment:l.payment,owner:mh(this.gasData.owner??c),price:BigInt(l.price),budget:BigInt(l.budget)},kind:{ProgrammableTransaction:{inputs:i,commands:o}}};return vt.TransactionData.serialize({V1:u},{maxSize:t}).toBytes()}addInput(t,r){const n=this.inputs.length;return this.inputs.push(r),{Input:n,type:t,$kind:"Input"}}getInputUses(t,r){this.mapArguments((n,i)=>(n.$kind==="Input"&&n.Input===t&&r(n,i),n))}mapArguments(t){for(const r of this.commands)switch(r.$kind){case"MoveCall":r.MoveCall.arguments=r.MoveCall.arguments.map(i=>t(i,r));break;case"TransferObjects":r.TransferObjects.objects=r.TransferObjects.objects.map(i=>t(i,r)),r.TransferObjects.address=t(r.TransferObjects.address,r);break;case"SplitCoins":r.SplitCoins.coin=t(r.SplitCoins.coin,r),r.SplitCoins.amounts=r.SplitCoins.amounts.map(i=>t(i,r));break;case"MergeCoins":r.MergeCoins.destination=t(r.MergeCoins.destination,r),r.MergeCoins.sources=r.MergeCoins.sources.map(i=>t(i,r));break;case"MakeMoveVec":r.MakeMoveVec.elements=r.MakeMoveVec.elements.map(i=>t(i,r));break;case"Upgrade":r.Upgrade.ticket=t(r.Upgrade.ticket,r);break;case"$Intent":const n=r.$Intent.inputs;r.$Intent.inputs={};for(const[i,o]of Object.entries(n))r.$Intent.inputs[i]=Array.isArray(o)?o.map(s=>t(s,r)):t(o,r);break;case"Publish":break;default:throw new Error(`Unexpected transaction kind: ${r.$kind}`)}}replaceCommand(t,r){if(!Array.isArray(r)){this.commands[t]=r;return}const n=r.length-1;this.commands.splice(t,1,...r),n!==0&&this.mapArguments(i=>{switch(i.$kind){case"Result":i.Result>t&&(i.Result+=n);break;case"NestedResult":i.NestedResult[0]>t&&(i.NestedResult[0]+=n);break}return i})}getDigest(){const t=this.build({onlyTransactionKind:!1});return Cn.getDigestFromBytes(t)}snapshot(){return cr(lc,this)}}function gh(e){if(typeof e=="string")return Bt(e);if(e.Object)return e.Object.ImmOrOwnedObject?Bt(e.Object.ImmOrOwnedObject.objectId):e.Object.Receiving?Bt(e.Object.Receiving.objectId):Bt(e.Object.SharedObject.objectId);if(e.UnresolvedObject)return Bt(e.UnresolvedObject.objectId)}var n1=e=>{throw TypeError(e)},xd=(e,t,r)=>t.has(e)||n1("Cannot "+r),Tt=(e,t,r)=>(xd(e,t,"read from private field"),r?r.call(e):t.get(e)),Fs=(e,t,r)=>t.has(e)?n1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),uo=(e,t,r,n)=>(xd(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),pi=(e,t,r)=>(xd(e,t,"access private method"),r),Js,oa,yo,Rt,xn,uc,Sd,xf,_d;function vh(e,t=1/0){const r={$kind:"Result",Result:e},n=[],i=o=>n[o]??(n[o]={$kind:"NestedResult",NestedResult:[e,o]});return new Proxy(r,{set(){throw new Error("The transaction result is a proxy, and does not support setting properties directly")},get(o,s){if(s in o)return Reflect.get(o,s);if(s===Symbol.iterator)return function*(){let c=0;for(;c<t;)yield i(c),c++};if(typeof s=="symbol")return;const a=parseInt(s,10);if(!(Number.isNaN(a)||a<0))return i(a)}})}const i1=Symbol.for("@mysten/transaction");function o1(e){return!!e&&typeof e=="object"&&e[i1]===!0}const bh={buildPlugins:new Map,serializationPlugins:new Map},vu=Symbol.for("@mysten/transaction/registry");function $s(){try{const e=globalThis;return e[vu]||(e[vu]=bh),e[vu]}catch{return bh}}const p3=class Sf{constructor(){Fs(this,xn),Fs(this,Js),Fs(this,oa),Fs(this,yo,new Map),Fs(this,Rt),this.object=f3(r=>{var o,s;if(typeof r=="function")return this.object(r(this));if(typeof r=="object"&&gf(rr,r))return r;const n=gh(r),i=Tt(this,Rt).inputs.find(a=>n===gh(a));return(o=i==null?void 0:i.Object)!=null&&o.SharedObject&&typeof r=="object"&&((s=r.Object)!=null&&s.SharedObject)&&(i.Object.SharedObject.mutable=i.Object.SharedObject.mutable||r.Object.SharedObject.mutable),i?{$kind:"Input",Input:Tt(this,Rt).inputs.indexOf(i),type:"object"}:Tt(this,Rt).addInput("object",typeof r=="string"?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:Bt(r)}}:r)});const t=$s();uo(this,Rt,new Cn),uo(this,oa,[...t.buildPlugins.values()]),uo(this,Js,[...t.serializationPlugins.values()])}static fromKind(t){const r=new Sf;return uo(r,Rt,Cn.fromKindBytes(typeof t=="string"?Sr(t):t)),r}static from(t){const r=new Sf;return o1(t)?uo(r,Rt,new Cn(t.getData())):typeof t!="string"||!t.startsWith("{")?uo(r,Rt,Cn.fromBytes(typeof t=="string"?Sr(t):t)):uo(r,Rt,Cn.restore(JSON.parse(t))),r}static registerGlobalSerializationPlugin(t,r){$s().serializationPlugins.set(t,r??t)}static unregisterGlobalSerializationPlugin(t){$s().serializationPlugins.delete(t)}static registerGlobalBuildPlugin(t,r){$s().buildPlugins.set(t,r??t)}static unregisterGlobalBuildPlugin(t){$s().buildPlugins.delete(t)}addSerializationPlugin(t){Tt(this,Js).push(t)}addBuildPlugin(t){Tt(this,oa).push(t)}addIntentResolver(t,r){if(Tt(this,yo).has(t)&&Tt(this,yo).get(t)!==r)throw new Error(`Intent resolver for ${t} already exists`);Tt(this,yo).set(t,r)}setSender(t){Tt(this,Rt).sender=t}setSenderIfNotSet(t){Tt(this,Rt).sender||(Tt(this,Rt).sender=t)}setExpiration(t){Tt(this,Rt).expiration=t?cr(Kg,t):null}setGasPrice(t){Tt(this,Rt).gasConfig.price=String(t)}setGasBudget(t){Tt(this,Rt).gasConfig.budget=String(t)}setGasBudgetIfNotSet(t){Tt(this,Rt).gasData.budget==null&&(Tt(this,Rt).gasConfig.budget=String(t))}setGasOwner(t){Tt(this,Rt).gasConfig.owner=t}setGasPayment(t){Tt(this,Rt).gasConfig.payment=t.map(r=>cr(Ki,r))}get blockData(){return dh(Tt(this,Rt).snapshot())}getData(){return Tt(this,Rt).snapshot()}get[i1](){return!0}get pure(){return Object.defineProperty(this,"pure",{enumerable:!1,value:d3(t=>sl(t)?Tt(this,Rt).addInput("pure",{$kind:"Pure",Pure:{bytes:t.toBase64()}}):Tt(this,Rt).addInput("pure",gf(lh,t)?cr(lh,t):t instanceof Uint8Array?yi.Pure(t):{$kind:"UnresolvedPure",UnresolvedPure:{value:t}}))}),this.pure}get gas(){return{$kind:"GasCoin",GasCoin:!0}}objectRef(...t){return this.object(yi.ObjectRef(...t))}receivingRef(...t){return this.object(yi.ReceivingRef(...t))}sharedObjectRef(...t){return this.object(yi.SharedObjectRef(...t))}add(t){if(typeof t=="function")return t(this);const r=Tt(this,Rt).commands.push(t);return vh(r-1)}splitCoins(t,r){const n=lo.SplitCoins(typeof t=="string"?this.object(t):pi(this,xn,Sd).call(this,t),r.map(o=>typeof o=="number"||typeof o=="bigint"||typeof o=="string"?this.pure.u64(o):pi(this,xn,uc).call(this,o))),i=Tt(this,Rt).commands.push(n);return vh(i-1,r.length)}mergeCoins(t,r){return this.add(lo.MergeCoins(this.object(t),r.map(n=>this.object(n))))}publish({modules:t,dependencies:r}){return this.add(lo.Publish({modules:t,dependencies:r}))}upgrade({modules:t,dependencies:r,package:n,ticket:i}){return this.add(lo.Upgrade({modules:t,dependencies:r,package:n,ticket:this.object(i)}))}moveCall({arguments:t,...r}){return this.add(lo.MoveCall({...r,arguments:t==null?void 0:t.map(n=>pi(this,xn,uc).call(this,n))}))}transferObjects(t,r){return this.add(lo.TransferObjects(t.map(n=>this.object(n)),typeof r=="string"?this.pure.address(r):pi(this,xn,uc).call(this,r)))}makeMoveVec({type:t,elements:r}){return this.add(lo.MakeMoveVec({type:t,elements:r.map(n=>this.object(n))}))}serialize(){return JSON.stringify(dh(Tt(this,Rt).snapshot()))}async toJSON(t={}){return await this.prepareForSerialization(t),JSON.stringify(cr(e8,Tt(this,Rt).snapshot()),(r,n)=>typeof n=="bigint"?n.toString():n,2)}async sign(t){const{signer:r,...n}=t,i=await this.build(n);return r.signTransaction(i)}async build(t={}){return await this.prepareForSerialization(t),await pi(this,xn,xf).call(this,t),Tt(this,Rt).build({onlyTransactionKind:t.onlyTransactionKind})}async getDigest(t={}){return await pi(this,xn,xf).call(this,t),Tt(this,Rt).getDigest()}async prepareForSerialization(t){var i;const r=new Set;for(const o of Tt(this,Rt).commands)o.$Intent&&r.add(o.$Intent.name);const n=[...Tt(this,Js)];for(const o of r)if(!((i=t.supportedIntents)!=null&&i.includes(o))){if(!Tt(this,yo).has(o))throw new Error(`Missing intent resolver for ${o}`);n.push(Tt(this,yo).get(o))}await pi(this,xn,_d).call(this,n,t)}};Js=new WeakMap;oa=new WeakMap;yo=new WeakMap;Rt=new WeakMap;xn=new WeakSet;uc=function(e){return sl(e)?this.pure(e):pi(this,xn,Sd).call(this,e)};Sd=function(e){return typeof e=="function"?cr(rr,e(this)):cr(rr,e)};xf=async function(e){if(!e.onlyTransactionKind&&!Tt(this,Rt).sender)throw new Error("Missing transaction sender");await pi(this,xn,_d).call(this,[...Tt(this,oa),e3],e)};_d=async function(e,t){const r=n=>{if(n>=e.length)return()=>{};const i=e[n];return async()=>{const o=r(n+1);let s=!1,a=!1;if(await i(Tt(this,Rt),t,async()=>{if(s)throw new Error(`next() was call multiple times in TransactionPlugin ${n}`);s=!0,await o(),a=!0}),!s)throw new Error(`next() was not called in TransactionPlugin ${n}`);if(!a)throw new Error(`next() was not awaited in TransactionPlugin ${n}`)}};await r(0)()};let To=p3;class m3 extends mg{constructor(){super(...arguments),this.core=this}}class g3 extends Error{}class Vi extends g3{constructor(t,r){super(r),this.code=t}static fromResponse(t,r){switch(t.code){case"notExists":return new Vi(t.code,`Object ${t.object_id} does not exist`);case"dynamicFieldNotFound":return new Vi(t.code,`Dynamic field not found for object ${t.parent_object_id}`);case"deleted":return new Vi(t.code,`Object ${t.object_id} has been deleted`);case"displayError":return new Vi(t.code,`Display error: ${t.error}`);case"unknown":default:return new Vi(t.code,`Unknown error while loading object${r?` ${r}`:""}`)}}}var s1=e=>{throw TypeError(e)},a1=(e,t,r)=>t.has(e)||s1("Cannot "+r),fi=(e,t,r)=>(a1(e,t,"read from private field"),r?r.call(e):t.get(e)),v3=(e,t,r)=>t.has(e)?s1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),b3=(e,t,r,n)=>(a1(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),sn;class y3 extends m3{constructor(t){super({network:t.network}),v3(this,sn),b3(this,sn,t)}async getObjects(t){const r=y4(t.objectIds,50),n=[];for(const i of r){const o=await fi(this,sn).multiGetObjects({ids:i,options:{showOwner:!0,showType:!0}});for(const[s,a]of o.entries())a.error?n.push(Vi.fromResponse(a.error,i[s])):n.push(yh(a.data))}return{objects:n}}async getOwnedObjects(t){const r=await fi(this,sn).getOwnedObjects({owner:t.address,limit:t.limit,cursor:t.cursor});return{objects:r.data.map(n=>{if(n.error)throw Vi.fromResponse(n.error);return yh(n.data)}),hasNextPage:r.hasNextPage,cursor:r.nextCursor??null}}async getCoins(t){const r=await fi(this,sn).getCoins({owner:t.address,coinType:t.coinType});return{objects:r.data.map(n=>({id:n.coinObjectId,version:n.version,digest:n.digest,balance:BigInt(n.balance),type:`0x2::coin::Coin<${n.coinType}>`,content:S3.serialize({id:n.coinObjectId,balance:{value:n.balance}}).toBytes(),owner:{$kind:"ObjectOwner",ObjectOwner:t.address}})),hasNextPage:r.hasNextPage,cursor:r.nextCursor??null}}async getBalance(t){const r=await fi(this,sn).getBalance({owner:t.address,coinType:t.coinType});return{balance:{coinType:r.coinType,balance:BigInt(r.totalBalance)}}}async getAllBalances(t){return{balances:(await fi(this,sn).getAllBalances({owner:t.address})).map(n=>({coinType:n.coinType,balance:BigInt(n.totalBalance)})),hasNextPage:!1,cursor:null}}async getTransaction(t){const r=await fi(this,sn).getTransactionBlock({digest:t.digest,options:{showRawInput:!0,showObjectChanges:!0,showRawEffects:!0,showEvents:!0}});return{transaction:wh(r)}}async executeTransaction(t){const r=await fi(this,sn).executeTransactionBlock({transactionBlock:t.transaction,signature:t.signatures,options:{showEffects:!0,showEvents:!0}});return{transaction:wh(r)}}async dryRunTransaction(t){const r=To.from(t.transaction),n=await fi(this,sn).dryRunTransactionBlock({transactionBlock:t.transaction});return{transaction:{digest:await r.getDigest(),effects:n.effects,signatures:[],bcs:t.transaction}}}async getReferenceGasPrice(){return{referenceGasPrice:await fi(this,sn).getReferenceGasPrice()}}}sn=new WeakMap;function yh(e){var t;return{id:e.objectId,version:e.version,digest:e.digest,type:e.type,content:((t=e.bcs)==null?void 0:t.dataType)==="moveObject"?Sr(e.bcs.bcsBytes):new Uint8Array,owner:w3(e.owner)}}function w3(e){if(e==="Immutable")return{$kind:"Immutable",Immutable:!0};if("ConsensusV2"in e)return{$kind:"ConsensusV2",ConsensusV2Owner:{authenticator:{$kind:"SingleOwner",SingleOwner:e.ConsensusV2.authenticator.SingleOwner},startVersion:e.ConsensusV2.start_version}};if("AddressOwner"in e)return{$kind:"AddressOwner",AddressOwner:e.AddressOwner};if("ObjectOwner"in e)return{$kind:"ObjectOwner",ObjectOwner:e.ObjectOwner};if("Shared"in e)return{$kind:"Shared",Shared:{initialSharedVersion:e.Shared.initial_shared_version}};throw new Error(`Unknown owner type: ${JSON.stringify(e)}`)}function wh(e){const t=vt.SenderSignedData.parse(Sr(e.rawTransaction))[0];return{digest:e.digest,effects:new Uint8Array(e.rawEffects),bcs:vt.TransactionData.serialize(t.intentMessage.value).toBytes(),signatures:t.txSignatures}}const x3=vt.struct("Balance",{value:vt.u64()}),S3=vt.struct("Coin",{id:vt.Address,balance:x3}),_3=Symbol.for("@mysten/SuiClient");class ps extends mg{constructor(t){super({network:t.network??"unknown"}),this.core=new y3(this),this.transport=t.transport??new T6({url:t.url})}get[_3](){return!0}async getRpcApiVersion(){return(await this.transport.request({method:"rpc.discover",params:[]})).info.version}async getCoins(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getCoins",params:[t.owner,t.coinType,t.cursor,t.limit]})}async getAllCoins(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getAllCoins",params:[t.owner,t.cursor,t.limit]})}async getBalance(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getBalance",params:[t.owner,t.coinType]})}async getAllBalances(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getAllBalances",params:[t.owner]})}async getCoinMetadata(t){return await this.transport.request({method:"suix_getCoinMetadata",params:[t.coinType]})}async getTotalSupply(t){return await this.transport.request({method:"suix_getTotalSupply",params:[t.coinType]})}async call(t,r){return await this.transport.request({method:t,params:r})}async getMoveFunctionArgTypes(t){return await this.transport.request({method:"sui_getMoveFunctionArgTypes",params:[t.package,t.module,t.function]})}async getNormalizedMoveModulesByPackage(t){return await this.transport.request({method:"sui_getNormalizedMoveModulesByPackage",params:[t.package]})}async getNormalizedMoveModule(t){return await this.transport.request({method:"sui_getNormalizedMoveModule",params:[t.package,t.module]})}async getNormalizedMoveFunction(t){return await this.transport.request({method:"sui_getNormalizedMoveFunction",params:[t.package,t.module,t.function]})}async getNormalizedMoveStruct(t){return await this.transport.request({method:"sui_getNormalizedMoveStruct",params:[t.package,t.module,t.struct]})}async getOwnedObjects(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getOwnedObjects",params:[t.owner,{filter:t.filter,options:t.options},t.cursor,t.limit]})}async getObject(t){if(!t.id||!Xs(Jr(t.id)))throw new Error("Invalid Sui Object id");return await this.transport.request({method:"sui_getObject",params:[t.id,t.options]})}async tryGetPastObject(t){return await this.transport.request({method:"sui_tryGetPastObject",params:[t.id,t.version,t.options]})}async multiGetObjects(t){if(t.ids.forEach(n=>{if(!n||!Xs(Jr(n)))throw new Error(`Invalid Sui Object id ${n}`)}),t.ids.length!==new Set(t.ids).size)throw new Error(`Duplicate object ids in batch call ${t.ids}`);return await this.transport.request({method:"sui_multiGetObjects",params:[t.ids,t.options]})}async queryTransactionBlocks(t){return await this.transport.request({method:"suix_queryTransactionBlocks",params:[{filter:t.filter,options:t.options},t.cursor,t.limit,(t.order||"descending")==="descending"]})}async getTransactionBlock(t){if(!mf(t.digest))throw new Error("Invalid Transaction digest");return await this.transport.request({method:"sui_getTransactionBlock",params:[t.digest,t.options]})}async multiGetTransactionBlocks(t){if(t.digests.forEach(n=>{if(!mf(n))throw new Error(`Invalid Transaction digest ${n}`)}),t.digests.length!==new Set(t.digests).size)throw new Error(`Duplicate digests in batch call ${t.digests}`);return await this.transport.request({method:"sui_multiGetTransactionBlocks",params:[t.digests,t.options]})}async executeTransactionBlock({transactionBlock:t,signature:r,options:n,requestType:i}){const o=await this.transport.request({method:"sui_executeTransactionBlock",params:[typeof t=="string"?t:yr(t),Array.isArray(r)?r:[r],n]});if(i==="WaitForLocalExecution")try{await this.waitForTransaction({digest:o.digest})}catch{}return o}async signAndExecuteTransaction({transaction:t,signer:r,...n}){let i;t instanceof Uint8Array?i=t:(t.setSenderIfNotSet(r.toSuiAddress()),i=await t.build({client:this}));const{signature:o,bytes:s}=await r.signTransaction(i);return this.executeTransactionBlock({transactionBlock:s,signature:o,...n})}async getTotalTransactionBlocks(){const t=await this.transport.request({method:"sui_getTotalTransactionBlocks",params:[]});return BigInt(t)}async getReferenceGasPrice(){const t=await this.transport.request({method:"suix_getReferenceGasPrice",params:[]});return BigInt(t)}async getStakes(t){if(!t.owner||!Wn(Bt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getStakes",params:[t.owner]})}async getStakesByIds(t){return t.stakedSuiIds.forEach(r=>{if(!r||!Xs(Jr(r)))throw new Error(`Invalid Sui Stake id ${r}`)}),await this.transport.request({method:"suix_getStakesByIds",params:[t.stakedSuiIds]})}async getLatestSuiSystemState(){return await this.transport.request({method:"suix_getLatestSuiSystemState",params:[]})}async queryEvents(t){return await this.transport.request({method:"suix_queryEvents",params:[t.query,t.cursor,t.limit,(t.order||"descending")==="descending"]})}async subscribeEvent(t){return this.transport.subscribe({method:"suix_subscribeEvent",unsubscribe:"suix_unsubscribeEvent",params:[t.filter],onMessage:t.onMessage})}async subscribeTransaction(t){return this.transport.subscribe({method:"suix_subscribeTransaction",unsubscribe:"suix_unsubscribeTransaction",params:[t.filter],onMessage:t.onMessage})}async devInspectTransactionBlock(t){var n;let r;if(o1(t.transactionBlock))t.transactionBlock.setSenderIfNotSet(t.sender),r=yr(await t.transactionBlock.build({client:this,onlyTransactionKind:!0}));else if(typeof t.transactionBlock=="string")r=t.transactionBlock;else if(t.transactionBlock instanceof Uint8Array)r=yr(t.transactionBlock);else throw new Error("Unknown transaction block format.");return await this.transport.request({method:"sui_devInspectTransactionBlock",params:[t.sender,r,(n=t.gasPrice)==null?void 0:n.toString(),t.epoch]})}async dryRunTransactionBlock(t){return await this.transport.request({method:"sui_dryRunTransactionBlock",params:[typeof t.transactionBlock=="string"?t.transactionBlock:yr(t.transactionBlock)]})}async getDynamicFields(t){if(!t.parentId||!Xs(Jr(t.parentId)))throw new Error("Invalid Sui Object id");return await this.transport.request({method:"suix_getDynamicFields",params:[t.parentId,t.cursor,t.limit]})}async getDynamicFieldObject(t){return await this.transport.request({method:"suix_getDynamicFieldObject",params:[t.parentId,t.name]})}async getLatestCheckpointSequenceNumber(){const t=await this.transport.request({method:"sui_getLatestCheckpointSequenceNumber",params:[]});return String(t)}async getCheckpoint(t){return await this.transport.request({method:"sui_getCheckpoint",params:[t.id]})}async getCheckpoints(t){return await this.transport.request({method:"sui_getCheckpoints",params:[t.cursor,t==null?void 0:t.limit,t.descendingOrder]})}async getCommitteeInfo(t){return await this.transport.request({method:"suix_getCommitteeInfo",params:[t==null?void 0:t.epoch]})}async getNetworkMetrics(){return await this.transport.request({method:"suix_getNetworkMetrics",params:[]})}async getAddressMetrics(){return await this.transport.request({method:"suix_getLatestAddressMetrics",params:[]})}async getEpochMetrics(t){return await this.transport.request({method:"suix_getEpochMetrics",params:[t==null?void 0:t.cursor,t==null?void 0:t.limit,t==null?void 0:t.descendingOrder]})}async getAllEpochAddressMetrics(t){return await this.transport.request({method:"suix_getAllEpochAddressMetrics",params:[t==null?void 0:t.descendingOrder]})}async getEpochs(t){return await this.transport.request({method:"suix_getEpochs",params:[t==null?void 0:t.cursor,t==null?void 0:t.limit,t==null?void 0:t.descendingOrder]})}async getMoveCallMetrics(){return await this.transport.request({method:"suix_getMoveCallMetrics",params:[]})}async getCurrentEpoch(){return await this.transport.request({method:"suix_getCurrentEpoch",params:[]})}async getValidatorsApy(){return await this.transport.request({method:"suix_getValidatorsApy",params:[]})}async getChainIdentifier(){const t=await this.getCheckpoint({id:"0"}),r=_i(t.digest);return Ei(r.slice(0,4))}async resolveNameServiceAddress(t){return await this.transport.request({method:"suix_resolveNameServiceAddress",params:[t.name]})}async resolveNameServiceNames({format:t="dot",...r}){const{nextCursor:n,hasNextPage:i,data:o}=await this.transport.request({method:"suix_resolveNameServiceNames",params:[r.address,r.cursor,r.limit]});return{hasNextPage:i,nextCursor:n,data:o.map(s=>yg(s,t))}}async getProtocolConfig(t){return await this.transport.request({method:"sui_getProtocolConfig",params:[t==null?void 0:t.version]})}async waitForTransaction({signal:t,timeout:r=60*1e3,pollInterval:n=2*1e3,...i}){const o=AbortSignal.timeout(r),s=new Promise((a,c)=>{o.addEventListener("abort",()=>c(o.reason))});for(s.catch(()=>{});!o.aborted;){t==null||t.throwIfAborted();try{return await this.getTransactionBlock(i)}catch{await Promise.race([new Promise(c=>setTimeout(c,n)),s])}}throw o.throwIfAborted(),new Error("Unexpected error while waiting for transaction block.")}experimental_asClientExtension(){return{name:"jsonRPC",register:()=>this}}}var _f={},fl={},Ed={},dl={},Cd={},hl={};Object.defineProperty(hl,"__esModule",{value:!0});hl.Convert=void 0;class E3{static toPriceFeed(t){return bu(t,gi("PriceFeed"))}static priceFeedToJson(t){return yu(t,gi("PriceFeed"))}static toPrice(t){return bu(t,gi("Price"))}static priceToJson(t){return yu(t,gi("Price"))}static toPriceFeedMetadata(t){return bu(t,gi("PriceFeedMetadata"))}static priceFeedMetadataToJson(t){return yu(t,gi("PriceFeedMetadata"))}}hl.Convert=E3;function di(e,t,r=""){throw Error(r?`Invalid value for key "${r}". Expected type ${JSON.stringify(e)} but got ${JSON.stringify(t)}`:`Invalid value ${JSON.stringify(t)} for type ${JSON.stringify(e)}`)}function C3(e){if(e.jsonToJS===void 0){const t={};e.props.forEach(r=>t[r.json]={key:r.js,typ:r.typ}),e.jsonToJS=t}return e.jsonToJS}function T3(e){if(e.jsToJSON===void 0){const t={};e.props.forEach(r=>t[r.js]={key:r.json,typ:r.typ}),e.jsToJSON=t}return e.jsToJSON}function ns(e,t,r,n=""){function i(u,d){return typeof u==typeof d?d:di(u,d,n)}function o(u,d){const p=u.length;for(let y=0;y<p;y++){const x=u[y];try{return ns(d,x,r)}catch{}}return di(u,d)}function s(u,d){return u.indexOf(d)!==-1?d:di(u,d)}function a(u,d){return Array.isArray(d)?d.map(p=>ns(p,u,r)):di("array",d)}function c(u){if(u===null)return null;const d=new Date(u);return isNaN(d.valueOf())?di("Date",u):d}function l(u,d,p){if(p===null||typeof p!="object"||Array.isArray(p))return di("object",p);const y={};return Object.getOwnPropertyNames(u).forEach(x=>{const b=u[x],M=Object.prototype.hasOwnProperty.call(p,x)?p[x]:void 0;y[b.key]=ns(M,b.typ,r,b.key)}),Object.getOwnPropertyNames(p).forEach(x=>{Object.prototype.hasOwnProperty.call(u,x)||(y[x]=ns(p[x],d,r,x))}),y}if(t==="any")return e;if(t===null)return e===null?e:di(t,e);if(t===!1)return di(t,e);for(;typeof t=="object"&&t.ref!==void 0;)t=A3[t.ref];return Array.isArray(t)?s(t,e):typeof t=="object"?t.hasOwnProperty("unionMembers")?o(t.unionMembers,e):t.hasOwnProperty("arrayItems")?a(t.arrayItems,e):t.hasOwnProperty("props")?l(r(t),t.additional,e):di(t,e):t===Date&&typeof e!="number"?c(e):i(t,e)}function bu(e,t){return ns(e,t,C3)}function yu(e,t){return ns(e,t,T3)}function fo(...e){return{unionMembers:e}}function wu(e,t){return{props:e,additional:t}}function gi(e){return{ref:e}}const A3={PriceFeed:wu([{json:"ema_price",js:"ema_price",typ:gi("Price")},{json:"id",js:"id",typ:""},{json:"metadata",js:"metadata",typ:fo(void 0,gi("PriceFeedMetadata"))},{json:"price",js:"price",typ:gi("Price")},{json:"vaa",js:"vaa",typ:fo(void 0,"")}],"any"),Price:wu([{json:"conf",js:"conf",typ:""},{json:"expo",js:"expo",typ:0},{json:"price",js:"price",typ:""},{json:"publish_time",js:"publish_time",typ:0}],"any"),PriceFeedMetadata:wu([{json:"attestation_time",js:"attestation_time",typ:fo(void 0,0)},{json:"emitter_chain",js:"emitter_chain",typ:0},{json:"prev_publish_time",js:"prev_publish_time",typ:fo(void 0,0)},{json:"price_service_receive_time",js:"price_service_receive_time",typ:fo(void 0,0)},{json:"sequence_number",js:"sequence_number",typ:fo(void 0,0)},{json:"slot",js:"slot",typ:fo(void 0,0)}],"any")};var Oa={};(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},r={};r.byteLength=u,r.toByteArray=p,r.fromByteArray=b;for(var n=[],i=[],o=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63;function l(P){var k=P.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var F=P.indexOf("=");F===-1&&(F=k);var B=F===k?0:4-F%4;return[F,B]}function u(P){var k=l(P),F=k[0],B=k[1];return(F+B)*3/4-B}function d(P,k,F){return(k+F)*3/4-F}function p(P){var k,F=l(P),B=F[0],W=F[1],z=new o(d(P,B,W)),G=0,re=W>0?B-4:B,oe;for(oe=0;oe<re;oe+=4)k=i[P.charCodeAt(oe)]<<18|i[P.charCodeAt(oe+1)]<<12|i[P.charCodeAt(oe+2)]<<6|i[P.charCodeAt(oe+3)],z[G++]=k>>16&255,z[G++]=k>>8&255,z[G++]=k&255;return W===2&&(k=i[P.charCodeAt(oe)]<<2|i[P.charCodeAt(oe+1)]>>4,z[G++]=k&255),W===1&&(k=i[P.charCodeAt(oe)]<<10|i[P.charCodeAt(oe+1)]<<4|i[P.charCodeAt(oe+2)]>>2,z[G++]=k>>8&255,z[G++]=k&255),z}function y(P){return n[P>>18&63]+n[P>>12&63]+n[P>>6&63]+n[P&63]}function x(P,k,F){for(var B,W=[],z=k;z<F;z+=3)B=(P[z]<<16&16711680)+(P[z+1]<<8&65280)+(P[z+2]&255),W.push(y(B));return W.join("")}function b(P){for(var k,F=P.length,B=F%3,W=[],z=16383,G=0,re=F-B;G<re;G+=z)W.push(x(P,G,G+z>re?re:G+z));return B===1?(k=P[F-1],W.push(n[k>>2]+n[k<<4&63]+"==")):B===2&&(k=(P[F-2]<<8)+P[F-1],W.push(n[k>>10]+n[k>>4&63]+n[k<<2&63]+"=")),W.join("")}var M={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */M.read=function(P,k,F,B,W){var z,G,re=W*8-B-1,oe=(1<<re)-1,se=oe>>1,q=-7,L=F?W-1:0,h=F?-1:1,f=P[k+L];for(L+=h,z=f&(1<<-q)-1,f>>=-q,q+=re;q>0;z=z*256+P[k+L],L+=h,q-=8);for(G=z&(1<<-q)-1,z>>=-q,q+=B;q>0;G=G*256+P[k+L],L+=h,q-=8);if(z===0)z=1-se;else{if(z===oe)return G?NaN:(f?-1:1)*(1/0);G=G+Math.pow(2,B),z=z-se}return(f?-1:1)*G*Math.pow(2,z-B)},M.write=function(P,k,F,B,W,z){var G,re,oe,se=z*8-W-1,q=(1<<se)-1,L=q>>1,h=W===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=B?0:z-1,m=B?1:-1,S=k<0||k===0&&1/k<0?1:0;for(k=Math.abs(k),isNaN(k)||k===1/0?(re=isNaN(k)?1:0,G=q):(G=Math.floor(Math.log(k)/Math.LN2),k*(oe=Math.pow(2,-G))<1&&(G--,oe*=2),G+L>=1?k+=h/oe:k+=h*Math.pow(2,1-L),k*oe>=2&&(G++,oe/=2),G+L>=q?(re=0,G=q):G+L>=1?(re=(k*oe-1)*Math.pow(2,W),G=G+L):(re=k*Math.pow(2,L-1)*Math.pow(2,W),G=0));W>=8;P[F+f]=re&255,f+=m,re/=256,W-=8);for(G=G<<W|re,se+=W;se>0;P[F+f]=G&255,f+=m,G/=256,se-=8);P[F+f-m]|=S*128};/*!
|
|
25
25
|
* The buffer module from node.js, for the browser.
|
|
26
26
|
*
|
|
27
27
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
28
28
|
* @license MIT
|
|
29
|
-
*/(function(P){const k=r,F=M,B=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;P.Buffer=q,P.SlowBuffer=v,P.INSPECT_MAX_BYTES=50;const W=2147483647;P.kMaxLength=W;const{Uint8Array:z,ArrayBuffer:G,SharedArrayBuffer:re}=globalThis;q.TYPED_ARRAY_SUPPORT=oe(),!q.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function oe(){try{const N=new z(1),_={foo:function(){return 42}};return Object.setPrototypeOf(_,z.prototype),Object.setPrototypeOf(N,_),N.foo()===42}catch{return!1}}Object.defineProperty(q.prototype,"parent",{enumerable:!0,get:function(){if(q.isBuffer(this))return this.buffer}}),Object.defineProperty(q.prototype,"offset",{enumerable:!0,get:function(){if(q.isBuffer(this))return this.byteOffset}});function se(N){if(N>W)throw new RangeError('The value "'+N+'" is invalid for option "size"');const _=new z(N);return Object.setPrototypeOf(_,q.prototype),_}function q(N,_,A){if(typeof N=="number"){if(typeof _=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(N)}return L(N,_,A)}q.poolSize=8192;function L(N,_,A){if(typeof N=="string")return S(N,_);if(G.isView(N))return E(N);if(N==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof N);if(mt(N,G)||N&&mt(N.buffer,G)||typeof re<"u"&&(mt(N,re)||N&&mt(N.buffer,re)))return I(N,_,A);if(typeof N=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const U=N.valueOf&&N.valueOf();if(U!=null&&U!==N)return q.from(U,_,A);const Y=C(N);if(Y)return Y;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof N[Symbol.toPrimitive]=="function")return q.from(N[Symbol.toPrimitive]("string"),_,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof N)}q.from=function(N,_,A){return L(N,_,A)},Object.setPrototypeOf(q.prototype,z.prototype),Object.setPrototypeOf(q,z);function h(N){if(typeof N!="number")throw new TypeError('"size" argument must be of type number');if(N<0)throw new RangeError('The value "'+N+'" is invalid for option "size"')}function f(N,_,A){return h(N),N<=0?se(N):_!==void 0?typeof A=="string"?se(N).fill(_,A):se(N).fill(_):se(N)}q.alloc=function(N,_,A){return f(N,_,A)};function m(N){return h(N),se(N<0?0:g(N)|0)}q.allocUnsafe=function(N){return m(N)},q.allocUnsafeSlow=function(N){return m(N)};function S(N,_){if((typeof _!="string"||_==="")&&(_="utf8"),!q.isEncoding(_))throw new TypeError("Unknown encoding: "+_);const A=j(N,_)|0;let U=se(A);const Y=U.write(N,_);return Y!==A&&(U=U.slice(0,Y)),U}function T(N){const _=N.length<0?0:g(N.length)|0,A=se(_);for(let U=0;U<_;U+=1)A[U]=N[U]&255;return A}function E(N){if(mt(N,z)){const _=new z(N);return I(_.buffer,_.byteOffset,_.byteLength)}return T(N)}function I(N,_,A){if(_<0||N.byteLength<_)throw new RangeError('"offset" is outside of buffer bounds');if(N.byteLength<_+(A||0))throw new RangeError('"length" is outside of buffer bounds');let U;return _===void 0&&A===void 0?U=new z(N):A===void 0?U=new z(N,_):U=new z(N,_,A),Object.setPrototypeOf(U,q.prototype),U}function C(N){if(q.isBuffer(N)){const _=g(N.length)|0,A=se(_);return A.length===0||N.copy(A,0,0,_),A}if(N.length!==void 0)return typeof N.length!="number"||Nt(N.length)?se(0):T(N);if(N.type==="Buffer"&&Array.isArray(N.data))return T(N.data)}function g(N){if(N>=W)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+W.toString(16)+" bytes");return N|0}function v(N){return+N!=N&&(N=0),q.alloc(+N)}q.isBuffer=function(_){return _!=null&&_._isBuffer===!0&&_!==q.prototype},q.compare=function(_,A){if(mt(_,z)&&(_=q.from(_,_.offset,_.byteLength)),mt(A,z)&&(A=q.from(A,A.offset,A.byteLength)),!q.isBuffer(_)||!q.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(_===A)return 0;let U=_.length,Y=A.length;for(let ee=0,ne=Math.min(U,Y);ee<ne;++ee)if(_[ee]!==A[ee]){U=_[ee],Y=A[ee];break}return U<Y?-1:Y<U?1:0},q.isEncoding=function(_){switch(String(_).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},q.concat=function(_,A){if(!Array.isArray(_))throw new TypeError('"list" argument must be an Array of Buffers');if(_.length===0)return q.alloc(0);let U;if(A===void 0)for(A=0,U=0;U<_.length;++U)A+=_[U].length;const Y=q.allocUnsafe(A);let ee=0;for(U=0;U<_.length;++U){let ne=_[U];if(mt(ne,z))ee+ne.length>Y.length?(q.isBuffer(ne)||(ne=q.from(ne)),ne.copy(Y,ee)):z.prototype.set.call(Y,ne,ee);else if(q.isBuffer(ne))ne.copy(Y,ee);else throw new TypeError('"list" argument must be an Array of Buffers');ee+=ne.length}return Y};function j(N,_){if(q.isBuffer(N))return N.length;if(G.isView(N)||mt(N,G))return N.byteLength;if(typeof N!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof N);const A=N.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&A===0)return 0;let Y=!1;for(;;)switch(_){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Pt(N).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return Ct(N).length;default:if(Y)return U?-1:Pt(N).length;_=(""+_).toLowerCase(),Y=!0}}q.byteLength=j;function Q(N,_,A){let U=!1;if((_===void 0||_<0)&&(_=0),_>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,_>>>=0,A<=_))return"";for(N||(N="utf8");;)switch(N){case"hex":return Ve(this,_,A);case"utf8":case"utf-8":return je(this,_,A);case"ascii":return he(this,_,A);case"latin1":case"binary":return Ce(this,_,A);case"base64":return ft(this,_,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke(this,_,A);default:if(U)throw new TypeError("Unknown encoding: "+N);N=(N+"").toLowerCase(),U=!0}}q.prototype._isBuffer=!0;function Z(N,_,A){const U=N[_];N[_]=N[A],N[A]=U}q.prototype.swap16=function(){const _=this.length;if(_%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;A<_;A+=2)Z(this,A,A+1);return this},q.prototype.swap32=function(){const _=this.length;if(_%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<_;A+=4)Z(this,A,A+3),Z(this,A+1,A+2);return this},q.prototype.swap64=function(){const _=this.length;if(_%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let A=0;A<_;A+=8)Z(this,A,A+7),Z(this,A+1,A+6),Z(this,A+2,A+5),Z(this,A+3,A+4);return this},q.prototype.toString=function(){const _=this.length;return _===0?"":arguments.length===0?je(this,0,_):Q.apply(this,arguments)},q.prototype.toLocaleString=q.prototype.toString,q.prototype.equals=function(_){if(!q.isBuffer(_))throw new TypeError("Argument must be a Buffer");return this===_?!0:q.compare(this,_)===0},q.prototype.inspect=function(){let _="";const A=P.INSPECT_MAX_BYTES;return _=this.toString("hex",0,A).replace(/(.{2})/g,"$1 ").trim(),this.length>A&&(_+=" ... "),"<Buffer "+_+">"},B&&(q.prototype[B]=q.prototype.inspect),q.prototype.compare=function(_,A,U,Y,ee){if(mt(_,z)&&(_=q.from(_,_.offset,_.byteLength)),!q.isBuffer(_))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof _);if(A===void 0&&(A=0),U===void 0&&(U=_?_.length:0),Y===void 0&&(Y=0),ee===void 0&&(ee=this.length),A<0||U>_.length||Y<0||ee>this.length)throw new RangeError("out of range index");if(Y>=ee&&A>=U)return 0;if(Y>=ee)return-1;if(A>=U)return 1;if(A>>>=0,U>>>=0,Y>>>=0,ee>>>=0,this===_)return 0;let ne=ee-Y,De=U-A;const Ze=Math.min(ne,De),Ne=this.slice(Y,ee),V=_.slice(A,U);for(let ae=0;ae<Ze;++ae)if(Ne[ae]!==V[ae]){ne=Ne[ae],De=V[ae];break}return ne<De?-1:De<ne?1:0};function ce(N,_,A,U,Y){if(N.length===0)return-1;if(typeof A=="string"?(U=A,A=0):A>2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,Nt(A)&&(A=Y?0:N.length-1),A<0&&(A=N.length+A),A>=N.length){if(Y)return-1;A=N.length-1}else if(A<0)if(Y)A=0;else return-1;if(typeof _=="string"&&(_=q.from(_,U)),q.isBuffer(_))return _.length===0?-1:be(N,_,A,U,Y);if(typeof _=="number")return _=_&255,typeof z.prototype.indexOf=="function"?Y?z.prototype.indexOf.call(N,_,A):z.prototype.lastIndexOf.call(N,_,A):be(N,[_],A,U,Y);throw new TypeError("val must be string, number or Buffer")}function be(N,_,A,U,Y){let ee=1,ne=N.length,De=_.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(N.length<2||_.length<2)return-1;ee=2,ne/=2,De/=2,A/=2}function Ze(V,ae){return ee===1?V[ae]:V.readUInt16BE(ae*ee)}let Ne;if(Y){let V=-1;for(Ne=A;Ne<ne;Ne++)if(Ze(N,Ne)===Ze(_,V===-1?0:Ne-V)){if(V===-1&&(V=Ne),Ne-V+1===De)return V*ee}else V!==-1&&(Ne-=Ne-V),V=-1}else for(A+De>ne&&(A=ne-De),Ne=A;Ne>=0;Ne--){let V=!0;for(let ae=0;ae<De;ae++)if(Ze(N,Ne+ae)!==Ze(_,ae)){V=!1;break}if(V)return Ne}return-1}q.prototype.includes=function(_,A,U){return this.indexOf(_,A,U)!==-1},q.prototype.indexOf=function(_,A,U){return ce(this,_,A,U,!0)},q.prototype.lastIndexOf=function(_,A,U){return ce(this,_,A,U,!1)};function xe(N,_,A,U){A=Number(A)||0;const Y=N.length-A;U?(U=Number(U),U>Y&&(U=Y)):U=Y;const ee=_.length;U>ee/2&&(U=ee/2);let ne;for(ne=0;ne<U;++ne){const De=parseInt(_.substr(ne*2,2),16);if(Nt(De))return ne;N[A+ne]=De}return ne}function pe(N,_,A,U){return Ge(Pt(_,N.length-A),N,A,U)}function Le(N,_,A,U){return Ge(tt(_),N,A,U)}function Ae(N,_,A,U){return Ge(Ct(_),N,A,U)}function Je(N,_,A,U){return Ge(wt(_,N.length-A),N,A,U)}q.prototype.write=function(_,A,U,Y){if(A===void 0)Y="utf8",U=this.length,A=0;else if(U===void 0&&typeof A=="string")Y=A,U=this.length,A=0;else if(isFinite(A))A=A>>>0,isFinite(U)?(U=U>>>0,Y===void 0&&(Y="utf8")):(Y=U,U=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ee=this.length-A;if((U===void 0||U>ee)&&(U=ee),_.length>0&&(U<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");Y||(Y="utf8");let ne=!1;for(;;)switch(Y){case"hex":return xe(this,_,A,U);case"utf8":case"utf-8":return pe(this,_,A,U);case"ascii":case"latin1":case"binary":return Le(this,_,A,U);case"base64":return Ae(this,_,A,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Je(this,_,A,U);default:if(ne)throw new TypeError("Unknown encoding: "+Y);Y=(""+Y).toLowerCase(),ne=!0}},q.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ft(N,_,A){return _===0&&A===N.length?k.fromByteArray(N):k.fromByteArray(N.slice(_,A))}function je(N,_,A){A=Math.min(N.length,A);const U=[];let Y=_;for(;Y<A;){const ee=N[Y];let ne=null,De=ee>239?4:ee>223?3:ee>191?2:1;if(Y+De<=A){let Ze,Ne,V,ae;switch(De){case 1:ee<128&&(ne=ee);break;case 2:Ze=N[Y+1],(Ze&192)===128&&(ae=(ee&31)<<6|Ze&63,ae>127&&(ne=ae));break;case 3:Ze=N[Y+1],Ne=N[Y+2],(Ze&192)===128&&(Ne&192)===128&&(ae=(ee&15)<<12|(Ze&63)<<6|Ne&63,ae>2047&&(ae<55296||ae>57343)&&(ne=ae));break;case 4:Ze=N[Y+1],Ne=N[Y+2],V=N[Y+3],(Ze&192)===128&&(Ne&192)===128&&(V&192)===128&&(ae=(ee&15)<<18|(Ze&63)<<12|(Ne&63)<<6|V&63,ae>65535&&ae<1114112&&(ne=ae))}}ne===null?(ne=65533,De=1):ne>65535&&(ne-=65536,U.push(ne>>>10&1023|55296),ne=56320|ne&1023),U.push(ne),Y+=De}return we(U)}const pt=4096;function we(N){const _=N.length;if(_<=pt)return String.fromCharCode.apply(String,N);let A="",U=0;for(;U<_;)A+=String.fromCharCode.apply(String,N.slice(U,U+=pt));return A}function he(N,_,A){let U="";A=Math.min(N.length,A);for(let Y=_;Y<A;++Y)U+=String.fromCharCode(N[Y]&127);return U}function Ce(N,_,A){let U="";A=Math.min(N.length,A);for(let Y=_;Y<A;++Y)U+=String.fromCharCode(N[Y]);return U}function Ve(N,_,A){const U=N.length;(!_||_<0)&&(_=0),(!A||A<0||A>U)&&(A=U);let Y="";for(let ee=_;ee<A;++ee)Y+=it[N[ee]];return Y}function ke(N,_,A){const U=N.slice(_,A);let Y="";for(let ee=0;ee<U.length-1;ee+=2)Y+=String.fromCharCode(U[ee]+U[ee+1]*256);return Y}q.prototype.slice=function(_,A){const U=this.length;_=~~_,A=A===void 0?U:~~A,_<0?(_+=U,_<0&&(_=0)):_>U&&(_=U),A<0?(A+=U,A<0&&(A=0)):A>U&&(A=U),A<_&&(A=_);const Y=this.subarray(_,A);return Object.setPrototypeOf(Y,q.prototype),Y};function Te(N,_,A){if(N%1!==0||N<0)throw new RangeError("offset is not uint");if(N+_>A)throw new RangeError("Trying to access beyond buffer length")}q.prototype.readUintLE=q.prototype.readUIntLE=function(_,A,U){_=_>>>0,A=A>>>0,U||Te(_,A,this.length);let Y=this[_],ee=1,ne=0;for(;++ne<A&&(ee*=256);)Y+=this[_+ne]*ee;return Y},q.prototype.readUintBE=q.prototype.readUIntBE=function(_,A,U){_=_>>>0,A=A>>>0,U||Te(_,A,this.length);let Y=this[_+--A],ee=1;for(;A>0&&(ee*=256);)Y+=this[_+--A]*ee;return Y},q.prototype.readUint8=q.prototype.readUInt8=function(_,A){return _=_>>>0,A||Te(_,1,this.length),this[_]},q.prototype.readUint16LE=q.prototype.readUInt16LE=function(_,A){return _=_>>>0,A||Te(_,2,this.length),this[_]|this[_+1]<<8},q.prototype.readUint16BE=q.prototype.readUInt16BE=function(_,A){return _=_>>>0,A||Te(_,2,this.length),this[_]<<8|this[_+1]},q.prototype.readUint32LE=q.prototype.readUInt32LE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),(this[_]|this[_+1]<<8|this[_+2]<<16)+this[_+3]*16777216},q.prototype.readUint32BE=q.prototype.readUInt32BE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),this[_]*16777216+(this[_+1]<<16|this[_+2]<<8|this[_+3])},q.prototype.readBigUInt64LE=xt(function(_){_=_>>>0,Et(_,"offset");const A=this[_],U=this[_+7];(A===void 0||U===void 0)&&It(_,this.length-8);const Y=A+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24,ee=this[++_]+this[++_]*2**8+this[++_]*2**16+U*2**24;return BigInt(Y)+(BigInt(ee)<<BigInt(32))}),q.prototype.readBigUInt64BE=xt(function(_){_=_>>>0,Et(_,"offset");const A=this[_],U=this[_+7];(A===void 0||U===void 0)&&It(_,this.length-8);const Y=A*2**24+this[++_]*2**16+this[++_]*2**8+this[++_],ee=this[++_]*2**24+this[++_]*2**16+this[++_]*2**8+U;return(BigInt(Y)<<BigInt(32))+BigInt(ee)}),q.prototype.readIntLE=function(_,A,U){_=_>>>0,A=A>>>0,U||Te(_,A,this.length);let Y=this[_],ee=1,ne=0;for(;++ne<A&&(ee*=256);)Y+=this[_+ne]*ee;return ee*=128,Y>=ee&&(Y-=Math.pow(2,8*A)),Y},q.prototype.readIntBE=function(_,A,U){_=_>>>0,A=A>>>0,U||Te(_,A,this.length);let Y=A,ee=1,ne=this[_+--Y];for(;Y>0&&(ee*=256);)ne+=this[_+--Y]*ee;return ee*=128,ne>=ee&&(ne-=Math.pow(2,8*A)),ne},q.prototype.readInt8=function(_,A){return _=_>>>0,A||Te(_,1,this.length),this[_]&128?(255-this[_]+1)*-1:this[_]},q.prototype.readInt16LE=function(_,A){_=_>>>0,A||Te(_,2,this.length);const U=this[_]|this[_+1]<<8;return U&32768?U|4294901760:U},q.prototype.readInt16BE=function(_,A){_=_>>>0,A||Te(_,2,this.length);const U=this[_+1]|this[_]<<8;return U&32768?U|4294901760:U},q.prototype.readInt32LE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),this[_]|this[_+1]<<8|this[_+2]<<16|this[_+3]<<24},q.prototype.readInt32BE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),this[_]<<24|this[_+1]<<16|this[_+2]<<8|this[_+3]},q.prototype.readBigInt64LE=xt(function(_){_=_>>>0,Et(_,"offset");const A=this[_],U=this[_+7];(A===void 0||U===void 0)&&It(_,this.length-8);const Y=this[_+4]+this[_+5]*2**8+this[_+6]*2**16+(U<<24);return(BigInt(Y)<<BigInt(32))+BigInt(A+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24)}),q.prototype.readBigInt64BE=xt(function(_){_=_>>>0,Et(_,"offset");const A=this[_],U=this[_+7];(A===void 0||U===void 0)&&It(_,this.length-8);const Y=(A<<24)+this[++_]*2**16+this[++_]*2**8+this[++_];return(BigInt(Y)<<BigInt(32))+BigInt(this[++_]*2**24+this[++_]*2**16+this[++_]*2**8+U)}),q.prototype.readFloatLE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),F.read(this,_,!0,23,4)},q.prototype.readFloatBE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),F.read(this,_,!1,23,4)},q.prototype.readDoubleLE=function(_,A){return _=_>>>0,A||Te(_,8,this.length),F.read(this,_,!0,52,8)},q.prototype.readDoubleBE=function(_,A){return _=_>>>0,A||Te(_,8,this.length),F.read(this,_,!1,52,8)};function Me(N,_,A,U,Y,ee){if(!q.isBuffer(N))throw new TypeError('"buffer" argument must be a Buffer instance');if(_>Y||_<ee)throw new RangeError('"value" argument is out of bounds');if(A+U>N.length)throw new RangeError("Index out of range")}q.prototype.writeUintLE=q.prototype.writeUIntLE=function(_,A,U,Y){if(_=+_,A=A>>>0,U=U>>>0,!Y){const De=Math.pow(2,8*U)-1;Me(this,_,A,U,De,0)}let ee=1,ne=0;for(this[A]=_&255;++ne<U&&(ee*=256);)this[A+ne]=_/ee&255;return A+U},q.prototype.writeUintBE=q.prototype.writeUIntBE=function(_,A,U,Y){if(_=+_,A=A>>>0,U=U>>>0,!Y){const De=Math.pow(2,8*U)-1;Me(this,_,A,U,De,0)}let ee=U-1,ne=1;for(this[A+ee]=_&255;--ee>=0&&(ne*=256);)this[A+ee]=_/ne&255;return A+U},q.prototype.writeUint8=q.prototype.writeUInt8=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,1,255,0),this[A]=_&255,A+1},q.prototype.writeUint16LE=q.prototype.writeUInt16LE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,2,65535,0),this[A]=_&255,this[A+1]=_>>>8,A+2},q.prototype.writeUint16BE=q.prototype.writeUInt16BE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,2,65535,0),this[A]=_>>>8,this[A+1]=_&255,A+2},q.prototype.writeUint32LE=q.prototype.writeUInt32LE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,4,4294967295,0),this[A+3]=_>>>24,this[A+2]=_>>>16,this[A+1]=_>>>8,this[A]=_&255,A+4},q.prototype.writeUint32BE=q.prototype.writeUInt32BE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,4,4294967295,0),this[A]=_>>>24,this[A+1]=_>>>16,this[A+2]=_>>>8,this[A+3]=_&255,A+4};function Ue(N,_,A,U,Y){et(_,U,Y,N,A,7);let ee=Number(_&BigInt(4294967295));N[A++]=ee,ee=ee>>8,N[A++]=ee,ee=ee>>8,N[A++]=ee,ee=ee>>8,N[A++]=ee;let ne=Number(_>>BigInt(32)&BigInt(4294967295));return N[A++]=ne,ne=ne>>8,N[A++]=ne,ne=ne>>8,N[A++]=ne,ne=ne>>8,N[A++]=ne,A}function lt(N,_,A,U,Y){et(_,U,Y,N,A,7);let ee=Number(_&BigInt(4294967295));N[A+7]=ee,ee=ee>>8,N[A+6]=ee,ee=ee>>8,N[A+5]=ee,ee=ee>>8,N[A+4]=ee;let ne=Number(_>>BigInt(32)&BigInt(4294967295));return N[A+3]=ne,ne=ne>>8,N[A+2]=ne,ne=ne>>8,N[A+1]=ne,ne=ne>>8,N[A]=ne,A+8}q.prototype.writeBigUInt64LE=xt(function(_,A=0){return Ue(this,_,A,BigInt(0),BigInt("0xffffffffffffffff"))}),q.prototype.writeBigUInt64BE=xt(function(_,A=0){return lt(this,_,A,BigInt(0),BigInt("0xffffffffffffffff"))}),q.prototype.writeIntLE=function(_,A,U,Y){if(_=+_,A=A>>>0,!Y){const Ze=Math.pow(2,8*U-1);Me(this,_,A,U,Ze-1,-Ze)}let ee=0,ne=1,De=0;for(this[A]=_&255;++ee<U&&(ne*=256);)_<0&&De===0&&this[A+ee-1]!==0&&(De=1),this[A+ee]=(_/ne>>0)-De&255;return A+U},q.prototype.writeIntBE=function(_,A,U,Y){if(_=+_,A=A>>>0,!Y){const Ze=Math.pow(2,8*U-1);Me(this,_,A,U,Ze-1,-Ze)}let ee=U-1,ne=1,De=0;for(this[A+ee]=_&255;--ee>=0&&(ne*=256);)_<0&&De===0&&this[A+ee+1]!==0&&(De=1),this[A+ee]=(_/ne>>0)-De&255;return A+U},q.prototype.writeInt8=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,1,127,-128),_<0&&(_=255+_+1),this[A]=_&255,A+1},q.prototype.writeInt16LE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,2,32767,-32768),this[A]=_&255,this[A+1]=_>>>8,A+2},q.prototype.writeInt16BE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,2,32767,-32768),this[A]=_>>>8,this[A+1]=_&255,A+2},q.prototype.writeInt32LE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,4,2147483647,-2147483648),this[A]=_&255,this[A+1]=_>>>8,this[A+2]=_>>>16,this[A+3]=_>>>24,A+4},q.prototype.writeInt32BE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,4,2147483647,-2147483648),_<0&&(_=4294967295+_+1),this[A]=_>>>24,this[A+1]=_>>>16,this[A+2]=_>>>8,this[A+3]=_&255,A+4},q.prototype.writeBigInt64LE=xt(function(_,A=0){return Ue(this,_,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),q.prototype.writeBigInt64BE=xt(function(_,A=0){return lt(this,_,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ut(N,_,A,U,Y,ee){if(A+U>N.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function ze(N,_,A,U,Y){return _=+_,A=A>>>0,Y||ut(N,_,A,4),F.write(N,_,A,U,23,4),A+4}q.prototype.writeFloatLE=function(_,A,U){return ze(this,_,A,!0,U)},q.prototype.writeFloatBE=function(_,A,U){return ze(this,_,A,!1,U)};function kt(N,_,A,U,Y){return _=+_,A=A>>>0,Y||ut(N,_,A,8),F.write(N,_,A,U,52,8),A+8}q.prototype.writeDoubleLE=function(_,A,U){return kt(this,_,A,!0,U)},q.prototype.writeDoubleBE=function(_,A,U){return kt(this,_,A,!1,U)},q.prototype.copy=function(_,A,U,Y){if(!q.isBuffer(_))throw new TypeError("argument should be a Buffer");if(U||(U=0),!Y&&Y!==0&&(Y=this.length),A>=_.length&&(A=_.length),A||(A=0),Y>0&&Y<U&&(Y=U),Y===U||_.length===0||this.length===0)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("sourceEnd out of bounds");Y>this.length&&(Y=this.length),_.length-A<Y-U&&(Y=_.length-A+U);const ee=Y-U;return this===_&&typeof z.prototype.copyWithin=="function"?this.copyWithin(A,U,Y):z.prototype.set.call(_,this.subarray(U,Y),A),ee},q.prototype.fill=function(_,A,U,Y){if(typeof _=="string"){if(typeof A=="string"?(Y=A,A=0,U=this.length):typeof U=="string"&&(Y=U,U=this.length),Y!==void 0&&typeof Y!="string")throw new TypeError("encoding must be a string");if(typeof Y=="string"&&!q.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y);if(_.length===1){const ne=_.charCodeAt(0);(Y==="utf8"&&ne<128||Y==="latin1")&&(_=ne)}}else typeof _=="number"?_=_&255:typeof _=="boolean"&&(_=Number(_));if(A<0||this.length<A||this.length<U)throw new RangeError("Out of range index");if(U<=A)return this;A=A>>>0,U=U===void 0?this.length:U>>>0,_||(_=0);let ee;if(typeof _=="number")for(ee=A;ee<U;++ee)this[ee]=_;else{const ne=q.isBuffer(_)?_:q.from(_,Y),De=ne.length;if(De===0)throw new TypeError('The value "'+_+'" is invalid for argument "value"');for(ee=0;ee<U-A;++ee)this[ee+A]=ne[ee%De]}return this};const _t={};function Ke(N,_,A){_t[N]=class extends A{constructor(){super(),Object.defineProperty(this,"message",{value:_.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${N}]`,this.stack,delete this.name}get code(){return N}set code(Y){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Y,writable:!0})}toString(){return`${this.name} [${N}]: ${this.message}`}}}Ke("ERR_BUFFER_OUT_OF_BOUNDS",function(N){return N?`${N} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ke("ERR_INVALID_ARG_TYPE",function(N,_){return`The "${N}" argument must be of type number. Received type ${typeof _}`},TypeError),Ke("ERR_OUT_OF_RANGE",function(N,_,A){let U=`The value of "${N}" is out of range.`,Y=A;return Number.isInteger(A)&&Math.abs(A)>2**32?Y=Mt(String(A)):typeof A=="bigint"&&(Y=String(A),(A>BigInt(2)**BigInt(32)||A<-(BigInt(2)**BigInt(32)))&&(Y=Mt(Y)),Y+="n"),U+=` It must be ${_}. Received ${Y}`,U},RangeError);function Mt(N){let _="",A=N.length;const U=N[0]==="-"?1:0;for(;A>=U+4;A-=3)_=`_${N.slice(A-3,A)}${_}`;return`${N.slice(0,A)}${_}`}function Ut(N,_,A){Et(_,"offset"),(N[_]===void 0||N[_+A]===void 0)&&It(_,N.length-(A+1))}function et(N,_,A,U,Y,ee){if(N>A||N<_){const ne=typeof _=="bigint"?"n":"";let De;throw ee>3?_===0||_===BigInt(0)?De=`>= 0${ne} and < 2${ne} ** ${(ee+1)*8}${ne}`:De=`>= -(2${ne} ** ${(ee+1)*8-1}${ne}) and < 2 ** ${(ee+1)*8-1}${ne}`:De=`>= ${_}${ne} and <= ${A}${ne}`,new _t.ERR_OUT_OF_RANGE("value",De,N)}Ut(U,Y,ee)}function Et(N,_){if(typeof N!="number")throw new _t.ERR_INVALID_ARG_TYPE(_,"number",N)}function It(N,_,A){throw Math.floor(N)!==N?(Et(N,A),new _t.ERR_OUT_OF_RANGE(A||"offset","an integer",N)):_<0?new _t.ERR_BUFFER_OUT_OF_BOUNDS:new _t.ERR_OUT_OF_RANGE(A||"offset",`>= ${A?1:0} and <= ${_}`,N)}const nt=/[^+/0-9A-Za-z-_]/g;function jt(N){if(N=N.split("=")[0],N=N.trim().replace(nt,""),N.length<2)return"";for(;N.length%4!==0;)N=N+"=";return N}function Pt(N,_){_=_||1/0;let A;const U=N.length;let Y=null;const ee=[];for(let ne=0;ne<U;++ne){if(A=N.charCodeAt(ne),A>55295&&A<57344){if(!Y){if(A>56319){(_-=3)>-1&&ee.push(239,191,189);continue}else if(ne+1===U){(_-=3)>-1&&ee.push(239,191,189);continue}Y=A;continue}if(A<56320){(_-=3)>-1&&ee.push(239,191,189),Y=A;continue}A=(Y-55296<<10|A-56320)+65536}else Y&&(_-=3)>-1&&ee.push(239,191,189);if(Y=null,A<128){if((_-=1)<0)break;ee.push(A)}else if(A<2048){if((_-=2)<0)break;ee.push(A>>6|192,A&63|128)}else if(A<65536){if((_-=3)<0)break;ee.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((_-=4)<0)break;ee.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return ee}function tt(N){const _=[];for(let A=0;A<N.length;++A)_.push(N.charCodeAt(A)&255);return _}function wt(N,_){let A,U,Y;const ee=[];for(let ne=0;ne<N.length&&!((_-=2)<0);++ne)A=N.charCodeAt(ne),U=A>>8,Y=A%256,ee.push(Y),ee.push(U);return ee}function Ct(N){return k.toByteArray(jt(N))}function Ge(N,_,A,U){let Y;for(Y=0;Y<U&&!(Y+A>=_.length||Y>=N.length);++Y)_[Y+A]=N[Y];return Y}function mt(N,_){return N instanceof _||N!=null&&N.constructor!=null&&N.constructor.name!=null&&N.constructor.name===_.name}function Nt(N){return N!==N}const it=function(){const N="0123456789abcdef",_=new Array(256);for(let A=0;A<16;++A){const U=A*16;for(let Y=0;Y<16;++Y)_[U+Y]=N[A]+N[Y]}return _}();function xt(N){return typeof BigInt>"u"?zt:N}function zt(){throw new Error("BigInt not supported")}})(t);const R=t.Buffer;e.Blob=t.Blob,e.BlobOptions=t.BlobOptions,e.Buffer=t.Buffer,e.File=t.File,e.FileOptions=t.FileOptions,e.INSPECT_MAX_BYTES=t.INSPECT_MAX_BYTES,e.SlowBuffer=t.SlowBuffer,e.TranscodeEncoding=t.TranscodeEncoding,e.atob=t.atob,e.btoa=t.btoa,e.constants=t.constants,e.default=R,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode})(Ra);const Ef=Ta(Ra);var fn={},Td={exports:{}};Td.exports;(function(e){(function(t,r){function n(L,h){if(!L)throw new Error(h||"Assertion failed")}function i(L,h){L.super_=h;var f=function(){};f.prototype=h.prototype,L.prototype=new f,L.prototype.constructor=L}function o(L,h,f){if(o.isBN(L))return L;this.negative=0,this.words=null,this.length=0,this.red=null,L!==null&&((h==="le"||h==="be")&&(f=h,h=10),this._init(L||0,h||10,f||"be"))}typeof t=="object"?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=Ra.Buffer}catch{}o.isBN=function(h){return h instanceof o?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===o.wordSize&&Array.isArray(h.words)},o.max=function(h,f){return h.cmp(f)>0?h:f},o.min=function(h,f){return h.cmp(f)<0?h:f},o.prototype._init=function(h,f,m){if(typeof h=="number")return this._initNumber(h,f,m);if(typeof h=="object")return this._initArray(h,f,m);f==="hex"&&(f=16),n(f===(f|0)&&f>=2&&f<=36),h=h.toString().replace(/\s+/g,"");var S=0;h[0]==="-"&&(S++,this.negative=1),S<h.length&&(f===16?this._parseHex(h,S,m):(this._parseBase(h,f,S),m==="le"&&this._initArray(this.toArray(),f,m)))},o.prototype._initNumber=function(h,f,m){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(n(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),m==="le"&&this._initArray(this.toArray(),f,m)},o.prototype._initArray=function(h,f,m){if(n(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var T,E,I=0;if(m==="be")for(S=h.length-1,T=0;S>=0;S-=3)E=h[S]|h[S-1]<<8|h[S-2]<<16,this.words[T]|=E<<I&67108863,this.words[T+1]=E>>>26-I&67108863,I+=24,I>=26&&(I-=26,T++);else if(m==="le")for(S=0,T=0;S<h.length;S+=3)E=h[S]|h[S+1]<<8|h[S+2]<<16,this.words[T]|=E<<I&67108863,this.words[T+1]=E>>>26-I&67108863,I+=24,I>=26&&(I-=26,T++);return this._strip()};function a(L,h){var f=L.charCodeAt(h);if(f>=48&&f<=57)return f-48;if(f>=65&&f<=70)return f-55;if(f>=97&&f<=102)return f-87;n(!1,"Invalid character in "+L)}function c(L,h,f){var m=a(L,f);return f-1>=h&&(m|=a(L,f-1)<<4),m}o.prototype._parseHex=function(h,f,m){this.length=Math.ceil((h.length-f)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var T=0,E=0,I;if(m==="be")for(S=h.length-1;S>=f;S-=2)I=c(h,f,S)<<T,this.words[E]|=I&67108863,T>=18?(T-=18,E+=1,this.words[E]|=I>>>26):T+=8;else{var C=h.length-f;for(S=C%2===0?f+1:f;S<h.length;S+=2)I=c(h,f,S)<<T,this.words[E]|=I&67108863,T>=18?(T-=18,E+=1,this.words[E]|=I>>>26):T+=8}this._strip()};function l(L,h,f,m){for(var S=0,T=0,E=Math.min(L.length,f),I=h;I<E;I++){var C=L.charCodeAt(I)-48;S*=m,C>=49?T=C-49+10:C>=17?T=C-17+10:T=C,n(C>=0&&T<m,"Invalid character"),S+=T}return S}o.prototype._parseBase=function(h,f,m){this.words=[0],this.length=1;for(var S=0,T=1;T<=67108863;T*=f)S++;S--,T=T/f|0;for(var E=h.length-m,I=E%S,C=Math.min(E,E-I)+m,g=0,v=m;v<C;v+=S)g=l(h,v,v+S,f),this.imuln(T),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(I!==0){var j=1;for(g=l(h,v,h.length,f),v=0;v<I;v++)j*=f;this.imuln(j),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this._strip()},o.prototype.copy=function(h){h.words=new Array(this.length);for(var f=0;f<this.length;f++)h.words[f]=this.words[f];h.length=this.length,h.negative=this.negative,h.red=this.red};function u(L,h){L.words=h.words,L.length=h.length,L.negative=h.negative,L.red=h.red}if(o.prototype._move=function(h){u(h,this)},o.prototype.clone=function(){var h=new o(null);return this.copy(h),h},o.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch{o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],y=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(h,f){h=h||10,f=f|0||1;var m;if(h===16||h==="hex"){m="";for(var S=0,T=0,E=0;E<this.length;E++){var I=this.words[E],C=((I<<S|T)&16777215).toString(16);T=I>>>24-S&16777215,S+=2,S>=26&&(S-=26,E--),T!==0||E!==this.length-1?m=p[6-C.length]+C+m:m=C+m}for(T!==0&&(m=T.toString(16)+m);m.length%f!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(h===(h|0)&&h>=2&&h<=36){var g=y[h],v=x[h];m="";var j=this.clone();for(j.negative=0;!j.isZero();){var Q=j.modrn(v).toString(h);j=j.idivn(v),j.isZero()?m=Q+m:m=p[g-Q.length]+Q+m}for(this.isZero()&&(m="0"+m);m.length%f!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(h,f){return this.toArrayLike(s,h,f)}),o.prototype.toArray=function(h,f){return this.toArrayLike(Array,h,f)};var b=function(h,f){return h.allocUnsafe?h.allocUnsafe(f):new h(f)};o.prototype.toArrayLike=function(h,f,m){this._strip();var S=this.byteLength(),T=m||Math.max(1,S);n(S<=T,"byte array longer than desired length"),n(T>0,"Requested array length <= 0");var E=b(h,T),I=f==="le"?"LE":"BE";return this["_toArrayLike"+I](E,S),E},o.prototype._toArrayLikeLE=function(h,f){for(var m=0,S=0,T=0,E=0;T<this.length;T++){var I=this.words[T]<<E|S;h[m++]=I&255,m<h.length&&(h[m++]=I>>8&255),m<h.length&&(h[m++]=I>>16&255),E===6?(m<h.length&&(h[m++]=I>>24&255),S=0,E=0):(S=I>>>24,E+=2)}if(m<h.length)for(h[m++]=S;m<h.length;)h[m++]=0},o.prototype._toArrayLikeBE=function(h,f){for(var m=h.length-1,S=0,T=0,E=0;T<this.length;T++){var I=this.words[T]<<E|S;h[m--]=I&255,m>=0&&(h[m--]=I>>8&255),m>=0&&(h[m--]=I>>16&255),E===6?(m>=0&&(h[m--]=I>>24&255),S=0,E=0):(S=I>>>24,E+=2)}if(m>=0)for(h[m--]=S;m>=0;)h[m--]=0},Math.clz32?o.prototype._countBits=function(h){return 32-Math.clz32(h)}:o.prototype._countBits=function(h){var f=h,m=0;return f>=4096&&(m+=13,f>>>=13),f>=64&&(m+=7,f>>>=7),f>=8&&(m+=4,f>>>=4),f>=2&&(m+=2,f>>>=2),m+f},o.prototype._zeroBits=function(h){if(h===0)return 26;var f=h,m=0;return f&8191||(m+=13,f>>>=13),f&127||(m+=7,f>>>=7),f&15||(m+=4,f>>>=4),f&3||(m+=2,f>>>=2),f&1||m++,m},o.prototype.bitLength=function(){var h=this.words[this.length-1],f=this._countBits(h);return(this.length-1)*26+f};function M(L){for(var h=new Array(L.bitLength()),f=0;f<h.length;f++){var m=f/26|0,S=f%26;h[f]=L.words[m]>>>S&1}return h}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,f=0;f<this.length;f++){var m=this._zeroBits(this.words[f]);if(h+=m,m!==26)break}return h},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},o.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var f=0;f<h.length;f++)this.words[f]=this.words[f]|h.words[f];return this._strip()},o.prototype.ior=function(h){return n((this.negative|h.negative)===0),this.iuor(h)},o.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},o.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},o.prototype.iuand=function(h){var f;this.length>h.length?f=h:f=this;for(var m=0;m<f.length;m++)this.words[m]=this.words[m]&h.words[m];return this.length=f.length,this._strip()},o.prototype.iand=function(h){return n((this.negative|h.negative)===0),this.iuand(h)},o.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},o.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},o.prototype.iuxor=function(h){var f,m;this.length>h.length?(f=this,m=h):(f=h,m=this);for(var S=0;S<m.length;S++)this.words[S]=f.words[S]^m.words[S];if(this!==f)for(;S<f.length;S++)this.words[S]=f.words[S];return this.length=f.length,this._strip()},o.prototype.ixor=function(h){return n((this.negative|h.negative)===0),this.iuxor(h)},o.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},o.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},o.prototype.inotn=function(h){n(typeof h=="number"&&h>=0);var f=Math.ceil(h/26)|0,m=h%26;this._expand(f),m>0&&f--;for(var S=0;S<f;S++)this.words[S]=~this.words[S]&67108863;return m>0&&(this.words[S]=~this.words[S]&67108863>>26-m),this._strip()},o.prototype.notn=function(h){return this.clone().inotn(h)},o.prototype.setn=function(h,f){n(typeof h=="number"&&h>=0);var m=h/26|0,S=h%26;return this._expand(m+1),f?this.words[m]=this.words[m]|1<<S:this.words[m]=this.words[m]&~(1<<S),this._strip()},o.prototype.iadd=function(h){var f;if(this.negative!==0&&h.negative===0)return this.negative=0,f=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,f=this.isub(h),h.negative=1,f._normSign();var m,S;this.length>h.length?(m=this,S=h):(m=h,S=this);for(var T=0,E=0;E<S.length;E++)f=(m.words[E]|0)+(S.words[E]|0)+T,this.words[E]=f&67108863,T=f>>>26;for(;T!==0&&E<m.length;E++)f=(m.words[E]|0)+T,this.words[E]=f&67108863,T=f>>>26;if(this.length=m.length,T!==0)this.words[this.length]=T,this.length++;else if(m!==this)for(;E<m.length;E++)this.words[E]=m.words[E];return this},o.prototype.add=function(h){var f;return h.negative!==0&&this.negative===0?(h.negative=0,f=this.sub(h),h.negative^=1,f):h.negative===0&&this.negative!==0?(this.negative=0,f=h.sub(this),this.negative=1,f):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},o.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var f=this.iadd(h);return h.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var m=this.cmp(h);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var S,T;m>0?(S=this,T=h):(S=h,T=this);for(var E=0,I=0;I<T.length;I++)f=(S.words[I]|0)-(T.words[I]|0)+E,E=f>>26,this.words[I]=f&67108863;for(;E!==0&&I<S.length;I++)f=(S.words[I]|0)+E,E=f>>26,this.words[I]=f&67108863;if(E===0&&I<S.length&&S!==this)for(;I<S.length;I++)this.words[I]=S.words[I];return this.length=Math.max(this.length,I),S!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(h){return this.clone().isub(h)};function R(L,h,f){f.negative=h.negative^L.negative;var m=L.length+h.length|0;f.length=m,m=m-1|0;var S=L.words[0]|0,T=h.words[0]|0,E=S*T,I=E&67108863,C=E/67108864|0;f.words[0]=I;for(var g=1;g<m;g++){for(var v=C>>>26,j=C&67108863,Q=Math.min(g,h.length-1),Z=Math.max(0,g-L.length+1);Z<=Q;Z++){var ce=g-Z|0;S=L.words[ce]|0,T=h.words[Z]|0,E=S*T+j,v+=E/67108864|0,j=E&67108863}f.words[g]=j|0,C=v|0}return C!==0?f.words[g]=C|0:f.length--,f._strip()}var P=function(h,f,m){var S=h.words,T=f.words,E=m.words,I=0,C,g,v,j=S[0]|0,Q=j&8191,Z=j>>>13,ce=S[1]|0,be=ce&8191,xe=ce>>>13,pe=S[2]|0,Le=pe&8191,Ae=pe>>>13,Je=S[3]|0,ft=Je&8191,je=Je>>>13,pt=S[4]|0,we=pt&8191,he=pt>>>13,Ce=S[5]|0,Ve=Ce&8191,ke=Ce>>>13,Te=S[6]|0,Me=Te&8191,Ue=Te>>>13,lt=S[7]|0,ut=lt&8191,ze=lt>>>13,kt=S[8]|0,_t=kt&8191,Ke=kt>>>13,Mt=S[9]|0,Ut=Mt&8191,et=Mt>>>13,Et=T[0]|0,It=Et&8191,nt=Et>>>13,jt=T[1]|0,Pt=jt&8191,tt=jt>>>13,wt=T[2]|0,Ct=wt&8191,Ge=wt>>>13,mt=T[3]|0,Nt=mt&8191,it=mt>>>13,xt=T[4]|0,zt=xt&8191,N=xt>>>13,_=T[5]|0,A=_&8191,U=_>>>13,Y=T[6]|0,ee=Y&8191,ne=Y>>>13,De=T[7]|0,Ze=De&8191,Ne=De>>>13,V=T[8]|0,ae=V&8191,fe=V>>>13,Oe=T[9]|0,qe=Oe&8191,Pe=Oe>>>13;m.negative=h.negative^f.negative,m.length=19,C=Math.imul(Q,It),g=Math.imul(Q,nt),g=g+Math.imul(Z,It)|0,v=Math.imul(Z,nt);var Fe=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,C=Math.imul(be,It),g=Math.imul(be,nt),g=g+Math.imul(xe,It)|0,v=Math.imul(xe,nt),C=C+Math.imul(Q,Pt)|0,g=g+Math.imul(Q,tt)|0,g=g+Math.imul(Z,Pt)|0,v=v+Math.imul(Z,tt)|0;var ot=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(ot>>>26)|0,ot&=67108863,C=Math.imul(Le,It),g=Math.imul(Le,nt),g=g+Math.imul(Ae,It)|0,v=Math.imul(Ae,nt),C=C+Math.imul(be,Pt)|0,g=g+Math.imul(be,tt)|0,g=g+Math.imul(xe,Pt)|0,v=v+Math.imul(xe,tt)|0,C=C+Math.imul(Q,Ct)|0,g=g+Math.imul(Q,Ge)|0,g=g+Math.imul(Z,Ct)|0,v=v+Math.imul(Z,Ge)|0;var Jt=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,C=Math.imul(ft,It),g=Math.imul(ft,nt),g=g+Math.imul(je,It)|0,v=Math.imul(je,nt),C=C+Math.imul(Le,Pt)|0,g=g+Math.imul(Le,tt)|0,g=g+Math.imul(Ae,Pt)|0,v=v+Math.imul(Ae,tt)|0,C=C+Math.imul(be,Ct)|0,g=g+Math.imul(be,Ge)|0,g=g+Math.imul(xe,Ct)|0,v=v+Math.imul(xe,Ge)|0,C=C+Math.imul(Q,Nt)|0,g=g+Math.imul(Q,it)|0,g=g+Math.imul(Z,Nt)|0,v=v+Math.imul(Z,it)|0;var Dt=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,C=Math.imul(we,It),g=Math.imul(we,nt),g=g+Math.imul(he,It)|0,v=Math.imul(he,nt),C=C+Math.imul(ft,Pt)|0,g=g+Math.imul(ft,tt)|0,g=g+Math.imul(je,Pt)|0,v=v+Math.imul(je,tt)|0,C=C+Math.imul(Le,Ct)|0,g=g+Math.imul(Le,Ge)|0,g=g+Math.imul(Ae,Ct)|0,v=v+Math.imul(Ae,Ge)|0,C=C+Math.imul(be,Nt)|0,g=g+Math.imul(be,it)|0,g=g+Math.imul(xe,Nt)|0,v=v+Math.imul(xe,it)|0,C=C+Math.imul(Q,zt)|0,g=g+Math.imul(Q,N)|0,g=g+Math.imul(Z,zt)|0,v=v+Math.imul(Z,N)|0;var Ft=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,C=Math.imul(Ve,It),g=Math.imul(Ve,nt),g=g+Math.imul(ke,It)|0,v=Math.imul(ke,nt),C=C+Math.imul(we,Pt)|0,g=g+Math.imul(we,tt)|0,g=g+Math.imul(he,Pt)|0,v=v+Math.imul(he,tt)|0,C=C+Math.imul(ft,Ct)|0,g=g+Math.imul(ft,Ge)|0,g=g+Math.imul(je,Ct)|0,v=v+Math.imul(je,Ge)|0,C=C+Math.imul(Le,Nt)|0,g=g+Math.imul(Le,it)|0,g=g+Math.imul(Ae,Nt)|0,v=v+Math.imul(Ae,it)|0,C=C+Math.imul(be,zt)|0,g=g+Math.imul(be,N)|0,g=g+Math.imul(xe,zt)|0,v=v+Math.imul(xe,N)|0,C=C+Math.imul(Q,A)|0,g=g+Math.imul(Q,U)|0,g=g+Math.imul(Z,A)|0,v=v+Math.imul(Z,U)|0;var or=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(or>>>26)|0,or&=67108863,C=Math.imul(Me,It),g=Math.imul(Me,nt),g=g+Math.imul(Ue,It)|0,v=Math.imul(Ue,nt),C=C+Math.imul(Ve,Pt)|0,g=g+Math.imul(Ve,tt)|0,g=g+Math.imul(ke,Pt)|0,v=v+Math.imul(ke,tt)|0,C=C+Math.imul(we,Ct)|0,g=g+Math.imul(we,Ge)|0,g=g+Math.imul(he,Ct)|0,v=v+Math.imul(he,Ge)|0,C=C+Math.imul(ft,Nt)|0,g=g+Math.imul(ft,it)|0,g=g+Math.imul(je,Nt)|0,v=v+Math.imul(je,it)|0,C=C+Math.imul(Le,zt)|0,g=g+Math.imul(Le,N)|0,g=g+Math.imul(Ae,zt)|0,v=v+Math.imul(Ae,N)|0,C=C+Math.imul(be,A)|0,g=g+Math.imul(be,U)|0,g=g+Math.imul(xe,A)|0,v=v+Math.imul(xe,U)|0,C=C+Math.imul(Q,ee)|0,g=g+Math.imul(Q,ne)|0,g=g+Math.imul(Z,ee)|0,v=v+Math.imul(Z,ne)|0;var _r=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(_r>>>26)|0,_r&=67108863,C=Math.imul(ut,It),g=Math.imul(ut,nt),g=g+Math.imul(ze,It)|0,v=Math.imul(ze,nt),C=C+Math.imul(Me,Pt)|0,g=g+Math.imul(Me,tt)|0,g=g+Math.imul(Ue,Pt)|0,v=v+Math.imul(Ue,tt)|0,C=C+Math.imul(Ve,Ct)|0,g=g+Math.imul(Ve,Ge)|0,g=g+Math.imul(ke,Ct)|0,v=v+Math.imul(ke,Ge)|0,C=C+Math.imul(we,Nt)|0,g=g+Math.imul(we,it)|0,g=g+Math.imul(he,Nt)|0,v=v+Math.imul(he,it)|0,C=C+Math.imul(ft,zt)|0,g=g+Math.imul(ft,N)|0,g=g+Math.imul(je,zt)|0,v=v+Math.imul(je,N)|0,C=C+Math.imul(Le,A)|0,g=g+Math.imul(Le,U)|0,g=g+Math.imul(Ae,A)|0,v=v+Math.imul(Ae,U)|0,C=C+Math.imul(be,ee)|0,g=g+Math.imul(be,ne)|0,g=g+Math.imul(xe,ee)|0,v=v+Math.imul(xe,ne)|0,C=C+Math.imul(Q,Ze)|0,g=g+Math.imul(Q,Ne)|0,g=g+Math.imul(Z,Ze)|0,v=v+Math.imul(Z,Ne)|0;var ur=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(ur>>>26)|0,ur&=67108863,C=Math.imul(_t,It),g=Math.imul(_t,nt),g=g+Math.imul(Ke,It)|0,v=Math.imul(Ke,nt),C=C+Math.imul(ut,Pt)|0,g=g+Math.imul(ut,tt)|0,g=g+Math.imul(ze,Pt)|0,v=v+Math.imul(ze,tt)|0,C=C+Math.imul(Me,Ct)|0,g=g+Math.imul(Me,Ge)|0,g=g+Math.imul(Ue,Ct)|0,v=v+Math.imul(Ue,Ge)|0,C=C+Math.imul(Ve,Nt)|0,g=g+Math.imul(Ve,it)|0,g=g+Math.imul(ke,Nt)|0,v=v+Math.imul(ke,it)|0,C=C+Math.imul(we,zt)|0,g=g+Math.imul(we,N)|0,g=g+Math.imul(he,zt)|0,v=v+Math.imul(he,N)|0,C=C+Math.imul(ft,A)|0,g=g+Math.imul(ft,U)|0,g=g+Math.imul(je,A)|0,v=v+Math.imul(je,U)|0,C=C+Math.imul(Le,ee)|0,g=g+Math.imul(Le,ne)|0,g=g+Math.imul(Ae,ee)|0,v=v+Math.imul(Ae,ne)|0,C=C+Math.imul(be,Ze)|0,g=g+Math.imul(be,Ne)|0,g=g+Math.imul(xe,Ze)|0,v=v+Math.imul(xe,Ne)|0,C=C+Math.imul(Q,ae)|0,g=g+Math.imul(Q,fe)|0,g=g+Math.imul(Z,ae)|0,v=v+Math.imul(Z,fe)|0;var Zt=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,C=Math.imul(Ut,It),g=Math.imul(Ut,nt),g=g+Math.imul(et,It)|0,v=Math.imul(et,nt),C=C+Math.imul(_t,Pt)|0,g=g+Math.imul(_t,tt)|0,g=g+Math.imul(Ke,Pt)|0,v=v+Math.imul(Ke,tt)|0,C=C+Math.imul(ut,Ct)|0,g=g+Math.imul(ut,Ge)|0,g=g+Math.imul(ze,Ct)|0,v=v+Math.imul(ze,Ge)|0,C=C+Math.imul(Me,Nt)|0,g=g+Math.imul(Me,it)|0,g=g+Math.imul(Ue,Nt)|0,v=v+Math.imul(Ue,it)|0,C=C+Math.imul(Ve,zt)|0,g=g+Math.imul(Ve,N)|0,g=g+Math.imul(ke,zt)|0,v=v+Math.imul(ke,N)|0,C=C+Math.imul(we,A)|0,g=g+Math.imul(we,U)|0,g=g+Math.imul(he,A)|0,v=v+Math.imul(he,U)|0,C=C+Math.imul(ft,ee)|0,g=g+Math.imul(ft,ne)|0,g=g+Math.imul(je,ee)|0,v=v+Math.imul(je,ne)|0,C=C+Math.imul(Le,Ze)|0,g=g+Math.imul(Le,Ne)|0,g=g+Math.imul(Ae,Ze)|0,v=v+Math.imul(Ae,Ne)|0,C=C+Math.imul(be,ae)|0,g=g+Math.imul(be,fe)|0,g=g+Math.imul(xe,ae)|0,v=v+Math.imul(xe,fe)|0,C=C+Math.imul(Q,qe)|0,g=g+Math.imul(Q,Pe)|0,g=g+Math.imul(Z,qe)|0,v=v+Math.imul(Z,Pe)|0;var wr=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(wr>>>26)|0,wr&=67108863,C=Math.imul(Ut,Pt),g=Math.imul(Ut,tt),g=g+Math.imul(et,Pt)|0,v=Math.imul(et,tt),C=C+Math.imul(_t,Ct)|0,g=g+Math.imul(_t,Ge)|0,g=g+Math.imul(Ke,Ct)|0,v=v+Math.imul(Ke,Ge)|0,C=C+Math.imul(ut,Nt)|0,g=g+Math.imul(ut,it)|0,g=g+Math.imul(ze,Nt)|0,v=v+Math.imul(ze,it)|0,C=C+Math.imul(Me,zt)|0,g=g+Math.imul(Me,N)|0,g=g+Math.imul(Ue,zt)|0,v=v+Math.imul(Ue,N)|0,C=C+Math.imul(Ve,A)|0,g=g+Math.imul(Ve,U)|0,g=g+Math.imul(ke,A)|0,v=v+Math.imul(ke,U)|0,C=C+Math.imul(we,ee)|0,g=g+Math.imul(we,ne)|0,g=g+Math.imul(he,ee)|0,v=v+Math.imul(he,ne)|0,C=C+Math.imul(ft,Ze)|0,g=g+Math.imul(ft,Ne)|0,g=g+Math.imul(je,Ze)|0,v=v+Math.imul(je,Ne)|0,C=C+Math.imul(Le,ae)|0,g=g+Math.imul(Le,fe)|0,g=g+Math.imul(Ae,ae)|0,v=v+Math.imul(Ae,fe)|0,C=C+Math.imul(be,qe)|0,g=g+Math.imul(be,Pe)|0,g=g+Math.imul(xe,qe)|0,v=v+Math.imul(xe,Pe)|0;var bn=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(bn>>>26)|0,bn&=67108863,C=Math.imul(Ut,Ct),g=Math.imul(Ut,Ge),g=g+Math.imul(et,Ct)|0,v=Math.imul(et,Ge),C=C+Math.imul(_t,Nt)|0,g=g+Math.imul(_t,it)|0,g=g+Math.imul(Ke,Nt)|0,v=v+Math.imul(Ke,it)|0,C=C+Math.imul(ut,zt)|0,g=g+Math.imul(ut,N)|0,g=g+Math.imul(ze,zt)|0,v=v+Math.imul(ze,N)|0,C=C+Math.imul(Me,A)|0,g=g+Math.imul(Me,U)|0,g=g+Math.imul(Ue,A)|0,v=v+Math.imul(Ue,U)|0,C=C+Math.imul(Ve,ee)|0,g=g+Math.imul(Ve,ne)|0,g=g+Math.imul(ke,ee)|0,v=v+Math.imul(ke,ne)|0,C=C+Math.imul(we,Ze)|0,g=g+Math.imul(we,Ne)|0,g=g+Math.imul(he,Ze)|0,v=v+Math.imul(he,Ne)|0,C=C+Math.imul(ft,ae)|0,g=g+Math.imul(ft,fe)|0,g=g+Math.imul(je,ae)|0,v=v+Math.imul(je,fe)|0,C=C+Math.imul(Le,qe)|0,g=g+Math.imul(Le,Pe)|0,g=g+Math.imul(Ae,qe)|0,v=v+Math.imul(Ae,Pe)|0;var $r=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+($r>>>26)|0,$r&=67108863,C=Math.imul(Ut,Nt),g=Math.imul(Ut,it),g=g+Math.imul(et,Nt)|0,v=Math.imul(et,it),C=C+Math.imul(_t,zt)|0,g=g+Math.imul(_t,N)|0,g=g+Math.imul(Ke,zt)|0,v=v+Math.imul(Ke,N)|0,C=C+Math.imul(ut,A)|0,g=g+Math.imul(ut,U)|0,g=g+Math.imul(ze,A)|0,v=v+Math.imul(ze,U)|0,C=C+Math.imul(Me,ee)|0,g=g+Math.imul(Me,ne)|0,g=g+Math.imul(Ue,ee)|0,v=v+Math.imul(Ue,ne)|0,C=C+Math.imul(Ve,Ze)|0,g=g+Math.imul(Ve,Ne)|0,g=g+Math.imul(ke,Ze)|0,v=v+Math.imul(ke,Ne)|0,C=C+Math.imul(we,ae)|0,g=g+Math.imul(we,fe)|0,g=g+Math.imul(he,ae)|0,v=v+Math.imul(he,fe)|0,C=C+Math.imul(ft,qe)|0,g=g+Math.imul(ft,Pe)|0,g=g+Math.imul(je,qe)|0,v=v+Math.imul(je,Pe)|0;var yn=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(yn>>>26)|0,yn&=67108863,C=Math.imul(Ut,zt),g=Math.imul(Ut,N),g=g+Math.imul(et,zt)|0,v=Math.imul(et,N),C=C+Math.imul(_t,A)|0,g=g+Math.imul(_t,U)|0,g=g+Math.imul(Ke,A)|0,v=v+Math.imul(Ke,U)|0,C=C+Math.imul(ut,ee)|0,g=g+Math.imul(ut,ne)|0,g=g+Math.imul(ze,ee)|0,v=v+Math.imul(ze,ne)|0,C=C+Math.imul(Me,Ze)|0,g=g+Math.imul(Me,Ne)|0,g=g+Math.imul(Ue,Ze)|0,v=v+Math.imul(Ue,Ne)|0,C=C+Math.imul(Ve,ae)|0,g=g+Math.imul(Ve,fe)|0,g=g+Math.imul(ke,ae)|0,v=v+Math.imul(ke,fe)|0,C=C+Math.imul(we,qe)|0,g=g+Math.imul(we,Pe)|0,g=g+Math.imul(he,qe)|0,v=v+Math.imul(he,Pe)|0;var ii=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(ii>>>26)|0,ii&=67108863,C=Math.imul(Ut,A),g=Math.imul(Ut,U),g=g+Math.imul(et,A)|0,v=Math.imul(et,U),C=C+Math.imul(_t,ee)|0,g=g+Math.imul(_t,ne)|0,g=g+Math.imul(Ke,ee)|0,v=v+Math.imul(Ke,ne)|0,C=C+Math.imul(ut,Ze)|0,g=g+Math.imul(ut,Ne)|0,g=g+Math.imul(ze,Ze)|0,v=v+Math.imul(ze,Ne)|0,C=C+Math.imul(Me,ae)|0,g=g+Math.imul(Me,fe)|0,g=g+Math.imul(Ue,ae)|0,v=v+Math.imul(Ue,fe)|0,C=C+Math.imul(Ve,qe)|0,g=g+Math.imul(Ve,Pe)|0,g=g+Math.imul(ke,qe)|0,v=v+Math.imul(ke,Pe)|0;var oi=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(oi>>>26)|0,oi&=67108863,C=Math.imul(Ut,ee),g=Math.imul(Ut,ne),g=g+Math.imul(et,ee)|0,v=Math.imul(et,ne),C=C+Math.imul(_t,Ze)|0,g=g+Math.imul(_t,Ne)|0,g=g+Math.imul(Ke,Ze)|0,v=v+Math.imul(Ke,Ne)|0,C=C+Math.imul(ut,ae)|0,g=g+Math.imul(ut,fe)|0,g=g+Math.imul(ze,ae)|0,v=v+Math.imul(ze,fe)|0,C=C+Math.imul(Me,qe)|0,g=g+Math.imul(Me,Pe)|0,g=g+Math.imul(Ue,qe)|0,v=v+Math.imul(Ue,Pe)|0;var wn=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(wn>>>26)|0,wn&=67108863,C=Math.imul(Ut,Ze),g=Math.imul(Ut,Ne),g=g+Math.imul(et,Ze)|0,v=Math.imul(et,Ne),C=C+Math.imul(_t,ae)|0,g=g+Math.imul(_t,fe)|0,g=g+Math.imul(Ke,ae)|0,v=v+Math.imul(Ke,fe)|0,C=C+Math.imul(ut,qe)|0,g=g+Math.imul(ut,Pe)|0,g=g+Math.imul(ze,qe)|0,v=v+Math.imul(ze,Pe)|0;var si=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(si>>>26)|0,si&=67108863,C=Math.imul(Ut,ae),g=Math.imul(Ut,fe),g=g+Math.imul(et,ae)|0,v=Math.imul(et,fe),C=C+Math.imul(_t,qe)|0,g=g+Math.imul(_t,Pe)|0,g=g+Math.imul(Ke,qe)|0,v=v+Math.imul(Ke,Pe)|0;var ai=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(ai>>>26)|0,ai&=67108863,C=Math.imul(Ut,qe),g=Math.imul(Ut,Pe),g=g+Math.imul(et,qe)|0,v=Math.imul(et,Pe);var D=(I+C|0)+((g&8191)<<13)|0;return I=(v+(g>>>13)|0)+(D>>>26)|0,D&=67108863,E[0]=Fe,E[1]=ot,E[2]=Jt,E[3]=Dt,E[4]=Ft,E[5]=or,E[6]=_r,E[7]=ur,E[8]=Zt,E[9]=wr,E[10]=bn,E[11]=$r,E[12]=yn,E[13]=ii,E[14]=oi,E[15]=wn,E[16]=si,E[17]=ai,E[18]=D,I!==0&&(E[19]=I,m.length++),m};Math.imul||(P=R);function k(L,h,f){f.negative=h.negative^L.negative,f.length=L.length+h.length;for(var m=0,S=0,T=0;T<f.length-1;T++){var E=S;S=0;for(var I=m&67108863,C=Math.min(T,h.length-1),g=Math.max(0,T-L.length+1);g<=C;g++){var v=T-g,j=L.words[v]|0,Q=h.words[g]|0,Z=j*Q,ce=Z&67108863;E=E+(Z/67108864|0)|0,ce=ce+I|0,I=ce&67108863,E=E+(ce>>>26)|0,S+=E>>>26,E&=67108863}f.words[T]=I,m=E,E=S}return m!==0?f.words[T]=m:f.length--,f._strip()}function F(L,h,f){return k(L,h,f)}o.prototype.mulTo=function(h,f){var m,S=this.length+h.length;return this.length===10&&h.length===10?m=P(this,h,f):S<63?m=R(this,h,f):S<1024?m=k(this,h,f):m=F(this,h,f),m},o.prototype.mul=function(h){var f=new o(null);return f.words=new Array(this.length+h.length),this.mulTo(h,f)},o.prototype.mulf=function(h){var f=new o(null);return f.words=new Array(this.length+h.length),F(this,h,f)},o.prototype.imul=function(h){return this.clone().mulTo(h,this)},o.prototype.imuln=function(h){var f=h<0;f&&(h=-h),n(typeof h=="number"),n(h<67108864);for(var m=0,S=0;S<this.length;S++){var T=(this.words[S]|0)*h,E=(T&67108863)+(m&67108863);m>>=26,m+=T/67108864|0,m+=E>>>26,this.words[S]=E&67108863}return m!==0&&(this.words[S]=m,this.length++),f?this.ineg():this},o.prototype.muln=function(h){return this.clone().imuln(h)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(h){var f=M(h);if(f.length===0)return new o(1);for(var m=this,S=0;S<f.length&&f[S]===0;S++,m=m.sqr());if(++S<f.length)for(var T=m.sqr();S<f.length;S++,T=T.sqr())f[S]!==0&&(m=m.mul(T));return m},o.prototype.iushln=function(h){n(typeof h=="number"&&h>=0);var f=h%26,m=(h-f)/26,S=67108863>>>26-f<<26-f,T;if(f!==0){var E=0;for(T=0;T<this.length;T++){var I=this.words[T]&S,C=(this.words[T]|0)-I<<f;this.words[T]=C|E,E=I>>>26-f}E&&(this.words[T]=E,this.length++)}if(m!==0){for(T=this.length-1;T>=0;T--)this.words[T+m]=this.words[T];for(T=0;T<m;T++)this.words[T]=0;this.length+=m}return this._strip()},o.prototype.ishln=function(h){return n(this.negative===0),this.iushln(h)},o.prototype.iushrn=function(h,f,m){n(typeof h=="number"&&h>=0);var S;f?S=(f-f%26)/26:S=0;var T=h%26,E=Math.min((h-T)/26,this.length),I=67108863^67108863>>>T<<T,C=m;if(S-=E,S=Math.max(0,S),C){for(var g=0;g<E;g++)C.words[g]=this.words[g];C.length=E}if(E!==0)if(this.length>E)for(this.length-=E,g=0;g<this.length;g++)this.words[g]=this.words[g+E];else this.words[0]=0,this.length=1;var v=0;for(g=this.length-1;g>=0&&(v!==0||g>=S);g--){var j=this.words[g]|0;this.words[g]=v<<26-T|j>>>T,v=j&I}return C&&v!==0&&(C.words[C.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(h,f,m){return n(this.negative===0),this.iushrn(h,f,m)},o.prototype.shln=function(h){return this.clone().ishln(h)},o.prototype.ushln=function(h){return this.clone().iushln(h)},o.prototype.shrn=function(h){return this.clone().ishrn(h)},o.prototype.ushrn=function(h){return this.clone().iushrn(h)},o.prototype.testn=function(h){n(typeof h=="number"&&h>=0);var f=h%26,m=(h-f)/26,S=1<<f;if(this.length<=m)return!1;var T=this.words[m];return!!(T&S)},o.prototype.imaskn=function(h){n(typeof h=="number"&&h>=0);var f=h%26,m=(h-f)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(f!==0&&m++,this.length=Math.min(m,this.length),f!==0){var S=67108863^67108863>>>f<<f;this.words[this.length-1]&=S}return this._strip()},o.prototype.maskn=function(h){return this.clone().imaskn(h)},o.prototype.iaddn=function(h){return n(typeof h=="number"),n(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<=h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},o.prototype._iaddn=function(h){this.words[0]+=h;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},o.prototype.isubn=function(h){if(n(typeof h=="number"),n(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this._strip()},o.prototype.addn=function(h){return this.clone().iaddn(h)},o.prototype.subn=function(h){return this.clone().isubn(h)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(h,f,m){var S=h.length+m,T;this._expand(S);var E,I=0;for(T=0;T<h.length;T++){E=(this.words[T+m]|0)+I;var C=(h.words[T]|0)*f;E-=C&67108863,I=(E>>26)-(C/67108864|0),this.words[T+m]=E&67108863}for(;T<this.length-m;T++)E=(this.words[T+m]|0)+I,I=E>>26,this.words[T+m]=E&67108863;if(I===0)return this._strip();for(n(I===-1),I=0,T=0;T<this.length;T++)E=-(this.words[T]|0)+I,I=E>>26,this.words[T]=E&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(h,f){var m=this.length-h.length,S=this.clone(),T=h,E=T.words[T.length-1]|0,I=this._countBits(E);m=26-I,m!==0&&(T=T.ushln(m),S.iushln(m),E=T.words[T.length-1]|0);var C=S.length-T.length,g;if(f!=="mod"){g=new o(null),g.length=C+1,g.words=new Array(g.length);for(var v=0;v<g.length;v++)g.words[v]=0}var j=S.clone()._ishlnsubmul(T,1,C);j.negative===0&&(S=j,g&&(g.words[C]=1));for(var Q=C-1;Q>=0;Q--){var Z=(S.words[T.length+Q]|0)*67108864+(S.words[T.length+Q-1]|0);for(Z=Math.min(Z/E|0,67108863),S._ishlnsubmul(T,Z,Q);S.negative!==0;)Z--,S.negative=0,S._ishlnsubmul(T,1,Q),S.isZero()||(S.negative^=1);g&&(g.words[Q]=Z)}return g&&g._strip(),S._strip(),f!=="div"&&m!==0&&S.iushrn(m),{div:g||null,mod:S}},o.prototype.divmod=function(h,f,m){if(n(!h.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var S,T,E;return this.negative!==0&&h.negative===0?(E=this.neg().divmod(h,f),f!=="mod"&&(S=E.div.neg()),f!=="div"&&(T=E.mod.neg(),m&&T.negative!==0&&T.iadd(h)),{div:S,mod:T}):this.negative===0&&h.negative!==0?(E=this.divmod(h.neg(),f),f!=="mod"&&(S=E.div.neg()),{div:S,mod:E.mod}):this.negative&h.negative?(E=this.neg().divmod(h.neg(),f),f!=="div"&&(T=E.mod.neg(),m&&T.negative!==0&&T.isub(h)),{div:E.div,mod:T}):h.length>this.length||this.cmp(h)<0?{div:new o(0),mod:this}:h.length===1?f==="div"?{div:this.divn(h.words[0]),mod:null}:f==="mod"?{div:null,mod:new o(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new o(this.modrn(h.words[0]))}:this._wordDiv(h,f)},o.prototype.div=function(h){return this.divmod(h,"div",!1).div},o.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},o.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},o.prototype.divRound=function(h){var f=this.divmod(h);if(f.mod.isZero())return f.div;var m=f.div.negative!==0?f.mod.isub(h):f.mod,S=h.ushrn(1),T=h.andln(1),E=m.cmp(S);return E<0||T===1&&E===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},o.prototype.modrn=function(h){var f=h<0;f&&(h=-h),n(h<=67108863);for(var m=(1<<26)%h,S=0,T=this.length-1;T>=0;T--)S=(m*S+(this.words[T]|0))%h;return f?-S:S},o.prototype.modn=function(h){return this.modrn(h)},o.prototype.idivn=function(h){var f=h<0;f&&(h=-h),n(h<=67108863);for(var m=0,S=this.length-1;S>=0;S--){var T=(this.words[S]|0)+m*67108864;this.words[S]=T/h|0,m=T%h}return this._strip(),f?this.ineg():this},o.prototype.divn=function(h){return this.clone().idivn(h)},o.prototype.egcd=function(h){n(h.negative===0),n(!h.isZero());var f=this,m=h.clone();f.negative!==0?f=f.umod(h):f=f.clone();for(var S=new o(1),T=new o(0),E=new o(0),I=new o(1),C=0;f.isEven()&&m.isEven();)f.iushrn(1),m.iushrn(1),++C;for(var g=m.clone(),v=f.clone();!f.isZero();){for(var j=0,Q=1;!(f.words[0]&Q)&&j<26;++j,Q<<=1);if(j>0)for(f.iushrn(j);j-- >0;)(S.isOdd()||T.isOdd())&&(S.iadd(g),T.isub(v)),S.iushrn(1),T.iushrn(1);for(var Z=0,ce=1;!(m.words[0]&ce)&&Z<26;++Z,ce<<=1);if(Z>0)for(m.iushrn(Z);Z-- >0;)(E.isOdd()||I.isOdd())&&(E.iadd(g),I.isub(v)),E.iushrn(1),I.iushrn(1);f.cmp(m)>=0?(f.isub(m),S.isub(E),T.isub(I)):(m.isub(f),E.isub(S),I.isub(T))}return{a:E,b:I,gcd:m.iushln(C)}},o.prototype._invmp=function(h){n(h.negative===0),n(!h.isZero());var f=this,m=h.clone();f.negative!==0?f=f.umod(h):f=f.clone();for(var S=new o(1),T=new o(0),E=m.clone();f.cmpn(1)>0&&m.cmpn(1)>0;){for(var I=0,C=1;!(f.words[0]&C)&&I<26;++I,C<<=1);if(I>0)for(f.iushrn(I);I-- >0;)S.isOdd()&&S.iadd(E),S.iushrn(1);for(var g=0,v=1;!(m.words[0]&v)&&g<26;++g,v<<=1);if(g>0)for(m.iushrn(g);g-- >0;)T.isOdd()&&T.iadd(E),T.iushrn(1);f.cmp(m)>=0?(f.isub(m),S.isub(T)):(m.isub(f),T.isub(S))}var j;return f.cmpn(1)===0?j=S:j=T,j.cmpn(0)<0&&j.iadd(h),j},o.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var f=this.clone(),m=h.clone();f.negative=0,m.negative=0;for(var S=0;f.isEven()&&m.isEven();S++)f.iushrn(1),m.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;m.isEven();)m.iushrn(1);var T=f.cmp(m);if(T<0){var E=f;f=m,m=E}else if(T===0||m.cmpn(1)===0)break;f.isub(m)}while(!0);return m.iushln(S)},o.prototype.invm=function(h){return this.egcd(h).a.umod(h)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(h){return this.words[0]&h},o.prototype.bincn=function(h){n(typeof h=="number");var f=h%26,m=(h-f)/26,S=1<<f;if(this.length<=m)return this._expand(m+1),this.words[m]|=S,this;for(var T=S,E=m;T!==0&&E<this.length;E++){var I=this.words[E]|0;I+=T,T=I>>>26,I&=67108863,this.words[E]=I}return T!==0&&(this.words[E]=T,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(h){var f=h<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this._strip();var m;if(this.length>1)m=1;else{f&&(h=-h),n(h<=67108863,"Number is too big");var S=this.words[0]|0;m=S===h?0:S<h?-1:1}return this.negative!==0?-m|0:m},o.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var f=this.ucmp(h);return this.negative!==0?-f|0:f},o.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var f=0,m=this.length-1;m>=0;m--){var S=this.words[m]|0,T=h.words[m]|0;if(S!==T){S<T?f=-1:S>T&&(f=1);break}}return f},o.prototype.gtn=function(h){return this.cmpn(h)===1},o.prototype.gt=function(h){return this.cmp(h)===1},o.prototype.gten=function(h){return this.cmpn(h)>=0},o.prototype.gte=function(h){return this.cmp(h)>=0},o.prototype.ltn=function(h){return this.cmpn(h)===-1},o.prototype.lt=function(h){return this.cmp(h)===-1},o.prototype.lten=function(h){return this.cmpn(h)<=0},o.prototype.lte=function(h){return this.cmp(h)<=0},o.prototype.eqn=function(h){return this.cmpn(h)===0},o.prototype.eq=function(h){return this.cmp(h)===0},o.red=function(h){return new se(h)},o.prototype.toRed=function(h){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(h){return this.red=h,this},o.prototype.forceRed=function(h){return n(!this.red,"Already a number in reduction context"),this._forceRed(h)},o.prototype.redAdd=function(h){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},o.prototype.redIAdd=function(h){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},o.prototype.redSub=function(h){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},o.prototype.redISub=function(h){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},o.prototype.redShl=function(h){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},o.prototype.redMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},o.prototype.redIMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(h){return n(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var B={k256:null,p224:null,p192:null,p25519:null};function W(L,h){this.name=L,this.p=new o(h,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}W.prototype._tmp=function(){var h=new o(null);return h.words=new Array(Math.ceil(this.n/13)),h},W.prototype.ireduce=function(h){var f=h,m;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),m=f.bitLength();while(m>this.n);var S=m<this.n?-1:f.ucmp(this.p);return S===0?(f.words[0]=0,f.length=1):S>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},W.prototype.split=function(h,f){h.iushrn(this.n,0,f)},W.prototype.imulK=function(h){return h.imul(this.k)};function z(){W.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(z,W),z.prototype.split=function(h,f){for(var m=4194303,S=Math.min(h.length,9),T=0;T<S;T++)f.words[T]=h.words[T];if(f.length=S,h.length<=9){h.words[0]=0,h.length=1;return}var E=h.words[9];for(f.words[f.length++]=E&m,T=10;T<h.length;T++){var I=h.words[T]|0;h.words[T-10]=(I&m)<<4|E>>>22,E=I}E>>>=22,h.words[T-10]=E,E===0&&h.length>10?h.length-=10:h.length-=9},z.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var f=0,m=0;m<h.length;m++){var S=h.words[m]|0;f+=S*977,h.words[m]=f&67108863,f=S*64+(f/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function G(){W.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(G,W);function re(){W.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(re,W);function oe(){W.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(oe,W),oe.prototype.imulK=function(h){for(var f=0,m=0;m<h.length;m++){var S=(h.words[m]|0)*19+f,T=S&67108863;S>>>=26,h.words[m]=T,f=S}return f!==0&&(h.words[h.length++]=f),h},o._prime=function(h){if(B[h])return B[h];var f;if(h==="k256")f=new z;else if(h==="p224")f=new G;else if(h==="p192")f=new re;else if(h==="p25519")f=new oe;else throw new Error("Unknown prime "+h);return B[h]=f,f};function se(L){if(typeof L=="string"){var h=o._prime(L);this.m=h.p,this.prime=h}else n(L.gtn(1),"modulus must be greater than 1"),this.m=L,this.prime=null}se.prototype._verify1=function(h){n(h.negative===0,"red works only with positives"),n(h.red,"red works only with red numbers")},se.prototype._verify2=function(h,f){n((h.negative|f.negative)===0,"red works only with positives"),n(h.red&&h.red===f.red,"red works only with red numbers")},se.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(u(h,h.umod(this.m)._forceRed(this)),h)},se.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},se.prototype.add=function(h,f){this._verify2(h,f);var m=h.add(f);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},se.prototype.iadd=function(h,f){this._verify2(h,f);var m=h.iadd(f);return m.cmp(this.m)>=0&&m.isub(this.m),m},se.prototype.sub=function(h,f){this._verify2(h,f);var m=h.sub(f);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},se.prototype.isub=function(h,f){this._verify2(h,f);var m=h.isub(f);return m.cmpn(0)<0&&m.iadd(this.m),m},se.prototype.shl=function(h,f){return this._verify1(h),this.imod(h.ushln(f))},se.prototype.imul=function(h,f){return this._verify2(h,f),this.imod(h.imul(f))},se.prototype.mul=function(h,f){return this._verify2(h,f),this.imod(h.mul(f))},se.prototype.isqr=function(h){return this.imul(h,h.clone())},se.prototype.sqr=function(h){return this.mul(h,h)},se.prototype.sqrt=function(h){if(h.isZero())return h.clone();var f=this.m.andln(3);if(n(f%2===1),f===3){var m=this.m.add(new o(1)).iushrn(2);return this.pow(h,m)}for(var S=this.m.subn(1),T=0;!S.isZero()&&S.andln(1)===0;)T++,S.iushrn(1);n(!S.isZero());var E=new o(1).toRed(this),I=E.redNeg(),C=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new o(2*g*g).toRed(this);this.pow(g,C).cmp(I)!==0;)g.redIAdd(I);for(var v=this.pow(g,S),j=this.pow(h,S.addn(1).iushrn(1)),Q=this.pow(h,S),Z=T;Q.cmp(E)!==0;){for(var ce=Q,be=0;ce.cmp(E)!==0;be++)ce=ce.redSqr();n(be<Z);var xe=this.pow(v,new o(1).iushln(Z-be-1));j=j.redMul(xe),v=xe.redSqr(),Q=Q.redMul(v),Z=be}return j},se.prototype.invm=function(h){var f=h._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},se.prototype.pow=function(h,f){if(f.isZero())return new o(1).toRed(this);if(f.cmpn(1)===0)return h.clone();var m=4,S=new Array(1<<m);S[0]=new o(1).toRed(this),S[1]=h;for(var T=2;T<S.length;T++)S[T]=this.mul(S[T-1],h);var E=S[0],I=0,C=0,g=f.bitLength()%26;for(g===0&&(g=26),T=f.length-1;T>=0;T--){for(var v=f.words[T],j=g-1;j>=0;j--){var Q=v>>j&1;if(E!==S[0]&&(E=this.sqr(E)),Q===0&&I===0){C=0;continue}I<<=1,I|=Q,C++,!(C!==m&&(T!==0||j!==0))&&(E=this.mul(E,S[I]),C=0,I=0)}g=26}return E},se.prototype.convertTo=function(h){var f=h.umod(this.m);return f===h?f.clone():f},se.prototype.convertFrom=function(h){var f=h.clone();return f.red=null,f},o.mont=function(h){return new q(h)};function q(L){se.call(this,L),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(q,se),q.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},q.prototype.convertFrom=function(h){var f=this.imod(h.mul(this.rinv));return f.red=null,f},q.prototype.imul=function(h,f){if(h.isZero()||f.isZero())return h.words[0]=0,h.length=1,h;var m=h.imul(f),S=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=m.isub(S).iushrn(this.shift),E=T;return T.cmp(this.m)>=0?E=T.isub(this.m):T.cmpn(0)<0&&(E=T.iadd(this.m)),E._forceRed(this)},q.prototype.mul=function(h,f){if(h.isZero()||f.isZero())return new o(0)._forceRed(this);var m=h.mul(f),S=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=m.isub(S).iushrn(this.shift),E=T;return T.cmp(this.m)>=0?E=T.isub(this.m):T.cmpn(0)<0&&(E=T.iadd(this.m)),E._forceRed(this)},q.prototype.invm=function(h){var f=this.imod(h._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(e,Tr)})(Td);var s1=Td.exports;const yh=Ta(s1);var T3=Tr&&Tr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fn,"__esModule",{value:!0});fn.parseAccumulatorUpdateData=fn.sliceAccumulatorUpdateData=fn.parseTwapMessage=fn.parsePriceFeedMessage=fn.isAccumulatorUpdateData=void 0;const ln=T3(s1),A3="504e4155",M3=1,I3=0,Cf=20,R3=0,O3=1;function Ad(e){return e.toString("hex").slice(0,8)===A3&&e[4]===M3&&e[5]===I3}fn.isAccumulatorUpdateData=Ad;function P3(e){let t=0;if(e.readUInt8(t)!==R3)throw new Error("Not a price feed message");t+=1;const n=e.subarray(t,t+32);t+=32;const i=new ln.default(e.subarray(t,t+8),"be");t+=8;const o=new ln.default(e.subarray(t,t+8),"be");t+=8;const s=e.readInt32BE(t);t+=4;const a=new ln.default(e.subarray(t,t+8),"be");t+=8;const c=new ln.default(e.subarray(t,t+8),"be");t+=8;const l=new ln.default(e.subarray(t,t+8),"be");t+=8;const u=new ln.default(e.subarray(t,t+8),"be");return t+=8,{feedId:n,price:i,confidence:o,exponent:s,publishTime:a,prevPublishTime:c,emaPrice:l,emaConf:u}}fn.parsePriceFeedMessage=P3;function N3(e){let t=0;if(e.readUInt8(t)!==O3)throw new Error("Not a twap message");t+=1;const n=e.subarray(t,t+32);t+=32;const i=new ln.default(e.subarray(t,t+16),"be");t+=16;const o=new ln.default(e.subarray(t,t+16),"be");t+=16;const s=new ln.default(e.subarray(t,t+8),"be");t+=8;const a=e.readInt32BE(t);t+=4;const c=new ln.default(e.subarray(t,t+8),"be");t+=8;const l=new ln.default(e.subarray(t,t+8),"be");t+=8;const u=new ln.default(e.subarray(t,t+8),"be");return t+=8,{feedId:n,cumulativePrice:i,cumulativeConf:o,numDownSlots:s,exponent:a,publishTime:c,prevPublishTime:l,publishSlot:u}}fn.parseTwapMessage=N3;function k3(e,t,r){if(!Ad(e))throw new Error("Invalid accumulator message");let n=6;const i=e.readUint8(n);n+=1+i,n+=1;const o=e.readUint16BE(n);n+=2,n+=o;const s=n,a=[],c=e.readUInt8(n);n+=1;for(let u=0;u<c;u++){const d=n,p=e.readUint16BE(n);n+=2,n+=p;const y=e.readUInt8(n);n+=1,n+=Cf*y,a.push(e.subarray(d,n))}if(n!==e.length)throw new Error("Didn't reach the end of the message");const l=a.slice(t,r);return Ef.concat([e.subarray(0,s),Ef.from([l.length]),...a.slice(t,r)])}fn.sliceAccumulatorUpdateData=k3;function j3(e){if(!Ad(e))throw new Error("Invalid accumulator message");let t=6;const r=e.readUint8(t);t+=1+r,t+=1;const n=e.readUint16BE(t);t+=2;const i=e.subarray(t,t+n);t+=n;const o=e.readUInt8(t),s=[];t+=1;for(let a=0;a<o;a++){const c=e.readUint16BE(t);t+=2;const l=e.subarray(t,t+c);t+=c;const u=e.readUInt8(t);t+=1;const d=[];for(let p=0;p<u;p++)d.push(Array.from(e.subarray(t,t+Cf))),t+=Cf;s.push({message:l,proof:d})}if(t!==e.length)throw new Error("Didn't reach the end of the message");return{vaa:i,updates:s}}fn.parseAccumulatorUpdateData=j3;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PriceFeed=e.PriceFeedMetadata=e.Price=e.parseTwapMessage=e.parsePriceFeedMessage=e.parseAccumulatorUpdateData=e.sliceAccumulatorUpdateData=e.isAccumulatorUpdateData=void 0;const t=hl;var r=fn;Object.defineProperty(e,"isAccumulatorUpdateData",{enumerable:!0,get:function(){return r.isAccumulatorUpdateData}}),Object.defineProperty(e,"sliceAccumulatorUpdateData",{enumerable:!0,get:function(){return r.sliceAccumulatorUpdateData}}),Object.defineProperty(e,"parseAccumulatorUpdateData",{enumerable:!0,get:function(){return r.parseAccumulatorUpdateData}}),Object.defineProperty(e,"parsePriceFeedMessage",{enumerable:!0,get:function(){return r.parsePriceFeedMessage}}),Object.defineProperty(e,"parseTwapMessage",{enumerable:!0,get:function(){return r.parseTwapMessage}});class n{constructor(a){gt(this,"conf");gt(this,"expo");gt(this,"price");gt(this,"publishTime");this.conf=a.conf,this.expo=a.expo,this.price=a.price,this.publishTime=a.publishTime}getPriceAsNumberUnchecked(){return Number(this.price)*10**this.expo}getConfAsNumberUnchecked(){return Number(this.conf)*10**this.expo}static fromJson(a){const c=t.Convert.toPrice(a);return new n({conf:c.conf,expo:c.expo,price:c.price,publishTime:c.publish_time})}toJson(){const a={conf:this.conf,expo:this.expo,price:this.price,publish_time:this.publishTime};return t.Convert.priceToJson(a)}}e.Price=n;class i{constructor(a){gt(this,"attestationTime");gt(this,"emitterChain");gt(this,"priceServiceReceiveTime");gt(this,"sequenceNumber");gt(this,"slot");gt(this,"prevPublishTime");this.attestationTime=a.attestationTime,this.emitterChain=a.emitterChain,this.priceServiceReceiveTime=a.receiveTime,this.sequenceNumber=a.sequenceNumber,this.slot=a.slot,this.prevPublishTime=a.prevPublishTime}static fromJson(a){if(a===void 0)return;const c=t.Convert.toPriceFeedMetadata(a);return new i({attestationTime:c.attestation_time,emitterChain:c.emitter_chain,receiveTime:c.price_service_receive_time,sequenceNumber:c.sequence_number,slot:c.slot,prevPublishTime:c.prev_publish_time})}toJson(){const a={attestation_time:this.attestationTime,emitter_chain:this.emitterChain,price_service_receive_time:this.priceServiceReceiveTime,sequence_number:this.sequenceNumber,slot:this.slot,prev_publish_time:this.prevPublishTime};return t.Convert.priceFeedMetadataToJson(a)}}e.PriceFeedMetadata=i;let o=class a1{constructor(a){gt(this,"emaPrice");gt(this,"id");gt(this,"metadata");gt(this,"vaa");gt(this,"price");this.emaPrice=a.emaPrice,this.id=a.id,this.metadata=a.metadata,this.vaa=a.vaa,this.price=a.price}static fromJson(a){const c=t.Convert.toPriceFeed(a);return new a1({emaPrice:n.fromJson(c.ema_price),id:c.id,metadata:i.fromJson(c.metadata),vaa:c.vaa,price:n.fromJson(c.price)})}toJson(){var c;const a={ema_price:this.emaPrice.toJson(),id:this.id,metadata:(c=this.metadata)==null?void 0:c.toJson(),price:this.price.toJson()};return t.Convert.priceFeedToJson(a)}getPriceUnchecked(){return this.price}getEmaPriceUnchecked(){return this.emaPrice}getPriceNoOlderThan(a){const c=this.getPriceUnchecked(),l=Math.floor(Date.now()/1e3);if(!(Math.abs(l-c.publishTime)>a))return c}getEmaPriceNoOlderThan(a){const c=this.getEmaPriceUnchecked(),l=Math.floor(Date.now()/1e3);if(!(Math.abs(l-c.publishTime)>a))return c}getMetadata(){return this.metadata}getVAA(){return this.vaa}};e.PriceFeed=o})(Cd);function c1(e,t){return function(){return e.apply(t,arguments)}}const{toString:D3}=Object.prototype,{getPrototypeOf:Md}=Object,pl=(e=>t=>{const r=D3.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Dn=e=>(e=e.toLowerCase(),t=>pl(t)===e),ml=e=>t=>typeof t===e,{isArray:Cs}=Array,da=ml("undefined");function L3(e){return e!==null&&!da(e)&&e.constructor!==null&&!da(e.constructor)&&Qr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const l1=Dn("ArrayBuffer");function B3(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&l1(e.buffer),t}const U3=ml("string"),Qr=ml("function"),u1=ml("number"),gl=e=>e!==null&&typeof e=="object",F3=e=>e===!0||e===!1,fc=e=>{if(pl(e)!=="object")return!1;const t=Md(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},$3=Dn("Date"),V3=Dn("File"),z3=Dn("Blob"),q3=Dn("FileList"),H3=e=>gl(e)&&Qr(e.pipe),W3=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Qr(e.append)&&((t=pl(e))==="formdata"||t==="object"&&Qr(e.toString)&&e.toString()==="[object FormData]"))},G3=Dn("URLSearchParams"),[K3,Y3,X3,J3]=["ReadableStream","Request","Response","Headers"].map(Dn),Z3=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Oa(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Cs(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let a;for(n=0;n<s;n++)a=o[n],t.call(null,e[a],a,e)}}function f1(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const Ao=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Tr)(),d1=e=>!da(e)&&e!==Ao;function Tf(){const{caseless:e}=d1(this)&&this||{},t={},r=(n,i)=>{const o=e&&f1(t,i)||i;fc(t[o])&&fc(n)?t[o]=Tf(t[o],n):fc(n)?t[o]=Tf({},n):Cs(n)?t[o]=n.slice():t[o]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&Oa(arguments[n],r);return t}const Q3=(e,t,r,{allOwnKeys:n}={})=>(Oa(t,(i,o)=>{r&&Qr(i)?e[o]=c1(i,r):e[o]=i},{allOwnKeys:n}),e),ex=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),tx=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},rx=(e,t,r,n)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&Md(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},nx=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},ix=e=>{if(!e)return null;if(Cs(e))return e;let t=e.length;if(!u1(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},ox=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Md(Uint8Array)),sx=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=n.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},ax=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},cx=Dn("HTMLFormElement"),lx=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),wh=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),ux=Dn("RegExp"),h1=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Oa(r,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(n[o]=s||i)}),Object.defineProperties(e,n)},fx=e=>{h1(e,(t,r)=>{if(Qr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Qr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},dx=(e,t)=>{const r={},n=i=>{i.forEach(o=>{r[o]=!0})};return Cs(e)?n(e):n(String(e).split(t)),r},hx=()=>{},px=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function mx(e){return!!(e&&Qr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const gx=e=>{const t=new Array(10),r=(n,i)=>{if(gl(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const o=Cs(n)?[]:{};return Oa(n,(s,a)=>{const c=r(s,i+1);!da(c)&&(o[a]=c)}),t[i]=void 0,o}}return n};return r(e,0)},vx=Dn("AsyncFunction"),bx=e=>e&&(gl(e)||Qr(e))&&Qr(e.then)&&Qr(e.catch),p1=((e,t)=>e?setImmediate:t?((r,n)=>(Ao.addEventListener("message",({source:i,data:o})=>{i===Ao&&o===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Ao.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Qr(Ao.postMessage)),yx=typeof queueMicrotask<"u"?queueMicrotask.bind(Ao):typeof In<"u"&&In.nextTick||p1;var le={isArray:Cs,isArrayBuffer:l1,isBuffer:L3,isFormData:W3,isArrayBufferView:B3,isString:U3,isNumber:u1,isBoolean:F3,isObject:gl,isPlainObject:fc,isReadableStream:K3,isRequest:Y3,isResponse:X3,isHeaders:J3,isUndefined:da,isDate:$3,isFile:V3,isBlob:z3,isRegExp:ux,isFunction:Qr,isStream:H3,isURLSearchParams:G3,isTypedArray:ox,isFileList:q3,forEach:Oa,merge:Tf,extend:Q3,trim:Z3,stripBOM:ex,inherits:tx,toFlatObject:rx,kindOf:pl,kindOfTest:Dn,endsWith:nx,toArray:ix,forEachEntry:sx,matchAll:ax,isHTMLForm:cx,hasOwnProperty:wh,hasOwnProp:wh,reduceDescriptors:h1,freezeMethods:fx,toObjectSet:dx,toCamelCase:lx,noop:hx,toFiniteNumber:px,findKey:f1,global:Ao,isContextDefined:d1,isSpecCompliantForm:mx,toJSONObject:gx,isAsyncFn:vx,isThenable:bx,setImmediate:p1,asap:yx};function ht(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}le.inherits(ht,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:le.toJSONObject(this.config),code:this.code,status:this.status}}});const m1=ht.prototype,g1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{g1[e]={value:e}});Object.defineProperties(ht,g1);Object.defineProperty(m1,"isAxiosError",{value:!0});ht.from=(e,t,r,n,i,o)=>{const s=Object.create(m1);return le.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),ht.call(s,e.message,t,r,n,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};var wx=null;function Af(e){return le.isPlainObject(e)||le.isArray(e)}function v1(e){return le.endsWith(e,"[]")?e.slice(0,-2):e}function xh(e,t,r){return e?e.concat(t).map(function(i,o){return i=v1(i),!r&&o?"["+i+"]":i}).join(r?".":""):t}function xx(e){return le.isArray(e)&&!e.some(Af)}const Sx=le.toFlatObject(le,{},null,function(t){return/^is[A-Z]/.test(t)});function vl(e,t,r){if(!le.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=le.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,M){return!le.isUndefined(M[b])});const n=r.metaTokens,i=r.visitor||u,o=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&le.isSpecCompliantForm(t);if(!le.isFunction(i))throw new TypeError("visitor must be a function");function l(x){if(x===null)return"";if(le.isDate(x))return x.toISOString();if(!c&&le.isBlob(x))throw new ht("Blob is not supported. Use a Buffer instead.");return le.isArrayBuffer(x)||le.isTypedArray(x)?c&&typeof Blob=="function"?new Blob([x]):Ef.from(x):x}function u(x,b,M){let R=x;if(x&&!M&&typeof x=="object"){if(le.endsWith(b,"{}"))b=n?b:b.slice(0,-2),x=JSON.stringify(x);else if(le.isArray(x)&&xx(x)||(le.isFileList(x)||le.endsWith(b,"[]"))&&(R=le.toArray(x)))return b=v1(b),R.forEach(function(k,F){!(le.isUndefined(k)||k===null)&&t.append(s===!0?xh([b],F,o):s===null?b:b+"[]",l(k))}),!1}return Af(x)?!0:(t.append(xh(M,b,o),l(x)),!1)}const d=[],p=Object.assign(Sx,{defaultVisitor:u,convertValue:l,isVisitable:Af});function y(x,b){if(!le.isUndefined(x)){if(d.indexOf(x)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(x),le.forEach(x,function(R,P){(!(le.isUndefined(R)||R===null)&&i.call(t,R,le.isString(P)?P.trim():P,b,p))===!0&&y(R,b?b.concat(P):[P])}),d.pop()}}if(!le.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Sh(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Id(e,t){this._pairs=[],e&&vl(e,this,t)}const b1=Id.prototype;b1.append=function(t,r){this._pairs.push([t,r])};b1.toString=function(t){const r=t?function(n){return t.call(this,n,Sh)}:Sh;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function _x(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function y1(e,t,r){if(!t)return e;const n=r&&r.encode||_x;le.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let o;if(i?o=i(t,r):o=le.isURLSearchParams(t)?t.toString():new Id(t,r).toString(n),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ex{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){le.forEach(this.handlers,function(n){n!==null&&t(n)})}}var _h=Ex,w1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Cx=typeof URLSearchParams<"u"?URLSearchParams:Id,Tx=typeof FormData<"u"?FormData:null,Ax=typeof Blob<"u"?Blob:null,Mx={isBrowser:!0,classes:{URLSearchParams:Cx,FormData:Tx,Blob:Ax},protocols:["http","https","file","blob","url","data"]};const Rd=typeof window<"u"&&typeof document<"u",Mf=typeof navigator=="object"&&navigator||void 0,Ix=Rd&&(!Mf||["ReactNative","NativeScript","NS"].indexOf(Mf.product)<0),Rx=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Ox=Rd&&window.location.href||"http://localhost";var Px=Object.freeze({__proto__:null,hasBrowserEnv:Rd,hasStandardBrowserWebWorkerEnv:Rx,hasStandardBrowserEnv:Ix,navigator:Mf,origin:Ox}),Rr={...Px,...Mx};function Nx(e,t){return vl(e,new Rr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,o){return Rr.isNode&&le.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function kx(e){return le.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function jx(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}function x1(e){function t(r,n,i,o){let s=r[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),c=o>=r.length;return s=!s&&le.isArray(i)?i.length:s,c?(le.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!a):((!i[s]||!le.isObject(i[s]))&&(i[s]=[]),t(r,n,i[s],o)&&le.isArray(i[s])&&(i[s]=jx(i[s])),!a)}if(le.isFormData(e)&&le.isFunction(e.entries)){const r={};return le.forEachEntry(e,(n,i)=>{t(kx(n),i,r,0)}),r}return null}function Dx(e,t,r){if(le.isString(e))try{return(t||JSON.parse)(e),le.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Od={transitional:w1,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,o=le.isObject(t);if(o&&le.isHTMLForm(t)&&(t=new FormData(t)),le.isFormData(t))return i?JSON.stringify(x1(t)):t;if(le.isArrayBuffer(t)||le.isBuffer(t)||le.isStream(t)||le.isFile(t)||le.isBlob(t)||le.isReadableStream(t))return t;if(le.isArrayBufferView(t))return t.buffer;if(le.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Nx(t,this.formSerializer).toString();if((a=le.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return vl(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(r.setContentType("application/json",!1),Dx(t)):t}],transformResponse:[function(t){const r=this.transitional||Od.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(le.isResponse(t)||le.isReadableStream(t))return t;if(t&&le.isString(t)&&(n&&!this.responseType||i)){const s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?ht.from(a,ht.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Rr.classes.FormData,Blob:Rr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};le.forEach(["delete","get","head","post","put","patch"],e=>{Od.headers[e]={}});var Pd=Od;const Lx=le.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var Bx=e=>{const t={};let r,n,i;return e&&e.split(`
|
|
30
|
-
`).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||t[r]&&
|
|
31
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[Eh]=this[Eh]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Vs(s);n[a]||(Vx(i,s),n[a]=!0)}return le.isArray(t)?t.forEach(o):o(t),this}}bl.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);le.reduceDescriptors(bl.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});le.freezeMethods(bl);var Rn=bl;function Su(e,t){const r=this||Pd,n=t||r,i=Rn.from(n.headers);let o=n.data;return le.forEach(e,function(a){o=a.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function S1(e){return!!(e&&e.__CANCEL__)}function Ts(e,t,r){ht.call(this,e??"canceled",ht.ERR_CANCELED,t,r),this.name="CanceledError"}le.inherits(Ts,ht,{__CANCEL__:!0});function _1(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ht("Request failed with status code "+r.status,[ht.ERR_BAD_REQUEST,ht.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function zx(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function qx(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=n[o];s||(s=l),r[i]=c,n[i]=l;let d=o,p=0;for(;d!==i;)p+=r[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),l-s<t)return;const y=u&&l-u;return y?Math.round(p*1e3/y):void 0}}function Hx(e,t){let r=0,n=1e3/t,i,o;const s=(l,u=Date.now())=>{r=u,i=null,o&&(clearTimeout(o),o=null),e.apply(null,l)};return[(...l)=>{const u=Date.now(),d=u-r;d>=n?s(l,u):(i=l,o||(o=setTimeout(()=>{o=null,s(i)},n-d)))},()=>i&&s(i)]}const kc=(e,t,r=3)=>{let n=0;const i=qx(50,250);return Hx(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,c=s-n,l=i(c),u=s<=a;n=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-s)/l:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},r)},Ch=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Th=e=>(...t)=>le.asap(()=>e(...t));var Wx=Rr.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Rr.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Rr.origin),Rr.navigator&&/(msie|trident)/i.test(Rr.navigator.userAgent)):()=>!0,Gx=Rr.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const s=[e+"="+encodeURIComponent(t)];le.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),le.isString(n)&&s.push("path="+n),le.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Kx(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Yx(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function E1(e,t,r){let n=!Kx(t);return e&&(n||r==!1)?Yx(e,t):t}const Ah=e=>e instanceof Rn?{...e}:e;function Oo(e,t){t=t||{};const r={};function n(l,u,d,p){return le.isPlainObject(l)&&le.isPlainObject(u)?le.merge.call({caseless:p},l,u):le.isPlainObject(u)?le.merge({},u):le.isArray(u)?u.slice():u}function i(l,u,d,p){if(le.isUndefined(u)){if(!le.isUndefined(l))return n(void 0,l,d,p)}else return n(l,u,d,p)}function o(l,u){if(!le.isUndefined(u))return n(void 0,u)}function s(l,u){if(le.isUndefined(u)){if(!le.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function a(l,u,d){if(d in t)return n(l,u);if(d in e)return n(void 0,l)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,u,d)=>i(Ah(l),Ah(u),d,!0)};return le.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=c[u]||i,p=d(e[u],t[u],u);le.isUndefined(p)&&d!==a||(r[u]=p)}),r}var C1=e=>{const t=Oo({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=Rn.from(s),t.url=y1(E1(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(le.isFormData(r)){if(Rr.hasStandardBrowserEnv||Rr.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[l,...u]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];s.setContentType([l||"multipart/form-data",...u].join("; "))}}if(Rr.hasStandardBrowserEnv&&(n&&le.isFunction(n)&&(n=n(t)),n||n!==!1&&Wx(t.url))){const l=i&&o&&Gx.read(o);l&&s.set(i,l)}return t};const Xx=typeof XMLHttpRequest<"u";var Jx=Xx&&function(e){return new Promise(function(r,n){const i=C1(e);let o=i.data;const s=Rn.from(i.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=i,u,d,p,y,x;function b(){y&&y(),x&&x(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let M=new XMLHttpRequest;M.open(i.method.toUpperCase(),i.url,!0),M.timeout=i.timeout;function R(){if(!M)return;const k=Rn.from("getAllResponseHeaders"in M&&M.getAllResponseHeaders()),B={data:!a||a==="text"||a==="json"?M.responseText:M.response,status:M.status,statusText:M.statusText,headers:k,config:e,request:M};_1(function(z){r(z),b()},function(z){n(z),b()},B),M=null}"onloadend"in M?M.onloadend=R:M.onreadystatechange=function(){!M||M.readyState!==4||M.status===0&&!(M.responseURL&&M.responseURL.indexOf("file:")===0)||setTimeout(R)},M.onabort=function(){M&&(n(new ht("Request aborted",ht.ECONNABORTED,e,M)),M=null)},M.onerror=function(){n(new ht("Network Error",ht.ERR_NETWORK,e,M)),M=null},M.ontimeout=function(){let F=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const B=i.transitional||w1;i.timeoutErrorMessage&&(F=i.timeoutErrorMessage),n(new ht(F,B.clarifyTimeoutError?ht.ETIMEDOUT:ht.ECONNABORTED,e,M)),M=null},o===void 0&&s.setContentType(null),"setRequestHeader"in M&&le.forEach(s.toJSON(),function(F,B){M.setRequestHeader(B,F)}),le.isUndefined(i.withCredentials)||(M.withCredentials=!!i.withCredentials),a&&a!=="json"&&(M.responseType=i.responseType),l&&([p,x]=kc(l,!0),M.addEventListener("progress",p)),c&&M.upload&&([d,y]=kc(c),M.upload.addEventListener("progress",d),M.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(u=k=>{M&&(n(!k||k.type?new Ts(null,e,M):k),M.abort(),M=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const P=zx(i.url);if(P&&Rr.protocols.indexOf(P)===-1){n(new ht("Unsupported protocol "+P+":",ht.ERR_BAD_REQUEST,e));return}M.send(o||null)})};const Zx=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const o=function(l){if(!i){i=!0,a();const u=l instanceof Error?l:this.reason;n.abort(u instanceof ht?u:new Ts(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,o(new ht(`timeout ${t} of ms exceeded`,ht.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:c}=n;return c.unsubscribe=()=>le.asap(a),c}};var Qx=Zx;const e5=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},t5=async function*(e,t){for await(const r of r5(e))yield*e5(r,t)},r5=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Mh=(e,t,r,n)=>{const i=t5(e,t);let o=0,s,a=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await i.next();if(l){a(),c.close();return}let d=u.byteLength;if(r){let p=o+=d;r(p)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),i.return()}},{highWaterMark:2})},yl=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",T1=yl&&typeof ReadableStream=="function",n5=yl&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),A1=(e,...t)=>{try{return!!e(...t)}catch{return!1}},i5=T1&&A1(()=>{let e=!1;const t=new Request(Rr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Ih=64*1024,If=T1&&A1(()=>le.isReadableStream(new Response("").body)),jc={stream:If&&(e=>e.body)};yl&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!jc[t]&&(jc[t]=le.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new ht(`Response type '${t}' is not supported`,ht.ERR_NOT_SUPPORT,n)})})})(new Response);const o5=async e=>{if(e==null)return 0;if(le.isBlob(e))return e.size;if(le.isSpecCompliantForm(e))return(await new Request(Rr.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(le.isArrayBufferView(e)||le.isArrayBuffer(e))return e.byteLength;if(le.isURLSearchParams(e)&&(e=e+""),le.isString(e))return(await n5(e)).byteLength},s5=async(e,t)=>{const r=le.toFiniteNumber(e.getContentLength());return r??o5(t)};var a5=yl&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:p}=C1(e);l=l?(l+"").toLowerCase():"text";let y=Qx([i,o&&o.toAbortSignal()],s),x;const b=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let M;try{if(c&&i5&&r!=="get"&&r!=="head"&&(M=await s5(u,n))!==0){let B=new Request(t,{method:"POST",body:n,duplex:"half"}),W;if(le.isFormData(n)&&(W=B.headers.get("content-type"))&&u.setContentType(W),B.body){const[z,G]=Ch(M,kc(Th(c)));n=Mh(B.body,Ih,z,G)}}le.isString(d)||(d=d?"include":"omit");const R="credentials"in Request.prototype;x=new Request(t,{...p,signal:y,method:r.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",credentials:R?d:void 0});let P=await fetch(x);const k=If&&(l==="stream"||l==="response");if(If&&(a||k&&b)){const B={};["status","statusText","headers"].forEach(re=>{B[re]=P[re]});const W=le.toFiniteNumber(P.headers.get("content-length")),[z,G]=a&&Ch(W,kc(Th(a),!0))||[];P=new Response(Mh(P.body,Ih,z,()=>{G&&G(),b&&b()}),B)}l=l||"text";let F=await jc[le.findKey(jc,l)||"text"](P,e);return!k&&b&&b(),await new Promise((B,W)=>{_1(B,W,{data:F,headers:Rn.from(P.headers),status:P.status,statusText:P.statusText,config:e,request:x})})}catch(R){throw b&&b(),R&&R.name==="TypeError"&&/fetch/i.test(R.message)?Object.assign(new ht("Network Error",ht.ERR_NETWORK,e,x),{cause:R.cause||R}):ht.from(R,R&&R.code,e,x)}});const Rf={http:wx,xhr:Jx,fetch:a5};le.forEach(Rf,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Rh=e=>`- ${e}`,c5=e=>le.isFunction(e)||e===null||e===!1;var M1={getAdapter:e=>{e=le.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o<t;o++){r=e[o];let s;if(n=r,!c5(r)&&(n=Rf[(s=String(r)).toLowerCase()],n===void 0))throw new ht(`Unknown adapter '${s}'`);if(n)break;i[s||"#"+o]=n}if(!n){const o=Object.entries(i).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since :
|
|
32
|
-
`+o.map(
|
|
33
|
-
`):" "+
|
|
34
|
-
`+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Oo(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&hc.assertOptions(n,{silentJSONParsing:Bn.transitional(Bn.boolean),forcedJSONParsing:Bn.transitional(Bn.boolean),clarifyTimeoutError:Bn.transitional(Bn.boolean)},!1),i!=null&&(le.isFunction(i)?r.paramsSerializer={serialize:i}:hc.assertOptions(i,{encode:Bn.function,serialize:Bn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),hc.assertOptions(r,{baseUrl:Bn.spelling("baseURL"),withXsrfToken:Bn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=o&&le.merge(o.common,o[r.method]);o&&le.forEach(["delete","get","head","post","put","patch","common"],x=>{delete o[x]}),r.headers=Rn.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(c=c&&b.synchronous,a.unshift(b.fulfilled,b.rejected))});const l=[];this.interceptors.response.forEach(function(b){l.push(b.fulfilled,b.rejected)});let u,d=0,p;if(!c){const x=[Oh.bind(this),void 0];for(x.unshift.apply(x,a),x.push.apply(x,l),p=x.length,u=Promise.resolve(r);d<p;)u=u.then(x[d++],x[d++]);return u}p=a.length;let y=r;for(d=0;d<p;){const x=a[d++],b=a[d++];try{y=x(y)}catch(M){b.call(this,M);break}}try{u=Oh.call(this,y)}catch(x){return Promise.reject(x)}for(d=0,p=l.length;d<p;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Oo(this.defaults,t);const r=E1(t.baseURL,t.url,t.allowAbsoluteUrls);return y1(r,t.params,t.paramsSerializer)}}le.forEach(["delete","get","head","options"],function(t){Dc.prototype[t]=function(r,n){return this.request(Oo(n||{},{method:t,url:r,data:(n||{}).data}))}});le.forEach(["post","put","patch"],function(t){function r(n){return function(o,s,a){return this.request(Oo(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}Dc.prototype[t]=r(),Dc.prototype[t+"Form"]=r(!0)});var pc=Dc;class Nd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{n.subscribe(a),o=a}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},t(function(o,s,a){n.reason||(n.reason=new Ts(o,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Nd(function(i){t=i}),cancel:t}}}var u5=Nd;function f5(e){return function(r){return e.apply(null,r)}}function d5(e){return le.isObject(e)&&e.isAxiosError===!0}const Of={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Of).forEach(([e,t])=>{Of[t]=e});var h5=Of;function R1(e){const t=new pc(e),r=c1(pc.prototype.request,t);return le.extend(r,pc.prototype,t,{allOwnKeys:!0}),le.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return R1(Oo(e,i))},r}const pr=R1(Pd);pr.Axios=pc;pr.CanceledError=Ts;pr.CancelToken=u5;pr.isCancel=S1;pr.VERSION=I1;pr.toFormData=vl;pr.AxiosError=ht;pr.Cancel=pr.CanceledError;pr.all=function(t){return Promise.all(t)};pr.spread=f5;pr.isAxiosError=d5;pr.mergeConfig=Oo;pr.AxiosHeaders=Rn;pr.formToJSON=e=>x1(le.isHTMLForm(e)?new FormData(e):e);pr.getAdapter=M1.getAdapter;pr.HttpStatusCode=h5;pr.default=pr;var O1=pr,kd={exports:{}},rn={},P1={exports:{}};(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(P1);var p5=P1.exports,Eu={exports:{}},Cu={exports:{}},Nh;function xl(){return Nh||(Nh=1,function(e){function t(r){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Cu)),Cu.exports}var kh;function m5(){return kh||(kh=1,function(e){var t=xl().default;function r(){e.exports=r=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var n,i={},o=Object.prototype,s=o.hasOwnProperty,a=Object.defineProperty||function(E,I,C){E[I]=C.value},c=typeof Symbol=="function"?Symbol:{},l=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",d=c.toStringTag||"@@toStringTag";function p(E,I,C){return Object.defineProperty(E,I,{value:C,enumerable:!0,configurable:!0,writable:!0}),E[I]}try{p({},"")}catch{p=function(C,g,v){return C[g]=v}}function y(E,I,C,g){var v=I&&I.prototype instanceof F?I:F,j=Object.create(v.prototype),Q=new S(g||[]);return a(j,"_invoke",{value:L(E,C,Q)}),j}function x(E,I,C){try{return{type:"normal",arg:E.call(I,C)}}catch(g){return{type:"throw",arg:g}}}i.wrap=y;var b="suspendedStart",M="suspendedYield",R="executing",P="completed",k={};function F(){}function B(){}function W(){}var z={};p(z,l,function(){return this});var G=Object.getPrototypeOf,re=G&&G(G(T([])));re&&re!==o&&s.call(re,l)&&(z=re);var oe=W.prototype=F.prototype=Object.create(z);function se(E){["next","throw","return"].forEach(function(I){p(E,I,function(C){return this._invoke(I,C)})})}function q(E,I){function C(v,j,Q,Z){var ce=x(E[v],E,j);if(ce.type!=="throw"){var be=ce.arg,xe=be.value;return xe&&t(xe)=="object"&&s.call(xe,"__await")?I.resolve(xe.__await).then(function(pe){C("next",pe,Q,Z)},function(pe){C("throw",pe,Q,Z)}):I.resolve(xe).then(function(pe){be.value=pe,Q(be)},function(pe){return C("throw",pe,Q,Z)})}Z(ce.arg)}var g;a(this,"_invoke",{value:function(j,Q){function Z(){return new I(function(ce,be){C(j,Q,ce,be)})}return g=g?g.then(Z,Z):Z()}})}function L(E,I,C){var g=b;return function(v,j){if(g===R)throw Error("Generator is already running");if(g===P){if(v==="throw")throw j;return{value:n,done:!0}}for(C.method=v,C.arg=j;;){var Q=C.delegate;if(Q){var Z=h(Q,C);if(Z){if(Z===k)continue;return Z}}if(C.method==="next")C.sent=C._sent=C.arg;else if(C.method==="throw"){if(g===b)throw g=P,C.arg;C.dispatchException(C.arg)}else C.method==="return"&&C.abrupt("return",C.arg);g=R;var ce=x(E,I,C);if(ce.type==="normal"){if(g=C.done?P:M,ce.arg===k)continue;return{value:ce.arg,done:C.done}}ce.type==="throw"&&(g=P,C.method="throw",C.arg=ce.arg)}}}function h(E,I){var C=I.method,g=E.iterator[C];if(g===n)return I.delegate=null,C==="throw"&&E.iterator.return&&(I.method="return",I.arg=n,h(E,I),I.method==="throw")||C!=="return"&&(I.method="throw",I.arg=new TypeError("The iterator does not provide a '"+C+"' method")),k;var v=x(g,E.iterator,I.arg);if(v.type==="throw")return I.method="throw",I.arg=v.arg,I.delegate=null,k;var j=v.arg;return j?j.done?(I[E.resultName]=j.value,I.next=E.nextLoc,I.method!=="return"&&(I.method="next",I.arg=n),I.delegate=null,k):j:(I.method="throw",I.arg=new TypeError("iterator result is not an object"),I.delegate=null,k)}function f(E){var I={tryLoc:E[0]};1 in E&&(I.catchLoc=E[1]),2 in E&&(I.finallyLoc=E[2],I.afterLoc=E[3]),this.tryEntries.push(I)}function m(E){var I=E.completion||{};I.type="normal",delete I.arg,E.completion=I}function S(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(f,this),this.reset(!0)}function T(E){if(E||E===""){var I=E[l];if(I)return I.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var C=-1,g=function v(){for(;++C<E.length;)if(s.call(E,C))return v.value=E[C],v.done=!1,v;return v.value=n,v.done=!0,v};return g.next=g}}throw new TypeError(t(E)+" is not iterable")}return B.prototype=W,a(oe,"constructor",{value:W,configurable:!0}),a(W,"constructor",{value:B,configurable:!0}),B.displayName=p(W,d,"GeneratorFunction"),i.isGeneratorFunction=function(E){var I=typeof E=="function"&&E.constructor;return!!I&&(I===B||(I.displayName||I.name)==="GeneratorFunction")},i.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,W):(E.__proto__=W,p(E,d,"GeneratorFunction")),E.prototype=Object.create(oe),E},i.awrap=function(E){return{__await:E}},se(q.prototype),p(q.prototype,u,function(){return this}),i.AsyncIterator=q,i.async=function(E,I,C,g,v){v===void 0&&(v=Promise);var j=new q(y(E,I,C,g),v);return i.isGeneratorFunction(I)?j:j.next().then(function(Q){return Q.done?Q.value:j.next()})},se(oe),p(oe,d,"Generator"),p(oe,l,function(){return this}),p(oe,"toString",function(){return"[object Generator]"}),i.keys=function(E){var I=Object(E),C=[];for(var g in I)C.push(g);return C.reverse(),function v(){for(;C.length;){var j=C.pop();if(j in I)return v.value=j,v.done=!1,v}return v.done=!0,v}},i.values=T,S.prototype={constructor:S,reset:function(I){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(m),!I)for(var C in this)C.charAt(0)==="t"&&s.call(this,C)&&!isNaN(+C.slice(1))&&(this[C]=n)},stop:function(){this.done=!0;var I=this.tryEntries[0].completion;if(I.type==="throw")throw I.arg;return this.rval},dispatchException:function(I){if(this.done)throw I;var C=this;function g(be,xe){return Q.type="throw",Q.arg=I,C.next=be,xe&&(C.method="next",C.arg=n),!!xe}for(var v=this.tryEntries.length-1;v>=0;--v){var j=this.tryEntries[v],Q=j.completion;if(j.tryLoc==="root")return g("end");if(j.tryLoc<=this.prev){var Z=s.call(j,"catchLoc"),ce=s.call(j,"finallyLoc");if(Z&&ce){if(this.prev<j.catchLoc)return g(j.catchLoc,!0);if(this.prev<j.finallyLoc)return g(j.finallyLoc)}else if(Z){if(this.prev<j.catchLoc)return g(j.catchLoc,!0)}else{if(!ce)throw Error("try statement without catch or finally");if(this.prev<j.finallyLoc)return g(j.finallyLoc)}}}},abrupt:function(I,C){for(var g=this.tryEntries.length-1;g>=0;--g){var v=this.tryEntries[g];if(v.tryLoc<=this.prev&&s.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var j=v;break}}j&&(I==="break"||I==="continue")&&j.tryLoc<=C&&C<=j.finallyLoc&&(j=null);var Q=j?j.completion:{};return Q.type=I,Q.arg=C,j?(this.method="next",this.next=j.finallyLoc,k):this.complete(Q)},complete:function(I,C){if(I.type==="throw")throw I.arg;return I.type==="break"||I.type==="continue"?this.next=I.arg:I.type==="return"?(this.rval=this.arg=I.arg,this.method="return",this.next="end"):I.type==="normal"&&C&&(this.next=C),k},finish:function(I){for(var C=this.tryEntries.length-1;C>=0;--C){var g=this.tryEntries[C];if(g.finallyLoc===I)return this.complete(g.completion,g.afterLoc),m(g),k}},catch:function(I){for(var C=this.tryEntries.length-1;C>=0;--C){var g=this.tryEntries[C];if(g.tryLoc===I){var v=g.completion;if(v.type==="throw"){var j=v.arg;m(g)}return j}}throw Error("illegal catch attempt")},delegateYield:function(I,C,g){return this.delegate={iterator:T(I),resultName:C,nextLoc:g},this.method==="next"&&(this.arg=n),k}},i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Eu)),Eu.exports}var Tu,jh;function g5(){if(jh)return Tu;jh=1;var e=m5()();Tu=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return Tu}var Au={exports:{}},Dh;function v5(){return Dh||(Dh=1,function(e){function t(n,i,o,s,a,c,l){try{var u=n[c](l),d=u.value}catch(p){return void o(p)}u.done?i(d):Promise.resolve(d).then(s,a)}function r(n){return function(){var i=this,o=arguments;return new Promise(function(s,a){var c=n.apply(i,o);function l(d){t(c,s,a,l,u,"next",d)}function u(d){t(c,s,a,l,u,"throw",d)}l(void 0)})}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Au)),Au.exports}var Mu={exports:{}},Iu={exports:{}},Ru={exports:{}},Lh;function b5(){return Lh||(Lh=1,function(e){var t=xl().default;function r(n,i){if(t(n)!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var s=o.call(n,i||"default");if(t(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Ru)),Ru.exports}var Bh;function y5(){return Bh||(Bh=1,function(e){var t=xl().default,r=b5();function n(i){var o=r(i,"string");return t(o)=="symbol"?o:o+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Iu)),Iu.exports}var Uh;function w5(){return Uh||(Uh=1,function(e){var t=y5();function r(n,i,o){return(i=t(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o,n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Mu)),Mu.exports}var Ou,Fh;function x5(){if(Fh)return Ou;Fh=1;const e=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);return Ou=t=>!e.has(t&&t.code),Ou}var Pa=p5;Object.defineProperty(rn,"__esModule",{value:!0});rn.isNetworkError=Dd;rn.isRetryableError=Sl;rn.isSafeRequestError=j1;rn.isIdempotentRequestError=Ld;rn.isNetworkOrIdempotentRequestError=Bd;rn.exponentialDelay=D1;rn.default=Lo;rn.DEFAULT_OPTIONS=rn.namespace=void 0;var Lc=Pa(g5()),S5=Pa(xl()),N1=Pa(v5()),_5=Pa(w5()),E5=Pa(x5());function $h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$h(Object(r),!0).forEach(function(n){(0,_5.default)(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$h(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var jd="axios-retry";rn.namespace=jd;function Dd(e){var t=["ERR_CANCELED","ECONNABORTED"];return!e.response&&!!e.code&&!t.includes(e.code)&&(0,E5.default)(e)}var k1=["get","head","options"],C5=k1.concat(["put","delete"]);function Sl(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status>=500&&e.response.status<=599)}function j1(e){return e.config?Sl(e)&&k1.indexOf(e.config.method)!==-1:!1}function Ld(e){return e.config?Sl(e)&&C5.indexOf(e.config.method)!==-1:!1}function Bd(e){return Dd(e)||Ld(e)}function T5(){return 0}function D1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100,r=Math.pow(2,e)*t,n=r*.2*Math.random();return r+n}var L1={retries:3,retryCondition:Bd,retryDelay:T5,shouldResetTimeout:!1,onRetry:function(){}};rn.DEFAULT_OPTIONS=L1;function A5(e,t){return Pu(Pu(Pu({},L1),t),e[jd])}function Vh(e,t){var r=A5(e,t);return r.retryCount=r.retryCount||0,e[jd]=r,r}function M5(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}function I5(e,t){return Pf.apply(this,arguments)}function Pf(){return Pf=(0,N1.default)(Lc.default.mark(function e(t,r){var n,i,o,s;return Lc.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(n=t.retries,i=t.retryCondition,o=t.retryCount<n&&i(r),(0,S5.default)(o)!=="object"){c.next=13;break}return c.prev=3,c.next=6,o;case 6:return s=c.sent,c.abrupt("return",s!==!1);case 10:return c.prev=10,c.t0=c.catch(3),c.abrupt("return",!1);case 13:return c.abrupt("return",o);case 14:case"end":return c.stop()}},e,null,[[3,10]])})),Pf.apply(this,arguments)}function Lo(e,t){var r=e.interceptors.request.use(function(i){var o=Vh(i,t);return o.lastRequestTime=Date.now(),i}),n=e.interceptors.response.use(null,function(){var i=(0,N1.default)(Lc.default.mark(function o(s){var a,c,l,u,d,p,y,x;return Lc.default.wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(a=s.config,a){M.next=3;break}return M.abrupt("return",Promise.reject(s));case 3:return c=Vh(a,t),M.next=6,I5(c,s);case 6:if(!M.sent){M.next=21;break}if(c.retryCount+=1,l=c.retryDelay,u=c.shouldResetTimeout,d=c.onRetry,p=l(c.retryCount,s),M5(e,a),!(!u&&a.timeout&&c.lastRequestTime)){M.next=17;break}if(y=Date.now()-c.lastRequestTime,x=a.timeout-y-p,!(x<=0)){M.next=16;break}return M.abrupt("return",Promise.reject(s));case 16:a.timeout=x;case 17:return a.transformRequest=[function(R){return R}],M.next=20,d(c.retryCount,s,a);case 20:return M.abrupt("return",new Promise(function(R){return setTimeout(function(){return R(e(a))},p)}));case 21:return M.abrupt("return",Promise.reject(s));case 22:case"end":return M.stop()}},o)}));return function(o){return i.apply(this,arguments)}}());return{requestInterceptorId:r,responseInterceptorId:n}}Lo.isNetworkError=Dd;Lo.isSafeRequestError=j1;Lo.isIdempotentRequestError=Ld;Lo.isNetworkOrIdempotentRequestError=Bd;Lo.exponentialDelay=D1;Lo.isRetryableError=Sl;const B1=rn.default;kd.exports=B1;kd.exports.default=B1;var R5=kd.exports,_l={},rs=null;typeof WebSocket<"u"?rs=WebSocket:typeof MozWebSocket<"u"?rs=MozWebSocket:typeof Tr<"u"?rs=Tr.WebSocket||Tr.MozWebSocket:typeof window<"u"?rs=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(rs=self.WebSocket||self.MozWebSocket);var O5=rs,P5=Tr&&Tr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_l,"__esModule",{value:!0});_l.ResilientWebSocket=void 0;const N5=P5(O5),k5=3e4+3e3;class j5{constructor(t,r){gt(this,"endpoint");gt(this,"wsClient");gt(this,"wsUserClosed");gt(this,"wsFailedAttempts");gt(this,"pingTimeout");gt(this,"logger");gt(this,"onError");gt(this,"onMessage");gt(this,"onReconnect");this.endpoint=t,this.logger=r,this.wsFailedAttempts=0,this.onError=n=>{var i;(i=this.logger)==null||i.error(n)},this.wsUserClosed=!0,this.onMessage=()=>{},this.onReconnect=()=>{}}async send(t){var r,n,i;(r=this.logger)==null||r.info(`Sending ${t}`),await this.waitForMaybeReadyWebSocket(),this.wsClient===void 0?(n=this.logger)==null||n.error("Couldn't connect to the websocket server. Error callback is called."):(i=this.wsClient)==null||i.send(t)}async startWebSocket(){var t;this.wsClient===void 0&&((t=this.logger)==null||t.info("Creating Web Socket client"),this.wsClient=new N5.default(this.endpoint),this.wsUserClosed=!1,this.wsClient.onopen=()=>{this.wsFailedAttempts=0,this.wsClient.on!==void 0&&this.heartbeat()},this.wsClient.onerror=r=>{this.onError(r.error)},this.wsClient.onmessage=r=>{this.onMessage(r.data)},this.wsClient.onclose=async()=>{var r,n;if(this.pingTimeout!==void 0&&clearInterval(this.pingTimeout),this.wsUserClosed===!1){this.wsFailedAttempts+=1,this.wsClient=void 0;const i=D5(this.wsFailedAttempts);(r=this.logger)==null||r.error(`Connection closed unexpectedly or because of timeout. Reconnecting after ${i}ms.`),await zh(i),this.restartUnexpectedClosedWebsocket()}else(n=this.logger)==null||n.info("The connection has been closed successfully.")},this.wsClient.on!==void 0&&this.wsClient.on("ping",this.heartbeat.bind(this)))}heartbeat(){var t;(t=this.logger)==null||t.info("Heartbeat"),this.pingTimeout!==void 0&&clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n;(r=this.logger)==null||r.warn("Connection timed out. Reconnecting..."),(n=this.wsClient)==null||n.terminate(),this.restartUnexpectedClosedWebsocket()},k5)}async waitForMaybeReadyWebSocket(){let t=0;for(;this.wsClient!==void 0&&this.wsClient.readyState!==this.wsClient.OPEN;)if(t>5e3){this.wsClient.close();return}else t+=10,await zh(10)}async restartUnexpectedClosedWebsocket(){var t;if(this.wsUserClosed!==!0){if(await this.startWebSocket(),await this.waitForMaybeReadyWebSocket(),this.wsClient===void 0){(t=this.logger)==null||t.error("Couldn't reconnect to websocket. Error callback is called.");return}this.onReconnect()}}closeWebSocket(){if(this.wsClient!==void 0){const t=this.wsClient;this.wsClient=void 0,t.close()}this.wsUserClosed=!0}}_l.ResilientWebSocket=j5;async function zh(e){return new Promise(t=>setTimeout(t,e))}function D5(e){return 2**e*100}var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.removeLeading0xIfExists=ms.makeWebsocketUrl=void 0;function L5(e){const t=new URL("ws",e),r=t.protocol==="https:";return t.protocol=r?"wss:":"ws:",t.toString()}ms.makeWebsocketUrl=L5;function B5(e){return e.startsWith("0x")?e.substring(2):e}ms.removeLeading0xIfExists=B5;var U1=Tr&&Tr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dl,"__esModule",{value:!0});dl.PriceServiceConnection=void 0;const Nu=Cd,U5=U1(O1),qh=U1(R5),F5=_l,ku=ms;class $5{constructor(t,r){gt(this,"httpClient");gt(this,"priceFeedCallbacks");gt(this,"wsClient");gt(this,"wsEndpoint");gt(this,"logger");gt(this,"priceFeedRequestConfig");gt(this,"onWsError");var n,i,o;this.httpClient=U5.default.create({baseURL:t,timeout:(r==null?void 0:r.timeout)||5e3}),(0,qh.default)(this.httpClient,{retries:(r==null?void 0:r.httpRetries)||3,retryDelay:qh.default.exponentialDelay}),this.priceFeedRequestConfig={binary:(n=r==null?void 0:r.priceFeedRequestConfig)==null?void 0:n.binary,verbose:((i=r==null?void 0:r.priceFeedRequestConfig)==null?void 0:i.verbose)??(r==null?void 0:r.verbose),allowOutOfOrder:(o=r==null?void 0:r.priceFeedRequestConfig)==null?void 0:o.allowOutOfOrder},this.priceFeedCallbacks=new Map,this.logger=(r==null?void 0:r.logger)||{trace:()=>{},debug:()=>{},info:()=>{},warn:console.warn,error:console.error},this.onWsError=s=>{this.logger.error(s),typeof In<"u"&&typeof In.exit=="function"?(this.logger.error("Halting the process due to the websocket error"),In.exit(1)):this.logger.error("Cannot halt process. Please handle the websocket error.")},this.wsEndpoint=(0,ku.makeWebsocketUrl)(t)}async getLatestPriceFeeds(t){return t.length===0?[]:(await this.httpClient.get("/api/latest_price_feeds",{params:{ids:t,verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary}})).data.map(i=>Nu.PriceFeed.fromJson(i))}async getLatestVaas(t){return(await this.httpClient.get("/api/latest_vaas",{params:{ids:t}})).data}async getVaa(t,r){const n=await this.httpClient.get("/api/get_vaa",{params:{id:t,publish_time:r}});return[n.data.vaa,n.data.publishTime]}async getPriceFeed(t,r){const n=await this.httpClient.get("/api/get_price_feed",{params:{id:t,publish_time:r,verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary}});return Nu.PriceFeed.fromJson(n.data)}async getPriceFeedIds(){return(await this.httpClient.get("/api/price_feed_ids")).data}async subscribePriceFeedUpdates(t,r){var o;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(s=>(0,ku.removeLeading0xIfExists)(s));const n=[];for(const s of t)this.priceFeedCallbacks.has(s)||(this.priceFeedCallbacks.set(s,new Set),n.push(s)),this.priceFeedCallbacks.get(s).add(r);const i={ids:n,type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};await((o=this.wsClient)==null?void 0:o.send(JSON.stringify(i)))}async unsubscribePriceFeedUpdates(t,r){var o;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(s=>(0,ku.removeLeading0xIfExists)(s));const n=[];for(const s of t)if(this.priceFeedCallbacks.has(s)){let a=!1;r===void 0?(this.priceFeedCallbacks.delete(s),a=!0):(this.priceFeedCallbacks.get(s).delete(r),this.priceFeedCallbacks.get(s).size===0&&(this.priceFeedCallbacks.delete(s),a=!0)),a&&n.push(s)}const i={ids:n,type:"unsubscribe"};await((o=this.wsClient)==null?void 0:o.send(JSON.stringify(i))),this.priceFeedCallbacks.size===0&&this.closeWebSocket()}async startWebSocket(){if(this.wsEndpoint===void 0)throw new Error("Websocket endpoint is undefined.");this.wsClient=new F5.ResilientWebSocket(this.wsEndpoint,this.logger),this.wsClient.onError=this.onWsError,this.wsClient.onReconnect=()=>{var t;if(this.priceFeedCallbacks.size>0){const r={ids:Array.from(this.priceFeedCallbacks.keys()),type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};this.logger.info("Resubscribing to existing price feeds."),(t=this.wsClient)==null||t.send(JSON.stringify(r))}},this.wsClient.onMessage=t=>{this.logger.info(`Received message ${t.toString()}`);let r;try{r=JSON.parse(t.toString())}catch(n){this.logger.error(`Error parsing message ${t.toString()} as JSON.`),this.logger.error(n),this.onWsError(n);return}if(r.type==="response")r.status==="error"&&(this.logger.error(`Error response from the websocket server ${r.error}.`),this.onWsError(new Error(r.error)));else if(r.type==="price_update"){let n;try{n=Nu.PriceFeed.fromJson(r.price_feed)}catch(i){this.logger.error(`Error parsing price feeds from message ${t.toString()}.`),this.logger.error(i),this.onWsError(i);return}if(this.priceFeedCallbacks.has(n.id))for(const i of this.priceFeedCallbacks.get(n.id))i(n)}else this.logger.warn(`Ignoring unsupported server response ${t.toString()}.`)},await this.wsClient.startWebSocket()}closeWebSocket(){var t;(t=this.wsClient)==null||t.closeWebSocket(),this.wsClient=void 0,this.priceFeedCallbacks.clear()}}dl.PriceServiceConnection=$5;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseAccumulatorUpdateData=e.isAccumulatorUpdateData=e.Price=e.PriceFeed=e.PriceFeedMetadata=e.PriceServiceConnection=void 0;var t=dl;Object.defineProperty(e,"PriceServiceConnection",{enumerable:!0,get:function(){return t.PriceServiceConnection}});var r=Cd;Object.defineProperty(e,"PriceFeedMetadata",{enumerable:!0,get:function(){return r.PriceFeedMetadata}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return r.PriceFeed}}),Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return r.Price}}),Object.defineProperty(e,"isAccumulatorUpdateData",{enumerable:!0,get:function(){return r.isAccumulatorUpdateData}}),Object.defineProperty(e,"parseAccumulatorUpdateData",{enumerable:!0,get:function(){return r.parseAccumulatorUpdateData}})})(Ed);Object.defineProperty(fl,"__esModule",{value:!0});fl.SuiPriceServiceConnection=void 0;const V5=Ed,z5=Ra;class q5 extends V5.PriceServiceConnection{async getPriceFeedsUpdateData(t){return(await this.getLatestVaas(t)).map(n=>z5.Buffer.from(n,"base64"))}}fl.SuiPriceServiceConnection=q5;var El={};const H5=$m(B8),Bo=$m(F6);var Ud=Object.defineProperty,W5=Object.getOwnPropertyDescriptor,G5=Object.getOwnPropertyNames,K5=Object.prototype.hasOwnProperty,Y5=(e,t)=>{for(var r in t)Ud(e,r,{get:t[r],enumerable:!0})},X5=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of G5(t))!K5.call(e,i)&&i!==r&&Ud(e,i,{get:()=>t[i],enumerable:!(n=W5(t,i))||n.enumerable});return e},J5=e=>X5(Ud({},"__esModule",{value:!0}),e),F1={};Y5(F1,{isValidSuiNSName:()=>eS,normalizeSuiNSName:()=>tS});var Z5=J5(F1);const $1=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,V1=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,Q5=235;function eS(e){return e.length>Q5?!1:e.includes("@")?$1.test(e):V1.test(e)}function tS(e,t="at"){const r=e.toLowerCase();let n;if(r.includes("@")){if(!$1.test(r))throw new Error(`Invalid SuiNS name ${e}`);const[i,o]=r.split("@");n=[...i?i.split("."):[],o]}else{if(!V1.test(r))throw new Error(`Invalid SuiNS name ${e}`);n=r.split(".").slice(0,-1)}return t==="dot"?`${n.join(".")}.sui`:`${n.slice(0,-1).join(".")}@${n[n.length-1]}`}var Fd=Object.defineProperty,rS=Object.getOwnPropertyDescriptor,nS=Object.getOwnPropertyNames,iS=Object.prototype.hasOwnProperty,oS=(e,t)=>{for(var r in t)Fd(e,r,{get:t[r],enumerable:!0})},sS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of nS(t))!iS.call(e,i)&&i!==r&&Fd(e,i,{get:()=>t[i],enumerable:!(n=rS(t,i))||n.enumerable});return e},aS=e=>sS(Fd({},"__esModule",{value:!0}),e),z1={};oS(z1,{isValidNamedPackage:()=>H1,isValidNamedType:()=>hS});var cS=aS(z1),lS=Z5;const uS=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,fS=/^\d+$/,dS=64,q1="/",H1=e=>{const t=e.split(q1);if(t.length<2||t.length>3)return!1;const[r,n,i]=t;return i!==void 0&&!fS.test(i)||!(0,lS.isValidSuiNSName)(r)?!1:uS.test(n)&&n.length<dS},hS=e=>{const t=e.split(/::|<|>|,/);for(const r of t)if(r.includes(q1)&&!H1(r))return!1;return!0};var $d=Object.defineProperty,pS=Object.getOwnPropertyDescriptor,mS=Object.getOwnPropertyNames,gS=Object.prototype.hasOwnProperty,vS=(e,t)=>{for(var r in t)$d(e,r,{get:t[r],enumerable:!0})},bS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of mS(t))!gS.call(e,i)&&i!==r&&$d(e,i,{get:()=>t[i],enumerable:!(n=pS(t,i))||n.enumerable});return e},yS=e=>bS($d({},"__esModule",{value:!0}),e),W1={};vS(W1,{SUI_ADDRESS_LENGTH:()=>Vd,isValidSuiAddress:()=>Y1,isValidSuiObjectId:()=>_S,isValidTransactionDigest:()=>SS,normalizeStructTag:()=>X1,normalizeSuiAddress:()=>qd,normalizeSuiObjectId:()=>CS,parseStructTag:()=>zd});var G1=yS(W1),K1=Bo,wS=cS;const xS=32;function SS(e){try{return(0,K1.fromBase58)(e).length===xS}catch{return!1}}const Vd=32;function Y1(e){return TS(e)&&AS(e)===Vd}function _S(e){return Y1(e)}function ES(e){return e.includes("::")?zd(e):e}function zd(e){const[t,r]=e.split("::"),n=(0,wS.isValidNamedPackage)(t),i=e.slice(t.length+r.length+4),o=i.includes("<")?i.slice(0,i.indexOf("<")):i,s=i.includes("<")?(0,K1.splitGenericParameters)(i.slice(i.indexOf("<")+1,i.lastIndexOf(">"))).map(a=>ES(a.trim())):[];return{address:n?t:qd(t),module:r,name:o,typeParams:s}}function X1(e){const{address:t,module:r,name:n,typeParams:i}=typeof e=="string"?zd(e):e,o=(i==null?void 0:i.length)>0?`<${i.map(s=>typeof s=="string"?s:X1(s)).join(",")}>`:"";return`${t}::${r}::${n}${o}`}function qd(e,t=!1){let r=e.toLowerCase();return!t&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(Vd*2,"0")}`}function CS(e,t=!1){return qd(e,t)}function TS(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function AS(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}var Hd=Object.defineProperty,MS=Object.getOwnPropertyDescriptor,IS=Object.getOwnPropertyNames,RS=Object.prototype.hasOwnProperty,OS=(e,t)=>{for(var r in t)Hd(e,r,{get:t[r],enumerable:!0})},PS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of IS(t))!RS.call(e,i)&&i!==r&&Hd(e,i,{get:()=>t[i],enumerable:!(n=MS(t,i))||n.enumerable});return e},NS=e=>PS(Hd({},"__esModule",{value:!0}),e),J1={};OS(J1,{TypeTagSerializer:()=>xo});var Z1=NS(J1),kS=Bo,jS=G1;const DS=/^vector<(.+)>$/,LS=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;class xo{static parseFromStr(t,r=!1){if(t==="address")return{address:null};if(t==="bool")return{bool:null};if(t==="u8")return{u8:null};if(t==="u16")return{u16:null};if(t==="u32")return{u32:null};if(t==="u64")return{u64:null};if(t==="u128")return{u128:null};if(t==="u256")return{u256:null};if(t==="signer")return{signer:null};const n=t.match(DS);if(n)return{vector:xo.parseFromStr(n[1],r)};const i=t.match(LS);if(i)return{struct:{address:r?(0,jS.normalizeSuiAddress)(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:xo.parseStructTypeArgs(i[5],r)}};throw new Error(`Encountered unexpected token when parsing type args for ${t}`)}static parseStructTypeArgs(t,r=!1){return(0,kS.splitGenericParameters)(t).map(n=>xo.parseFromStr(n,r))}static tagToString(t){if("bool"in t)return"bool";if("u8"in t)return"u8";if("u16"in t)return"u16";if("u32"in t)return"u32";if("u64"in t)return"u64";if("u128"in t)return"u128";if("u256"in t)return"u256";if("address"in t)return"address";if("signer"in t)return"signer";if("vector"in t)return`vector<${xo.tagToString(t.vector)}>`;if("struct"in t){const r=t.struct,n=r.typeParams.map(xo.tagToString).join(", ");return`${r.address}::${r.module}::${r.name}${n?`<${n}>`:""}`}throw new Error("Invalid TypeTag")}}var Wd=Object.defineProperty,BS=Object.getOwnPropertyDescriptor,US=Object.getOwnPropertyNames,FS=Object.prototype.hasOwnProperty,$S=(e,t)=>{for(var r in t)Wd(e,r,{get:t[r],enumerable:!0})},VS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of US(t))!FS.call(e,i)&&i!==r&&Wd(e,i,{get:()=>t[i],enumerable:!(n=BS(t,i))||n.enumerable});return e},zS=e=>VS(Wd({},"__esModule",{value:!0}),e),Q1={};$S(Q1,{Address:()=>hn,AppId:()=>mv,Argument:()=>Vn,CallArg:()=>nv,Command:()=>ov,CompressedSignature:()=>bv,GasData:()=>uv,Intent:()=>gv,IntentMessage:()=>vv,IntentScope:()=>hv,IntentVersion:()=>pv,MultiSig:()=>GS,MultiSigPkMap:()=>wv,MultiSigPublicKey:()=>xv,ObjectArg:()=>rv,ObjectDigest:()=>ev,Owner:()=>WS,PasskeyAuthenticator:()=>YS,ProgrammableMoveCall:()=>iv,ProgrammableTransaction:()=>sv,PublicKey:()=>yv,SenderSignedData:()=>KS,SenderSignedTransaction:()=>_v,SharedObjectRef:()=>tv,StructTag:()=>lv,SuiObjectRef:()=>Bc,TransactionData:()=>dv,TransactionDataV1:()=>fv,TransactionExpiration:()=>cv,TransactionKind:()=>av,TypeTag:()=>Yd,base64String:()=>Sv});var Gd=zS(Q1),ue=Bo,zs=G1,Hh=Z1;function qS(e){return ue.bcs.u64({name:"unsafe_u64",...e}).transform({input:t=>t,output:t=>Number(t)})}function HS(e){return ue.bcs.enum("Option",{None:null,Some:e})}const hn=ue.bcs.bytes(zs.SUI_ADDRESS_LENGTH).transform({validate:e=>{const t=typeof e=="string"?e:(0,ue.toHex)(e);if(!t||!(0,zs.isValidSuiAddress)((0,zs.normalizeSuiAddress)(t)))throw new Error(`Invalid Sui address ${t}`)},input:e=>typeof e=="string"?(0,ue.fromHex)((0,zs.normalizeSuiAddress)(e)):e,output:e=>(0,zs.normalizeSuiAddress)((0,ue.toHex)(e))}),ev=ue.bcs.vector(ue.bcs.u8()).transform({name:"ObjectDigest",input:e=>(0,ue.fromBase58)(e),output:e=>(0,ue.toBase58)(new Uint8Array(e)),validate:e=>{if((0,ue.fromBase58)(e).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),Bc=ue.bcs.struct("SuiObjectRef",{objectId:hn,version:ue.bcs.u64(),digest:ev}),tv=ue.bcs.struct("SharedObjectRef",{objectId:hn,initialSharedVersion:ue.bcs.u64(),mutable:ue.bcs.bool()}),rv=ue.bcs.enum("ObjectArg",{ImmOrOwnedObject:Bc,SharedObject:tv,Receiving:Bc}),WS=ue.bcs.enum("Owner",{AddressOwner:hn,ObjectOwner:hn,Shared:ue.bcs.struct("Shared",{initialSharedVersion:ue.bcs.u64()}),Immutable:null,ConsensusV2:ue.bcs.struct("ConsensusV2",{authenticator:ue.bcs.struct("Authenticator",{SingleOwner:ue.bcs.string()}),startVersion:ue.bcs.string()})}),nv=ue.bcs.enum("CallArg",{Pure:ue.bcs.struct("Pure",{bytes:ue.bcs.vector(ue.bcs.u8()).transform({input:e=>typeof e=="string"?(0,ue.fromBase64)(e):e,output:e=>(0,ue.toBase64)(new Uint8Array(e))})}),Object:rv}),Kd=ue.bcs.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:ue.bcs.lazy(()=>Kd),struct:ue.bcs.lazy(()=>lv),u16:null,u32:null,u256:null}),Yd=Kd.transform({input:e=>typeof e=="string"?Hh.TypeTagSerializer.parseFromStr(e,!0):e,output:e=>Hh.TypeTagSerializer.tagToString(e)}),Vn=ue.bcs.enum("Argument",{GasCoin:null,Input:ue.bcs.u16(),Result:ue.bcs.u16(),NestedResult:ue.bcs.tuple([ue.bcs.u16(),ue.bcs.u16()])}),iv=ue.bcs.struct("ProgrammableMoveCall",{package:hn,module:ue.bcs.string(),function:ue.bcs.string(),typeArguments:ue.bcs.vector(Yd),arguments:ue.bcs.vector(Vn)}),ov=ue.bcs.enum("Command",{MoveCall:iv,TransferObjects:ue.bcs.struct("TransferObjects",{objects:ue.bcs.vector(Vn),address:Vn}),SplitCoins:ue.bcs.struct("SplitCoins",{coin:Vn,amounts:ue.bcs.vector(Vn)}),MergeCoins:ue.bcs.struct("MergeCoins",{destination:Vn,sources:ue.bcs.vector(Vn)}),Publish:ue.bcs.struct("Publish",{modules:ue.bcs.vector(ue.bcs.vector(ue.bcs.u8()).transform({input:e=>typeof e=="string"?(0,ue.fromBase64)(e):e,output:e=>(0,ue.toBase64)(new Uint8Array(e))})),dependencies:ue.bcs.vector(hn)}),MakeMoveVec:ue.bcs.struct("MakeMoveVec",{type:HS(Yd).transform({input:e=>e===null?{None:!0}:{Some:e},output:e=>e.Some??null}),elements:ue.bcs.vector(Vn)}),Upgrade:ue.bcs.struct("Upgrade",{modules:ue.bcs.vector(ue.bcs.vector(ue.bcs.u8()).transform({input:e=>typeof e=="string"?(0,ue.fromBase64)(e):e,output:e=>(0,ue.toBase64)(new Uint8Array(e))})),dependencies:ue.bcs.vector(hn),package:hn,ticket:Vn})}),sv=ue.bcs.struct("ProgrammableTransaction",{inputs:ue.bcs.vector(nv),commands:ue.bcs.vector(ov)}),av=ue.bcs.enum("TransactionKind",{ProgrammableTransaction:sv,ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null}),cv=ue.bcs.enum("TransactionExpiration",{None:null,Epoch:qS()}),lv=ue.bcs.struct("StructTag",{address:hn,module:ue.bcs.string(),name:ue.bcs.string(),typeParams:ue.bcs.vector(Kd)}),uv=ue.bcs.struct("GasData",{payment:ue.bcs.vector(Bc),owner:hn,price:ue.bcs.u64(),budget:ue.bcs.u64()}),fv=ue.bcs.struct("TransactionDataV1",{kind:av,sender:hn,gasData:uv,expiration:cv}),dv=ue.bcs.enum("TransactionData",{V1:fv}),hv=ue.bcs.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),pv=ue.bcs.enum("IntentVersion",{V0:null}),mv=ue.bcs.enum("AppId",{Sui:null}),gv=ue.bcs.struct("Intent",{scope:hv,version:pv,appId:mv});function vv(e){return ue.bcs.struct(`IntentMessage<${e.name}>`,{intent:gv,value:e})}const bv=ue.bcs.enum("CompressedSignature",{ED25519:ue.bcs.fixedArray(64,ue.bcs.u8()),Secp256k1:ue.bcs.fixedArray(64,ue.bcs.u8()),Secp256r1:ue.bcs.fixedArray(64,ue.bcs.u8()),ZkLogin:ue.bcs.vector(ue.bcs.u8())}),yv=ue.bcs.enum("PublicKey",{ED25519:ue.bcs.fixedArray(32,ue.bcs.u8()),Secp256k1:ue.bcs.fixedArray(33,ue.bcs.u8()),Secp256r1:ue.bcs.fixedArray(33,ue.bcs.u8()),ZkLogin:ue.bcs.vector(ue.bcs.u8())}),wv=ue.bcs.struct("MultiSigPkMap",{pubKey:yv,weight:ue.bcs.u8()}),xv=ue.bcs.struct("MultiSigPublicKey",{pk_map:ue.bcs.vector(wv),threshold:ue.bcs.u16()}),GS=ue.bcs.struct("MultiSig",{sigs:ue.bcs.vector(bv),bitmap:ue.bcs.u16(),multisig_pk:xv}),Sv=ue.bcs.vector(ue.bcs.u8()).transform({input:e=>typeof e=="string"?(0,ue.fromBase64)(e):e,output:e=>(0,ue.toBase64)(new Uint8Array(e))}),_v=ue.bcs.struct("SenderSignedTransaction",{intentMessage:vv(dv),txSignatures:ue.bcs.vector(Sv)}),KS=ue.bcs.vector(_v,{name:"SenderSignedData"}),YS=ue.bcs.struct("PasskeyAuthenticator",{authenticatorData:ue.bcs.vector(ue.bcs.u8()),clientDataJson:ue.bcs.string(),userSignature:ue.bcs.vector(ue.bcs.u8())});var Xd=Object.defineProperty,XS=Object.getOwnPropertyDescriptor,JS=Object.getOwnPropertyNames,ZS=Object.prototype.hasOwnProperty,QS=(e,t)=>{for(var r in t)Xd(e,r,{get:t[r],enumerable:!0})},e7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of JS(t))!ZS.call(e,i)&&i!==r&&Xd(e,i,{get:()=>t[i],enumerable:!(n=XS(t,i))||n.enumerable});return e},t7=e=>e7(Xd({},"__esModule",{value:!0}),e),Ev={};QS(Ev,{TransactionEffects:()=>m7});var r7=t7(Ev),me=Bo,At=Gd;const n7=me.bcs.enum("PackageUpgradeError",{UnableToFetchPackage:me.bcs.struct("UnableToFetchPackage",{packageId:At.Address}),NotAPackage:me.bcs.struct("NotAPackage",{objectId:At.Address}),IncompatibleUpgrade:null,DigestDoesNotMatch:me.bcs.struct("DigestDoesNotMatch",{digest:me.bcs.vector(me.bcs.u8())}),UnknownUpgradePolicy:me.bcs.struct("UnknownUpgradePolicy",{policy:me.bcs.u8()}),PackageIDDoesNotMatch:me.bcs.struct("PackageIDDoesNotMatch",{packageId:At.Address,ticketId:At.Address})}),i7=me.bcs.struct("ModuleId",{address:At.Address,name:me.bcs.string()}),Wh=me.bcs.struct("MoveLocation",{module:i7,function:me.bcs.u16(),instruction:me.bcs.u16(),functionName:me.bcs.option(me.bcs.string())}),o7=me.bcs.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:me.bcs.struct("IndexOutOfBounds",{idx:me.bcs.u16()}),SecondaryIndexOutOfBounds:me.bcs.struct("SecondaryIndexOutOfBounds",{resultIdx:me.bcs.u16(),secondaryIdx:me.bcs.u16()}),InvalidResultArity:me.bcs.struct("InvalidResultArity",{resultIdx:me.bcs.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null}),s7=me.bcs.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),a7=me.bcs.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:me.bcs.struct("MoveObjectTooBig",{objectSize:me.bcs.u64(),maxObjectSize:me.bcs.u64()}),MovePackageTooBig:me.bcs.struct("MovePackageTooBig",{objectSize:me.bcs.u64(),maxObjectSize:me.bcs.u64()}),CircularObjectOwnership:me.bcs.struct("CircularObjectOwnership",{object:At.Address}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:me.bcs.option(Wh),MoveAbort:me.bcs.tuple([Wh,me.bcs.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:me.bcs.struct("CommandArgumentError",{argIdx:me.bcs.u16(),kind:o7}),TypeArgumentError:me.bcs.struct("TypeArgumentError",{argumentIdx:me.bcs.u16(),kind:s7}),UnusedValueWithoutDrop:me.bcs.struct("UnusedValueWithoutDrop",{resultIdx:me.bcs.u16(),secondaryIdx:me.bcs.u16()}),InvalidPublicFunctionReturnType:me.bcs.struct("InvalidPublicFunctionReturnType",{idx:me.bcs.u16()}),InvalidTransferObject:null,EffectsTooLarge:me.bcs.struct("EffectsTooLarge",{currentSize:me.bcs.u64(),maxSize:me.bcs.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:me.bcs.struct("PackageUpgradeError",{upgradeError:n7}),WrittenObjectsTooLarge:me.bcs.struct("WrittenObjectsTooLarge",{currentSize:me.bcs.u64(),maxSize:me.bcs.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:me.bcs.struct("ExecutionCancelledDueToSharedObjectCongestion",{congestedObjects:me.bcs.vector(At.Address)}),AddressDeniedForCoin:me.bcs.struct("AddressDeniedForCoin",{address:At.Address,coinType:me.bcs.string()}),CoinTypeGlobalPause:me.bcs.struct("CoinTypeGlobalPause",{coinType:me.bcs.string()}),ExecutionCancelledDueToRandomnessUnavailable:null}),Cv=me.bcs.enum("ExecutionStatus",{Success:null,Failed:me.bcs.struct("ExecutionFailed",{error:a7,command:me.bcs.option(me.bcs.u64())})}),Tv=me.bcs.struct("GasCostSummary",{computationCost:me.bcs.u64(),storageCost:me.bcs.u64(),storageRebate:me.bcs.u64(),nonRefundableStorageFee:me.bcs.u64()}),c7=me.bcs.struct("TransactionEffectsV1",{status:Cv,executedEpoch:me.bcs.u64(),gasUsed:Tv,modifiedAtVersions:me.bcs.vector(me.bcs.tuple([At.Address,me.bcs.u64()])),sharedObjects:me.bcs.vector(At.SuiObjectRef),transactionDigest:At.ObjectDigest,created:me.bcs.vector(me.bcs.tuple([At.SuiObjectRef,At.Owner])),mutated:me.bcs.vector(me.bcs.tuple([At.SuiObjectRef,At.Owner])),unwrapped:me.bcs.vector(me.bcs.tuple([At.SuiObjectRef,At.Owner])),deleted:me.bcs.vector(At.SuiObjectRef),unwrappedThenDeleted:me.bcs.vector(At.SuiObjectRef),wrapped:me.bcs.vector(At.SuiObjectRef),gasObject:me.bcs.tuple([At.SuiObjectRef,At.Owner]),eventsDigest:me.bcs.option(At.ObjectDigest),dependencies:me.bcs.vector(At.ObjectDigest)}),Jd=me.bcs.tuple([me.bcs.u64(),At.ObjectDigest]),l7=me.bcs.enum("ObjectIn",{NotExist:null,Exist:me.bcs.tuple([Jd,At.Owner])}),u7=me.bcs.enum("ObjectOut",{NotExist:null,ObjectWrite:me.bcs.tuple([At.ObjectDigest,At.Owner]),PackageWrite:Jd}),f7=me.bcs.enum("IDOperation",{None:null,Created:null,Deleted:null}),d7=me.bcs.struct("EffectsObjectChange",{inputState:l7,outputState:u7,idOperation:f7}),h7=me.bcs.enum("UnchangedSharedKind",{ReadOnlyRoot:Jd,MutateDeleted:me.bcs.u64(),ReadDeleted:me.bcs.u64(),Cancelled:me.bcs.u64(),PerEpochConfig:null}),p7=me.bcs.struct("TransactionEffectsV2",{status:Cv,executedEpoch:me.bcs.u64(),gasUsed:Tv,transactionDigest:At.ObjectDigest,gasObjectIndex:me.bcs.option(me.bcs.u32()),eventsDigest:me.bcs.option(At.ObjectDigest),dependencies:me.bcs.vector(At.ObjectDigest),lamportVersion:me.bcs.u64(),changedObjects:me.bcs.vector(me.bcs.tuple([At.Address,d7])),unchangedSharedObjects:me.bcs.vector(me.bcs.tuple([At.Address,h7])),auxDataDigest:me.bcs.option(At.ObjectDigest)}),m7=me.bcs.enum("TransactionEffects",{V1:c7,V2:p7});var Zd=Object.defineProperty,g7=Object.getOwnPropertyDescriptor,v7=Object.getOwnPropertyNames,b7=Object.prototype.hasOwnProperty,y7=(e,t)=>{for(var r in t)Zd(e,r,{get:t[r],enumerable:!0})},w7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of v7(t))!b7.call(e,i)&&i!==r&&Zd(e,i,{get:()=>t[i],enumerable:!(n=g7(t,i))||n.enumerable});return e},x7=e=>w7(Zd({},"__esModule",{value:!0}),e),Av={};y7(Av,{pureBcsSchemaFromTypeName:()=>Nf});var S7=x7(Av),Un=Bo,_7=Gd;function Nf(e){switch(e){case"u8":return Un.bcs.u8();case"u16":return Un.bcs.u16();case"u32":return Un.bcs.u32();case"u64":return Un.bcs.u64();case"u128":return Un.bcs.u128();case"u256":return Un.bcs.u256();case"bool":return Un.bcs.bool();case"string":return Un.bcs.string();case"id":case"address":return _7.Address}const t=e.match(/^(vector|option)<(.+)>$/);if(t){const[r,n]=t.slice(1);return r==="vector"?Un.bcs.vector(Nf(n)):Un.bcs.option(Nf(n))}throw new Error(`Invalid Pure type name: ${e}`)}var Qd=Object.defineProperty,E7=Object.getOwnPropertyDescriptor,C7=Object.getOwnPropertyNames,T7=Object.prototype.hasOwnProperty,A7=(e,t)=>{for(var r in t)Qd(e,r,{get:t[r],enumerable:!0})},M7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of C7(t))!T7.call(e,i)&&i!==r&&Qd(e,i,{get:()=>t[i],enumerable:!(n=E7(t,i))||n.enumerable});return e},I7=e=>M7(Qd({},"__esModule",{value:!0}),e),Mv={};A7(Mv,{BcsType:()=>N7.BcsType,TypeTagSerializer:()=>P7.TypeTagSerializer,bcs:()=>j7,pureBcsSchemaFromTypeName:()=>k7.pureBcsSchemaFromTypeName});var R7=I7(Mv),Fn=Bo,Lt=Gd,O7=r7,P7=Z1,N7=Bo,k7=S7;const j7={...Fn.bcs,U8:Fn.bcs.u8(),U16:Fn.bcs.u16(),U32:Fn.bcs.u32(),U64:Fn.bcs.u64(),U128:Fn.bcs.u128(),U256:Fn.bcs.u256(),ULEB128:Fn.bcs.uleb128(),Bool:Fn.bcs.bool(),String:Fn.bcs.string(),Address:Lt.Address,AppId:Lt.AppId,Argument:Lt.Argument,CallArg:Lt.CallArg,CompressedSignature:Lt.CompressedSignature,GasData:Lt.GasData,Intent:Lt.Intent,IntentMessage:Lt.IntentMessage,IntentScope:Lt.IntentScope,IntentVersion:Lt.IntentVersion,MultiSig:Lt.MultiSig,MultiSigPkMap:Lt.MultiSigPkMap,MultiSigPublicKey:Lt.MultiSigPublicKey,ObjectArg:Lt.ObjectArg,ObjectDigest:Lt.ObjectDigest,Owner:Lt.Owner,ProgrammableMoveCall:Lt.ProgrammableMoveCall,ProgrammableTransaction:Lt.ProgrammableTransaction,PublicKey:Lt.PublicKey,SenderSignedData:Lt.SenderSignedData,SenderSignedTransaction:Lt.SenderSignedTransaction,SharedObjectRef:Lt.SharedObjectRef,StructTag:Lt.StructTag,SuiObjectRef:Lt.SuiObjectRef,Command:Lt.Command,TransactionData:Lt.TransactionData,TransactionDataV1:Lt.TransactionDataV1,TransactionExpiration:Lt.TransactionExpiration,TransactionKind:Lt.TransactionKind,TypeTag:Lt.TypeTag,TransactionEffects:O7.TransactionEffects,PasskeyAuthenticator:Lt.PasskeyAuthenticator};Object.defineProperty(El,"__esModule",{value:!0});El.SuiPythClient=void 0;const Ga=H5,Ho=R7,D7=Ra,ju=16*1024;class L7{constructor(t,r,n){gt(this,"provider");gt(this,"pythStateId");gt(this,"wormholeStateId");gt(this,"pythPackageId");gt(this,"wormholePackageId");gt(this,"priceTableInfo");gt(this,"priceFeedObjectIdCache",new Map);gt(this,"baseUpdateFee");this.provider=t,this.pythStateId=r,this.wormholeStateId=n,this.pythPackageId=void 0,this.wormholePackageId=void 0}async getBaseUpdateFee(){if(this.baseUpdateFee===void 0){const t=await this.provider.getObject({id:this.pythStateId,options:{showContent:!0}});if(!t.data||!t.data.content||t.data.content.dataType!=="moveObject")throw new Error("Unable to fetch pyth state object");this.baseUpdateFee=t.data.content.fields.base_update_fee}return this.baseUpdateFee}async getPackageId(t){const r=await this.provider.getObject({id:t,options:{showContent:!0}}).then(n=>{var i,o,s;if(((o=(i=n.data)==null?void 0:i.content)==null?void 0:o.dataType)=="moveObject")return n.data.content.fields;throw console.log((s=n.data)==null?void 0:s.content),new Error(`Cannot fetch package id for object ${t}`)});if("upgrade_cap"in r)return r.upgrade_cap.fields.package;throw new Error("upgrade_cap not found")}async verifyVaas(t,r){const n=await this.getWormholePackageId(),i=[];for(const o of t){const[s]=r.moveCall({target:`${n}::vaa::parse_and_verify`,arguments:[r.object(this.wormholeStateId),r.pure(Ho.bcs.vector(Ho.bcs.U8).serialize(Array.from(o),{maxSize:ju}).toBytes()),r.object(Ga.SUI_CLOCK_OBJECT_ID)]});i.push(s)}return i}async updatePriceFeeds(t,r,n){const i=await this.getPythPackageId();let o;if(r.length>1)throw new Error("SDK does not support sending multiple accumulator messages in a single transaction");const s=this.extractVaaBytesFromAccumulatorMessage(r[0]),a=await this.verifyVaas([s],t);[o]=t.moveCall({target:`${i}::pyth::create_authenticated_price_infos_using_accumulator`,arguments:[t.object(this.pythStateId),t.pure(Ho.bcs.vector(Ho.bcs.U8).serialize(Array.from(r[0]),{maxSize:ju}).toBytes()),a[0],t.object(Ga.SUI_CLOCK_OBJECT_ID)]});const c=[],l=await this.getBaseUpdateFee(),u=t.splitCoins(t.gas,n.map(()=>t.pure.u64(l)));let d=0;for(const p of n){const y=await this.getPriceFeedObjectId(p);if(!y)throw new Error(`Price feed ${p} not found, please create it first`);c.push(y),[o]=t.moveCall({target:`${i}::pyth::update_single_price_feed`,arguments:[t.object(this.pythStateId),o,t.object(y),u[d],t.object(Ga.SUI_CLOCK_OBJECT_ID)]}),d++}return t.moveCall({target:`${i}::hot_potato_vector::destroy`,arguments:[o],typeArguments:[`${i}::price_info::PriceInfo`]}),c}async createPriceFeed(t,r){const n=await this.getPythPackageId();if(r.length>1)throw new Error("SDK does not support sending multiple accumulator messages in a single transaction");const i=this.extractVaaBytesFromAccumulatorMessage(r[0]),o=await this.verifyVaas([i],t);t.moveCall({target:`${n}::pyth::create_price_feeds_using_accumulator`,arguments:[t.object(this.pythStateId),t.pure(Ho.bcs.vector(Ho.bcs.U8).serialize(Array.from(r[0]),{maxSize:ju}).toBytes()),o[0],t.object(Ga.SUI_CLOCK_OBJECT_ID)]})}async getWormholePackageId(){return this.wormholePackageId||(this.wormholePackageId=await this.getPackageId(this.wormholeStateId)),this.wormholePackageId}async getPythPackageId(){return this.pythPackageId||(this.pythPackageId=await this.getPackageId(this.pythStateId)),this.pythPackageId}async getPriceFeedObjectId(t){const r=t.replace("0x","");if(!this.priceFeedObjectIdCache.has(r)){const{id:n,fieldType:i}=await this.getPriceTableInfo(),o=await this.provider.getDynamicFieldObject({parentId:n,name:{type:`${i}::price_identifier::PriceIdentifier`,value:{bytes:Array.from(D7.Buffer.from(r,"hex"))}}});if(!o.data||!o.data.content)return;if(o.data.content.dataType!=="moveObject")throw new Error("Price feed type mismatch");this.priceFeedObjectIdCache.set(r,o.data.content.fields.value)}return this.priceFeedObjectIdCache.get(r)}async getPriceTableInfo(){if(this.priceTableInfo===void 0){const t=await this.provider.getDynamicFieldObject({parentId:this.pythStateId,name:{type:"vector<u8>",value:"price_info"}});if(!t.data||!t.data.type)throw new Error("Price Table not found, contract may not be initialized");let r=t.data.type.replace("0x2::table::Table<","");r=r.replace("::price_identifier::PriceIdentifier, 0x2::object::ID>",""),this.priceTableInfo={id:t.data.objectId,fieldType:r}}return this.priceTableInfo}extractVaaBytesFromAccumulatorMessage(t){const n=7+t.readUint8(6)+1,i=t.readUint16BE(n),o=n+2;return t.subarray(o,o+i)}}El.SuiPythClient=L7;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PriceFeed=e.Price=e.SuiPythClient=e.SuiPriceServiceConnection=void 0;var t=fl;Object.defineProperty(e,"SuiPriceServiceConnection",{enumerable:!0,get:function(){return t.SuiPriceServiceConnection}});var r=El;Object.defineProperty(e,"SuiPythClient",{enumerable:!0,get:function(){return r.SuiPythClient}});var n=Ed;Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return n.Price}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return n.PriceFeed}})})(_f);var B7=Object.create,e0=Object.defineProperty,U7=Object.defineProperties,F7=Object.getOwnPropertyDescriptor,$7=Object.getOwnPropertyDescriptors,Iv=Object.getOwnPropertyNames,Gh=Object.getOwnPropertySymbols,V7=Object.getPrototypeOf,Rv=Object.prototype.hasOwnProperty,z7=Object.prototype.propertyIsEnumerable,Kh=(e,t,r)=>t in e?e0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,q7=(e,t)=>{for(var r in t||(t={}))Rv.call(t,r)&&Kh(e,r,t[r]);if(Gh)for(var r of Gh(t))z7.call(t,r)&&Kh(e,r,t[r]);return e},H7=(e,t)=>U7(e,$7(t)),W7=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),G7=(e,t)=>function(){return t||(0,e[Iv(e)[0]])((t={exports:{}}).exports,t),t.exports},K7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Iv(t))!Rv.call(e,i)&&i!==r&&e0(e,i,{get:()=>t[i],enumerable:!(n=F7(t,i))||n.enumerable});return e},Uo=(e,t,r)=>(r=e!=null?B7(V7(e)):{},K7(!e||!e.__esModule?e0(r,"default",{value:e,enumerable:!0}):r,e)),dt=(e,t,r)=>new Promise((n,i)=>{var o=c=>{try{a(r.next(c))}catch(l){i(l)}},s=c=>{try{a(r.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,s);a((r=r.apply(e,t)).next())}),Fo=G7({"node_modules/bn.js/lib/bn.js"(e,t){(function(r,n){function i(h,f){if(!h)throw new Error(f||"Assertion failed")}function o(h,f){h.super_=f;var m=function(){};m.prototype=f.prototype,h.prototype=new m,h.prototype.constructor=h}function s(h,f,m){if(s.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((f==="le"||f==="be")&&(m=f,f=10),this._init(h||0,f||10,m||"be"))}typeof r=="object"?r.exports=s:n.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=W7("buffer").Buffer}catch{}s.isBN=function(f){return f instanceof s?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===s.wordSize&&Array.isArray(f.words)},s.max=function(f,m){return f.cmp(m)>0?f:m},s.min=function(f,m){return f.cmp(m)<0?f:m},s.prototype._init=function(f,m,S){if(typeof f=="number")return this._initNumber(f,m,S);if(typeof f=="object")return this._initArray(f,m,S);m==="hex"&&(m=16),i(m===(m|0)&&m>=2&&m<=36),f=f.toString().replace(/\s+/g,"");var T=0;f[0]==="-"&&(T++,this.negative=1),T<f.length&&(m===16?this._parseHex(f,T,S):(this._parseBase(f,m,T),S==="le"&&this._initArray(this.toArray(),m,S)))},s.prototype._initNumber=function(f,m,S){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(i(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),S==="le"&&this._initArray(this.toArray(),m,S)},s.prototype._initArray=function(f,m,S){if(i(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var T=0;T<this.length;T++)this.words[T]=0;var E,I,C=0;if(S==="be")for(T=f.length-1,E=0;T>=0;T-=3)I=f[T]|f[T-1]<<8|f[T-2]<<16,this.words[E]|=I<<C&67108863,this.words[E+1]=I>>>26-C&67108863,C+=24,C>=26&&(C-=26,E++);else if(S==="le")for(T=0,E=0;T<f.length;T+=3)I=f[T]|f[T+1]<<8|f[T+2]<<16,this.words[E]|=I<<C&67108863,this.words[E+1]=I>>>26-C&67108863,C+=24,C>=26&&(C-=26,E++);return this._strip()};function c(h,f){var m=h.charCodeAt(f);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;i(!1,"Invalid character in "+h)}function l(h,f,m){var S=c(h,m);return m-1>=f&&(S|=c(h,m-1)<<4),S}s.prototype._parseHex=function(f,m,S){this.length=Math.ceil((f.length-m)/6),this.words=new Array(this.length);for(var T=0;T<this.length;T++)this.words[T]=0;var E=0,I=0,C;if(S==="be")for(T=f.length-1;T>=m;T-=2)C=l(f,m,T)<<E,this.words[I]|=C&67108863,E>=18?(E-=18,I+=1,this.words[I]|=C>>>26):E+=8;else{var g=f.length-m;for(T=g%2===0?m+1:m;T<f.length;T+=2)C=l(f,m,T)<<E,this.words[I]|=C&67108863,E>=18?(E-=18,I+=1,this.words[I]|=C>>>26):E+=8}this._strip()};function u(h,f,m,S){for(var T=0,E=0,I=Math.min(h.length,m),C=f;C<I;C++){var g=h.charCodeAt(C)-48;T*=S,g>=49?E=g-49+10:g>=17?E=g-17+10:E=g,i(g>=0&&E<S,"Invalid character"),T+=E}return T}s.prototype._parseBase=function(f,m,S){this.words=[0],this.length=1;for(var T=0,E=1;E<=67108863;E*=m)T++;T--,E=E/m|0;for(var I=f.length-S,C=I%T,g=Math.min(I,I-C)+S,v=0,j=S;j<g;j+=T)v=u(f,j,j+T,m),this.imuln(E),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v);if(C!==0){var Q=1;for(v=u(f,j,f.length,m),j=0;j<C;j++)Q*=m;this.imuln(Q),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v)}this._strip()},s.prototype.copy=function(f){f.words=new Array(this.length);for(var m=0;m<this.length;m++)f.words[m]=this.words[m];f.length=this.length,f.negative=this.negative,f.red=this.red};function d(h,f){h.words=f.words,h.length=f.length,h.negative=f.negative,h.red=f.red}if(s.prototype._move=function(f){d(f,this)},s.prototype.clone=function(){var f=new s(null);return this.copy(f),f},s.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=p}catch{s.prototype.inspect=p}else s.prototype.inspect=p;function p(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],b=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(f,m){f=f||10,m=m|0||1;var S;if(f===16||f==="hex"){S="";for(var T=0,E=0,I=0;I<this.length;I++){var C=this.words[I],g=((C<<T|E)&16777215).toString(16);E=C>>>24-T&16777215,T+=2,T>=26&&(T-=26,I--),E!==0||I!==this.length-1?S=y[6-g.length]+g+S:S=g+S}for(E!==0&&(S=E.toString(16)+S);S.length%m!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}if(f===(f|0)&&f>=2&&f<=36){var v=x[f],j=b[f];S="";var Q=this.clone();for(Q.negative=0;!Q.isZero();){var Z=Q.modrn(j).toString(f);Q=Q.idivn(j),Q.isZero()?S=Z+S:S=y[v-Z.length]+Z+S}for(this.isZero()&&(S="0"+S);S.length%m!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(f,m){return this.toArrayLike(a,f,m)}),s.prototype.toArray=function(f,m){return this.toArrayLike(Array,f,m)};var M=function(f,m){return f.allocUnsafe?f.allocUnsafe(m):new f(m)};s.prototype.toArrayLike=function(f,m,S){this._strip();var T=this.byteLength(),E=S||Math.max(1,T);i(T<=E,"byte array longer than desired length"),i(E>0,"Requested array length <= 0");var I=M(f,E),C=m==="le"?"LE":"BE";return this["_toArrayLike"+C](I,T),I},s.prototype._toArrayLikeLE=function(f,m){for(var S=0,T=0,E=0,I=0;E<this.length;E++){var C=this.words[E]<<I|T;f[S++]=C&255,S<f.length&&(f[S++]=C>>8&255),S<f.length&&(f[S++]=C>>16&255),I===6?(S<f.length&&(f[S++]=C>>24&255),T=0,I=0):(T=C>>>24,I+=2)}if(S<f.length)for(f[S++]=T;S<f.length;)f[S++]=0},s.prototype._toArrayLikeBE=function(f,m){for(var S=f.length-1,T=0,E=0,I=0;E<this.length;E++){var C=this.words[E]<<I|T;f[S--]=C&255,S>=0&&(f[S--]=C>>8&255),S>=0&&(f[S--]=C>>16&255),I===6?(S>=0&&(f[S--]=C>>24&255),T=0,I=0):(T=C>>>24,I+=2)}if(S>=0)for(f[S--]=T;S>=0;)f[S--]=0},Math.clz32?s.prototype._countBits=function(f){return 32-Math.clz32(f)}:s.prototype._countBits=function(f){var m=f,S=0;return m>=4096&&(S+=13,m>>>=13),m>=64&&(S+=7,m>>>=7),m>=8&&(S+=4,m>>>=4),m>=2&&(S+=2,m>>>=2),S+m},s.prototype._zeroBits=function(f){if(f===0)return 26;var m=f,S=0;return m&8191||(S+=13,m>>>=13),m&127||(S+=7,m>>>=7),m&15||(S+=4,m>>>=4),m&3||(S+=2,m>>>=2),m&1||S++,S},s.prototype.bitLength=function(){var f=this.words[this.length-1],m=this._countBits(f);return(this.length-1)*26+m};function R(h){for(var f=new Array(h.bitLength()),m=0;m<f.length;m++){var S=m/26|0,T=m%26;f[m]=h.words[S]>>>T&1}return f}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,m=0;m<this.length;m++){var S=this._zeroBits(this.words[m]);if(f+=S,S!==26)break}return f},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},s.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var m=0;m<f.length;m++)this.words[m]=this.words[m]|f.words[m];return this._strip()},s.prototype.ior=function(f){return i((this.negative|f.negative)===0),this.iuor(f)},s.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},s.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},s.prototype.iuand=function(f){var m;this.length>f.length?m=f:m=this;for(var S=0;S<m.length;S++)this.words[S]=this.words[S]&f.words[S];return this.length=m.length,this._strip()},s.prototype.iand=function(f){return i((this.negative|f.negative)===0),this.iuand(f)},s.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},s.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},s.prototype.iuxor=function(f){var m,S;this.length>f.length?(m=this,S=f):(m=f,S=this);for(var T=0;T<S.length;T++)this.words[T]=m.words[T]^S.words[T];if(this!==m)for(;T<m.length;T++)this.words[T]=m.words[T];return this.length=m.length,this._strip()},s.prototype.ixor=function(f){return i((this.negative|f.negative)===0),this.iuxor(f)},s.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},s.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},s.prototype.inotn=function(f){i(typeof f=="number"&&f>=0);var m=Math.ceil(f/26)|0,S=f%26;this._expand(m),S>0&&m--;for(var T=0;T<m;T++)this.words[T]=~this.words[T]&67108863;return S>0&&(this.words[T]=~this.words[T]&67108863>>26-S),this._strip()},s.prototype.notn=function(f){return this.clone().inotn(f)},s.prototype.setn=function(f,m){i(typeof f=="number"&&f>=0);var S=f/26|0,T=f%26;return this._expand(S+1),m?this.words[S]=this.words[S]|1<<T:this.words[S]=this.words[S]&~(1<<T),this._strip()},s.prototype.iadd=function(f){var m;if(this.negative!==0&&f.negative===0)return this.negative=0,m=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,m=this.isub(f),f.negative=1,m._normSign();var S,T;this.length>f.length?(S=this,T=f):(S=f,T=this);for(var E=0,I=0;I<T.length;I++)m=(S.words[I]|0)+(T.words[I]|0)+E,this.words[I]=m&67108863,E=m>>>26;for(;E!==0&&I<S.length;I++)m=(S.words[I]|0)+E,this.words[I]=m&67108863,E=m>>>26;if(this.length=S.length,E!==0)this.words[this.length]=E,this.length++;else if(S!==this)for(;I<S.length;I++)this.words[I]=S.words[I];return this},s.prototype.add=function(f){var m;return f.negative!==0&&this.negative===0?(f.negative=0,m=this.sub(f),f.negative^=1,m):f.negative===0&&this.negative!==0?(this.negative=0,m=f.sub(this),this.negative=1,m):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},s.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var m=this.iadd(f);return f.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var S=this.cmp(f);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var T,E;S>0?(T=this,E=f):(T=f,E=this);for(var I=0,C=0;C<E.length;C++)m=(T.words[C]|0)-(E.words[C]|0)+I,I=m>>26,this.words[C]=m&67108863;for(;I!==0&&C<T.length;C++)m=(T.words[C]|0)+I,I=m>>26,this.words[C]=m&67108863;if(I===0&&C<T.length&&T!==this)for(;C<T.length;C++)this.words[C]=T.words[C];return this.length=Math.max(this.length,C),T!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(f){return this.clone().isub(f)};function P(h,f,m){m.negative=f.negative^h.negative;var S=h.length+f.length|0;m.length=S,S=S-1|0;var T=h.words[0]|0,E=f.words[0]|0,I=T*E,C=I&67108863,g=I/67108864|0;m.words[0]=C;for(var v=1;v<S;v++){for(var j=g>>>26,Q=g&67108863,Z=Math.min(v,f.length-1),ce=Math.max(0,v-h.length+1);ce<=Z;ce++){var be=v-ce|0;T=h.words[be]|0,E=f.words[ce]|0,I=T*E+Q,j+=I/67108864|0,Q=I&67108863}m.words[v]=Q|0,g=j|0}return g!==0?m.words[v]=g|0:m.length--,m._strip()}var k=function(f,m,S){var T=f.words,E=m.words,I=S.words,C=0,g,v,j,Q=T[0]|0,Z=Q&8191,ce=Q>>>13,be=T[1]|0,xe=be&8191,pe=be>>>13,Le=T[2]|0,Ae=Le&8191,Je=Le>>>13,ft=T[3]|0,je=ft&8191,pt=ft>>>13,we=T[4]|0,he=we&8191,Ce=we>>>13,Ve=T[5]|0,ke=Ve&8191,Te=Ve>>>13,Me=T[6]|0,Ue=Me&8191,lt=Me>>>13,ut=T[7]|0,ze=ut&8191,kt=ut>>>13,_t=T[8]|0,Ke=_t&8191,Mt=_t>>>13,Ut=T[9]|0,et=Ut&8191,Et=Ut>>>13,It=E[0]|0,nt=It&8191,jt=It>>>13,Pt=E[1]|0,tt=Pt&8191,wt=Pt>>>13,Ct=E[2]|0,Ge=Ct&8191,mt=Ct>>>13,Nt=E[3]|0,it=Nt&8191,xt=Nt>>>13,zt=E[4]|0,N=zt&8191,_=zt>>>13,A=E[5]|0,U=A&8191,Y=A>>>13,ee=E[6]|0,ne=ee&8191,De=ee>>>13,Ze=E[7]|0,Ne=Ze&8191,V=Ze>>>13,ae=E[8]|0,fe=ae&8191,Oe=ae>>>13,qe=E[9]|0,Pe=qe&8191,Fe=qe>>>13;S.negative=f.negative^m.negative,S.length=19,g=Math.imul(Z,nt),v=Math.imul(Z,jt),v=v+Math.imul(ce,nt)|0,j=Math.imul(ce,jt);var ot=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(ot>>>26)|0,ot&=67108863,g=Math.imul(xe,nt),v=Math.imul(xe,jt),v=v+Math.imul(pe,nt)|0,j=Math.imul(pe,jt),g=g+Math.imul(Z,tt)|0,v=v+Math.imul(Z,wt)|0,v=v+Math.imul(ce,tt)|0,j=j+Math.imul(ce,wt)|0;var Jt=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,g=Math.imul(Ae,nt),v=Math.imul(Ae,jt),v=v+Math.imul(Je,nt)|0,j=Math.imul(Je,jt),g=g+Math.imul(xe,tt)|0,v=v+Math.imul(xe,wt)|0,v=v+Math.imul(pe,tt)|0,j=j+Math.imul(pe,wt)|0,g=g+Math.imul(Z,Ge)|0,v=v+Math.imul(Z,mt)|0,v=v+Math.imul(ce,Ge)|0,j=j+Math.imul(ce,mt)|0;var Dt=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,g=Math.imul(je,nt),v=Math.imul(je,jt),v=v+Math.imul(pt,nt)|0,j=Math.imul(pt,jt),g=g+Math.imul(Ae,tt)|0,v=v+Math.imul(Ae,wt)|0,v=v+Math.imul(Je,tt)|0,j=j+Math.imul(Je,wt)|0,g=g+Math.imul(xe,Ge)|0,v=v+Math.imul(xe,mt)|0,v=v+Math.imul(pe,Ge)|0,j=j+Math.imul(pe,mt)|0,g=g+Math.imul(Z,it)|0,v=v+Math.imul(Z,xt)|0,v=v+Math.imul(ce,it)|0,j=j+Math.imul(ce,xt)|0;var Ft=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,g=Math.imul(he,nt),v=Math.imul(he,jt),v=v+Math.imul(Ce,nt)|0,j=Math.imul(Ce,jt),g=g+Math.imul(je,tt)|0,v=v+Math.imul(je,wt)|0,v=v+Math.imul(pt,tt)|0,j=j+Math.imul(pt,wt)|0,g=g+Math.imul(Ae,Ge)|0,v=v+Math.imul(Ae,mt)|0,v=v+Math.imul(Je,Ge)|0,j=j+Math.imul(Je,mt)|0,g=g+Math.imul(xe,it)|0,v=v+Math.imul(xe,xt)|0,v=v+Math.imul(pe,it)|0,j=j+Math.imul(pe,xt)|0,g=g+Math.imul(Z,N)|0,v=v+Math.imul(Z,_)|0,v=v+Math.imul(ce,N)|0,j=j+Math.imul(ce,_)|0;var or=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(or>>>26)|0,or&=67108863,g=Math.imul(ke,nt),v=Math.imul(ke,jt),v=v+Math.imul(Te,nt)|0,j=Math.imul(Te,jt),g=g+Math.imul(he,tt)|0,v=v+Math.imul(he,wt)|0,v=v+Math.imul(Ce,tt)|0,j=j+Math.imul(Ce,wt)|0,g=g+Math.imul(je,Ge)|0,v=v+Math.imul(je,mt)|0,v=v+Math.imul(pt,Ge)|0,j=j+Math.imul(pt,mt)|0,g=g+Math.imul(Ae,it)|0,v=v+Math.imul(Ae,xt)|0,v=v+Math.imul(Je,it)|0,j=j+Math.imul(Je,xt)|0,g=g+Math.imul(xe,N)|0,v=v+Math.imul(xe,_)|0,v=v+Math.imul(pe,N)|0,j=j+Math.imul(pe,_)|0,g=g+Math.imul(Z,U)|0,v=v+Math.imul(Z,Y)|0,v=v+Math.imul(ce,U)|0,j=j+Math.imul(ce,Y)|0;var _r=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(_r>>>26)|0,_r&=67108863,g=Math.imul(Ue,nt),v=Math.imul(Ue,jt),v=v+Math.imul(lt,nt)|0,j=Math.imul(lt,jt),g=g+Math.imul(ke,tt)|0,v=v+Math.imul(ke,wt)|0,v=v+Math.imul(Te,tt)|0,j=j+Math.imul(Te,wt)|0,g=g+Math.imul(he,Ge)|0,v=v+Math.imul(he,mt)|0,v=v+Math.imul(Ce,Ge)|0,j=j+Math.imul(Ce,mt)|0,g=g+Math.imul(je,it)|0,v=v+Math.imul(je,xt)|0,v=v+Math.imul(pt,it)|0,j=j+Math.imul(pt,xt)|0,g=g+Math.imul(Ae,N)|0,v=v+Math.imul(Ae,_)|0,v=v+Math.imul(Je,N)|0,j=j+Math.imul(Je,_)|0,g=g+Math.imul(xe,U)|0,v=v+Math.imul(xe,Y)|0,v=v+Math.imul(pe,U)|0,j=j+Math.imul(pe,Y)|0,g=g+Math.imul(Z,ne)|0,v=v+Math.imul(Z,De)|0,v=v+Math.imul(ce,ne)|0,j=j+Math.imul(ce,De)|0;var ur=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(ur>>>26)|0,ur&=67108863,g=Math.imul(ze,nt),v=Math.imul(ze,jt),v=v+Math.imul(kt,nt)|0,j=Math.imul(kt,jt),g=g+Math.imul(Ue,tt)|0,v=v+Math.imul(Ue,wt)|0,v=v+Math.imul(lt,tt)|0,j=j+Math.imul(lt,wt)|0,g=g+Math.imul(ke,Ge)|0,v=v+Math.imul(ke,mt)|0,v=v+Math.imul(Te,Ge)|0,j=j+Math.imul(Te,mt)|0,g=g+Math.imul(he,it)|0,v=v+Math.imul(he,xt)|0,v=v+Math.imul(Ce,it)|0,j=j+Math.imul(Ce,xt)|0,g=g+Math.imul(je,N)|0,v=v+Math.imul(je,_)|0,v=v+Math.imul(pt,N)|0,j=j+Math.imul(pt,_)|0,g=g+Math.imul(Ae,U)|0,v=v+Math.imul(Ae,Y)|0,v=v+Math.imul(Je,U)|0,j=j+Math.imul(Je,Y)|0,g=g+Math.imul(xe,ne)|0,v=v+Math.imul(xe,De)|0,v=v+Math.imul(pe,ne)|0,j=j+Math.imul(pe,De)|0,g=g+Math.imul(Z,Ne)|0,v=v+Math.imul(Z,V)|0,v=v+Math.imul(ce,Ne)|0,j=j+Math.imul(ce,V)|0;var Zt=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,g=Math.imul(Ke,nt),v=Math.imul(Ke,jt),v=v+Math.imul(Mt,nt)|0,j=Math.imul(Mt,jt),g=g+Math.imul(ze,tt)|0,v=v+Math.imul(ze,wt)|0,v=v+Math.imul(kt,tt)|0,j=j+Math.imul(kt,wt)|0,g=g+Math.imul(Ue,Ge)|0,v=v+Math.imul(Ue,mt)|0,v=v+Math.imul(lt,Ge)|0,j=j+Math.imul(lt,mt)|0,g=g+Math.imul(ke,it)|0,v=v+Math.imul(ke,xt)|0,v=v+Math.imul(Te,it)|0,j=j+Math.imul(Te,xt)|0,g=g+Math.imul(he,N)|0,v=v+Math.imul(he,_)|0,v=v+Math.imul(Ce,N)|0,j=j+Math.imul(Ce,_)|0,g=g+Math.imul(je,U)|0,v=v+Math.imul(je,Y)|0,v=v+Math.imul(pt,U)|0,j=j+Math.imul(pt,Y)|0,g=g+Math.imul(Ae,ne)|0,v=v+Math.imul(Ae,De)|0,v=v+Math.imul(Je,ne)|0,j=j+Math.imul(Je,De)|0,g=g+Math.imul(xe,Ne)|0,v=v+Math.imul(xe,V)|0,v=v+Math.imul(pe,Ne)|0,j=j+Math.imul(pe,V)|0,g=g+Math.imul(Z,fe)|0,v=v+Math.imul(Z,Oe)|0,v=v+Math.imul(ce,fe)|0,j=j+Math.imul(ce,Oe)|0;var wr=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(wr>>>26)|0,wr&=67108863,g=Math.imul(et,nt),v=Math.imul(et,jt),v=v+Math.imul(Et,nt)|0,j=Math.imul(Et,jt),g=g+Math.imul(Ke,tt)|0,v=v+Math.imul(Ke,wt)|0,v=v+Math.imul(Mt,tt)|0,j=j+Math.imul(Mt,wt)|0,g=g+Math.imul(ze,Ge)|0,v=v+Math.imul(ze,mt)|0,v=v+Math.imul(kt,Ge)|0,j=j+Math.imul(kt,mt)|0,g=g+Math.imul(Ue,it)|0,v=v+Math.imul(Ue,xt)|0,v=v+Math.imul(lt,it)|0,j=j+Math.imul(lt,xt)|0,g=g+Math.imul(ke,N)|0,v=v+Math.imul(ke,_)|0,v=v+Math.imul(Te,N)|0,j=j+Math.imul(Te,_)|0,g=g+Math.imul(he,U)|0,v=v+Math.imul(he,Y)|0,v=v+Math.imul(Ce,U)|0,j=j+Math.imul(Ce,Y)|0,g=g+Math.imul(je,ne)|0,v=v+Math.imul(je,De)|0,v=v+Math.imul(pt,ne)|0,j=j+Math.imul(pt,De)|0,g=g+Math.imul(Ae,Ne)|0,v=v+Math.imul(Ae,V)|0,v=v+Math.imul(Je,Ne)|0,j=j+Math.imul(Je,V)|0,g=g+Math.imul(xe,fe)|0,v=v+Math.imul(xe,Oe)|0,v=v+Math.imul(pe,fe)|0,j=j+Math.imul(pe,Oe)|0,g=g+Math.imul(Z,Pe)|0,v=v+Math.imul(Z,Fe)|0,v=v+Math.imul(ce,Pe)|0,j=j+Math.imul(ce,Fe)|0;var bn=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(bn>>>26)|0,bn&=67108863,g=Math.imul(et,tt),v=Math.imul(et,wt),v=v+Math.imul(Et,tt)|0,j=Math.imul(Et,wt),g=g+Math.imul(Ke,Ge)|0,v=v+Math.imul(Ke,mt)|0,v=v+Math.imul(Mt,Ge)|0,j=j+Math.imul(Mt,mt)|0,g=g+Math.imul(ze,it)|0,v=v+Math.imul(ze,xt)|0,v=v+Math.imul(kt,it)|0,j=j+Math.imul(kt,xt)|0,g=g+Math.imul(Ue,N)|0,v=v+Math.imul(Ue,_)|0,v=v+Math.imul(lt,N)|0,j=j+Math.imul(lt,_)|0,g=g+Math.imul(ke,U)|0,v=v+Math.imul(ke,Y)|0,v=v+Math.imul(Te,U)|0,j=j+Math.imul(Te,Y)|0,g=g+Math.imul(he,ne)|0,v=v+Math.imul(he,De)|0,v=v+Math.imul(Ce,ne)|0,j=j+Math.imul(Ce,De)|0,g=g+Math.imul(je,Ne)|0,v=v+Math.imul(je,V)|0,v=v+Math.imul(pt,Ne)|0,j=j+Math.imul(pt,V)|0,g=g+Math.imul(Ae,fe)|0,v=v+Math.imul(Ae,Oe)|0,v=v+Math.imul(Je,fe)|0,j=j+Math.imul(Je,Oe)|0,g=g+Math.imul(xe,Pe)|0,v=v+Math.imul(xe,Fe)|0,v=v+Math.imul(pe,Pe)|0,j=j+Math.imul(pe,Fe)|0;var $r=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+($r>>>26)|0,$r&=67108863,g=Math.imul(et,Ge),v=Math.imul(et,mt),v=v+Math.imul(Et,Ge)|0,j=Math.imul(Et,mt),g=g+Math.imul(Ke,it)|0,v=v+Math.imul(Ke,xt)|0,v=v+Math.imul(Mt,it)|0,j=j+Math.imul(Mt,xt)|0,g=g+Math.imul(ze,N)|0,v=v+Math.imul(ze,_)|0,v=v+Math.imul(kt,N)|0,j=j+Math.imul(kt,_)|0,g=g+Math.imul(Ue,U)|0,v=v+Math.imul(Ue,Y)|0,v=v+Math.imul(lt,U)|0,j=j+Math.imul(lt,Y)|0,g=g+Math.imul(ke,ne)|0,v=v+Math.imul(ke,De)|0,v=v+Math.imul(Te,ne)|0,j=j+Math.imul(Te,De)|0,g=g+Math.imul(he,Ne)|0,v=v+Math.imul(he,V)|0,v=v+Math.imul(Ce,Ne)|0,j=j+Math.imul(Ce,V)|0,g=g+Math.imul(je,fe)|0,v=v+Math.imul(je,Oe)|0,v=v+Math.imul(pt,fe)|0,j=j+Math.imul(pt,Oe)|0,g=g+Math.imul(Ae,Pe)|0,v=v+Math.imul(Ae,Fe)|0,v=v+Math.imul(Je,Pe)|0,j=j+Math.imul(Je,Fe)|0;var yn=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(yn>>>26)|0,yn&=67108863,g=Math.imul(et,it),v=Math.imul(et,xt),v=v+Math.imul(Et,it)|0,j=Math.imul(Et,xt),g=g+Math.imul(Ke,N)|0,v=v+Math.imul(Ke,_)|0,v=v+Math.imul(Mt,N)|0,j=j+Math.imul(Mt,_)|0,g=g+Math.imul(ze,U)|0,v=v+Math.imul(ze,Y)|0,v=v+Math.imul(kt,U)|0,j=j+Math.imul(kt,Y)|0,g=g+Math.imul(Ue,ne)|0,v=v+Math.imul(Ue,De)|0,v=v+Math.imul(lt,ne)|0,j=j+Math.imul(lt,De)|0,g=g+Math.imul(ke,Ne)|0,v=v+Math.imul(ke,V)|0,v=v+Math.imul(Te,Ne)|0,j=j+Math.imul(Te,V)|0,g=g+Math.imul(he,fe)|0,v=v+Math.imul(he,Oe)|0,v=v+Math.imul(Ce,fe)|0,j=j+Math.imul(Ce,Oe)|0,g=g+Math.imul(je,Pe)|0,v=v+Math.imul(je,Fe)|0,v=v+Math.imul(pt,Pe)|0,j=j+Math.imul(pt,Fe)|0;var ii=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(ii>>>26)|0,ii&=67108863,g=Math.imul(et,N),v=Math.imul(et,_),v=v+Math.imul(Et,N)|0,j=Math.imul(Et,_),g=g+Math.imul(Ke,U)|0,v=v+Math.imul(Ke,Y)|0,v=v+Math.imul(Mt,U)|0,j=j+Math.imul(Mt,Y)|0,g=g+Math.imul(ze,ne)|0,v=v+Math.imul(ze,De)|0,v=v+Math.imul(kt,ne)|0,j=j+Math.imul(kt,De)|0,g=g+Math.imul(Ue,Ne)|0,v=v+Math.imul(Ue,V)|0,v=v+Math.imul(lt,Ne)|0,j=j+Math.imul(lt,V)|0,g=g+Math.imul(ke,fe)|0,v=v+Math.imul(ke,Oe)|0,v=v+Math.imul(Te,fe)|0,j=j+Math.imul(Te,Oe)|0,g=g+Math.imul(he,Pe)|0,v=v+Math.imul(he,Fe)|0,v=v+Math.imul(Ce,Pe)|0,j=j+Math.imul(Ce,Fe)|0;var oi=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(oi>>>26)|0,oi&=67108863,g=Math.imul(et,U),v=Math.imul(et,Y),v=v+Math.imul(Et,U)|0,j=Math.imul(Et,Y),g=g+Math.imul(Ke,ne)|0,v=v+Math.imul(Ke,De)|0,v=v+Math.imul(Mt,ne)|0,j=j+Math.imul(Mt,De)|0,g=g+Math.imul(ze,Ne)|0,v=v+Math.imul(ze,V)|0,v=v+Math.imul(kt,Ne)|0,j=j+Math.imul(kt,V)|0,g=g+Math.imul(Ue,fe)|0,v=v+Math.imul(Ue,Oe)|0,v=v+Math.imul(lt,fe)|0,j=j+Math.imul(lt,Oe)|0,g=g+Math.imul(ke,Pe)|0,v=v+Math.imul(ke,Fe)|0,v=v+Math.imul(Te,Pe)|0,j=j+Math.imul(Te,Fe)|0;var wn=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(wn>>>26)|0,wn&=67108863,g=Math.imul(et,ne),v=Math.imul(et,De),v=v+Math.imul(Et,ne)|0,j=Math.imul(Et,De),g=g+Math.imul(Ke,Ne)|0,v=v+Math.imul(Ke,V)|0,v=v+Math.imul(Mt,Ne)|0,j=j+Math.imul(Mt,V)|0,g=g+Math.imul(ze,fe)|0,v=v+Math.imul(ze,Oe)|0,v=v+Math.imul(kt,fe)|0,j=j+Math.imul(kt,Oe)|0,g=g+Math.imul(Ue,Pe)|0,v=v+Math.imul(Ue,Fe)|0,v=v+Math.imul(lt,Pe)|0,j=j+Math.imul(lt,Fe)|0;var si=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(si>>>26)|0,si&=67108863,g=Math.imul(et,Ne),v=Math.imul(et,V),v=v+Math.imul(Et,Ne)|0,j=Math.imul(Et,V),g=g+Math.imul(Ke,fe)|0,v=v+Math.imul(Ke,Oe)|0,v=v+Math.imul(Mt,fe)|0,j=j+Math.imul(Mt,Oe)|0,g=g+Math.imul(ze,Pe)|0,v=v+Math.imul(ze,Fe)|0,v=v+Math.imul(kt,Pe)|0,j=j+Math.imul(kt,Fe)|0;var ai=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(ai>>>26)|0,ai&=67108863,g=Math.imul(et,fe),v=Math.imul(et,Oe),v=v+Math.imul(Et,fe)|0,j=Math.imul(Et,Oe),g=g+Math.imul(Ke,Pe)|0,v=v+Math.imul(Ke,Fe)|0,v=v+Math.imul(Mt,Pe)|0,j=j+Math.imul(Mt,Fe)|0;var D=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(D>>>26)|0,D&=67108863,g=Math.imul(et,Pe),v=Math.imul(et,Fe),v=v+Math.imul(Et,Pe)|0,j=Math.imul(Et,Fe);var K=(C+g|0)+((v&8191)<<13)|0;return C=(j+(v>>>13)|0)+(K>>>26)|0,K&=67108863,I[0]=ot,I[1]=Jt,I[2]=Dt,I[3]=Ft,I[4]=or,I[5]=_r,I[6]=ur,I[7]=Zt,I[8]=wr,I[9]=bn,I[10]=$r,I[11]=yn,I[12]=ii,I[13]=oi,I[14]=wn,I[15]=si,I[16]=ai,I[17]=D,I[18]=K,C!==0&&(I[19]=C,S.length++),S};Math.imul||(k=P);function F(h,f,m){m.negative=f.negative^h.negative,m.length=h.length+f.length;for(var S=0,T=0,E=0;E<m.length-1;E++){var I=T;T=0;for(var C=S&67108863,g=Math.min(E,f.length-1),v=Math.max(0,E-h.length+1);v<=g;v++){var j=E-v,Q=h.words[j]|0,Z=f.words[v]|0,ce=Q*Z,be=ce&67108863;I=I+(ce/67108864|0)|0,be=be+C|0,C=be&67108863,I=I+(be>>>26)|0,T+=I>>>26,I&=67108863}m.words[E]=C,S=I,I=T}return S!==0?m.words[E]=S:m.length--,m._strip()}function B(h,f,m){return F(h,f,m)}s.prototype.mulTo=function(f,m){var S,T=this.length+f.length;return this.length===10&&f.length===10?S=k(this,f,m):T<63?S=P(this,f,m):T<1024?S=F(this,f,m):S=B(this,f,m),S},s.prototype.mul=function(f){var m=new s(null);return m.words=new Array(this.length+f.length),this.mulTo(f,m)},s.prototype.mulf=function(f){var m=new s(null);return m.words=new Array(this.length+f.length),B(this,f,m)},s.prototype.imul=function(f){return this.clone().mulTo(f,this)},s.prototype.imuln=function(f){var m=f<0;m&&(f=-f),i(typeof f=="number"),i(f<67108864);for(var S=0,T=0;T<this.length;T++){var E=(this.words[T]|0)*f,I=(E&67108863)+(S&67108863);S>>=26,S+=E/67108864|0,S+=I>>>26,this.words[T]=I&67108863}return S!==0&&(this.words[T]=S,this.length++),m?this.ineg():this},s.prototype.muln=function(f){return this.clone().imuln(f)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(f){var m=R(f);if(m.length===0)return new s(1);for(var S=this,T=0;T<m.length&&m[T]===0;T++,S=S.sqr());if(++T<m.length)for(var E=S.sqr();T<m.length;T++,E=E.sqr())m[T]!==0&&(S=S.mul(E));return S},s.prototype.iushln=function(f){i(typeof f=="number"&&f>=0);var m=f%26,S=(f-m)/26,T=67108863>>>26-m<<26-m,E;if(m!==0){var I=0;for(E=0;E<this.length;E++){var C=this.words[E]&T,g=(this.words[E]|0)-C<<m;this.words[E]=g|I,I=C>>>26-m}I&&(this.words[E]=I,this.length++)}if(S!==0){for(E=this.length-1;E>=0;E--)this.words[E+S]=this.words[E];for(E=0;E<S;E++)this.words[E]=0;this.length+=S}return this._strip()},s.prototype.ishln=function(f){return i(this.negative===0),this.iushln(f)},s.prototype.iushrn=function(f,m,S){i(typeof f=="number"&&f>=0);var T;m?T=(m-m%26)/26:T=0;var E=f%26,I=Math.min((f-E)/26,this.length),C=67108863^67108863>>>E<<E,g=S;if(T-=I,T=Math.max(0,T),g){for(var v=0;v<I;v++)g.words[v]=this.words[v];g.length=I}if(I!==0)if(this.length>I)for(this.length-=I,v=0;v<this.length;v++)this.words[v]=this.words[v+I];else this.words[0]=0,this.length=1;var j=0;for(v=this.length-1;v>=0&&(j!==0||v>=T);v--){var Q=this.words[v]|0;this.words[v]=j<<26-E|Q>>>E,j=Q&C}return g&&j!==0&&(g.words[g.length++]=j),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(f,m,S){return i(this.negative===0),this.iushrn(f,m,S)},s.prototype.shln=function(f){return this.clone().ishln(f)},s.prototype.ushln=function(f){return this.clone().iushln(f)},s.prototype.shrn=function(f){return this.clone().ishrn(f)},s.prototype.ushrn=function(f){return this.clone().iushrn(f)},s.prototype.testn=function(f){i(typeof f=="number"&&f>=0);var m=f%26,S=(f-m)/26,T=1<<m;if(this.length<=S)return!1;var E=this.words[S];return!!(E&T)},s.prototype.imaskn=function(f){i(typeof f=="number"&&f>=0);var m=f%26,S=(f-m)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=S)return this;if(m!==0&&S++,this.length=Math.min(S,this.length),m!==0){var T=67108863^67108863>>>m<<m;this.words[this.length-1]&=T}return this._strip()},s.prototype.maskn=function(f){return this.clone().imaskn(f)},s.prototype.iaddn=function(f){return i(typeof f=="number"),i(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},s.prototype._iaddn=function(f){this.words[0]+=f;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(f){if(i(typeof f=="number"),i(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this._strip()},s.prototype.addn=function(f){return this.clone().iaddn(f)},s.prototype.subn=function(f){return this.clone().isubn(f)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(f,m,S){var T=f.length+S,E;this._expand(T);var I,C=0;for(E=0;E<f.length;E++){I=(this.words[E+S]|0)+C;var g=(f.words[E]|0)*m;I-=g&67108863,C=(I>>26)-(g/67108864|0),this.words[E+S]=I&67108863}for(;E<this.length-S;E++)I=(this.words[E+S]|0)+C,C=I>>26,this.words[E+S]=I&67108863;if(C===0)return this._strip();for(i(C===-1),C=0,E=0;E<this.length;E++)I=-(this.words[E]|0)+C,C=I>>26,this.words[E]=I&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(f,m){var S=this.length-f.length,T=this.clone(),E=f,I=E.words[E.length-1]|0,C=this._countBits(I);S=26-C,S!==0&&(E=E.ushln(S),T.iushln(S),I=E.words[E.length-1]|0);var g=T.length-E.length,v;if(m!=="mod"){v=new s(null),v.length=g+1,v.words=new Array(v.length);for(var j=0;j<v.length;j++)v.words[j]=0}var Q=T.clone()._ishlnsubmul(E,1,g);Q.negative===0&&(T=Q,v&&(v.words[g]=1));for(var Z=g-1;Z>=0;Z--){var ce=(T.words[E.length+Z]|0)*67108864+(T.words[E.length+Z-1]|0);for(ce=Math.min(ce/I|0,67108863),T._ishlnsubmul(E,ce,Z);T.negative!==0;)ce--,T.negative=0,T._ishlnsubmul(E,1,Z),T.isZero()||(T.negative^=1);v&&(v.words[Z]=ce)}return v&&v._strip(),T._strip(),m!=="div"&&S!==0&&T.iushrn(S),{div:v||null,mod:T}},s.prototype.divmod=function(f,m,S){if(i(!f.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var T,E,I;return this.negative!==0&&f.negative===0?(I=this.neg().divmod(f,m),m!=="mod"&&(T=I.div.neg()),m!=="div"&&(E=I.mod.neg(),S&&E.negative!==0&&E.iadd(f)),{div:T,mod:E}):this.negative===0&&f.negative!==0?(I=this.divmod(f.neg(),m),m!=="mod"&&(T=I.div.neg()),{div:T,mod:I.mod}):this.negative&f.negative?(I=this.neg().divmod(f.neg(),m),m!=="div"&&(E=I.mod.neg(),S&&E.negative!==0&&E.isub(f)),{div:I.div,mod:E}):f.length>this.length||this.cmp(f)<0?{div:new s(0),mod:this}:f.length===1?m==="div"?{div:this.divn(f.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new s(this.modrn(f.words[0]))}:this._wordDiv(f,m)},s.prototype.div=function(f){return this.divmod(f,"div",!1).div},s.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},s.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},s.prototype.divRound=function(f){var m=this.divmod(f);if(m.mod.isZero())return m.div;var S=m.div.negative!==0?m.mod.isub(f):m.mod,T=f.ushrn(1),E=f.andln(1),I=S.cmp(T);return I<0||E===1&&I===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(f){var m=f<0;m&&(f=-f),i(f<=67108863);for(var S=(1<<26)%f,T=0,E=this.length-1;E>=0;E--)T=(S*T+(this.words[E]|0))%f;return m?-T:T},s.prototype.modn=function(f){return this.modrn(f)},s.prototype.idivn=function(f){var m=f<0;m&&(f=-f),i(f<=67108863);for(var S=0,T=this.length-1;T>=0;T--){var E=(this.words[T]|0)+S*67108864;this.words[T]=E/f|0,S=E%f}return this._strip(),m?this.ineg():this},s.prototype.divn=function(f){return this.clone().idivn(f)},s.prototype.egcd=function(f){i(f.negative===0),i(!f.isZero());var m=this,S=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var T=new s(1),E=new s(0),I=new s(0),C=new s(1),g=0;m.isEven()&&S.isEven();)m.iushrn(1),S.iushrn(1),++g;for(var v=S.clone(),j=m.clone();!m.isZero();){for(var Q=0,Z=1;!(m.words[0]&Z)&&Q<26;++Q,Z<<=1);if(Q>0)for(m.iushrn(Q);Q-- >0;)(T.isOdd()||E.isOdd())&&(T.iadd(v),E.isub(j)),T.iushrn(1),E.iushrn(1);for(var ce=0,be=1;!(S.words[0]&be)&&ce<26;++ce,be<<=1);if(ce>0)for(S.iushrn(ce);ce-- >0;)(I.isOdd()||C.isOdd())&&(I.iadd(v),C.isub(j)),I.iushrn(1),C.iushrn(1);m.cmp(S)>=0?(m.isub(S),T.isub(I),E.isub(C)):(S.isub(m),I.isub(T),C.isub(E))}return{a:I,b:C,gcd:S.iushln(g)}},s.prototype._invmp=function(f){i(f.negative===0),i(!f.isZero());var m=this,S=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var T=new s(1),E=new s(0),I=S.clone();m.cmpn(1)>0&&S.cmpn(1)>0;){for(var C=0,g=1;!(m.words[0]&g)&&C<26;++C,g<<=1);if(C>0)for(m.iushrn(C);C-- >0;)T.isOdd()&&T.iadd(I),T.iushrn(1);for(var v=0,j=1;!(S.words[0]&j)&&v<26;++v,j<<=1);if(v>0)for(S.iushrn(v);v-- >0;)E.isOdd()&&E.iadd(I),E.iushrn(1);m.cmp(S)>=0?(m.isub(S),T.isub(E)):(S.isub(m),E.isub(T))}var Q;return m.cmpn(1)===0?Q=T:Q=E,Q.cmpn(0)<0&&Q.iadd(f),Q},s.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var m=this.clone(),S=f.clone();m.negative=0,S.negative=0;for(var T=0;m.isEven()&&S.isEven();T++)m.iushrn(1),S.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;S.isEven();)S.iushrn(1);var E=m.cmp(S);if(E<0){var I=m;m=S,S=I}else if(E===0||S.cmpn(1)===0)break;m.isub(S)}while(!0);return S.iushln(T)},s.prototype.invm=function(f){return this.egcd(f).a.umod(f)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(f){return this.words[0]&f},s.prototype.bincn=function(f){i(typeof f=="number");var m=f%26,S=(f-m)/26,T=1<<m;if(this.length<=S)return this._expand(S+1),this.words[S]|=T,this;for(var E=T,I=S;E!==0&&I<this.length;I++){var C=this.words[I]|0;C+=E,E=C>>>26,C&=67108863,this.words[I]=C}return E!==0&&(this.words[I]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(f){var m=f<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var S;if(this.length>1)S=1;else{m&&(f=-f),i(f<=67108863,"Number is too big");var T=this.words[0]|0;S=T===f?0:T<f?-1:1}return this.negative!==0?-S|0:S},s.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var m=this.ucmp(f);return this.negative!==0?-m|0:m},s.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var m=0,S=this.length-1;S>=0;S--){var T=this.words[S]|0,E=f.words[S]|0;if(T!==E){T<E?m=-1:T>E&&(m=1);break}}return m},s.prototype.gtn=function(f){return this.cmpn(f)===1},s.prototype.gt=function(f){return this.cmp(f)===1},s.prototype.gten=function(f){return this.cmpn(f)>=0},s.prototype.gte=function(f){return this.cmp(f)>=0},s.prototype.ltn=function(f){return this.cmpn(f)===-1},s.prototype.lt=function(f){return this.cmp(f)===-1},s.prototype.lten=function(f){return this.cmpn(f)<=0},s.prototype.lte=function(f){return this.cmp(f)<=0},s.prototype.eqn=function(f){return this.cmpn(f)===0},s.prototype.eq=function(f){return this.cmp(f)===0},s.red=function(f){return new q(f)},s.prototype.toRed=function(f){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(f){return this.red=f,this},s.prototype.forceRed=function(f){return i(!this.red,"Already a number in reduction context"),this._forceRed(f)},s.prototype.redAdd=function(f){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},s.prototype.redIAdd=function(f){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},s.prototype.redSub=function(f){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},s.prototype.redISub=function(f){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},s.prototype.redShl=function(f){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},s.prototype.redMul=function(f){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},s.prototype.redIMul=function(f){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(f){return i(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var W={k256:null,p224:null,p192:null,p25519:null};function z(h,f){this.name=h,this.p=new s(f,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var f=new s(null);return f.words=new Array(Math.ceil(this.n/13)),f},z.prototype.ireduce=function(f){var m=f,S;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),S=m.bitLength();while(S>this.n);var T=S<this.n?-1:m.ucmp(this.p);return T===0?(m.words[0]=0,m.length=1):T>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},z.prototype.split=function(f,m){f.iushrn(this.n,0,m)},z.prototype.imulK=function(f){return f.imul(this.k)};function G(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(G,z),G.prototype.split=function(f,m){for(var S=4194303,T=Math.min(f.length,9),E=0;E<T;E++)m.words[E]=f.words[E];if(m.length=T,f.length<=9){f.words[0]=0,f.length=1;return}var I=f.words[9];for(m.words[m.length++]=I&S,E=10;E<f.length;E++){var C=f.words[E]|0;f.words[E-10]=(C&S)<<4|I>>>22,I=C}I>>>=22,f.words[E-10]=I,I===0&&f.length>10?f.length-=10:f.length-=9},G.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var m=0,S=0;S<f.length;S++){var T=f.words[S]|0;m+=T*977,f.words[S]=m&67108863,m=T*64+(m/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function re(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(re,z);function oe(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(oe,z);function se(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(se,z),se.prototype.imulK=function(f){for(var m=0,S=0;S<f.length;S++){var T=(f.words[S]|0)*19+m,E=T&67108863;T>>>=26,f.words[S]=E,m=T}return m!==0&&(f.words[f.length++]=m),f},s._prime=function(f){if(W[f])return W[f];var m;if(f==="k256")m=new G;else if(f==="p224")m=new re;else if(f==="p192")m=new oe;else if(f==="p25519")m=new se;else throw new Error("Unknown prime "+f);return W[f]=m,m};function q(h){if(typeof h=="string"){var f=s._prime(h);this.m=f.p,this.prime=f}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}q.prototype._verify1=function(f){i(f.negative===0,"red works only with positives"),i(f.red,"red works only with red numbers")},q.prototype._verify2=function(f,m){i((f.negative|m.negative)===0,"red works only with positives"),i(f.red&&f.red===m.red,"red works only with red numbers")},q.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(d(f,f.umod(this.m)._forceRed(this)),f)},q.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},q.prototype.add=function(f,m){this._verify2(f,m);var S=f.add(m);return S.cmp(this.m)>=0&&S.isub(this.m),S._forceRed(this)},q.prototype.iadd=function(f,m){this._verify2(f,m);var S=f.iadd(m);return S.cmp(this.m)>=0&&S.isub(this.m),S},q.prototype.sub=function(f,m){this._verify2(f,m);var S=f.sub(m);return S.cmpn(0)<0&&S.iadd(this.m),S._forceRed(this)},q.prototype.isub=function(f,m){this._verify2(f,m);var S=f.isub(m);return S.cmpn(0)<0&&S.iadd(this.m),S},q.prototype.shl=function(f,m){return this._verify1(f),this.imod(f.ushln(m))},q.prototype.imul=function(f,m){return this._verify2(f,m),this.imod(f.imul(m))},q.prototype.mul=function(f,m){return this._verify2(f,m),this.imod(f.mul(m))},q.prototype.isqr=function(f){return this.imul(f,f.clone())},q.prototype.sqr=function(f){return this.mul(f,f)},q.prototype.sqrt=function(f){if(f.isZero())return f.clone();var m=this.m.andln(3);if(i(m%2===1),m===3){var S=this.m.add(new s(1)).iushrn(2);return this.pow(f,S)}for(var T=this.m.subn(1),E=0;!T.isZero()&&T.andln(1)===0;)E++,T.iushrn(1);i(!T.isZero());var I=new s(1).toRed(this),C=I.redNeg(),g=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new s(2*v*v).toRed(this);this.pow(v,g).cmp(C)!==0;)v.redIAdd(C);for(var j=this.pow(v,T),Q=this.pow(f,T.addn(1).iushrn(1)),Z=this.pow(f,T),ce=E;Z.cmp(I)!==0;){for(var be=Z,xe=0;be.cmp(I)!==0;xe++)be=be.redSqr();i(xe<ce);var pe=this.pow(j,new s(1).iushln(ce-xe-1));Q=Q.redMul(pe),j=pe.redSqr(),Z=Z.redMul(j),ce=xe}return Q},q.prototype.invm=function(f){var m=f._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},q.prototype.pow=function(f,m){if(m.isZero())return new s(1).toRed(this);if(m.cmpn(1)===0)return f.clone();var S=4,T=new Array(1<<S);T[0]=new s(1).toRed(this),T[1]=f;for(var E=2;E<T.length;E++)T[E]=this.mul(T[E-1],f);var I=T[0],C=0,g=0,v=m.bitLength()%26;for(v===0&&(v=26),E=m.length-1;E>=0;E--){for(var j=m.words[E],Q=v-1;Q>=0;Q--){var Z=j>>Q&1;if(I!==T[0]&&(I=this.sqr(I)),Z===0&&C===0){g=0;continue}C<<=1,C|=Z,g++,!(g!==S&&(E!==0||Q!==0))&&(I=this.mul(I,T[C]),g=0,C=0)}v=26}return I},q.prototype.convertTo=function(f){var m=f.umod(this.m);return m===f?m.clone():m},q.prototype.convertFrom=function(f){var m=f.clone();return m.red=null,m},s.mont=function(f){return new L(f)};function L(h){q.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}o(L,q),L.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},L.prototype.convertFrom=function(f){var m=this.imod(f.mul(this.rinv));return m.red=null,m},L.prototype.imul=function(f,m){if(f.isZero()||m.isZero())return f.words[0]=0,f.length=1,f;var S=f.imul(m),T=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=S.isub(T).iushrn(this.shift),I=E;return E.cmp(this.m)>=0?I=E.isub(this.m):E.cmpn(0)<0&&(I=E.iadd(this.m)),I._forceRed(this)},L.prototype.mul=function(f,m){if(f.isZero()||m.isZero())return new s(0)._forceRed(this);var S=f.mul(m),T=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=S.isub(T).iushrn(this.shift),I=E;return E.cmp(this.m)>=0?I=E.isub(this.m):E.cmpn(0)<0&&(I=E.iadd(this.m)),I._forceRed(this)},L.prototype.invm=function(f){var m=this.imod(f._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(typeof t>"u"||t,e)}}),is=9e15,no=1e9,kf="0123456789abcdef",Uc="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Fc="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",jf={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-is,maxE:is,crypto:!1},Ov,wi,st=!0,Cl="[DecimalError] ",Yi=Cl+"Invalid argument: ",Pv=Cl+"Precision limit exceeded",Nv=Cl+"crypto unavailable",kv="[object Decimal]",kr=Math.floor,gr=Math.pow,Y7=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,X7=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,J7=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,jv=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,On=1e7,Ye=7,Z7=9007199254740991,Q7=Uc.length-1,Df=Fc.length-1,ge={toStringTag:kv};ge.absoluteValue=ge.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),He(e)};ge.ceil=function(){return He(new this.constructor(this),this.e+1,2)};ge.clampedTo=ge.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Yi+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};ge.comparedTo=ge.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,c=o.s,l=e.s;if(!s||!a)return!c||!l?NaN:c!==l?c:s===a?0:!s^c<0?1:-1;if(!s[0]||!a[0])return s[0]?c:a[0]?-l:0;if(c!==l)return c;if(o.e!==e.e)return o.e>e.e^c<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};ge.cosine=ge.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ye,n.rounding=1,r=e9(n,Fv(n,r)),n.precision=e,n.rounding=t,He(wi==2||wi==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};ge.cubeRoot=ge.cbrt=function(){var e,t,r,n,i,o,s,a,c,l,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(st=!1,o=u.s*gr(u.s*u,1/3),!o||Math.abs(o)==1/0?(r=Ar(u.d),e=u.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=gr(r,1/3),e=kr((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new d(r),n.s=u.s):n=new d(o.toString()),s=(e=d.precision)+3;;)if(a=n,c=a.times(a).times(a),l=c.plus(u),n=Gt(l.plus(u).times(a),l.plus(c),s+2,1),Ar(a.d).slice(0,s)===(r=Ar(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(He(a,e+1,0),a.times(a).times(a).eq(u))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(He(n,e+1,1),t=!n.times(n).times(n).eq(u));break}return st=!0,He(n,e,d.rounding,t)};ge.decimalPlaces=ge.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-kr(this.e/Ye))*Ye,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};ge.dividedBy=ge.div=function(e){return Gt(this,new this.constructor(e))};ge.dividedToIntegerBy=ge.divToInt=function(e){var t=this,r=t.constructor;return He(Gt(t,new r(e),0,1,1),r.precision,r.rounding)};ge.equals=ge.eq=function(e){return this.cmp(e)===0};ge.floor=function(){return He(new this.constructor(this),this.e+1,3)};ge.greaterThan=ge.gt=function(e){return this.cmp(e)>0};ge.greaterThanOrEqualTo=ge.gte=function(e){var t=this.cmp(e);return t==1||t===0};ge.hyperbolicCosine=ge.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Al(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=gs(s,1,o.times(t),new s(1),!0);for(var c,l=e,u=new s(8);l--;)c=o.times(o),o=a.minus(c.times(u.minus(c.times(u))));return He(o,s.precision=r,s.rounding=n,!0)};ge.hyperbolicSine=ge.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=gs(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Al(5,e)),i=gs(o,2,i,i,!0);for(var s,a=new o(5),c=new o(16),l=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(c.times(s).plus(l))))}return o.precision=t,o.rounding=r,He(i,t,r,!0)};ge.hyperbolicTangent=ge.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,Gt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};ge.inverseCosine=ge.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?Mn(r,i,o):new r(0):new r(NaN):t.isZero()?Mn(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=Mn(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};ge.inverseHyperbolicCosine=ge.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,st=!1,r=r.times(r).minus(1).sqrt().plus(r),st=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};ge.inverseHyperbolicSine=ge.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,st=!1,r=r.times(r).plus(1).sqrt().plus(r),st=!0,n.precision=e,n.rounding=t,r.ln())};ge.inverseHyperbolicTangent=ge.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?He(new o(i),e,t,!0):(o.precision=r=n-i.e,i=Gt(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};ge.inverseSine=ge.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=Mn(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};ge.inverseTangent=ge.atan=function(){var e,t,r,n,i,o,s,a,c,l=this,u=l.constructor,d=u.precision,p=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&d+4<=Df)return s=Mn(u,d+4,p).times(.25),s.s=l.s,s}else{if(!l.s)return new u(NaN);if(d+4<=Df)return s=Mn(u,d+4,p).times(.5),s.s=l.s,s}for(u.precision=a=d+10,u.rounding=1,r=Math.min(28,a/Ye+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(st=!1,t=Math.ceil(a/Ye),n=1,c=l.times(l),s=new u(l),i=l;e!==-1;)if(i=i.times(c),o=s.minus(i.div(n+=2)),i=i.times(c),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),st=!0,He(s,u.precision=d,u.rounding=p,!0)};ge.isFinite=function(){return!!this.d};ge.isInteger=ge.isInt=function(){return!!this.d&&kr(this.e/Ye)>this.d.length-2};ge.isNaN=function(){return!this.s};ge.isNegative=ge.isNeg=function(){return this.s<0};ge.isPositive=ge.isPos=function(){return this.s>0};ge.isZero=function(){return!!this.d&&this.d[0]===0};ge.lessThan=ge.lt=function(e){return this.cmp(e)<0};ge.lessThanOrEqualTo=ge.lte=function(e){return this.cmp(e)<1};ge.logarithm=ge.log=function(e){var t,r,n,i,o,s,a,c,l=this,u=l.constructor,d=u.precision,p=u.rounding,y=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new u(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(st=!1,a=d+y,s=qi(l,a),n=t?$c(u,a+10):qi(e,a),c=Gt(s,n,a,1),ha(c.d,i=d,p))do if(a+=10,s=qi(l,a),n=t?$c(u,a+10):qi(e,a),c=Gt(s,n,a,1),!o){+Ar(c.d).slice(i+1,i+15)+1==1e14&&(c=He(c,d+1,0));break}while(ha(c.d,i+=10,p));return st=!0,He(c,d,p)};ge.minus=ge.sub=function(e){var t,r,n,i,o,s,a,c,l,u,d,p,y=this,x=y.constructor;if(e=new x(e),!y.d||!e.d)return!y.s||!e.s?e=new x(NaN):y.d?e.s=-e.s:e=new x(e.d||y.s!==e.s?y:NaN),e;if(y.s!=e.s)return e.s=-e.s,y.plus(e);if(l=y.d,p=e.d,a=x.precision,c=x.rounding,!l[0]||!p[0]){if(p[0])e.s=-e.s;else if(l[0])e=new x(y);else return new x(c===3?-0:0);return st?He(e,a,c):e}if(r=kr(e.e/Ye),u=kr(y.e/Ye),l=l.slice(),o=u-r,o){for(d=o<0,d?(t=l,o=-o,s=p.length):(t=p,r=u,s=l.length),n=Math.max(Math.ceil(a/Ye),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=p.length,d=n<s,d&&(s=n),n=0;n<s;n++)if(l[n]!=p[n]){d=l[n]<p[n];break}o=0}for(d&&(t=l,l=p,p=t,e.s=-e.s),s=l.length,n=p.length-s;n>0;--n)l[s++]=0;for(n=p.length;n>o;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=On-1;--l[i],l[n]+=On}l[n]-=p[n]}for(;l[--s]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=Tl(l,r),st?He(e,a,c):e):new x(c===3?-0:0)};ge.modulo=ge.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?He(new n(r),n.precision,n.rounding):(st=!1,n.modulo==9?(t=Gt(r,e.abs(),0,3,1),t.s*=e.s):t=Gt(r,e,0,n.modulo,1),t=t.times(e),st=!0,r.minus(t))};ge.naturalExponential=ge.exp=function(){return Lf(this)};ge.naturalLogarithm=ge.ln=function(){return qi(this)};ge.negated=ge.neg=function(){var e=new this.constructor(this);return e.s=-e.s,He(e)};ge.plus=ge.add=function(e){var t,r,n,i,o,s,a,c,l,u,d=this,p=d.constructor;if(e=new p(e),!d.d||!e.d)return!d.s||!e.s?e=new p(NaN):d.d||(e=new p(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(l=d.d,u=e.d,a=p.precision,c=p.rounding,!l[0]||!u[0])return u[0]||(e=new p(d)),st?He(e,a,c):e;if(o=kr(d.e/Ye),n=kr(e.e/Ye),l=l.slice(),i=o-n,i){for(i<0?(r=l,i=-i,s=u.length):(r=u,n=o,s=l.length),o=Math.ceil(a/Ye),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=u.length,s-i<0&&(i=s,r=u,u=l,l=r),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/On|0,l[i]%=On;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=Tl(l,n),st?He(e,a,c):e};ge.precision=ge.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Yi+e);return r.d?(t=Dv(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};ge.round=function(){var e=this,t=e.constructor;return He(new t(e),e.e+1,t.rounding)};ge.sine=ge.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ye,n.rounding=1,r=r9(n,Fv(n,r)),n.precision=e,n.rounding=t,He(wi>2?r.neg():r,e,t,!0)):new n(NaN)};ge.squareRoot=ge.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,c=s.e,l=s.s,u=s.constructor;if(l!==1||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(st=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=Ar(a),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=kr((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new u(t)):n=new u(l.toString()),r=(c=u.precision)+3;;)if(o=n,n=o.plus(Gt(s,o,r+2,1)).times(.5),Ar(o.d).slice(0,r)===(t=Ar(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(He(o,c+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(He(n,c+1,1),e=!n.times(n).eq(s));break}return st=!0,He(n,c,u.rounding,e)};ge.tangent=ge.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=Gt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,He(wi==2||wi==4?r.neg():r,e,t,!0)):new n(NaN)};ge.times=ge.mul=function(e){var t,r,n,i,o,s,a,c,l,u=this,d=u.constructor,p=u.d,y=(e=new d(e)).d;if(e.s*=u.s,!p||!p[0]||!y||!y[0])return new d(!e.s||p&&!p[0]&&!y||y&&!y[0]&&!p?NaN:!p||!y?e.s/0:e.s*0);for(r=kr(u.e/Ye)+kr(e.e/Ye),c=p.length,l=y.length,c<l&&(o=p,p=y,y=o,s=c,c=l,l=s),o=[],s=c+l,n=s;n--;)o.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)a=o[i]+y[n]*p[i-n-1]+t,o[i--]=a%On|0,t=a/On|0;o[i]=(o[i]+t)%On|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Tl(o,r),st?He(e,d.precision,d.rounding):e};ge.toBinary=function(e,t){return t0(this,2,e,t)};ge.toDecimalPlaces=ge.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(qr(e,0,no),t===void 0?t=n.rounding:qr(t,0,8),He(r,e+r.e+1,t))};ge.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Jn(n,!0):(qr(e,0,no),t===void 0?t=i.rounding:qr(t,0,8),n=He(new i(n),e+1,t),r=Jn(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};ge.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Jn(i):(qr(e,0,no),t===void 0?t=o.rounding:qr(t,0,8),n=He(new o(i),e+i.e+1,t),r=Jn(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};ge.toFraction=function(e){var t,r,n,i,o,s,a,c,l,u,d,p,y=this,x=y.d,b=y.constructor;if(!x)return new b(y);if(l=r=new b(1),n=c=new b(0),t=new b(n),o=t.e=Dv(x)-y.e-1,s=o%Ye,t.d[0]=gr(10,s<0?Ye+s:s),e==null)e=o>0?t:l;else{if(a=new b(e),!a.isInt()||a.lt(l))throw Error(Yi+a);e=a.gt(t)?o>0?t:l:a}for(st=!1,a=new b(Ar(x)),u=b.precision,b.precision=o=x.length*Ye*2;d=Gt(a,t,0,1,1),i=r.plus(d.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(d.times(i)),c=i,i=t,t=a.minus(d.times(i)),a=i;return i=Gt(e.minus(r),n,0,1,1),c=c.plus(i.times(l)),r=r.plus(i.times(n)),c.s=l.s=y.s,p=Gt(l,n,o,1).minus(y).abs().cmp(Gt(c,r,o,1).minus(y).abs())<1?[l,n]:[c,r],b.precision=u,st=!0,p};ge.toHexadecimal=ge.toHex=function(e,t){return t0(this,16,e,t)};ge.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:qr(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(st=!1,r=Gt(r,e,0,t,1).times(e),st=!0,He(r)):(e.s=r.s,r=e),r};ge.toNumber=function(){return+this};ge.toOctal=function(e,t){return t0(this,8,e,t)};ge.toPower=ge.pow=function(e){var t,r,n,i,o,s,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(gr(+a,l));if(a=new c(a),a.eq(1))return a;if(n=c.precision,o=c.rounding,e.eq(1))return He(a,n,o);if(t=kr(e.e/Ye),t>=e.d.length-1&&(r=l<0?-l:l)<=Z7)return i=Lv(c,a,r,n),e.s<0?new c(1).div(i):He(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=gr(+a,l),t=r==0||!isFinite(r)?kr(l*(Math.log("0."+Ar(a.d))/Math.LN10+a.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?s/0:0):(st=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Lf(e.times(qi(a,n+r)),n),i.d&&(i=He(i,n+5,1),ha(i.d,n,o)&&(t=n+10,i=He(Lf(e.times(qi(a,t+r)),t),t+5,1),+Ar(i.d).slice(n+1,n+15)+1==1e14&&(i=He(i,n+1,0)))),i.s=s,st=!0,c.rounding=o,He(i,n,o))};ge.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Jn(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(qr(e,1,no),t===void 0?t=i.rounding:qr(t,0,8),n=He(new i(n),e,t),r=Jn(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};ge.toSignificantDigits=ge.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(qr(e,1,no),t===void 0?t=n.rounding:qr(t,0,8)),He(new n(r),e,t)};ge.toString=function(){var e=this,t=e.constructor,r=Jn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};ge.truncated=ge.trunc=function(){return He(new this.constructor(this),this.e+1,1)};ge.valueOf=ge.toJSON=function(){var e=this,t=e.constructor,r=Jn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Ar(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=Ye-n.length,r&&(o+=Fi(r)),o+=n;s=e[t],n=s+"",r=Ye-n.length,r&&(o+=Fi(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function qr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Yi+e)}function ha(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=Ye,i=0):(i=Math.ceil((t+1)/Ye),t%=Ye),o=gr(10,Ye-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==gr(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==gr(10,t-3)-1,s}function mc(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=kf.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function e9(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Al(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=gs(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var Gt=function(){function e(n,i,o){var s,a=0,c=n.length;for(n=n.slice();c--;)s=n[c]*i+a,n[c]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,c;if(o!=s)c=o>s?1:-1;else for(a=c=0;a<o;a++)if(n[a]!=i[a]){c=n[a]>i[a]?1:-1;break}return c}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<i[o]?1:0,n[o]=a*s+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s,a,c){var l,u,d,p,y,x,b,M,R,P,k,F,B,W,z,G,re,oe,se,q,L=n.constructor,h=n.s==i.s?1:-1,f=n.d,m=i.d;if(!f||!f[0]||!m||!m[0])return new L(!n.s||!i.s||(f?m&&f[0]==m[0]:!m)?NaN:f&&f[0]==0||!m?h*0:h/0);for(c?(y=1,u=n.e-i.e):(c=On,y=Ye,u=kr(n.e/y)-kr(i.e/y)),se=m.length,re=f.length,R=new L(h),P=R.d=[],d=0;m[d]==(f[d]||0);d++);if(m[d]>(f[d]||0)&&u--,o==null?(W=o=L.precision,s=L.rounding):a?W=o+(n.e-i.e)+1:W=o,W<0)P.push(1),x=!0;else{if(W=W/y+2|0,d=0,se==1){for(p=0,m=m[0],W++;(d<re||p)&&W--;d++)z=p*c+(f[d]||0),P[d]=z/m|0,p=z%m|0;x=p||d<re}else{for(p=c/(m[0]+1)|0,p>1&&(m=e(m,p,c),f=e(f,p,c),se=m.length,re=f.length),G=se,k=f.slice(0,se),F=k.length;F<se;)k[F++]=0;q=m.slice(),q.unshift(0),oe=m[0],m[1]>=c/2&&++oe;do p=0,l=t(m,k,se,F),l<0?(B=k[0],se!=F&&(B=B*c+(k[1]||0)),p=B/oe|0,p>1?(p>=c&&(p=c-1),b=e(m,p,c),M=b.length,F=k.length,l=t(b,k,M,F),l==1&&(p--,r(b,se<M?q:m,M,c))):(p==0&&(l=p=1),b=m.slice()),M=b.length,M<F&&b.unshift(0),r(k,b,F,c),l==-1&&(F=k.length,l=t(m,k,se,F),l<1&&(p++,r(k,se<F?q:m,F,c))),F=k.length):l===0&&(p++,k=[0]),P[d++]=p,l&&k[0]?k[F++]=f[G]||0:(k=[f[G]],F=1);while((G++<re||k[0]!==void 0)&&W--);x=k[0]!==void 0}P[0]||P.shift()}if(y==1)R.e=u,Ov=x;else{for(d=1,p=P[0];p>=10;p/=10)d++;R.e=d+u*y-1,He(R,a?o+R.e+1:o,s,x)}return R}}();function He(e,t,r,n){var i,o,s,a,c,l,u,d,p,y=e.constructor;e:if(t!=null){if(d=e.d,!d)return e;for(i=1,a=d[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=Ye,s=t,u=d[p=0],c=u/gr(10,i-s-1)%10|0;else if(p=Math.ceil((o+1)/Ye),a=d.length,p>=a)if(n){for(;a++<=p;)d.push(0);u=c=0,i=1,o%=Ye,s=o-Ye+1}else break e;else{for(u=a=d[p],i=1;a>=10;a/=10)i++;o%=Ye,s=o-Ye+i,c=s<0?0:u/gr(10,i-s-1)%10|0}if(n=n||t<0||d[p+1]!==void 0||(s<0?u:u%gr(10,i-s-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(o>0?s>0?u/gr(10,i-s):0:d[p-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=gr(10,(Ye-t%Ye)%Ye),e.e=-t||0):d[0]=e.e=0,e;if(o==0?(d.length=p,a=1,p--):(d.length=p+1,a=gr(10,Ye-o),d[p]=s>0?(u/gr(10,i-s)%gr(10,s)|0)*a:0),l)for(;;)if(p==0){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,d[0]==On&&(d[0]=1));break}else{if(d[p]+=a,d[p]!=On)break;d[p--]=0,a=1}for(o=d.length;d[--o]===0;)d.pop()}return st&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e<y.minE&&(e.e=0,e.d=[0])),e}function Jn(e,t,r){if(!e.isFinite())return Uv(e);var n,i=e.e,o=Ar(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+Fi(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Fi(-i-1)+o,r&&(n=r-s)>0&&(o+=Fi(n))):i>=s?(o+=Fi(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Fi(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=Fi(n))),o}function Tl(e,t){var r=e[0];for(t*=Ye;r>=10;r/=10)t++;return t}function $c(e,t,r){if(t>Q7)throw st=!0,r&&(e.precision=r),Error(Pv);return He(new e(Uc),t,1,!0)}function Mn(e,t,r){if(t>Df)throw Error(Pv);return He(new e(Fc),t,r,!0)}function Dv(e){var t=e.length-1,r=t*Ye+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Fi(e){for(var t="";e--;)t+="0";return t}function Lv(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/Ye+4);for(st=!1;;){if(r%2&&(o=o.times(t),Xh(o.d,s)&&(i=!0)),r=kr(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),Xh(t.d,s)}return st=!0,o}function Yh(e){return e.d[e.d.length-1]&1}function Bv(e,t,r){for(var n,i=new e(t[0]),o=0;++o<t.length;)if(n=new e(t[o]),n.s)i[r](n)&&(i=n);else{i=n;break}return i}function Lf(e,t){var r,n,i,o,s,a,c,l=0,u=0,d=0,p=e.constructor,y=p.rounding,x=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(st=!1,c=x):c=t,a=new p(.03125);e.e>-2;)e=e.times(a),d+=5;for(n=Math.log(gr(2,d))/Math.LN10*2+5|0,c+=n,r=o=s=new p(1),p.precision=c;;){if(o=He(o.times(e),c,1),r=r.times(++u),a=s.plus(Gt(o,r,c,1)),Ar(a.d).slice(0,c)===Ar(s.d).slice(0,c)){for(i=d;i--;)s=He(s.times(s),c,1);if(t==null)if(l<3&&ha(s.d,c-n,y,l))p.precision=c+=10,r=o=a=new p(1),u=0,l++;else return He(s,p.precision=x,y,st=!0);else return p.precision=x,s}s=a}}function qi(e,t){var r,n,i,o,s,a,c,l,u,d,p,y=1,x=10,b=e,M=b.d,R=b.constructor,P=R.rounding,k=R.precision;if(b.s<0||!M||!M[0]||!b.e&&M[0]==1&&M.length==1)return new R(M&&!M[0]?-1/0:b.s!=1?NaN:M?0:b);if(t==null?(st=!1,u=k):u=t,R.precision=u+=x,r=Ar(M),n=r.charAt(0),Math.abs(o=b.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)b=b.times(e),r=Ar(b.d),n=r.charAt(0),y++;o=b.e,n>1?(b=new R("0."+r),o++):b=new R(n+"."+r.slice(1))}else return l=$c(R,u+2,k).times(o+""),b=qi(new R(n+"."+r.slice(1)),u-x).plus(l),R.precision=k,t==null?He(b,k,P,st=!0):b;for(d=b,c=s=b=Gt(b.minus(1),b.plus(1),u,1),p=He(b.times(b),u,1),i=3;;){if(s=He(s.times(p),u,1),l=c.plus(Gt(s,new R(i),u,1)),Ar(l.d).slice(0,u)===Ar(c.d).slice(0,u))if(c=c.times(2),o!==0&&(c=c.plus($c(R,u+2,k).times(o+""))),c=Gt(c,new R(y),u,1),t==null)if(ha(c.d,u-x,P,a))R.precision=u+=x,l=s=b=Gt(d.minus(1),d.plus(1),u,1),p=He(b.times(b),u,1),i=a=1;else return He(c,R.precision=k,P,st=!0);else return R.precision=k,c;c=l,i+=2}}function Uv(e){return String(e.s*e.s/0)}function Bf(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%Ye,r<0&&(n+=Ye),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=Ye;n<i;)e.d.push(+t.slice(n,n+=Ye));t=t.slice(n),n=Ye-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),st&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function t9(e,t){var r,n,i,o,s,a,c,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),jv.test(t))return Bf(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(X7.test(t))r=16,t=t.toLowerCase();else if(Y7.test(t))r=2;else if(J7.test(t))r=8;else throw Error(Yi+t);for(o=t.search(/p/i),o>0?(c=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Lv(n,new n(r),o,o*2)),l=mc(t,r,On),u=l.length-1,o=u;l[o]===0;--o)l.pop();return o<0?new n(e.s*0):(e.e=Tl(l,u),e.d=l,st=!1,s&&(e=Gt(e,i,a*4)),c&&(e=e.times(Math.abs(c)<54?gr(2,c):Na.pow(2,c))),st=!0,e)}function r9(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:gs(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Al(5,r)),t=gs(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function gs(e,t,r,n,i){var o,s,a,c,l=e.precision,u=Math.ceil(l/Ye);for(st=!1,c=r.times(r),a=new e(n);;){if(s=Gt(a.times(c),new e(t++*t++),l,1),a=i?n.plus(s):n.minus(s),n=Gt(s.times(c),new e(t++*t++),l,1),s=a.plus(n),s.d[u]!==void 0){for(o=u;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o}return st=!0,s.d.length=u+1,s}function Al(e,t){for(var r=e;--t;)r*=e;return r}function Fv(e,t){var r,n=t.s<0,i=Mn(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return wi=n?4:1,t;if(r=t.divToInt(i),r.isZero())wi=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return wi=Yh(r)?n?2:3:n?4:1,t;wi=Yh(r)?n?1:4:n?3:2}return t.minus(i).abs()}function t0(e,t,r,n){var i,o,s,a,c,l,u,d,p,y=e.constructor,x=r!==void 0;if(x?(qr(r,1,no),n===void 0?n=y.rounding:qr(n,0,8)):(r=y.precision,n=y.rounding),!e.isFinite())u=Uv(e);else{for(u=Jn(e),s=u.indexOf("."),x?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(u=u.replace(".",""),p=new y(1),p.e=u.length-s,p.d=mc(Jn(p),10,i),p.e=p.d.length),d=mc(u,10,i),o=c=d.length;d[--c]==0;)d.pop();if(!d[0])u=x?"0p+0":"0";else{if(s<0?o--:(e=new y(e),e.d=d,e.e=o,e=Gt(e,p,r,n,0,i),d=e.d,o=e.e,l=Ov),s=d[r],a=i/2,l=l||d[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&d[r-1]&1||n===(e.s<0?8:7)),d.length=r,l)for(;++d[--r]>i-1;)d[r]=0,r||(++o,d.unshift(1));for(c=d.length;!d[c-1];--c);for(s=0,u="";s<c;s++)u+=kf.charAt(d[s]);if(x){if(c>1)if(t==16||t==8){for(s=t==16?4:3,--c;c%s;c++)u+="0";for(d=mc(u,i,t),c=d.length;!d[c-1];--c);for(s=1,u="1.";s<c;s++)u+=kf.charAt(d[s])}else u=u.charAt(0)+"."+u.slice(1);u=u+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)u="0"+u;u="0."+u}else if(++o>c)for(o-=c;o--;)u+="0";else o<c&&(u=u.slice(0,o)+"."+u.slice(o))}u=(t==16?"0x":t==2?"0b":t==8?"0o":"")+u}return e.s<0?"-"+u:u}function Xh(e,t){if(e.length>t)return e.length=t,!0}function n9(e){return new this(e).abs()}function i9(e){return new this(e).acos()}function o9(e){return new this(e).acosh()}function s9(e,t){return new this(e).plus(t)}function a9(e){return new this(e).asin()}function c9(e){return new this(e).asinh()}function l9(e){return new this(e).atan()}function u9(e){return new this(e).atanh()}function f9(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Mn(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Mn(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Mn(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(Gt(e,t,o,1)),t=Mn(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(Gt(e,t,o,1)),r}function d9(e){return new this(e).cbrt()}function h9(e){return He(e=new this(e),e.e+1,2)}function p9(e,t,r){return new this(e).clamp(t,r)}function m9(e){if(!e||typeof e!="object")throw Error(Cl+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,no,"rounding",0,8,"toExpNeg",-is,0,"toExpPos",0,is,"maxE",0,is,"minE",-is,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=jf[r]),(n=e[r])!==void 0)if(kr(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Yi+r+": "+n);if(r="crypto",i&&(this[r]=jf[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Nv);else this[r]=!1;else throw Error(Yi+r+": "+n);return this}function g9(e){return new this(e).cos()}function v9(e){return new this(e).cosh()}function $v(e){var t,r,n;function i(o){var s,a,c,l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,Jh(o)){l.s=o.s,st?!o.d||o.e>i.maxE?(l.e=NaN,l.d=null):o.e<i.minE?(l.e=0,l.d=[0]):(l.e=o.e,l.d=o.d.slice()):(l.e=o.e,l.d=o.d?o.d.slice():o.d);return}if(c=typeof o,c==="number"){if(o===0){l.s=1/o<0?-1:1,l.e=0,l.d=[0];return}if(o<0?(o=-o,l.s=-1):l.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;st?s>i.maxE?(l.e=NaN,l.d=null):s<i.minE?(l.e=0,l.d=[0]):(l.e=s,l.d=[o]):(l.e=s,l.d=[o]);return}else if(o*0!==0){o||(l.s=NaN),l.e=NaN,l.d=null;return}return Bf(l,o.toString())}else if(c!=="string")throw Error(Yi+o);return(a=o.charCodeAt(0))===45?(o=o.slice(1),l.s=-1):(a===43&&(o=o.slice(1)),l.s=1),jv.test(o)?Bf(l,o):t9(l,o)}if(i.prototype=ge,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=m9,i.clone=$v,i.isDecimal=Jh,i.abs=n9,i.acos=i9,i.acosh=o9,i.add=s9,i.asin=a9,i.asinh=c9,i.atan=l9,i.atanh=u9,i.atan2=f9,i.cbrt=d9,i.ceil=h9,i.clamp=p9,i.cos=g9,i.cosh=v9,i.div=b9,i.exp=y9,i.floor=w9,i.hypot=x9,i.ln=S9,i.log=_9,i.log10=C9,i.log2=E9,i.max=T9,i.min=A9,i.mod=M9,i.mul=I9,i.pow=R9,i.random=O9,i.round=P9,i.sign=N9,i.sin=k9,i.sinh=j9,i.sqrt=D9,i.sub=L9,i.sum=B9,i.tan=U9,i.tanh=F9,i.trunc=$9,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function b9(e,t){return new this(e).div(t)}function y9(e){return new this(e).exp()}function w9(e){return He(e=new this(e),e.e+1,3)}function x9(){var e,t,r=new this(0);for(st=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return st=!0,new this(1/0);r=t}return st=!0,r.sqrt()}function Jh(e){return e instanceof Na||e&&e.toStringTag===kv||!1}function S9(e){return new this(e).ln()}function _9(e,t){return new this(e).log(t)}function E9(e){return new this(e).log(2)}function C9(e){return new this(e).log(10)}function T9(){return Bv(this,arguments,"lt")}function A9(){return Bv(this,arguments,"gt")}function M9(e,t){return new this(e).mod(t)}function I9(e,t){return new this(e).mul(t)}function R9(e,t){return new this(e).pow(t)}function O9(e){var t,r,n,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:qr(e,1,no),n=Math.ceil(e/Ye),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(Nv);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],e%=Ye,n&&e&&(i=gr(10,Ye-e),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=Ye)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<Ye&&(r-=Ye-n)}return s.e=r,s.d=a,s}function P9(e){return He(e=new this(e),e.e+1,this.rounding)}function N9(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function k9(e){return new this(e).sin()}function j9(e){return new this(e).sinh()}function D9(e){return new this(e).sqrt()}function L9(e,t){return new this(e).sub(t)}function B9(){var e=0,t=arguments,r=new this(t[e]);for(st=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return st=!0,He(r,this.precision,this.rounding)}function U9(e){return new this(e).tan()}function F9(e){return new this(e).tanh()}function $9(e){return He(e=new this(e),e.e+1,1)}ge[Symbol.for("nodejs.util.inspect.custom")]=ge.toString;ge[Symbol.toStringTag]="Decimal";var Na=ge.constructor=$v(jf);Uc=new Na(Uc);Fc=new Na(Fc);var gc=Na,Ht=Uo(Fo()),Du=Uo(Fo()),V9=class{constructor(e){if(e!==0)throw new Error("Aftermath only supported on mainnet");this.slippage="900000000000000000",this.poolRegistry="0xfcc774493db2c45c79f688f88d28023a3e7d98e4ee9f48bbf5c7990f651577ae",this.protocolFeeVault="0xf194d9b1bcad972e45a7dd67dd49b3ee1e3357a00a50850c52cd51bb450e13b4",this.treasury="0x28e499dff5e864a2eafe476269a4f5035f1c16f338da7be18b103499abf271ce",this.insuranceFund="0xf0c40d67b078000e18032334c3325c47b9ec9f3d9ae4128be820d54663d14e3b",this.referrealVault="0x35d35b0e5b177593d8c3a801462485572fc30861e6ce96a55af6dc4730709278"}amountLimit(e){return new Du.default(e).mul(new Du.default(this.slippage)).div(new Du.default("1000000000000000000")).toString()}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s];if(r.extendedDetails==null)throw new Error("Extended details not supported");if(r.extendedDetails.aftermathLpSupplyType==null)throw new Error("LP supply type not supported");const d=[t.object(r.id),t.object(this.poolRegistry),t.object(this.protocolFeeVault),t.object(this.treasury),t.object(this.insuranceFund),t.object(this.referrealVault),t.pure.u64(this.amountLimit(r.amountOut)),t.pure.u64(this.slippage),n],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::aftermath::${c}`,typeArguments:[l,u,r.extendedDetails.aftermathLpSupplyType],arguments:d})})}},Zh="0x000000000000000000000000000000000000000000000000000000000000dee9",z9=class{constructor(e){if(e!==0)throw new Error("Aftermath only supported on mainnet")}getAccountCap(e,t){return dt(this,null,function*(){let r=50,n=null;for(;;){const i=e.getOwnedObjects({owner:t,cursor:n,limit:r,filter:{MoveModule:{package:Zh,module:"custodian_v2"}}});if(i!=null&&i.data!=null){if(i.data.length!==0)return i.data[0].data.objectId;if(i.data.length<50)break}else break}return null})}getOrCreateAccountCap(e,t,r){return dt(this,null,function*(){let n=yield this.getAccountCap(t,r);return n!==null?{accountCap:e.object(n),isCreate:!1}:{accountCap:e.moveCall({target:`${Zh}::clob_v2::create_account`,typeArguments:[],arguments:[]}),isCreate:!0}})}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=yield this.getOrCreateAccountCap(t,e.client,e.signer),p=[t.object(r.id),n,d.accountCap,t.object(Hr)],y=xr(e.publishedAtV2(),i),x=t.moveCall({target:`${y}::deepbook::${c}`,typeArguments:[l,u],arguments:p});return d.isCreate&&t.transferObjects([d.accountCap],e.signer),x})}},q9=class{constructor(e){if(e!==0)throw new Error("Kriya amm only supported on mainnet")}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(r.id),n],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::kriya_amm::${c}`,typeArguments:[l,u],arguments:d})})}},H9=class{constructor(e){if(e!==0)throw new Error("Kriya clmm only supported on mainnet");this.version="0xf5145a7ac345ca8736cf8c76047d00d6d378f30e81be6f6eb557184d9de93c78"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(r.id),n,t.object(this.version),t.object(Hr)],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::kriya_clmm::${c}`,typeArguments:[l,u],arguments:d})})}},W9=class{constructor(e){if(e!==0)throw new Error("Flowx only supported on mainnet");this.container="0xb65dcbf63fd3ad5d0ebfbf334780dc9f785eff38a4459e37ab08fa79576ee511"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(this.container),n],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::flowx_amm::${c}`,typeArguments:[l,u],arguments:d})})}},G9=class{constructor(e){if(e!==0)throw new Error("Flowx clmm only supported on mainnet");this.versioned="0x67624a1533b5aff5d0dfcf5e598684350efd38134d2d245f475524c03a64e656",this.poolRegistry="0x27565d24a4cd51127ac90e4074a841bbe356cca7bf5759ddc14a975be1632abc"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(this.poolRegistry),t.pure.u64(r.feeRate*1e6),n,t.object(this.versioned),t.object(Hr)],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::flowx_clmm::${c}`,typeArguments:[l,u],arguments:d})})}},K9=class{constructor(e){if(e!==0)throw new Error("Turbos only supported on mainnet");this.versioned="0xf1cf0e81048df168ebeb1b8030fad24b3e0b53ae827c25053fff0779c1445b6f"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s];if(r.extendedDetails==null)throw new Error("Extended details not supported");if(r.extendedDetails.turbosFeeType==null)throw new Error("Turbos fee type not supported");const d=[t.object(r.id),n,t.object(Hr),t.object(this.versioned)],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::turbos::${c}`,typeArguments:[l,u,r.extendedDetails.turbosFeeType],arguments:d})})}},Qh=class{constructor(e,t){this.globalConfig=e===0?"0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f":"0x9774e359588ead122af1c7e7f64e14ade261cfeecdb5d0eb4a5b3b4c8ab8bd3e",this.partner=t??(e===0?"0x639b5e433da31739e800cd085f356e64cae222966d0f1b11bd9dc76b322ff58b":"0x1f5fa5c820f40d43fc47815ad06d95e40a1942ff72a732a92e8ef4aa8cde70a5")}flash_swap(e,t,r,n,i){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["flash_swap_a2b",s,a]:["flash_swap_b2a",a,s];let d=n?r.amountIn:r.amountOut;const p=[t.object(this.globalConfig),t.object(r.id),t.object(this.partner),t.pure.u64(d),t.pure.bool(n),t.object(Hr)],y=xr(e.publishedAtV2(),i),x=t.moveCall({target:`${y}::cetus::${c}`,typeArguments:[l,u],arguments:p});return{targetCoin:x[0],flashReceipt:x[1],payAmount:x[2]}}repay_flash_swap(e,t,r,n,i,o){const{direction:s,from:a,target:c}=r,[l,u,d]=s?["repay_flash_swap_a2b",a,c]:["repay_flash_swap_b2a",c,a],p=[t.object(this.globalConfig),t.object(r.id),t.object(this.partner),n,i],y=xr(e.publishedAtV2(),o);return t.moveCall({target:`${y}::cetus::${l}`,typeArguments:[u,d],arguments:p})[0]}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(this.globalConfig),t.object(r.id),t.object(this.partner),n,t.object(Hr)],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::cetus::${c}`,typeArguments:[l,u],arguments:d})})}};function ep(e,...t){const r=Array.isArray(t[t.length-1])?t.pop():[];let i=[e,...t].filter(Boolean).join("::");return r&&r.length&&(i+=`<${r.join(", ")}>`),i}function tp(e){return e.split("::")[0]}function Pn(e){var t;try{let r=e.replace(/\s/g,"");const n=r.match(/(<.+>)$/),i=(t=n==null?void 0:n[0])==null?void 0:t.match(/(\w+::\w+::\w+)(?:<.*?>(?!>))?/g);if(i){r=r.slice(0,r.indexOf("<"));const c=Pn(r),l=H7(q7({},c),{type_arguments:i.map(u=>Pn(u).source_address)});return l.type_arguments=l.type_arguments.map(u=>zn.isSuiCoin(u)?u:Pn(u).source_address),l.source_address=ep(l.full_address,l.type_arguments),l}const o=r.split("::"),a={full_address:r,address:r===Vv||r===J9?"0x2":Jr(o[0]),module:o[1],name:o[2],type_arguments:[],source_address:""};return a.full_address=`${a.address}::${a.module}::${a.name}`,a.source_address=ep(a.full_address,a.type_arguments),a}catch{return{full_address:e,address:"",module:"",name:"",type_arguments:[],source_address:e}}}function rp(e){return Pn(e).source_address}var Y9="0x2::coin::Coin",X9=/^0x2::coin::Coin<(.+)>$/,Vv="0x2::sui::SUI",J9="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",zn=class Bi{static getCoinTypeArg(t){const r=t.type.match(X9);return r?r[1]:null}static isSUI(t){const r=Bi.getCoinTypeArg(t);return r?Bi.getCoinSymbol(r)==="SUI":!1}static getCoinSymbol(t){return t.substring(t.lastIndexOf(":")+1)}static getBalance(t){return BigInt(t.fields.balance)}static totalBalance(t,r){let n=BigInt(0);return t.forEach(i=>{r===i.coinAddress&&(n+=BigInt(i.balance))}),n}static getID(t){return t.fields.id.id}static getCoinTypeFromArg(t){return`${Y9}<${t}>`}static getCoinAssets(t,r){const n=[];return r.forEach(i=>{rp(i.coinAddress)===rp(t)&&n.push(i)}),n}static isSuiCoin(t){return Pn(t).full_address===Vv}static selectCoinObjectIdGreaterThanOrEqual(t,r,n=[]){const i=Bi.selectCoinAssetGreaterThanOrEqual(t,r,n),o=i.selectedCoins.map(c=>c.coinObjectId),s=i.remainingCoins,a=i.selectedCoins.map(c=>c.balance.toString());return{objectArray:o,remainCoins:s,amountArray:a}}static selectCoinAssetGreaterThanOrEqual(t,r,n=[]){const i=Bi.sortByBalance(t.filter(l=>!n.includes(l.coinObjectId))),o=Bi.calculateTotalBalance(i);if(o<r)return{selectedCoins:[],remainingCoins:i};if(o===r)return{selectedCoins:i,remainingCoins:[]};let s=BigInt(0);const a=[],c=[...i];for(;s<o;){const l=r-s,u=c.findIndex(p=>p.balance>=l);if(u!==-1){a.push(c[u]),c.splice(u,1);break}const d=c.pop();d.balance>0&&(a.push(d),s+=d.balance)}return{selectedCoins:Bi.sortByBalance(a),remainingCoins:Bi.sortByBalance(c)}}static sortByBalance(t){return t.sort((r,n)=>r.balance<n.balance?-1:r.balance>n.balance?1:0)}static sortByBalanceDes(t){return t.sort((r,n)=>r.balance>n.balance?-1:r.balance<n.balance?0:1)}static calculateTotalBalance(t){return t.reduce((r,n)=>r+n.balance,BigInt(0))}};function Lu(e){switch(e){case 1e4:return"Calculate error";case 10001:return"Input number too large can not fit in target type";case 10002:return"No router";case 10003:return"Insufficient Liquidity";case 10004:return"Target token is detected as a HoneyPot scam";case 10005:return"Too many requests. Please try again later";default:return"Unknown error"}}function Xi(e){const t=e.indexOf("::");if(t===-1)return e;const r=e.substring(0,t),n=e.substring(t);if(!r.startsWith("0x"))return e;const i=r.substring(2);return i.length>64?e:`0x${i.padStart(64,"0")}${n}`}function Z9(e,t){e=Xi(e),t=Xi(t);const r=Math.min(e.length,t.length);for(let n=0;n<r;n++){if(e[n]>t[n])return!0;if(e[n]<t[n])return!1}return!0}function zv(e,t){return e.moveCall({target:"0x2::coin::zero",typeArguments:[t]})}function Bu(e,t,r,n){const i=zn.getCoinAssets(n,t);if(r===BigInt(0))return zn.isSuiCoin(n)||i.length===0&&!zn.isSuiCoin(n)?{targetCoin:zv(e,n),isMintZeroCoin:!0,targetCoinAmount:0}:{targetCoin:e.object(i[0].coinObjectId),isMintZeroCoin:!1,targetCoinAmount:Number(i[0].balance.toString())};if(zn.calculateTotalBalance(i)<r)throw new AggregateError("Insufficient balance when build merge coin, coinType: "+n,"InsufficientBalance"+n);if(zn.isSuiCoin(n))return{targetCoin:e.splitCoins(e.gas,[e.pure.u64(r.toString())]),isMintZeroCoin:!0,targetCoinAmount:Number(r.toString())};let s=zn.sortByBalance(i);s.slice(0,3).reduce((p,y)=>p+y.balance,BigInt(0))<BigInt(r)&&(s=zn.sortByBalanceDes(i));let c=zn.selectCoinObjectIdGreaterThanOrEqual(s,r);const[l,...u]=c.objectArray;return u.length>0&&e.mergeCoins(l,u.map(p=>e.object(p))),{targetCoin:e.splitCoins(e.object(l),[e.pure.u64(r.toString())]),isMintZeroCoin:!1,targetCoinAmount:Number(r.toString())}}function Q9(e){return!(!e.startsWith("0x")||e.length!==66)}var Wo=Uo(Fo()),Hi=Uo(Fo()),ka=Uo(Fo()),vi=new ka.default(0);new ka.default(1);var e_=new ka.default(2);e_.pow(new ka.default(128));var t_=new ka.default("18446744073709551615"),un=1e9;function r_(e,t,r){let n=vi;return t?n=e.mul(new Hi.default(un-r*un)).div(new Hi.default(un)):n=e.mul(new Hi.default(un+r*un)).div(new Hi.default(un)),Number(n.toString())}function np(e,t,r){let n=vi;return t?n=e.mul(new Hi.default(un-r*un)).div(new Hi.default(un)):n=e.mul(new Hi.default(un+r*un)).div(new Hi.default(un)),n}function n_(e,t,r){return new gc(e).mul(gc.pow(2,-64)).pow(2).mul(gc.pow(10,t-r))}function i_(e,t,r,n){return dt(this,null,function*(){var i,o,s,a,c;const{from:l,target:u,amount:d,byAmountIn:p,pools:y}=t,x=Xi(l),b=Xi(u),M=new To,R=Z9(x,b),P=n===0?"0x2d8c2e0fc6dd25b0214b3fa747e0fd27fd54608142cd2e4f64c1cd350cc4add4":"0x4f920e1ef6318cfba77e20a0538a419a5a504c14230169438b99aba485db40a6",k=R?x:b,F=R?b:x,B=[k,F];for(let C=0;C<y.length;C++){const g=[M.object(y[C]),M.pure.bool(R),M.pure.bool(p),M.pure.u64(d.toString())];M.moveCall({target:`${P}::fetcher_script::calculate_swap_result`,arguments:g,typeArguments:B})}if(!Q9(r))throw new AggregateError("Aggregator package not set","InvalidWallet");const W=yield e.devInspectTransactionBlock({transactionBlock:M,sender:r});if(W.error!=null)throw console.log("simulateRes.error",W.error),new AggregateError("Aggregator package not set","SimulateError");const z=(i=W.events)==null?void 0:i.filter(C=>C.type.includes("CalculatedSwapResultEvent"));if(z.length===0||z.length!==y.length)throw new AggregateError("Simulate event result error","simulateEventError");let G=p?vi:t_,re=0;for(let C=0;C<z.length;C+=1)if(!z[C].parsedJson.data.is_exceed)if(t.byAmountIn){const g=new Wo.BN(z[C].parsedJson.data.amount_out);g.gt(G)&&(re=C,G=g)}else{const g=new Wo.BN(z[C].parsedJson.data.amount_out);g.lt(G)&&(re=C,G=g)}const oe=z[re].parsedJson.data,se=oe.step_results[0].current_sqrt_price,[q,L]=yield Promise.all([e.getCoinMetadata({coinType:k}).then(C=>C==null?void 0:C.decimals),e.getCoinMetadata({coinType:F}).then(C=>C==null?void 0:C.decimals)]);if(q==null||L==null)throw new AggregateError("Simulate event result error","CannotGetDecimals");const h=n_(se,q,L),f=Number(oe.fee_rate)/1e6,m=new Wo.BN((o=oe.amount_in)!=null?o:0),S=new Wo.BN((s=oe.fee_amount)!=null?s:0),T=m.add(S),E={amountIn:T,amountOut:new Wo.BN((a=oe.amount_out)!=null?a:0),routes:[{path:[{id:y[re],direction:R,provider:"CETUS",from:x,target:b,feeRate:f,amountIn:oe.amount_in,amountOut:oe.amount_out,extendedDetails:{afterSqrtPrice:oe.after_sqrt_price}}],amountIn:T,amountOut:new Wo.BN((c=oe.amount_out)!=null?c:0),initialPrice:h}],insufficientLiquidity:!1,byAmountIn:t.byAmountIn};return{isExceed:oe.is_exceed,routeData:E}})}var o_=class{constructor(e){if(e!==0)throw new Error("Haedal only supported on mainnet")}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o}=r,s=o?"swap_a2b":"swap_b2a",a=[t.object(r.id),t.object("0x5"),n],c=xr(e.publishedAtV2(),i);return t.moveCall({target:`${c}::haedal::${s}`,typeArguments:[],arguments:a})})}},s_=class{constructor(e){if(e!==0)throw new Error("Afsui only supported on mainnet");this.stakedSuiVault="0x2f8f6d5da7f13ea37daa397724280483ed062769813b6f31e9788e59cc88994d",this.safe="0xeb685899830dd5837b47007809c76d91a098d52aabbf61e8ac467c59e5cc4610",this.referVault="0x4ce9a19b594599536c53edb25d22532f82f18038dc8ef618afd00fbbfb9845ef",this.validator="0xd30018ec3f5ff1a3c75656abf927a87d7f0529e6dc89c7ddd1bd27ecb05e3db2"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o}=r;if(!o)throw new Error("Afsui not support b2a swap");const s="swap_a2b",a=[t.object(this.stakedSuiVault),t.object(this.safe),t.object("0x5"),t.object(this.referVault),t.object(this.validator),n],c=xr(e.publishedAtV2(),i);return t.moveCall({target:`${c}::afsui::${s}`,typeArguments:[],arguments:a})})}},a_=class{constructor(e){if(e!==0)throw new Error("Volo only supported on mainnet");this.nativePool="0x7fa2faa111b8c65bea48a23049bfd81ca8f971a262d981dcd9a17c3825cb5baf",this.metadata="0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o}=r;if(!o)throw new Error("Volo not support b2a swap");const s="swap_a2b",a=[t.object(this.nativePool),t.object(this.metadata),t.object("0x5"),n],c=xr(e.publishedAtV2(),i);return t.moveCall({target:`${c}::volo::${s}`,typeArguments:[],arguments:a})})}},c_=class{constructor(e){if(e!==0)throw new Error("Bluemove only supported on mainnet");this.dexInfo="0x3f2d9f724f4a1ce5e71676448dc452be9a6243dac9c5b975a588c8c867066e92"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(this.dexInfo),n],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::bluemove::${c}`,typeArguments:[l,u],arguments:d})})}},l_=class{constructor(e){this.deepbookV3Config=e===0?"0x699d455ab8c5e02075b4345ea1f91be55bf46064ae6026cc2528e701ce3ac135":"0xe19b5d072346cae83a037d4e3c8492068a74410a74e5830b3a68012db38296aa"}swap(e,t,r,n,i,o){return dt(this,null,function*(){const{direction:s,from:a,target:c}=r,[l,u,d]=s?["swap_a2b_v2",a,c]:["swap_b2a_v2",c,a];let p;o?p=o:p=zv(t,e.deepbookv3DeepFeeType());const y=[t.object(this.deepbookV3Config),t.object(r.id),n,p,t.object(Hr)],x=gn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${x}::deepbookv3::${l}`,typeArguments:[u,d],arguments:y})})}},u_=class{constructor(e){if(e!==0)throw new Error("Scallop only supported on mainnet");this.version=e===0?"0x07871c4b3c847a0f674510d4978d5cf6f960452795e8ff6f189fd2088a3f6ac7":"0x0",this.market=e===0?"0xa757975255146dc9686aa823b7838b507f315d704f428cbadad2f4ea061939d9":"0x0"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",s,a];if(r.extendedDetails==null)throw new Error("Extended details not supported");if(r.extendedDetails.scallopScoinTreasury==null)throw new Error("Scallop coin treasury not supported");const d=[t.object(this.version),t.object(this.market),t.object(r.extendedDetails.scallopScoinTreasury),n,t.object(Hr)],p=gn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${p}::scallop::${c}`,typeArguments:[l,u],arguments:d})})}},ip=class{constructor(e){if(e!==0)throw new Error("Suilend only supported on mainnet");this.sui_system_state=e===0?"0x0000000000000000000000000000000000000000000000000000000000000005":"0x0"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l]=o?["swap_a2b",a]:["swap_b2a",s],u=[t.object(r.id),t.object(this.sui_system_state),n],d=gn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${d}::suilend::${c}`,typeArguments:[l],arguments:u})})}},f_=class{constructor(e){if(e!==0)throw new Error("Bluefin only supported on mainnet");this.globalConfig="0x03db251ba509a8d5d8777b6338836082335d93eecbdd09a11e190a1cff51c352"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(this.globalConfig),t.object(r.id),n,t.object(Hr)],p=gn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${p}::bluefin::${c}`,typeArguments:[l,u],arguments:d})})}},d_=class{constructor(e,t){if(e===1)throw new Error("HaedalPmm is not supported on testnet");this.pythPriceIDs=t}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s];let d,p;if(r.extendedDetails==null)throw new Error("Extended details not supported haedal pmm");if(!r.extendedDetails.haedalPmmBasePriceSeed||!r.extendedDetails.haedalPmmQuotePriceSeed)throw new Error("Base price seed or quote price seed not supported");d=r.extendedDetails.haedalPmmBasePriceSeed,p=r.extendedDetails.haedalPmmQuotePriceSeed;const y=this.pythPriceIDs.get(d),x=this.pythPriceIDs.get(p);if(!y||!x)throw new Error("Base price info object id or quote price info object id not found");const b=[t.object(r.id),t.object(y),t.object(x),n,t.object(Hr)],M=gn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${M}::haedalpmm::${c}`,typeArguments:[l,u],arguments:b})})}},h_=class{constructor(e){if(e!==0)throw new Error("Alphafi only supported on mainnet");this.sui_system_state=e===0?"0x0000000000000000000000000000000000000000000000000000000000000005":"0x0"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l]=o?["swap_a2b",a]:["swap_b2a",s],u=[t.object(r.id),t.object(this.sui_system_state),n],d=gn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${d}::alphafi::${c}`,typeArguments:[l],arguments:u})})}},p_=class{constructor(e){if(e!==0)throw new Error("Steamm only supported on mainnet")}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s];if(r.extendedDetails==null)throw new Error("Extended details not supported");if(r.extendedDetails.steammBankA==null)throw new Error("Steamm bank a type not supported");if(r.extendedDetails.steammBankB==null)throw new Error("Steamm bank b type not supported");if(r.extendedDetails.steammLendingMarket==null)throw new Error("Steamm lending market not supported");if(r.extendedDetails.steammLendingMarketType==null)throw new Error("Steamm lending market type not supported");if(r.extendedDetails.steammBCoinAType==null)throw new Error("Steamm b coin a type not supported");if(r.extendedDetails.steammBCoinBType==null)throw new Error("Steamm b coin b type not supported");if(r.extendedDetails.steammLPToken==null)throw new Error("Steamm lp token not supported");const d=[t.object(r.id),t.object(r.extendedDetails.steammBankA),t.object(r.extendedDetails.steammBankB),t.object(r.extendedDetails.steammLendingMarket),n,t.object(Hr)],p=gn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${p}::steammfe::${c}`,typeArguments:[r.extendedDetails.steammLendingMarketType,l,u,r.extendedDetails.steammBCoinAType,r.extendedDetails.steammBCoinBType,r.extendedDetails.steammLPToken],arguments:d})})}},m_="0x790f258062909e3a0ffc78b3c53ac2f62d7084c3bab95644bdeb05add7250001::super_sui::SUPER_SUI",g_="0xe44df51c0b21a27ab915fa1fe2ca610cd3eaa6d9666fe5e62b988bf7f0bd8722::musd::MUSD",v_="0xccd628c2334c5ed33e6c47d6c21bb664f8b6307b2ac32c2462a61f69a31ebcee::meth::METH",b_=class{constructor(e,t){if(e!==0)throw new Error("Metastable only supported on mainnet");this.versionID="0x4696559327b35ff2ab26904e7426a1646312e9c836d5c6cff6709a5ccc30915c",this.pythPriceIDs=t}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u,d]=o?["swap_a2b","create_deposit_cap",s,a]:["swap_b2a","create_withdraw_cap",a,s];let p="",y="pyth",x="";if(r.extendedDetails==null)throw new Error("Extended details not supported metastable");if(!r.extendedDetails.metastableCreateCapPkgId||!r.extendedDetails.metastableCreateCapModule||!r.extendedDetails.metastableRegistryId||!r.extendedDetails.metastableWhitelistedAppId)throw new Error("CreateCapPkgId or CreateCapModule or RegistryId or WhitelistedAppId or CreateCapAllTypeParams not supported");p=r.extendedDetails.metastableCreateCapPkgId,y=r.extendedDetails.metastableCreateCapModule,x=r.extendedDetails.metastableWhitelistedAppId;const b=[d];r.extendedDetails.metastableCreateCapAllTypeParams&&b.push(u);const M=[t.object(x),t.object(r.id)];switch(d){case m_:{if(!r.extendedDetails.metastableRegistryId)throw new Error("Not found registry id for super sui");M.push(t.object(r.extendedDetails.metastableRegistryId));break}case g_:{if(r.extendedDetails.metastablePriceSeed!=null){const B=this.pythPriceIDs.get(r.extendedDetails.metastablePriceSeed);if(B==null)throw new Error("Invalid Pyth price feed: "+r.extendedDetails.metastablePriceSeed);M.push(t.object(B))}if(r.extendedDetails.metastableETHPriceSeed!=null){const B=this.pythPriceIDs.get(r.extendedDetails.metastableETHPriceSeed);if(B==null)throw new Error("Invalid Pyth price feed: "+r.extendedDetails.metastableETHPriceSeed);M.push(t.object(B))}M.push(t.object(Hr));break}case v_:{if(r.extendedDetails.metastablePriceSeed!=null){const B=this.pythPriceIDs.get(r.extendedDetails.metastablePriceSeed);if(B==null)throw new Error("Invalid Pyth price feed: "+r.extendedDetails.metastablePriceSeed);M.push(t.object(B))}if(r.extendedDetails.metastableETHPriceSeed!=null){const B=this.pythPriceIDs.get(r.extendedDetails.metastableETHPriceSeed);if(B==null)throw new Error("Invalid Pyth price feed: "+r.extendedDetails.metastableETHPriceSeed);M.push(t.object(B))}M.push(t.object(Hr));break}default:throw new Error("Invalid Metacoin: "+d)}const R=t.moveCall({target:`${p}::${y}::${l}`,typeArguments:b,arguments:M}),P=[t.object(r.id),t.object(this.versionID),R,n],k=gn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${k}::metastable::${c}`,typeArguments:[u,d],arguments:P})})}},y_=class{constructor(e,t){if(e===1)throw new Error("Obric is not supported on testnet");this.pythPriceIDs=t,this.pythStateObjectId="0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s];let d,p,y,x;if(r.extendedDetails==null)throw new Error("Extended details not supported in obric");if(r.extendedDetails.obricCoinAPriceSeed&&r.extendedDetails.obricCoinBPriceSeed)d=r.extendedDetails.obricCoinAPriceSeed,y=this.pythPriceIDs.get(d),p=r.extendedDetails.obricCoinBPriceSeed,x=this.pythPriceIDs.get(p);else{if(!r.extendedDetails.obricCoinAPriceId||!r.extendedDetails.obricCoinBPriceId)throw new Error("Base price id or quote price id not supported");y=r.extendedDetails.obricCoinAPriceId,x=r.extendedDetails.obricCoinBPriceId}if(!y||!x)throw new Error("Base price info object id or quote price info object id not found");const b=[t.object(r.id),n,t.object(this.pythStateObjectId),t.object(y),t.object(x),t.object(Hr)],M=gn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${M}::obric::${c}`,typeArguments:[l,u],arguments:b})})}},w_=class{constructor(e){if(e!==0)throw new Error("HaWAL only supported on mainnet");this.staking=e===0?"0x10b9d30c28448939ce6c4d6c6e0ffce4a7f8a4ada8248bdad09ef8b70e4a3904":"0x0",this.validator=e===0?"0x7b3ba6de2ae58283f60d5b8dc04bb9e90e4796b3b2e0dea75569f491275242e7":"0x0"}swap(e,t,r,n,i){return dt(this,null,function*(){const{direction:o}=r,s=o?"swap_a2b":"swap_b2a",a=[t.object(this.staking),t.object(r.id),n,t.object(this.validator)],c=gn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${c}::hawal::${s}`,typeArguments:[],arguments:a})})}},qv="CETUS",x_="DEEPBOOK",S_="KRIYA",__="FLOWX",E_="FLOWXV3",C_="KRIYAV3",Hv="TURBOS",Uf="AFTERMATH",T_="HAEDAL",A_="VOLO",M_="AFSUI",I_="BLUEMOVE",Wv="DEEPBOOKV3",Gv="SCALLOP",R_="SUILEND",O_="BLUEFIN",r0="HAEDALPMM",P_="ALPHAFI",N_="SPRINGSUI",Kv="STEAMM",n0="METASTABLE",i0="OBRIC",k_="HAWAL",j_="https://api-sui.cetus.zone/router_v2";function Uu(e){return Array.isArray(e.routers)}function Fu(e){return Array.isArray(e.routers)}var Yv=class Xv{constructor(t){var r,n;this.endpoint=t.endpoint?U_(t.endpoint):j_,this.client=t.client||new ps({url:Xm("mainnet")}),this.signer=t.signer||"",this.env=t.env||0,this.allCoins=new Map;const i=Xv.CONFIG[this.env];if(this.pythConnections=this.newPythClients((r=t.pythUrls)!=null?r:[]),this.pythClient=new _f.SuiPythClient(this.client,i.pythStateId,i.wormholeStateId),this.apiKey=t.apiKey||"",this.partner=t.partner,t.overlayFeeRate)if(t.overlayFeeRate>0&&t.overlayFeeRate<=.01)this.overlayFeeRate=t.overlayFeeRate*1e6;else throw new Error("Overlay fee rate must be between 0 and 0.01");else this.overlayFeeRate=0;this.overlayFeeReceiver=(n=t.overlayFeeReceiver)!=null?n:"0x0"}newPythClients(t){return t.includes("https://hermes.pyth.network")||t.push("https://hermes.pyth.network"),t.map(n=>new _f.SuiPriceServiceConnection(n,{timeout:3e3}))}getCoins(t,r=!0){return dt(this,null,function*(){if(this.signer==="")throw new Error("Signer is required, but not provided.");let n=null,i=50;if(!r){const s=this.allCoins.get(t);if(s)return s}const o=[];for(;;)try{const s=yield this.client.getCoins({owner:this.signer,coinType:t,cursor:n,limit:i});for(const a of s.data)o.push({coinAddress:Pn(a.coinType).source_address,coinObjectId:a.coinObjectId,balance:BigInt(a.balance)});if(!s.hasNextPage)break;n=s.nextCursor}catch(s){console.error("getCoins error:",s);break}return this.allCoins.set(t,o),o})}findRouters(t){return dt(this,null,function*(){return F_(this.endpoint,this.apiKey,t,this.overlayFeeRate,this.overlayFeeReceiver)})}executeFlexibleInputSwap(t,r,n,i,o,s,a,c,l){return dt(this,null,function*(){if(n.length===0)throw new Error("No router found");const u=n[0].path[n[0].path.length-1].target,d=[];for(let b=0;b<n.length-1;b++){if(n[b].path.length===0)throw new Error("Empty path");let R=t.splitCoins(r,[n[b].amountIn.toString()])[0];for(const P of n[b].path)R=yield this.newDex(P.provider,s,a).swap(this,t,P,R,l,c);d.push(R)}if(n[n.length-1].path.length===0)throw new Error("Empty path");let p=r;for(const b of n[n.length-1].path)p=yield this.newDex(b.provider,s,a).swap(this,t,b,p,l,c);d.push(p);const y=gn(this.publishedAtV2Extend(),l);return this.checkCoinThresholdAndMergeCoin(t,d,u,i,o,y)})}expectInputSwap(t,r,n,i,o,s,a,c,l){return dt(this,null,function*(){if(n.length===0)throw new Error("No router found");const u=n.map(P=>P.amountIn.toString()),d=n[0].path[0].from,p=n[0].path[n[0].path.length-1].target,y=t.splitCoins(r,u),x=[];for(let P=0;P<n.length;P++){if(n[P].path.length===0)throw new Error("Empty path");let k=y[P];for(const F of n[P].path)k=yield this.newDex(F.provider,s,a).swap(this,t,F,k,l,c);x.push(k)}const b=xr(this.publishedAtV2(),l),M=gn(this.publishedAtV2Extend(),l);return this.transferOrDestoryCoin(t,r,d,b),this.checkCoinThresholdAndMergeCoin(t,x,p,i,o,M)})}expectOutputSwap(t,r,n,i,o){return dt(this,null,function*(){const s=[],a=[],c=[],l=new Qh(this.env,i),u=xr(this.publishedAtV2(),o);for(let p=0;p<n.length;p++){const y=n[p];for(let b=y.path.length-1;b>=0;b--){const M=y.path[b],R=l.flash_swap(this,t,M,!1);s.unshift(R.targetCoin),a.unshift(R.flashReceipt)}let x=r;for(let b=0;b<y.path.length;b++){const M=y.path[b],R=l.repay_flash_swap(this,t,M,x,a[b]);x=s[b],b===0?r=R:this.transferOrDestoryCoin(t,R,M.from,u),b===y.path.length-1&&c.push(x)}}const d=n[0].path[0].from;if(this.transferOrDestoryCoin(t,r,d,u),c.length>1){const p=t.makeMoveVec({elements:c.slice(1)});t.moveCall({target:`${fa}::pay::join_vec`,typeArguments:[n[0].path[n[0].path.length-1].target],arguments:[c[0],p]})}return c[0]})}swapInPools(t){return dt(this,null,function*(){let r;try{r=yield i_(this.client,t,this.signer,this.env)}catch(n){return console.error("swapInPools error:",n),null}return r})}routerSwap(t){return dt(this,null,function*(){const{routers:r,inputCoin:n,slippage:i,txb:o,deepbookv3DeepFee:s,partner:a}=t;if(i>1||i<0)throw new Error("Invalid slippage value. Must be between 0 and 1 (e.g., 0.01 represents 1% slippage)");const c=Array.isArray(r)?r:r.routes,l=Uu(t)?t.byAmountIn:t.routers.byAmountIn,u=c.reduce((z,G)=>z.add(G.amountIn),new Ht.default(0)),d=c.reduce((z,G)=>z.add(G.amountOut),new Ht.default(0));let p=new Ht.default(0);this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(l?p=d.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)):p=u.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)));const y=l?d.sub(p):d,x=l?u:u.add(p),b=np(l?y:x,l,i),M=Uu(t)?void 0:t.routers.packages,R=xr(this.publishedAtV2(),M),P=op(c),k=P.length>0?yield this.updatePythPriceIDs(P,o):new Map;if(l)return yield this.expectInputSwap(o,n,c,d.toString(),b.toString(),k,a??this.partner,s,M);const F=o.splitCoins(n,[p.toString()]);this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&o.transferObjects([F],this.overlayFeeReceiver);const B=o.splitCoins(n,[b.sub(p).toString()]);return this.transferOrDestoryCoin(o,n,c[0].path[0].from,R),yield this.expectOutputSwap(o,B[0],c,a??this.partner)})}fixableRouterSwap(t){return dt(this,null,function*(){const{routers:r,inputCoin:n,slippage:i,txb:o,deepbookv3DeepFee:s,partner:a}=t,c=Array.isArray(r)?r:r.routes,l=t.routers.byAmountIn,u=c.reduce((F,B)=>F.add(B.amountIn),new Ht.default(0)),d=c.reduce((F,B)=>F.add(B.amountOut),new Ht.default(0));let p=0;this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(l?p=Number(d.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)).toString()):p=Number(u.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)).toString()));const y=l?d.sub(new Ht.default(p)):d,x=l?u:u.add(new Ht.default(p)),b=np(l?y:x,l,i),M=Uu(t)?void 0:t.routers.packages,R=op(c),P=R.length>0?yield this.updatePythPriceIDs(R,o):new Map;return l?yield this.executeFlexibleInputSwap(o,n,c,y.toString(),b.toString(),P,a??this.partner,s,M):yield this.expectOutputSwap(o,n,c,a??this.partner)})}fastRouterSwap(t){return dt(this,null,function*(){const{routers:r,slippage:n,txb:i,partner:o,refreshAllCoins:s,payDeepFeeAmount:a}=t,c=Array.isArray(r)?r:r.routes,l=c[0].path[0].from;let u=yield this.getCoins(l,s);const d=c[0].path[c[0].path.length-1].target,p=c.reduce((G,re)=>G.add(re.amountIn),new Ht.default(0)),y=c.reduce((G,re)=>G.add(re.amountOut),new Ht.default(0)),x=Fu(t)?t.byAmountIn:t.routers.byAmountIn;let b=0;this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(x?b=Number(y.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)).toString()):b=Number(p.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)).toString()));const M=x?y.sub(new Ht.default(b)):y,R=x?p:p.add(new Ht.default(b)),P=r_(x?M:R,x,n),F=Bu(i,u,BigInt((x?R:P).toString()),l);let B;if(a&&a>0){let G=yield this.getCoins(this.deepbookv3DeepFeeType());B=Bu(i,G,BigInt(a),this.deepbookv3DeepFeeType()).targetCoin}const W=Fu(t)?{routers:c,inputCoin:F.targetCoin,slippage:n,byAmountIn:x,txb:i,partner:o??this.partner,deepbookv3DeepFee:B}:{routers:t.routers,inputCoin:F.targetCoin,slippage:n,byAmountIn:x,txb:i,partner:o??this.partner,deepbookv3DeepFee:B},z=yield this.routerSwap(W);if(zn.isSuiCoin(d))i.mergeCoins(i.gas,[z]);else{let G=yield this.getCoins(d,s);const re=Bu(i,G,BigInt(0),d),oe=Fu(t)?void 0:t.routers.packages,se=xr(this.publishedAtV2(),oe);i.mergeCoins(re.targetCoin,[z]),re.isMintZeroCoin&&this.transferOrDestoryCoin(i,re.targetCoin,d,se)}})}publishedAtV2(){return this.env===0?"0x3864c7c59a4889fec05d1aae4bc9dba5a0e0940594b424fbed44cb3f6ac4c032":"0x52eae33adeb44de55cfb3f281d4cc9e02d976181c0952f5323648b5717b33934"}publishedAtV2Extend(){return this.env===0?"0x39402d188b7231036e52266ebafad14413b4bf3daea4ac17115989444e6cd516":"0xabb6a81c8a216828e317719e06125de5bb2cb0fe8f9916ff8c023ca5be224c78"}deepbookv3DeepFeeType(){return this.env===0?"0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP":"0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP"}transferOrDestoryCoin(t,r,n,i){t.moveCall({target:`${i}::utils::transfer_or_destroy_coin`,typeArguments:[n],arguments:[r]})}checkCoinThresholdAndMergeCoin(t,r,n,i,o,s){let a=r[0];if(r.length>1){let c=t.makeMoveVec({elements:r.slice(1)});t.moveCall({target:`${fa}::pay::join_vec`,typeArguments:[n],arguments:[r[0],c]}),a=r[0]}return this.overlayFeeRate===0||this.overlayFeeReceiver==="0x0"?t.moveCall({target:`${s}::utils::check_coin_threshold_v1`,typeArguments:[n],arguments:[a,t.pure.u64(i),t.pure.u64(o)]}):t.moveCall({target:`${s}::utils::check_coin_threshold_v2`,typeArguments:[n],arguments:[a,t.pure.u64(i),t.pure.u64(o),t.pure.u64(this.overlayFeeRate),t.pure.address(this.overlayFeeReceiver)]}),a}newDex(t,r,n){switch(t){case qv:return new Qh(this.env,n);case x_:return new z9(this.env);case Wv:return new l_(this.env);case S_:return new q9(this.env);case C_:return new H9(this.env);case __:return new W9(this.env);case E_:return new G9(this.env);case Hv:return new K9(this.env);case Uf:return new V9(this.env);case T_:return new o_(this.env);case M_:return new s_(this.env);case A_:return new a_(this.env);case I_:return new c_(this.env);case Gv:return new u_(this.env);case R_:return new ip(this.env);case N_:return new ip(this.env);case O_:return new f_(this.env);case r0:return new d_(this.env,r);case P_:return new h_(this.env);case Kv:return new p_(this.env);case n0:return new b_(this.env,r);case i0:return new y_(this.env,r);case k_:return new w_(this.env);default:throw new Error(`Unsupported dex ${t}`)}}signAndExecuteTransaction(t,r){return dt(this,null,function*(){return yield this.client.signAndExecuteTransaction({transaction:t,signer:r,options:{showEffects:!0,showEvents:!0,showInput:!0,showBalanceChanges:!0}})})}devInspectTransactionBlock(t){return dt(this,null,function*(){return yield this.client.devInspectTransactionBlock({transactionBlock:t,sender:this.signer})})}sendTransaction(t,r){return dt(this,null,function*(){return yield this.client.signAndExecuteTransaction({transaction:t,signer:r})})}getDeepbookV3Config(){return dt(this,null,function*(){const t=yield z_(this.endpoint);return t?t.data:null})}updatePythPriceIDs(t,r){return dt(this,null,function*(){let n=null,i=null;for(const a of this.pythConnections)try{n=yield a.getPriceFeedsUpdateData(t);break}catch(c){i=c,console.log("Error: ",c);continue}if(n==null)throw new Error(`All Pyth price nodes are unavailable. Cannot fetch price data. Please switch to or add new available Pyth nodes. Detailed error: ${i==null?void 0:i.message}`);let o=[];try{o=yield this.pythClient.updatePriceFeeds(r,n,t)}catch(a){throw new Error(`All Pyth price nodes are unavailable. Cannot fetch price data. Please switch to or add new available Pyth nodes in the pythUrls parameter when initializing AggregatorClient, for example: new AggregatorClient({ pythUrls: ["https://your-pyth-node-url"] }). Detailed error: ${a}`)}let s=new Map;for(let a=0;a<t.length;a++)s.set(t[a],o[a]);return s})}};Yv.CONFIG={1:{wormholeStateId:"0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790",pythStateId:"0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c"},0:{wormholeStateId:"0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c",pythStateId:"0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8"}};var Jv=Yv;function op(e){const t=new Set;for(const r of e)for(const n of r.path)n.provider===r0&&n.extendedDetails&&n.extendedDetails.haedalPmmBasePriceSeed&&n.extendedDetails.haedalPmmQuotePriceSeed&&(t.add(n.extendedDetails.haedalPmmBasePriceSeed),t.add(n.extendedDetails.haedalPmmQuotePriceSeed)),n.provider===n0&&(n.extendedDetails&&n.extendedDetails.metastablePriceSeed&&t.add(n.extendedDetails.metastablePriceSeed),n.extendedDetails&&n.extendedDetails.metastableETHPriceSeed&&t.add(n.extendedDetails.metastableETHPriceSeed)),n.provider===i0&&(n.extendedDetails&&n.extendedDetails.obricCoinAPriceSeed&&t.add(n.extendedDetails.obricCoinAPriceSeed),n.extendedDetails&&n.extendedDetails.obricCoinBPriceSeed&&t.add(n.extendedDetails.obricCoinBPriceSeed));return Array.from(t)}function D_(e,t){let r=0;for(const o of e.routes)for(const s of o.path)s.extended_details&&s.extended_details.deepbookv3_deep_fee&&(r+=Number(s.extended_details.deepbookv3_deep_fee));let n;if(e.packages!=null){n=new Map;for(const[o,s]of Object.entries(e.packages))n.set(o,s)}return{amountIn:new Ht.default(e.amount_in.toString()),amountOut:new Ht.default(e.amount_out.toString()),byAmountIn:t,insufficientLiquidity:!1,routes:e.routes.map(o=>({path:o.path.map(s=>{var a,c,l,u,d,p,y,x,b,M,R,P,k,F,B,W,z,G,re,oe,se,q,L,h,f;let m;s.provider===Uf&&(m=s.extended_details.aftermath_pool_flatness===0?"v2":"v3");let S;return(s.provider===Hv||s.provider===Uf||s.provider===qv||s.provider===Wv||s.provider===Gv||s.provider===r0||s.provider===Kv||s.provider===n0||s.provider===i0)&&(S={aftermathLpSupplyType:(a=s.extended_details)==null?void 0:a.aftermath_lp_supply_type,turbosFeeType:(c=s.extended_details)==null?void 0:c.turbos_fee_type,afterSqrtPrice:(l=s.extended_details)==null?void 0:l.after_sqrt_price,deepbookv3DeepFee:(u=s.extended_details)==null?void 0:u.deepbookv3_deep_fee,scallopScoinTreasury:(d=s.extended_details)==null?void 0:d.scallop_scoin_treasury,haedalPmmBasePriceSeed:(p=s.extended_details)==null?void 0:p.haedal_pmm_base_price_seed,haedalPmmQuotePriceSeed:(y=s.extended_details)==null?void 0:y.haedal_pmm_quote_price_seed,steammBankA:(x=s.extended_details)==null?void 0:x.steamm_bank_a,steammBankB:(b=s.extended_details)==null?void 0:b.steamm_bank_b,steammLendingMarket:(M=s.extended_details)==null?void 0:M.steamm_lending_market,steammLendingMarketType:(R=s.extended_details)==null?void 0:R.steamm_lending_market_type,steammBCoinAType:(P=s.extended_details)==null?void 0:P.steamm_btoken_a_type,steammBCoinBType:(k=s.extended_details)==null?void 0:k.steamm_btoken_b_type,steammLPToken:(F=s.extended_details)==null?void 0:F.steamm_lp_token_type,metastablePriceSeed:(B=s.extended_details)==null?void 0:B.metastable_price_seed,metastableETHPriceSeed:(W=s.extended_details)==null?void 0:W.metastable_eth_price_seed,metastableWhitelistedAppId:(z=s.extended_details)==null?void 0:z.metastable_whitelisted_app_id,metastableCreateCapPkgId:(G=s.extended_details)==null?void 0:G.metastable_create_cap_pkg_id,metastableCreateCapModule:(re=s.extended_details)==null?void 0:re.metastable_create_cap_module,metastableCreateCapAllTypeParams:(oe=s.extended_details)==null?void 0:oe.metastable_create_cap_all_type_params,metastableRegistryId:(se=s.extended_details)==null?void 0:se.metastable_registry_id,obricCoinAPriceSeed:(q=s.extended_details)==null?void 0:q.obric_coin_a_price_seed,obricCoinBPriceSeed:(L=s.extended_details)==null?void 0:L.obric_coin_b_price_seed,obricCoinAPriceId:(h=s.extended_details)==null?void 0:h.obric_coin_a_price_id,obricCoinBPriceId:(f=s.extended_details)==null?void 0:f.obric_coin_b_price_id}),{id:s.id,direction:s.direction,provider:s.provider,from:s.from,target:s.target,feeRate:s.fee_rate,amountIn:s.amount_in,amountOut:s.amount_out,extendedDetails:S,version:m}}),amountIn:new Ht.default(o.amount_in.toString()),amountOut:new Ht.default(o.amount_out.toString()),initialPrice:new gc(o.initial_price.toString())})),totalDeepFee:r,packages:n}}var Hr=Xg,L_="aggregator_v2",B_="aggregator_v2_extend";function xr(e,t){var r;return t instanceof Map&&(r=t.get(L_))!=null?r:e}function gn(e,t){var r;return t instanceof Map&&(r=t.get(B_))!=null?r:e}Uo(Fo());function U_(e){return e.endsWith("/find_routes")?e.replace("/find_routes",""):e}var Ka=Uo(Fo()),Zv=1000600;function F_(e,t,r,n,i){return dt(this,null,function*(){let o;if(r.liquidityChanges&&r.liquidityChanges.length>0?o=yield V_(e,r):o=yield $_(e,t,r),!o)return null;if(!o.ok){let c=10001;return o.status===429&&(c=10005),{amountIn:vi,amountOut:vi,routes:[],byAmountIn:r.byAmountIn,insufficientLiquidity:!1,error:{code:c,msg:Lu(c)}}}const s=yield o.json(),a=s.msg==="liquidity is not enough";if(s.msg&&s.msg.indexOf("HoneyPot scam")>-1)return{amountIn:vi,amountOut:vi,routes:[],byAmountIn:r.byAmountIn,insufficientLiquidity:a,error:{code:10004,msg:Lu(10004)}};if(s.data!=null){const c=D_(s.data,r.byAmountIn);if(n>0&&i!=="0x0")if(r.byAmountIn){const l=c.amountOut.mul(new Ka.default(n)).div(new Ka.default(1e6));c.overlayFee=Number(l.toString()),c.amountOut=c.amountOut.sub(l)}else{const l=c.amountIn.mul(new Ka.default(n)).div(new Ka.default(1e6));c.overlayFee=Number(l.toString()),c.amountIn=c.amountIn.add(l)}return c}return{amountIn:vi,amountOut:vi,routes:[],insufficientLiquidity:a,byAmountIn:r.byAmountIn,error:{code:10003,msg:Lu(10003)}}})}function $_(e,t,r){return dt(this,null,function*(){try{const{from:n,target:i,amount:o,byAmountIn:s,depth:a,splitAlgorithm:c,splitFactor:l,splitCount:u,providers:d}=r,p=Xi(n),y=Xi(i);let x=`${e}/find_routes?from=${p}&target=${y}&amount=${o.toString()}&by_amount_in=${s}`;return a&&(x+=`&depth=${a}`),c&&(x+=`&split_algorithm=${c}`),l&&(x+=`&split_factor=${l}`),u&&(x+=`&split_count=${u}`),d&&d.length>0&&(x+=`&providers=${d.join(",")}`),t.length>0&&(x+=`&apiKey=${t}`),x+=`&v=${Zv}`,yield fetch(x)}catch(n){return console.error(n),null}})}function V_(e,t){return dt(this,null,function*(){const{from:r,target:n,amount:i,byAmountIn:o,depth:s,splitAlgorithm:a,splitFactor:c,splitCount:l,providers:u,liquidityChanges:d}=t,p=Xi(r),y=Xi(n),x=`${e}/find_routes`,b=u==null?void 0:u.join(","),M={from:p,target:y,amount:Number(i.toString()),by_amount_in:o,depth:s,split_algorithm:a,split_factor:c,split_count:l,providers:b,liquidity_changes:d.map(R=>({pool:R.poolID,tick_lower:R.ticklower,tick_upper:R.tickUpper,delta_liquidity:R.deltaLiquidity})),v:Zv};try{return yield fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})}catch(R){return console.error("Error:",R),null}})}function z_(e){return dt(this,null,function*(){const t=`${e}/deepbookv3_config`;try{return(yield fetch(t)).json()}catch(r){return console.error("Error:",r),null}})}var o0=(e=>(e[e.Mainnet=0]="Mainnet",e[e.Testnet=1]="Testnet",e))(o0||{});const Qv="0x2::sui::SUI",q_="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";function eb(e){return Nr(e).full_address===Qv}function sp(e,...t){const r=Array.isArray(t[t.length-1])?t.pop():[];let i=[e,...t].filter(Boolean).join("::");return r&&r.length&&(i+=`<${r.join(", ")}>`),i}function Nr(e){var t;try{let r=e.replace(/\s/g,"");const n=r.match(/(<.+>)$/),i=(t=n==null?void 0:n[0])==null?void 0:t.match(/(\w+::\w+::\w+)(?:<.*?>(?!>))?/g);if(i){r=r.slice(0,r.indexOf("<"));const l={...Nr(r),type_arguments:i.map(u=>Nr(u).source_address)};return l.type_arguments=l.type_arguments.map(u=>eb(u)?u:Nr(u).source_address),l.source_address=sp(l.full_address,l.type_arguments),l}const o=r.split("::"),a={full_address:r,address:r===Qv||r===q_?"0x2":Jr(o[0]),module:o[1],name:o[2],type_arguments:[],source_address:""};return a.full_address=`${a.address}::${a.module}::${a.name}`,a.source_address=sp(a.full_address,a.type_arguments),a}catch{return{full_address:e,address:"",module:"",name:"",type_arguments:[],source_address:e}}}function H_(e){return e.startsWith("0x")?`${e.slice(2)}`:e}const Ti=(e,t=!0)=>{const r=e.split("::"),n=r.shift();let i=Jr(n);return t&&(i=H_(i)),`${i}::${r.join("::")}`};/*!
|
|
29
|
+
*/(function(P){const k=r,F=M,B=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;P.Buffer=q,P.SlowBuffer=v,P.INSPECT_MAX_BYTES=50;const W=2147483647;P.kMaxLength=W;const{Uint8Array:z,ArrayBuffer:G,SharedArrayBuffer:re}=globalThis;q.TYPED_ARRAY_SUPPORT=oe(),!q.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function oe(){try{const N=new z(1),_={foo:function(){return 42}};return Object.setPrototypeOf(_,z.prototype),Object.setPrototypeOf(N,_),N.foo()===42}catch{return!1}}Object.defineProperty(q.prototype,"parent",{enumerable:!0,get:function(){if(q.isBuffer(this))return this.buffer}}),Object.defineProperty(q.prototype,"offset",{enumerable:!0,get:function(){if(q.isBuffer(this))return this.byteOffset}});function se(N){if(N>W)throw new RangeError('The value "'+N+'" is invalid for option "size"');const _=new z(N);return Object.setPrototypeOf(_,q.prototype),_}function q(N,_,A){if(typeof N=="number"){if(typeof _=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(N)}return L(N,_,A)}q.poolSize=8192;function L(N,_,A){if(typeof N=="string")return S(N,_);if(G.isView(N))return E(N);if(N==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof N);if(mt(N,G)||N&&mt(N.buffer,G)||typeof re<"u"&&(mt(N,re)||N&&mt(N.buffer,re)))return I(N,_,A);if(typeof N=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const U=N.valueOf&&N.valueOf();if(U!=null&&U!==N)return q.from(U,_,A);const Y=C(N);if(Y)return Y;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof N[Symbol.toPrimitive]=="function")return q.from(N[Symbol.toPrimitive]("string"),_,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof N)}q.from=function(N,_,A){return L(N,_,A)},Object.setPrototypeOf(q.prototype,z.prototype),Object.setPrototypeOf(q,z);function h(N){if(typeof N!="number")throw new TypeError('"size" argument must be of type number');if(N<0)throw new RangeError('The value "'+N+'" is invalid for option "size"')}function f(N,_,A){return h(N),N<=0?se(N):_!==void 0?typeof A=="string"?se(N).fill(_,A):se(N).fill(_):se(N)}q.alloc=function(N,_,A){return f(N,_,A)};function m(N){return h(N),se(N<0?0:g(N)|0)}q.allocUnsafe=function(N){return m(N)},q.allocUnsafeSlow=function(N){return m(N)};function S(N,_){if((typeof _!="string"||_==="")&&(_="utf8"),!q.isEncoding(_))throw new TypeError("Unknown encoding: "+_);const A=j(N,_)|0;let U=se(A);const Y=U.write(N,_);return Y!==A&&(U=U.slice(0,Y)),U}function T(N){const _=N.length<0?0:g(N.length)|0,A=se(_);for(let U=0;U<_;U+=1)A[U]=N[U]&255;return A}function E(N){if(mt(N,z)){const _=new z(N);return I(_.buffer,_.byteOffset,_.byteLength)}return T(N)}function I(N,_,A){if(_<0||N.byteLength<_)throw new RangeError('"offset" is outside of buffer bounds');if(N.byteLength<_+(A||0))throw new RangeError('"length" is outside of buffer bounds');let U;return _===void 0&&A===void 0?U=new z(N):A===void 0?U=new z(N,_):U=new z(N,_,A),Object.setPrototypeOf(U,q.prototype),U}function C(N){if(q.isBuffer(N)){const _=g(N.length)|0,A=se(_);return A.length===0||N.copy(A,0,0,_),A}if(N.length!==void 0)return typeof N.length!="number"||Nt(N.length)?se(0):T(N);if(N.type==="Buffer"&&Array.isArray(N.data))return T(N.data)}function g(N){if(N>=W)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+W.toString(16)+" bytes");return N|0}function v(N){return+N!=N&&(N=0),q.alloc(+N)}q.isBuffer=function(_){return _!=null&&_._isBuffer===!0&&_!==q.prototype},q.compare=function(_,A){if(mt(_,z)&&(_=q.from(_,_.offset,_.byteLength)),mt(A,z)&&(A=q.from(A,A.offset,A.byteLength)),!q.isBuffer(_)||!q.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(_===A)return 0;let U=_.length,Y=A.length;for(let ee=0,ne=Math.min(U,Y);ee<ne;++ee)if(_[ee]!==A[ee]){U=_[ee],Y=A[ee];break}return U<Y?-1:Y<U?1:0},q.isEncoding=function(_){switch(String(_).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},q.concat=function(_,A){if(!Array.isArray(_))throw new TypeError('"list" argument must be an Array of Buffers');if(_.length===0)return q.alloc(0);let U;if(A===void 0)for(A=0,U=0;U<_.length;++U)A+=_[U].length;const Y=q.allocUnsafe(A);let ee=0;for(U=0;U<_.length;++U){let ne=_[U];if(mt(ne,z))ee+ne.length>Y.length?(q.isBuffer(ne)||(ne=q.from(ne)),ne.copy(Y,ee)):z.prototype.set.call(Y,ne,ee);else if(q.isBuffer(ne))ne.copy(Y,ee);else throw new TypeError('"list" argument must be an Array of Buffers');ee+=ne.length}return Y};function j(N,_){if(q.isBuffer(N))return N.length;if(G.isView(N)||mt(N,G))return N.byteLength;if(typeof N!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof N);const A=N.length,U=arguments.length>2&&arguments[2]===!0;if(!U&&A===0)return 0;let Y=!1;for(;;)switch(_){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Pt(N).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return Ct(N).length;default:if(Y)return U?-1:Pt(N).length;_=(""+_).toLowerCase(),Y=!0}}q.byteLength=j;function Q(N,_,A){let U=!1;if((_===void 0||_<0)&&(_=0),_>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,_>>>=0,A<=_))return"";for(N||(N="utf8");;)switch(N){case"hex":return Ve(this,_,A);case"utf8":case"utf-8":return je(this,_,A);case"ascii":return he(this,_,A);case"latin1":case"binary":return Ce(this,_,A);case"base64":return dt(this,_,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ke(this,_,A);default:if(U)throw new TypeError("Unknown encoding: "+N);N=(N+"").toLowerCase(),U=!0}}q.prototype._isBuffer=!0;function Z(N,_,A){const U=N[_];N[_]=N[A],N[A]=U}q.prototype.swap16=function(){const _=this.length;if(_%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;A<_;A+=2)Z(this,A,A+1);return this},q.prototype.swap32=function(){const _=this.length;if(_%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<_;A+=4)Z(this,A,A+3),Z(this,A+1,A+2);return this},q.prototype.swap64=function(){const _=this.length;if(_%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let A=0;A<_;A+=8)Z(this,A,A+7),Z(this,A+1,A+6),Z(this,A+2,A+5),Z(this,A+3,A+4);return this},q.prototype.toString=function(){const _=this.length;return _===0?"":arguments.length===0?je(this,0,_):Q.apply(this,arguments)},q.prototype.toLocaleString=q.prototype.toString,q.prototype.equals=function(_){if(!q.isBuffer(_))throw new TypeError("Argument must be a Buffer");return this===_?!0:q.compare(this,_)===0},q.prototype.inspect=function(){let _="";const A=P.INSPECT_MAX_BYTES;return _=this.toString("hex",0,A).replace(/(.{2})/g,"$1 ").trim(),this.length>A&&(_+=" ... "),"<Buffer "+_+">"},B&&(q.prototype[B]=q.prototype.inspect),q.prototype.compare=function(_,A,U,Y,ee){if(mt(_,z)&&(_=q.from(_,_.offset,_.byteLength)),!q.isBuffer(_))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof _);if(A===void 0&&(A=0),U===void 0&&(U=_?_.length:0),Y===void 0&&(Y=0),ee===void 0&&(ee=this.length),A<0||U>_.length||Y<0||ee>this.length)throw new RangeError("out of range index");if(Y>=ee&&A>=U)return 0;if(Y>=ee)return-1;if(A>=U)return 1;if(A>>>=0,U>>>=0,Y>>>=0,ee>>>=0,this===_)return 0;let ne=ee-Y,De=U-A;const Ze=Math.min(ne,De),Ne=this.slice(Y,ee),V=_.slice(A,U);for(let ae=0;ae<Ze;++ae)if(Ne[ae]!==V[ae]){ne=Ne[ae],De=V[ae];break}return ne<De?-1:De<ne?1:0};function ce(N,_,A,U,Y){if(N.length===0)return-1;if(typeof A=="string"?(U=A,A=0):A>2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,Nt(A)&&(A=Y?0:N.length-1),A<0&&(A=N.length+A),A>=N.length){if(Y)return-1;A=N.length-1}else if(A<0)if(Y)A=0;else return-1;if(typeof _=="string"&&(_=q.from(_,U)),q.isBuffer(_))return _.length===0?-1:be(N,_,A,U,Y);if(typeof _=="number")return _=_&255,typeof z.prototype.indexOf=="function"?Y?z.prototype.indexOf.call(N,_,A):z.prototype.lastIndexOf.call(N,_,A):be(N,[_],A,U,Y);throw new TypeError("val must be string, number or Buffer")}function be(N,_,A,U,Y){let ee=1,ne=N.length,De=_.length;if(U!==void 0&&(U=String(U).toLowerCase(),U==="ucs2"||U==="ucs-2"||U==="utf16le"||U==="utf-16le")){if(N.length<2||_.length<2)return-1;ee=2,ne/=2,De/=2,A/=2}function Ze(V,ae){return ee===1?V[ae]:V.readUInt16BE(ae*ee)}let Ne;if(Y){let V=-1;for(Ne=A;Ne<ne;Ne++)if(Ze(N,Ne)===Ze(_,V===-1?0:Ne-V)){if(V===-1&&(V=Ne),Ne-V+1===De)return V*ee}else V!==-1&&(Ne-=Ne-V),V=-1}else for(A+De>ne&&(A=ne-De),Ne=A;Ne>=0;Ne--){let V=!0;for(let ae=0;ae<De;ae++)if(Ze(N,Ne+ae)!==Ze(_,ae)){V=!1;break}if(V)return Ne}return-1}q.prototype.includes=function(_,A,U){return this.indexOf(_,A,U)!==-1},q.prototype.indexOf=function(_,A,U){return ce(this,_,A,U,!0)},q.prototype.lastIndexOf=function(_,A,U){return ce(this,_,A,U,!1)};function xe(N,_,A,U){A=Number(A)||0;const Y=N.length-A;U?(U=Number(U),U>Y&&(U=Y)):U=Y;const ee=_.length;U>ee/2&&(U=ee/2);let ne;for(ne=0;ne<U;++ne){const De=parseInt(_.substr(ne*2,2),16);if(Nt(De))return ne;N[A+ne]=De}return ne}function pe(N,_,A,U){return Ge(Pt(_,N.length-A),N,A,U)}function Le(N,_,A,U){return Ge(tt(_),N,A,U)}function Ae(N,_,A,U){return Ge(Ct(_),N,A,U)}function Je(N,_,A,U){return Ge(wt(_,N.length-A),N,A,U)}q.prototype.write=function(_,A,U,Y){if(A===void 0)Y="utf8",U=this.length,A=0;else if(U===void 0&&typeof A=="string")Y=A,U=this.length,A=0;else if(isFinite(A))A=A>>>0,isFinite(U)?(U=U>>>0,Y===void 0&&(Y="utf8")):(Y=U,U=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ee=this.length-A;if((U===void 0||U>ee)&&(U=ee),_.length>0&&(U<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");Y||(Y="utf8");let ne=!1;for(;;)switch(Y){case"hex":return xe(this,_,A,U);case"utf8":case"utf-8":return pe(this,_,A,U);case"ascii":case"latin1":case"binary":return Le(this,_,A,U);case"base64":return Ae(this,_,A,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Je(this,_,A,U);default:if(ne)throw new TypeError("Unknown encoding: "+Y);Y=(""+Y).toLowerCase(),ne=!0}},q.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function dt(N,_,A){return _===0&&A===N.length?k.fromByteArray(N):k.fromByteArray(N.slice(_,A))}function je(N,_,A){A=Math.min(N.length,A);const U=[];let Y=_;for(;Y<A;){const ee=N[Y];let ne=null,De=ee>239?4:ee>223?3:ee>191?2:1;if(Y+De<=A){let Ze,Ne,V,ae;switch(De){case 1:ee<128&&(ne=ee);break;case 2:Ze=N[Y+1],(Ze&192)===128&&(ae=(ee&31)<<6|Ze&63,ae>127&&(ne=ae));break;case 3:Ze=N[Y+1],Ne=N[Y+2],(Ze&192)===128&&(Ne&192)===128&&(ae=(ee&15)<<12|(Ze&63)<<6|Ne&63,ae>2047&&(ae<55296||ae>57343)&&(ne=ae));break;case 4:Ze=N[Y+1],Ne=N[Y+2],V=N[Y+3],(Ze&192)===128&&(Ne&192)===128&&(V&192)===128&&(ae=(ee&15)<<18|(Ze&63)<<12|(Ne&63)<<6|V&63,ae>65535&&ae<1114112&&(ne=ae))}}ne===null?(ne=65533,De=1):ne>65535&&(ne-=65536,U.push(ne>>>10&1023|55296),ne=56320|ne&1023),U.push(ne),Y+=De}return we(U)}const pt=4096;function we(N){const _=N.length;if(_<=pt)return String.fromCharCode.apply(String,N);let A="",U=0;for(;U<_;)A+=String.fromCharCode.apply(String,N.slice(U,U+=pt));return A}function he(N,_,A){let U="";A=Math.min(N.length,A);for(let Y=_;Y<A;++Y)U+=String.fromCharCode(N[Y]&127);return U}function Ce(N,_,A){let U="";A=Math.min(N.length,A);for(let Y=_;Y<A;++Y)U+=String.fromCharCode(N[Y]);return U}function Ve(N,_,A){const U=N.length;(!_||_<0)&&(_=0),(!A||A<0||A>U)&&(A=U);let Y="";for(let ee=_;ee<A;++ee)Y+=it[N[ee]];return Y}function ke(N,_,A){const U=N.slice(_,A);let Y="";for(let ee=0;ee<U.length-1;ee+=2)Y+=String.fromCharCode(U[ee]+U[ee+1]*256);return Y}q.prototype.slice=function(_,A){const U=this.length;_=~~_,A=A===void 0?U:~~A,_<0?(_+=U,_<0&&(_=0)):_>U&&(_=U),A<0?(A+=U,A<0&&(A=0)):A>U&&(A=U),A<_&&(A=_);const Y=this.subarray(_,A);return Object.setPrototypeOf(Y,q.prototype),Y};function Te(N,_,A){if(N%1!==0||N<0)throw new RangeError("offset is not uint");if(N+_>A)throw new RangeError("Trying to access beyond buffer length")}q.prototype.readUintLE=q.prototype.readUIntLE=function(_,A,U){_=_>>>0,A=A>>>0,U||Te(_,A,this.length);let Y=this[_],ee=1,ne=0;for(;++ne<A&&(ee*=256);)Y+=this[_+ne]*ee;return Y},q.prototype.readUintBE=q.prototype.readUIntBE=function(_,A,U){_=_>>>0,A=A>>>0,U||Te(_,A,this.length);let Y=this[_+--A],ee=1;for(;A>0&&(ee*=256);)Y+=this[_+--A]*ee;return Y},q.prototype.readUint8=q.prototype.readUInt8=function(_,A){return _=_>>>0,A||Te(_,1,this.length),this[_]},q.prototype.readUint16LE=q.prototype.readUInt16LE=function(_,A){return _=_>>>0,A||Te(_,2,this.length),this[_]|this[_+1]<<8},q.prototype.readUint16BE=q.prototype.readUInt16BE=function(_,A){return _=_>>>0,A||Te(_,2,this.length),this[_]<<8|this[_+1]},q.prototype.readUint32LE=q.prototype.readUInt32LE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),(this[_]|this[_+1]<<8|this[_+2]<<16)+this[_+3]*16777216},q.prototype.readUint32BE=q.prototype.readUInt32BE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),this[_]*16777216+(this[_+1]<<16|this[_+2]<<8|this[_+3])},q.prototype.readBigUInt64LE=xt(function(_){_=_>>>0,Et(_,"offset");const A=this[_],U=this[_+7];(A===void 0||U===void 0)&&Ot(_,this.length-8);const Y=A+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24,ee=this[++_]+this[++_]*2**8+this[++_]*2**16+U*2**24;return BigInt(Y)+(BigInt(ee)<<BigInt(32))}),q.prototype.readBigUInt64BE=xt(function(_){_=_>>>0,Et(_,"offset");const A=this[_],U=this[_+7];(A===void 0||U===void 0)&&Ot(_,this.length-8);const Y=A*2**24+this[++_]*2**16+this[++_]*2**8+this[++_],ee=this[++_]*2**24+this[++_]*2**16+this[++_]*2**8+U;return(BigInt(Y)<<BigInt(32))+BigInt(ee)}),q.prototype.readIntLE=function(_,A,U){_=_>>>0,A=A>>>0,U||Te(_,A,this.length);let Y=this[_],ee=1,ne=0;for(;++ne<A&&(ee*=256);)Y+=this[_+ne]*ee;return ee*=128,Y>=ee&&(Y-=Math.pow(2,8*A)),Y},q.prototype.readIntBE=function(_,A,U){_=_>>>0,A=A>>>0,U||Te(_,A,this.length);let Y=A,ee=1,ne=this[_+--Y];for(;Y>0&&(ee*=256);)ne+=this[_+--Y]*ee;return ee*=128,ne>=ee&&(ne-=Math.pow(2,8*A)),ne},q.prototype.readInt8=function(_,A){return _=_>>>0,A||Te(_,1,this.length),this[_]&128?(255-this[_]+1)*-1:this[_]},q.prototype.readInt16LE=function(_,A){_=_>>>0,A||Te(_,2,this.length);const U=this[_]|this[_+1]<<8;return U&32768?U|4294901760:U},q.prototype.readInt16BE=function(_,A){_=_>>>0,A||Te(_,2,this.length);const U=this[_+1]|this[_]<<8;return U&32768?U|4294901760:U},q.prototype.readInt32LE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),this[_]|this[_+1]<<8|this[_+2]<<16|this[_+3]<<24},q.prototype.readInt32BE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),this[_]<<24|this[_+1]<<16|this[_+2]<<8|this[_+3]},q.prototype.readBigInt64LE=xt(function(_){_=_>>>0,Et(_,"offset");const A=this[_],U=this[_+7];(A===void 0||U===void 0)&&Ot(_,this.length-8);const Y=this[_+4]+this[_+5]*2**8+this[_+6]*2**16+(U<<24);return(BigInt(Y)<<BigInt(32))+BigInt(A+this[++_]*2**8+this[++_]*2**16+this[++_]*2**24)}),q.prototype.readBigInt64BE=xt(function(_){_=_>>>0,Et(_,"offset");const A=this[_],U=this[_+7];(A===void 0||U===void 0)&&Ot(_,this.length-8);const Y=(A<<24)+this[++_]*2**16+this[++_]*2**8+this[++_];return(BigInt(Y)<<BigInt(32))+BigInt(this[++_]*2**24+this[++_]*2**16+this[++_]*2**8+U)}),q.prototype.readFloatLE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),F.read(this,_,!0,23,4)},q.prototype.readFloatBE=function(_,A){return _=_>>>0,A||Te(_,4,this.length),F.read(this,_,!1,23,4)},q.prototype.readDoubleLE=function(_,A){return _=_>>>0,A||Te(_,8,this.length),F.read(this,_,!0,52,8)},q.prototype.readDoubleBE=function(_,A){return _=_>>>0,A||Te(_,8,this.length),F.read(this,_,!1,52,8)};function Me(N,_,A,U,Y,ee){if(!q.isBuffer(N))throw new TypeError('"buffer" argument must be a Buffer instance');if(_>Y||_<ee)throw new RangeError('"value" argument is out of bounds');if(A+U>N.length)throw new RangeError("Index out of range")}q.prototype.writeUintLE=q.prototype.writeUIntLE=function(_,A,U,Y){if(_=+_,A=A>>>0,U=U>>>0,!Y){const De=Math.pow(2,8*U)-1;Me(this,_,A,U,De,0)}let ee=1,ne=0;for(this[A]=_&255;++ne<U&&(ee*=256);)this[A+ne]=_/ee&255;return A+U},q.prototype.writeUintBE=q.prototype.writeUIntBE=function(_,A,U,Y){if(_=+_,A=A>>>0,U=U>>>0,!Y){const De=Math.pow(2,8*U)-1;Me(this,_,A,U,De,0)}let ee=U-1,ne=1;for(this[A+ee]=_&255;--ee>=0&&(ne*=256);)this[A+ee]=_/ne&255;return A+U},q.prototype.writeUint8=q.prototype.writeUInt8=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,1,255,0),this[A]=_&255,A+1},q.prototype.writeUint16LE=q.prototype.writeUInt16LE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,2,65535,0),this[A]=_&255,this[A+1]=_>>>8,A+2},q.prototype.writeUint16BE=q.prototype.writeUInt16BE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,2,65535,0),this[A]=_>>>8,this[A+1]=_&255,A+2},q.prototype.writeUint32LE=q.prototype.writeUInt32LE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,4,4294967295,0),this[A+3]=_>>>24,this[A+2]=_>>>16,this[A+1]=_>>>8,this[A]=_&255,A+4},q.prototype.writeUint32BE=q.prototype.writeUInt32BE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,4,4294967295,0),this[A]=_>>>24,this[A+1]=_>>>16,this[A+2]=_>>>8,this[A+3]=_&255,A+4};function Ue(N,_,A,U,Y){et(_,U,Y,N,A,7);let ee=Number(_&BigInt(4294967295));N[A++]=ee,ee=ee>>8,N[A++]=ee,ee=ee>>8,N[A++]=ee,ee=ee>>8,N[A++]=ee;let ne=Number(_>>BigInt(32)&BigInt(4294967295));return N[A++]=ne,ne=ne>>8,N[A++]=ne,ne=ne>>8,N[A++]=ne,ne=ne>>8,N[A++]=ne,A}function ut(N,_,A,U,Y){et(_,U,Y,N,A,7);let ee=Number(_&BigInt(4294967295));N[A+7]=ee,ee=ee>>8,N[A+6]=ee,ee=ee>>8,N[A+5]=ee,ee=ee>>8,N[A+4]=ee;let ne=Number(_>>BigInt(32)&BigInt(4294967295));return N[A+3]=ne,ne=ne>>8,N[A+2]=ne,ne=ne>>8,N[A+1]=ne,ne=ne>>8,N[A]=ne,A+8}q.prototype.writeBigUInt64LE=xt(function(_,A=0){return Ue(this,_,A,BigInt(0),BigInt("0xffffffffffffffff"))}),q.prototype.writeBigUInt64BE=xt(function(_,A=0){return ut(this,_,A,BigInt(0),BigInt("0xffffffffffffffff"))}),q.prototype.writeIntLE=function(_,A,U,Y){if(_=+_,A=A>>>0,!Y){const Ze=Math.pow(2,8*U-1);Me(this,_,A,U,Ze-1,-Ze)}let ee=0,ne=1,De=0;for(this[A]=_&255;++ee<U&&(ne*=256);)_<0&&De===0&&this[A+ee-1]!==0&&(De=1),this[A+ee]=(_/ne>>0)-De&255;return A+U},q.prototype.writeIntBE=function(_,A,U,Y){if(_=+_,A=A>>>0,!Y){const Ze=Math.pow(2,8*U-1);Me(this,_,A,U,Ze-1,-Ze)}let ee=U-1,ne=1,De=0;for(this[A+ee]=_&255;--ee>=0&&(ne*=256);)_<0&&De===0&&this[A+ee+1]!==0&&(De=1),this[A+ee]=(_/ne>>0)-De&255;return A+U},q.prototype.writeInt8=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,1,127,-128),_<0&&(_=255+_+1),this[A]=_&255,A+1},q.prototype.writeInt16LE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,2,32767,-32768),this[A]=_&255,this[A+1]=_>>>8,A+2},q.prototype.writeInt16BE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,2,32767,-32768),this[A]=_>>>8,this[A+1]=_&255,A+2},q.prototype.writeInt32LE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,4,2147483647,-2147483648),this[A]=_&255,this[A+1]=_>>>8,this[A+2]=_>>>16,this[A+3]=_>>>24,A+4},q.prototype.writeInt32BE=function(_,A,U){return _=+_,A=A>>>0,U||Me(this,_,A,4,2147483647,-2147483648),_<0&&(_=4294967295+_+1),this[A]=_>>>24,this[A+1]=_>>>16,this[A+2]=_>>>8,this[A+3]=_&255,A+4},q.prototype.writeBigInt64LE=xt(function(_,A=0){return Ue(this,_,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),q.prototype.writeBigInt64BE=xt(function(_,A=0){return ut(this,_,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ft(N,_,A,U,Y,ee){if(A+U>N.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function ze(N,_,A,U,Y){return _=+_,A=A>>>0,Y||ft(N,_,A,4),F.write(N,_,A,U,23,4),A+4}q.prototype.writeFloatLE=function(_,A,U){return ze(this,_,A,!0,U)},q.prototype.writeFloatBE=function(_,A,U){return ze(this,_,A,!1,U)};function kt(N,_,A,U,Y){return _=+_,A=A>>>0,Y||ft(N,_,A,8),F.write(N,_,A,U,52,8),A+8}q.prototype.writeDoubleLE=function(_,A,U){return kt(this,_,A,!0,U)},q.prototype.writeDoubleBE=function(_,A,U){return kt(this,_,A,!1,U)},q.prototype.copy=function(_,A,U,Y){if(!q.isBuffer(_))throw new TypeError("argument should be a Buffer");if(U||(U=0),!Y&&Y!==0&&(Y=this.length),A>=_.length&&(A=_.length),A||(A=0),Y>0&&Y<U&&(Y=U),Y===U||_.length===0||this.length===0)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(U<0||U>=this.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("sourceEnd out of bounds");Y>this.length&&(Y=this.length),_.length-A<Y-U&&(Y=_.length-A+U);const ee=Y-U;return this===_&&typeof z.prototype.copyWithin=="function"?this.copyWithin(A,U,Y):z.prototype.set.call(_,this.subarray(U,Y),A),ee},q.prototype.fill=function(_,A,U,Y){if(typeof _=="string"){if(typeof A=="string"?(Y=A,A=0,U=this.length):typeof U=="string"&&(Y=U,U=this.length),Y!==void 0&&typeof Y!="string")throw new TypeError("encoding must be a string");if(typeof Y=="string"&&!q.isEncoding(Y))throw new TypeError("Unknown encoding: "+Y);if(_.length===1){const ne=_.charCodeAt(0);(Y==="utf8"&&ne<128||Y==="latin1")&&(_=ne)}}else typeof _=="number"?_=_&255:typeof _=="boolean"&&(_=Number(_));if(A<0||this.length<A||this.length<U)throw new RangeError("Out of range index");if(U<=A)return this;A=A>>>0,U=U===void 0?this.length:U>>>0,_||(_=0);let ee;if(typeof _=="number")for(ee=A;ee<U;++ee)this[ee]=_;else{const ne=q.isBuffer(_)?_:q.from(_,Y),De=ne.length;if(De===0)throw new TypeError('The value "'+_+'" is invalid for argument "value"');for(ee=0;ee<U-A;++ee)this[ee+A]=ne[ee%De]}return this};const _t={};function Ke(N,_,A){_t[N]=class extends A{constructor(){super(),Object.defineProperty(this,"message",{value:_.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${N}]`,this.stack,delete this.name}get code(){return N}set code(Y){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Y,writable:!0})}toString(){return`${this.name} [${N}]: ${this.message}`}}}Ke("ERR_BUFFER_OUT_OF_BOUNDS",function(N){return N?`${N} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Ke("ERR_INVALID_ARG_TYPE",function(N,_){return`The "${N}" argument must be of type number. Received type ${typeof _}`},TypeError),Ke("ERR_OUT_OF_RANGE",function(N,_,A){let U=`The value of "${N}" is out of range.`,Y=A;return Number.isInteger(A)&&Math.abs(A)>2**32?Y=It(String(A)):typeof A=="bigint"&&(Y=String(A),(A>BigInt(2)**BigInt(32)||A<-(BigInt(2)**BigInt(32)))&&(Y=It(Y)),Y+="n"),U+=` It must be ${_}. Received ${Y}`,U},RangeError);function It(N){let _="",A=N.length;const U=N[0]==="-"?1:0;for(;A>=U+4;A-=3)_=`_${N.slice(A-3,A)}${_}`;return`${N.slice(0,A)}${_}`}function Ut(N,_,A){Et(_,"offset"),(N[_]===void 0||N[_+A]===void 0)&&Ot(_,N.length-(A+1))}function et(N,_,A,U,Y,ee){if(N>A||N<_){const ne=typeof _=="bigint"?"n":"";let De;throw ee>3?_===0||_===BigInt(0)?De=`>= 0${ne} and < 2${ne} ** ${(ee+1)*8}${ne}`:De=`>= -(2${ne} ** ${(ee+1)*8-1}${ne}) and < 2 ** ${(ee+1)*8-1}${ne}`:De=`>= ${_}${ne} and <= ${A}${ne}`,new _t.ERR_OUT_OF_RANGE("value",De,N)}Ut(U,Y,ee)}function Et(N,_){if(typeof N!="number")throw new _t.ERR_INVALID_ARG_TYPE(_,"number",N)}function Ot(N,_,A){throw Math.floor(N)!==N?(Et(N,A),new _t.ERR_OUT_OF_RANGE(A||"offset","an integer",N)):_<0?new _t.ERR_BUFFER_OUT_OF_BOUNDS:new _t.ERR_OUT_OF_RANGE(A||"offset",`>= ${A?1:0} and <= ${_}`,N)}const nt=/[^+/0-9A-Za-z-_]/g;function jt(N){if(N=N.split("=")[0],N=N.trim().replace(nt,""),N.length<2)return"";for(;N.length%4!==0;)N=N+"=";return N}function Pt(N,_){_=_||1/0;let A;const U=N.length;let Y=null;const ee=[];for(let ne=0;ne<U;++ne){if(A=N.charCodeAt(ne),A>55295&&A<57344){if(!Y){if(A>56319){(_-=3)>-1&&ee.push(239,191,189);continue}else if(ne+1===U){(_-=3)>-1&&ee.push(239,191,189);continue}Y=A;continue}if(A<56320){(_-=3)>-1&&ee.push(239,191,189),Y=A;continue}A=(Y-55296<<10|A-56320)+65536}else Y&&(_-=3)>-1&&ee.push(239,191,189);if(Y=null,A<128){if((_-=1)<0)break;ee.push(A)}else if(A<2048){if((_-=2)<0)break;ee.push(A>>6|192,A&63|128)}else if(A<65536){if((_-=3)<0)break;ee.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((_-=4)<0)break;ee.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return ee}function tt(N){const _=[];for(let A=0;A<N.length;++A)_.push(N.charCodeAt(A)&255);return _}function wt(N,_){let A,U,Y;const ee=[];for(let ne=0;ne<N.length&&!((_-=2)<0);++ne)A=N.charCodeAt(ne),U=A>>8,Y=A%256,ee.push(Y),ee.push(U);return ee}function Ct(N){return k.toByteArray(jt(N))}function Ge(N,_,A,U){let Y;for(Y=0;Y<U&&!(Y+A>=_.length||Y>=N.length);++Y)_[Y+A]=N[Y];return Y}function mt(N,_){return N instanceof _||N!=null&&N.constructor!=null&&N.constructor.name!=null&&N.constructor.name===_.name}function Nt(N){return N!==N}const it=function(){const N="0123456789abcdef",_=new Array(256);for(let A=0;A<16;++A){const U=A*16;for(let Y=0;Y<16;++Y)_[U+Y]=N[A]+N[Y]}return _}();function xt(N){return typeof BigInt>"u"?zt:N}function zt(){throw new Error("BigInt not supported")}})(t);const O=t.Buffer;e.Blob=t.Blob,e.BlobOptions=t.BlobOptions,e.Buffer=t.Buffer,e.File=t.File,e.FileOptions=t.FileOptions,e.INSPECT_MAX_BYTES=t.INSPECT_MAX_BYTES,e.SlowBuffer=t.SlowBuffer,e.TranscodeEncoding=t.TranscodeEncoding,e.atob=t.atob,e.btoa=t.btoa,e.constants=t.constants,e.default=O,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode})(Oa);const Ef=Ta(Oa);var fn={},Td={exports:{}};Td.exports;(function(e){(function(t,r){function n(L,h){if(!L)throw new Error(h||"Assertion failed")}function i(L,h){L.super_=h;var f=function(){};f.prototype=h.prototype,L.prototype=new f,L.prototype.constructor=L}function o(L,h,f){if(o.isBN(L))return L;this.negative=0,this.words=null,this.length=0,this.red=null,L!==null&&((h==="le"||h==="be")&&(f=h,h=10),this._init(L||0,h||10,f||"be"))}typeof t=="object"?t.exports=o:r.BN=o,o.BN=o,o.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=Oa.Buffer}catch{}o.isBN=function(h){return h instanceof o?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===o.wordSize&&Array.isArray(h.words)},o.max=function(h,f){return h.cmp(f)>0?h:f},o.min=function(h,f){return h.cmp(f)<0?h:f},o.prototype._init=function(h,f,m){if(typeof h=="number")return this._initNumber(h,f,m);if(typeof h=="object")return this._initArray(h,f,m);f==="hex"&&(f=16),n(f===(f|0)&&f>=2&&f<=36),h=h.toString().replace(/\s+/g,"");var S=0;h[0]==="-"&&(S++,this.negative=1),S<h.length&&(f===16?this._parseHex(h,S,m):(this._parseBase(h,f,S),m==="le"&&this._initArray(this.toArray(),f,m)))},o.prototype._initNumber=function(h,f,m){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(n(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),m==="le"&&this._initArray(this.toArray(),f,m)},o.prototype._initArray=function(h,f,m){if(n(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var T,E,I=0;if(m==="be")for(S=h.length-1,T=0;S>=0;S-=3)E=h[S]|h[S-1]<<8|h[S-2]<<16,this.words[T]|=E<<I&67108863,this.words[T+1]=E>>>26-I&67108863,I+=24,I>=26&&(I-=26,T++);else if(m==="le")for(S=0,T=0;S<h.length;S+=3)E=h[S]|h[S+1]<<8|h[S+2]<<16,this.words[T]|=E<<I&67108863,this.words[T+1]=E>>>26-I&67108863,I+=24,I>=26&&(I-=26,T++);return this._strip()};function a(L,h){var f=L.charCodeAt(h);if(f>=48&&f<=57)return f-48;if(f>=65&&f<=70)return f-55;if(f>=97&&f<=102)return f-87;n(!1,"Invalid character in "+L)}function c(L,h,f){var m=a(L,f);return f-1>=h&&(m|=a(L,f-1)<<4),m}o.prototype._parseHex=function(h,f,m){this.length=Math.ceil((h.length-f)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var T=0,E=0,I;if(m==="be")for(S=h.length-1;S>=f;S-=2)I=c(h,f,S)<<T,this.words[E]|=I&67108863,T>=18?(T-=18,E+=1,this.words[E]|=I>>>26):T+=8;else{var C=h.length-f;for(S=C%2===0?f+1:f;S<h.length;S+=2)I=c(h,f,S)<<T,this.words[E]|=I&67108863,T>=18?(T-=18,E+=1,this.words[E]|=I>>>26):T+=8}this._strip()};function l(L,h,f,m){for(var S=0,T=0,E=Math.min(L.length,f),I=h;I<E;I++){var C=L.charCodeAt(I)-48;S*=m,C>=49?T=C-49+10:C>=17?T=C-17+10:T=C,n(C>=0&&T<m,"Invalid character"),S+=T}return S}o.prototype._parseBase=function(h,f,m){this.words=[0],this.length=1;for(var S=0,T=1;T<=67108863;T*=f)S++;S--,T=T/f|0;for(var E=h.length-m,I=E%S,C=Math.min(E,E-I)+m,g=0,v=m;v<C;v+=S)g=l(h,v,v+S,f),this.imuln(T),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(I!==0){var j=1;for(g=l(h,v,h.length,f),v=0;v<I;v++)j*=f;this.imuln(j),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this._strip()},o.prototype.copy=function(h){h.words=new Array(this.length);for(var f=0;f<this.length;f++)h.words[f]=this.words[f];h.length=this.length,h.negative=this.negative,h.red=this.red};function u(L,h){L.words=h.words,L.length=h.length,L.negative=h.negative,L.red=h.red}if(o.prototype._move=function(h){u(h,this)},o.prototype.clone=function(){var h=new o(null);return this.copy(h),h},o.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch{o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],y=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(h,f){h=h||10,f=f|0||1;var m;if(h===16||h==="hex"){m="";for(var S=0,T=0,E=0;E<this.length;E++){var I=this.words[E],C=((I<<S|T)&16777215).toString(16);T=I>>>24-S&16777215,S+=2,S>=26&&(S-=26,E--),T!==0||E!==this.length-1?m=p[6-C.length]+C+m:m=C+m}for(T!==0&&(m=T.toString(16)+m);m.length%f!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(h===(h|0)&&h>=2&&h<=36){var g=y[h],v=x[h];m="";var j=this.clone();for(j.negative=0;!j.isZero();){var Q=j.modrn(v).toString(h);j=j.idivn(v),j.isZero()?m=Q+m:m=p[g-Q.length]+Q+m}for(this.isZero()&&(m="0"+m);m.length%f!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(h,f){return this.toArrayLike(s,h,f)}),o.prototype.toArray=function(h,f){return this.toArrayLike(Array,h,f)};var b=function(h,f){return h.allocUnsafe?h.allocUnsafe(f):new h(f)};o.prototype.toArrayLike=function(h,f,m){this._strip();var S=this.byteLength(),T=m||Math.max(1,S);n(S<=T,"byte array longer than desired length"),n(T>0,"Requested array length <= 0");var E=b(h,T),I=f==="le"?"LE":"BE";return this["_toArrayLike"+I](E,S),E},o.prototype._toArrayLikeLE=function(h,f){for(var m=0,S=0,T=0,E=0;T<this.length;T++){var I=this.words[T]<<E|S;h[m++]=I&255,m<h.length&&(h[m++]=I>>8&255),m<h.length&&(h[m++]=I>>16&255),E===6?(m<h.length&&(h[m++]=I>>24&255),S=0,E=0):(S=I>>>24,E+=2)}if(m<h.length)for(h[m++]=S;m<h.length;)h[m++]=0},o.prototype._toArrayLikeBE=function(h,f){for(var m=h.length-1,S=0,T=0,E=0;T<this.length;T++){var I=this.words[T]<<E|S;h[m--]=I&255,m>=0&&(h[m--]=I>>8&255),m>=0&&(h[m--]=I>>16&255),E===6?(m>=0&&(h[m--]=I>>24&255),S=0,E=0):(S=I>>>24,E+=2)}if(m>=0)for(h[m--]=S;m>=0;)h[m--]=0},Math.clz32?o.prototype._countBits=function(h){return 32-Math.clz32(h)}:o.prototype._countBits=function(h){var f=h,m=0;return f>=4096&&(m+=13,f>>>=13),f>=64&&(m+=7,f>>>=7),f>=8&&(m+=4,f>>>=4),f>=2&&(m+=2,f>>>=2),m+f},o.prototype._zeroBits=function(h){if(h===0)return 26;var f=h,m=0;return f&8191||(m+=13,f>>>=13),f&127||(m+=7,f>>>=7),f&15||(m+=4,f>>>=4),f&3||(m+=2,f>>>=2),f&1||m++,m},o.prototype.bitLength=function(){var h=this.words[this.length-1],f=this._countBits(h);return(this.length-1)*26+f};function M(L){for(var h=new Array(L.bitLength()),f=0;f<h.length;f++){var m=f/26|0,S=f%26;h[f]=L.words[m]>>>S&1}return h}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,f=0;f<this.length;f++){var m=this._zeroBits(this.words[f]);if(h+=m,m!==26)break}return h},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},o.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var f=0;f<h.length;f++)this.words[f]=this.words[f]|h.words[f];return this._strip()},o.prototype.ior=function(h){return n((this.negative|h.negative)===0),this.iuor(h)},o.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},o.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},o.prototype.iuand=function(h){var f;this.length>h.length?f=h:f=this;for(var m=0;m<f.length;m++)this.words[m]=this.words[m]&h.words[m];return this.length=f.length,this._strip()},o.prototype.iand=function(h){return n((this.negative|h.negative)===0),this.iuand(h)},o.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},o.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},o.prototype.iuxor=function(h){var f,m;this.length>h.length?(f=this,m=h):(f=h,m=this);for(var S=0;S<m.length;S++)this.words[S]=f.words[S]^m.words[S];if(this!==f)for(;S<f.length;S++)this.words[S]=f.words[S];return this.length=f.length,this._strip()},o.prototype.ixor=function(h){return n((this.negative|h.negative)===0),this.iuxor(h)},o.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},o.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},o.prototype.inotn=function(h){n(typeof h=="number"&&h>=0);var f=Math.ceil(h/26)|0,m=h%26;this._expand(f),m>0&&f--;for(var S=0;S<f;S++)this.words[S]=~this.words[S]&67108863;return m>0&&(this.words[S]=~this.words[S]&67108863>>26-m),this._strip()},o.prototype.notn=function(h){return this.clone().inotn(h)},o.prototype.setn=function(h,f){n(typeof h=="number"&&h>=0);var m=h/26|0,S=h%26;return this._expand(m+1),f?this.words[m]=this.words[m]|1<<S:this.words[m]=this.words[m]&~(1<<S),this._strip()},o.prototype.iadd=function(h){var f;if(this.negative!==0&&h.negative===0)return this.negative=0,f=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,f=this.isub(h),h.negative=1,f._normSign();var m,S;this.length>h.length?(m=this,S=h):(m=h,S=this);for(var T=0,E=0;E<S.length;E++)f=(m.words[E]|0)+(S.words[E]|0)+T,this.words[E]=f&67108863,T=f>>>26;for(;T!==0&&E<m.length;E++)f=(m.words[E]|0)+T,this.words[E]=f&67108863,T=f>>>26;if(this.length=m.length,T!==0)this.words[this.length]=T,this.length++;else if(m!==this)for(;E<m.length;E++)this.words[E]=m.words[E];return this},o.prototype.add=function(h){var f;return h.negative!==0&&this.negative===0?(h.negative=0,f=this.sub(h),h.negative^=1,f):h.negative===0&&this.negative!==0?(this.negative=0,f=h.sub(this),this.negative=1,f):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},o.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var f=this.iadd(h);return h.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var m=this.cmp(h);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var S,T;m>0?(S=this,T=h):(S=h,T=this);for(var E=0,I=0;I<T.length;I++)f=(S.words[I]|0)-(T.words[I]|0)+E,E=f>>26,this.words[I]=f&67108863;for(;E!==0&&I<S.length;I++)f=(S.words[I]|0)+E,E=f>>26,this.words[I]=f&67108863;if(E===0&&I<S.length&&S!==this)for(;I<S.length;I++)this.words[I]=S.words[I];return this.length=Math.max(this.length,I),S!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(h){return this.clone().isub(h)};function O(L,h,f){f.negative=h.negative^L.negative;var m=L.length+h.length|0;f.length=m,m=m-1|0;var S=L.words[0]|0,T=h.words[0]|0,E=S*T,I=E&67108863,C=E/67108864|0;f.words[0]=I;for(var g=1;g<m;g++){for(var v=C>>>26,j=C&67108863,Q=Math.min(g,h.length-1),Z=Math.max(0,g-L.length+1);Z<=Q;Z++){var ce=g-Z|0;S=L.words[ce]|0,T=h.words[Z]|0,E=S*T+j,v+=E/67108864|0,j=E&67108863}f.words[g]=j|0,C=v|0}return C!==0?f.words[g]=C|0:f.length--,f._strip()}var P=function(h,f,m){var S=h.words,T=f.words,E=m.words,I=0,C,g,v,j=S[0]|0,Q=j&8191,Z=j>>>13,ce=S[1]|0,be=ce&8191,xe=ce>>>13,pe=S[2]|0,Le=pe&8191,Ae=pe>>>13,Je=S[3]|0,dt=Je&8191,je=Je>>>13,pt=S[4]|0,we=pt&8191,he=pt>>>13,Ce=S[5]|0,Ve=Ce&8191,ke=Ce>>>13,Te=S[6]|0,Me=Te&8191,Ue=Te>>>13,ut=S[7]|0,ft=ut&8191,ze=ut>>>13,kt=S[8]|0,_t=kt&8191,Ke=kt>>>13,It=S[9]|0,Ut=It&8191,et=It>>>13,Et=T[0]|0,Ot=Et&8191,nt=Et>>>13,jt=T[1]|0,Pt=jt&8191,tt=jt>>>13,wt=T[2]|0,Ct=wt&8191,Ge=wt>>>13,mt=T[3]|0,Nt=mt&8191,it=mt>>>13,xt=T[4]|0,zt=xt&8191,N=xt>>>13,_=T[5]|0,A=_&8191,U=_>>>13,Y=T[6]|0,ee=Y&8191,ne=Y>>>13,De=T[7]|0,Ze=De&8191,Ne=De>>>13,V=T[8]|0,ae=V&8191,fe=V>>>13,Re=T[9]|0,qe=Re&8191,Pe=Re>>>13;m.negative=h.negative^f.negative,m.length=19,C=Math.imul(Q,Ot),g=Math.imul(Q,nt),g=g+Math.imul(Z,Ot)|0,v=Math.imul(Z,nt);var Fe=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Fe>>>26)|0,Fe&=67108863,C=Math.imul(be,Ot),g=Math.imul(be,nt),g=g+Math.imul(xe,Ot)|0,v=Math.imul(xe,nt),C=C+Math.imul(Q,Pt)|0,g=g+Math.imul(Q,tt)|0,g=g+Math.imul(Z,Pt)|0,v=v+Math.imul(Z,tt)|0;var ot=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(ot>>>26)|0,ot&=67108863,C=Math.imul(Le,Ot),g=Math.imul(Le,nt),g=g+Math.imul(Ae,Ot)|0,v=Math.imul(Ae,nt),C=C+Math.imul(be,Pt)|0,g=g+Math.imul(be,tt)|0,g=g+Math.imul(xe,Pt)|0,v=v+Math.imul(xe,tt)|0,C=C+Math.imul(Q,Ct)|0,g=g+Math.imul(Q,Ge)|0,g=g+Math.imul(Z,Ct)|0,v=v+Math.imul(Z,Ge)|0;var Jt=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,C=Math.imul(dt,Ot),g=Math.imul(dt,nt),g=g+Math.imul(je,Ot)|0,v=Math.imul(je,nt),C=C+Math.imul(Le,Pt)|0,g=g+Math.imul(Le,tt)|0,g=g+Math.imul(Ae,Pt)|0,v=v+Math.imul(Ae,tt)|0,C=C+Math.imul(be,Ct)|0,g=g+Math.imul(be,Ge)|0,g=g+Math.imul(xe,Ct)|0,v=v+Math.imul(xe,Ge)|0,C=C+Math.imul(Q,Nt)|0,g=g+Math.imul(Q,it)|0,g=g+Math.imul(Z,Nt)|0,v=v+Math.imul(Z,it)|0;var Dt=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,C=Math.imul(we,Ot),g=Math.imul(we,nt),g=g+Math.imul(he,Ot)|0,v=Math.imul(he,nt),C=C+Math.imul(dt,Pt)|0,g=g+Math.imul(dt,tt)|0,g=g+Math.imul(je,Pt)|0,v=v+Math.imul(je,tt)|0,C=C+Math.imul(Le,Ct)|0,g=g+Math.imul(Le,Ge)|0,g=g+Math.imul(Ae,Ct)|0,v=v+Math.imul(Ae,Ge)|0,C=C+Math.imul(be,Nt)|0,g=g+Math.imul(be,it)|0,g=g+Math.imul(xe,Nt)|0,v=v+Math.imul(xe,it)|0,C=C+Math.imul(Q,zt)|0,g=g+Math.imul(Q,N)|0,g=g+Math.imul(Z,zt)|0,v=v+Math.imul(Z,N)|0;var Ft=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,C=Math.imul(Ve,Ot),g=Math.imul(Ve,nt),g=g+Math.imul(ke,Ot)|0,v=Math.imul(ke,nt),C=C+Math.imul(we,Pt)|0,g=g+Math.imul(we,tt)|0,g=g+Math.imul(he,Pt)|0,v=v+Math.imul(he,tt)|0,C=C+Math.imul(dt,Ct)|0,g=g+Math.imul(dt,Ge)|0,g=g+Math.imul(je,Ct)|0,v=v+Math.imul(je,Ge)|0,C=C+Math.imul(Le,Nt)|0,g=g+Math.imul(Le,it)|0,g=g+Math.imul(Ae,Nt)|0,v=v+Math.imul(Ae,it)|0,C=C+Math.imul(be,zt)|0,g=g+Math.imul(be,N)|0,g=g+Math.imul(xe,zt)|0,v=v+Math.imul(xe,N)|0,C=C+Math.imul(Q,A)|0,g=g+Math.imul(Q,U)|0,g=g+Math.imul(Z,A)|0,v=v+Math.imul(Z,U)|0;var sr=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(sr>>>26)|0,sr&=67108863,C=Math.imul(Me,Ot),g=Math.imul(Me,nt),g=g+Math.imul(Ue,Ot)|0,v=Math.imul(Ue,nt),C=C+Math.imul(Ve,Pt)|0,g=g+Math.imul(Ve,tt)|0,g=g+Math.imul(ke,Pt)|0,v=v+Math.imul(ke,tt)|0,C=C+Math.imul(we,Ct)|0,g=g+Math.imul(we,Ge)|0,g=g+Math.imul(he,Ct)|0,v=v+Math.imul(he,Ge)|0,C=C+Math.imul(dt,Nt)|0,g=g+Math.imul(dt,it)|0,g=g+Math.imul(je,Nt)|0,v=v+Math.imul(je,it)|0,C=C+Math.imul(Le,zt)|0,g=g+Math.imul(Le,N)|0,g=g+Math.imul(Ae,zt)|0,v=v+Math.imul(Ae,N)|0,C=C+Math.imul(be,A)|0,g=g+Math.imul(be,U)|0,g=g+Math.imul(xe,A)|0,v=v+Math.imul(xe,U)|0,C=C+Math.imul(Q,ee)|0,g=g+Math.imul(Q,ne)|0,g=g+Math.imul(Z,ee)|0,v=v+Math.imul(Z,ne)|0;var Er=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Er>>>26)|0,Er&=67108863,C=Math.imul(ft,Ot),g=Math.imul(ft,nt),g=g+Math.imul(ze,Ot)|0,v=Math.imul(ze,nt),C=C+Math.imul(Me,Pt)|0,g=g+Math.imul(Me,tt)|0,g=g+Math.imul(Ue,Pt)|0,v=v+Math.imul(Ue,tt)|0,C=C+Math.imul(Ve,Ct)|0,g=g+Math.imul(Ve,Ge)|0,g=g+Math.imul(ke,Ct)|0,v=v+Math.imul(ke,Ge)|0,C=C+Math.imul(we,Nt)|0,g=g+Math.imul(we,it)|0,g=g+Math.imul(he,Nt)|0,v=v+Math.imul(he,it)|0,C=C+Math.imul(dt,zt)|0,g=g+Math.imul(dt,N)|0,g=g+Math.imul(je,zt)|0,v=v+Math.imul(je,N)|0,C=C+Math.imul(Le,A)|0,g=g+Math.imul(Le,U)|0,g=g+Math.imul(Ae,A)|0,v=v+Math.imul(Ae,U)|0,C=C+Math.imul(be,ee)|0,g=g+Math.imul(be,ne)|0,g=g+Math.imul(xe,ee)|0,v=v+Math.imul(xe,ne)|0,C=C+Math.imul(Q,Ze)|0,g=g+Math.imul(Q,Ne)|0,g=g+Math.imul(Z,Ze)|0,v=v+Math.imul(Z,Ne)|0;var ur=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(ur>>>26)|0,ur&=67108863,C=Math.imul(_t,Ot),g=Math.imul(_t,nt),g=g+Math.imul(Ke,Ot)|0,v=Math.imul(Ke,nt),C=C+Math.imul(ft,Pt)|0,g=g+Math.imul(ft,tt)|0,g=g+Math.imul(ze,Pt)|0,v=v+Math.imul(ze,tt)|0,C=C+Math.imul(Me,Ct)|0,g=g+Math.imul(Me,Ge)|0,g=g+Math.imul(Ue,Ct)|0,v=v+Math.imul(Ue,Ge)|0,C=C+Math.imul(Ve,Nt)|0,g=g+Math.imul(Ve,it)|0,g=g+Math.imul(ke,Nt)|0,v=v+Math.imul(ke,it)|0,C=C+Math.imul(we,zt)|0,g=g+Math.imul(we,N)|0,g=g+Math.imul(he,zt)|0,v=v+Math.imul(he,N)|0,C=C+Math.imul(dt,A)|0,g=g+Math.imul(dt,U)|0,g=g+Math.imul(je,A)|0,v=v+Math.imul(je,U)|0,C=C+Math.imul(Le,ee)|0,g=g+Math.imul(Le,ne)|0,g=g+Math.imul(Ae,ee)|0,v=v+Math.imul(Ae,ne)|0,C=C+Math.imul(be,Ze)|0,g=g+Math.imul(be,Ne)|0,g=g+Math.imul(xe,Ze)|0,v=v+Math.imul(xe,Ne)|0,C=C+Math.imul(Q,ae)|0,g=g+Math.imul(Q,fe)|0,g=g+Math.imul(Z,ae)|0,v=v+Math.imul(Z,fe)|0;var Zt=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,C=Math.imul(Ut,Ot),g=Math.imul(Ut,nt),g=g+Math.imul(et,Ot)|0,v=Math.imul(et,nt),C=C+Math.imul(_t,Pt)|0,g=g+Math.imul(_t,tt)|0,g=g+Math.imul(Ke,Pt)|0,v=v+Math.imul(Ke,tt)|0,C=C+Math.imul(ft,Ct)|0,g=g+Math.imul(ft,Ge)|0,g=g+Math.imul(ze,Ct)|0,v=v+Math.imul(ze,Ge)|0,C=C+Math.imul(Me,Nt)|0,g=g+Math.imul(Me,it)|0,g=g+Math.imul(Ue,Nt)|0,v=v+Math.imul(Ue,it)|0,C=C+Math.imul(Ve,zt)|0,g=g+Math.imul(Ve,N)|0,g=g+Math.imul(ke,zt)|0,v=v+Math.imul(ke,N)|0,C=C+Math.imul(we,A)|0,g=g+Math.imul(we,U)|0,g=g+Math.imul(he,A)|0,v=v+Math.imul(he,U)|0,C=C+Math.imul(dt,ee)|0,g=g+Math.imul(dt,ne)|0,g=g+Math.imul(je,ee)|0,v=v+Math.imul(je,ne)|0,C=C+Math.imul(Le,Ze)|0,g=g+Math.imul(Le,Ne)|0,g=g+Math.imul(Ae,Ze)|0,v=v+Math.imul(Ae,Ne)|0,C=C+Math.imul(be,ae)|0,g=g+Math.imul(be,fe)|0,g=g+Math.imul(xe,ae)|0,v=v+Math.imul(xe,fe)|0,C=C+Math.imul(Q,qe)|0,g=g+Math.imul(Q,Pe)|0,g=g+Math.imul(Z,qe)|0,v=v+Math.imul(Z,Pe)|0;var wr=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(wr>>>26)|0,wr&=67108863,C=Math.imul(Ut,Pt),g=Math.imul(Ut,tt),g=g+Math.imul(et,Pt)|0,v=Math.imul(et,tt),C=C+Math.imul(_t,Ct)|0,g=g+Math.imul(_t,Ge)|0,g=g+Math.imul(Ke,Ct)|0,v=v+Math.imul(Ke,Ge)|0,C=C+Math.imul(ft,Nt)|0,g=g+Math.imul(ft,it)|0,g=g+Math.imul(ze,Nt)|0,v=v+Math.imul(ze,it)|0,C=C+Math.imul(Me,zt)|0,g=g+Math.imul(Me,N)|0,g=g+Math.imul(Ue,zt)|0,v=v+Math.imul(Ue,N)|0,C=C+Math.imul(Ve,A)|0,g=g+Math.imul(Ve,U)|0,g=g+Math.imul(ke,A)|0,v=v+Math.imul(ke,U)|0,C=C+Math.imul(we,ee)|0,g=g+Math.imul(we,ne)|0,g=g+Math.imul(he,ee)|0,v=v+Math.imul(he,ne)|0,C=C+Math.imul(dt,Ze)|0,g=g+Math.imul(dt,Ne)|0,g=g+Math.imul(je,Ze)|0,v=v+Math.imul(je,Ne)|0,C=C+Math.imul(Le,ae)|0,g=g+Math.imul(Le,fe)|0,g=g+Math.imul(Ae,ae)|0,v=v+Math.imul(Ae,fe)|0,C=C+Math.imul(be,qe)|0,g=g+Math.imul(be,Pe)|0,g=g+Math.imul(xe,qe)|0,v=v+Math.imul(xe,Pe)|0;var vn=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(vn>>>26)|0,vn&=67108863,C=Math.imul(Ut,Ct),g=Math.imul(Ut,Ge),g=g+Math.imul(et,Ct)|0,v=Math.imul(et,Ge),C=C+Math.imul(_t,Nt)|0,g=g+Math.imul(_t,it)|0,g=g+Math.imul(Ke,Nt)|0,v=v+Math.imul(Ke,it)|0,C=C+Math.imul(ft,zt)|0,g=g+Math.imul(ft,N)|0,g=g+Math.imul(ze,zt)|0,v=v+Math.imul(ze,N)|0,C=C+Math.imul(Me,A)|0,g=g+Math.imul(Me,U)|0,g=g+Math.imul(Ue,A)|0,v=v+Math.imul(Ue,U)|0,C=C+Math.imul(Ve,ee)|0,g=g+Math.imul(Ve,ne)|0,g=g+Math.imul(ke,ee)|0,v=v+Math.imul(ke,ne)|0,C=C+Math.imul(we,Ze)|0,g=g+Math.imul(we,Ne)|0,g=g+Math.imul(he,Ze)|0,v=v+Math.imul(he,Ne)|0,C=C+Math.imul(dt,ae)|0,g=g+Math.imul(dt,fe)|0,g=g+Math.imul(je,ae)|0,v=v+Math.imul(je,fe)|0,C=C+Math.imul(Le,qe)|0,g=g+Math.imul(Le,Pe)|0,g=g+Math.imul(Ae,qe)|0,v=v+Math.imul(Ae,Pe)|0;var Vr=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,C=Math.imul(Ut,Nt),g=Math.imul(Ut,it),g=g+Math.imul(et,Nt)|0,v=Math.imul(et,it),C=C+Math.imul(_t,zt)|0,g=g+Math.imul(_t,N)|0,g=g+Math.imul(Ke,zt)|0,v=v+Math.imul(Ke,N)|0,C=C+Math.imul(ft,A)|0,g=g+Math.imul(ft,U)|0,g=g+Math.imul(ze,A)|0,v=v+Math.imul(ze,U)|0,C=C+Math.imul(Me,ee)|0,g=g+Math.imul(Me,ne)|0,g=g+Math.imul(Ue,ee)|0,v=v+Math.imul(Ue,ne)|0,C=C+Math.imul(Ve,Ze)|0,g=g+Math.imul(Ve,Ne)|0,g=g+Math.imul(ke,Ze)|0,v=v+Math.imul(ke,Ne)|0,C=C+Math.imul(we,ae)|0,g=g+Math.imul(we,fe)|0,g=g+Math.imul(he,ae)|0,v=v+Math.imul(he,fe)|0,C=C+Math.imul(dt,qe)|0,g=g+Math.imul(dt,Pe)|0,g=g+Math.imul(je,qe)|0,v=v+Math.imul(je,Pe)|0;var bn=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(bn>>>26)|0,bn&=67108863,C=Math.imul(Ut,zt),g=Math.imul(Ut,N),g=g+Math.imul(et,zt)|0,v=Math.imul(et,N),C=C+Math.imul(_t,A)|0,g=g+Math.imul(_t,U)|0,g=g+Math.imul(Ke,A)|0,v=v+Math.imul(Ke,U)|0,C=C+Math.imul(ft,ee)|0,g=g+Math.imul(ft,ne)|0,g=g+Math.imul(ze,ee)|0,v=v+Math.imul(ze,ne)|0,C=C+Math.imul(Me,Ze)|0,g=g+Math.imul(Me,Ne)|0,g=g+Math.imul(Ue,Ze)|0,v=v+Math.imul(Ue,Ne)|0,C=C+Math.imul(Ve,ae)|0,g=g+Math.imul(Ve,fe)|0,g=g+Math.imul(ke,ae)|0,v=v+Math.imul(ke,fe)|0,C=C+Math.imul(we,qe)|0,g=g+Math.imul(we,Pe)|0,g=g+Math.imul(he,qe)|0,v=v+Math.imul(he,Pe)|0;var ii=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(ii>>>26)|0,ii&=67108863,C=Math.imul(Ut,A),g=Math.imul(Ut,U),g=g+Math.imul(et,A)|0,v=Math.imul(et,U),C=C+Math.imul(_t,ee)|0,g=g+Math.imul(_t,ne)|0,g=g+Math.imul(Ke,ee)|0,v=v+Math.imul(Ke,ne)|0,C=C+Math.imul(ft,Ze)|0,g=g+Math.imul(ft,Ne)|0,g=g+Math.imul(ze,Ze)|0,v=v+Math.imul(ze,Ne)|0,C=C+Math.imul(Me,ae)|0,g=g+Math.imul(Me,fe)|0,g=g+Math.imul(Ue,ae)|0,v=v+Math.imul(Ue,fe)|0,C=C+Math.imul(Ve,qe)|0,g=g+Math.imul(Ve,Pe)|0,g=g+Math.imul(ke,qe)|0,v=v+Math.imul(ke,Pe)|0;var oi=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(oi>>>26)|0,oi&=67108863,C=Math.imul(Ut,ee),g=Math.imul(Ut,ne),g=g+Math.imul(et,ee)|0,v=Math.imul(et,ne),C=C+Math.imul(_t,Ze)|0,g=g+Math.imul(_t,Ne)|0,g=g+Math.imul(Ke,Ze)|0,v=v+Math.imul(Ke,Ne)|0,C=C+Math.imul(ft,ae)|0,g=g+Math.imul(ft,fe)|0,g=g+Math.imul(ze,ae)|0,v=v+Math.imul(ze,fe)|0,C=C+Math.imul(Me,qe)|0,g=g+Math.imul(Me,Pe)|0,g=g+Math.imul(Ue,qe)|0,v=v+Math.imul(Ue,Pe)|0;var yn=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(yn>>>26)|0,yn&=67108863,C=Math.imul(Ut,Ze),g=Math.imul(Ut,Ne),g=g+Math.imul(et,Ze)|0,v=Math.imul(et,Ne),C=C+Math.imul(_t,ae)|0,g=g+Math.imul(_t,fe)|0,g=g+Math.imul(Ke,ae)|0,v=v+Math.imul(Ke,fe)|0,C=C+Math.imul(ft,qe)|0,g=g+Math.imul(ft,Pe)|0,g=g+Math.imul(ze,qe)|0,v=v+Math.imul(ze,Pe)|0;var si=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(si>>>26)|0,si&=67108863,C=Math.imul(Ut,ae),g=Math.imul(Ut,fe),g=g+Math.imul(et,ae)|0,v=Math.imul(et,fe),C=C+Math.imul(_t,qe)|0,g=g+Math.imul(_t,Pe)|0,g=g+Math.imul(Ke,qe)|0,v=v+Math.imul(Ke,Pe)|0;var ai=(I+C|0)+((g&8191)<<13)|0;I=(v+(g>>>13)|0)+(ai>>>26)|0,ai&=67108863,C=Math.imul(Ut,qe),g=Math.imul(Ut,Pe),g=g+Math.imul(et,qe)|0,v=Math.imul(et,Pe);var D=(I+C|0)+((g&8191)<<13)|0;return I=(v+(g>>>13)|0)+(D>>>26)|0,D&=67108863,E[0]=Fe,E[1]=ot,E[2]=Jt,E[3]=Dt,E[4]=Ft,E[5]=sr,E[6]=Er,E[7]=ur,E[8]=Zt,E[9]=wr,E[10]=vn,E[11]=Vr,E[12]=bn,E[13]=ii,E[14]=oi,E[15]=yn,E[16]=si,E[17]=ai,E[18]=D,I!==0&&(E[19]=I,m.length++),m};Math.imul||(P=O);function k(L,h,f){f.negative=h.negative^L.negative,f.length=L.length+h.length;for(var m=0,S=0,T=0;T<f.length-1;T++){var E=S;S=0;for(var I=m&67108863,C=Math.min(T,h.length-1),g=Math.max(0,T-L.length+1);g<=C;g++){var v=T-g,j=L.words[v]|0,Q=h.words[g]|0,Z=j*Q,ce=Z&67108863;E=E+(Z/67108864|0)|0,ce=ce+I|0,I=ce&67108863,E=E+(ce>>>26)|0,S+=E>>>26,E&=67108863}f.words[T]=I,m=E,E=S}return m!==0?f.words[T]=m:f.length--,f._strip()}function F(L,h,f){return k(L,h,f)}o.prototype.mulTo=function(h,f){var m,S=this.length+h.length;return this.length===10&&h.length===10?m=P(this,h,f):S<63?m=O(this,h,f):S<1024?m=k(this,h,f):m=F(this,h,f),m},o.prototype.mul=function(h){var f=new o(null);return f.words=new Array(this.length+h.length),this.mulTo(h,f)},o.prototype.mulf=function(h){var f=new o(null);return f.words=new Array(this.length+h.length),F(this,h,f)},o.prototype.imul=function(h){return this.clone().mulTo(h,this)},o.prototype.imuln=function(h){var f=h<0;f&&(h=-h),n(typeof h=="number"),n(h<67108864);for(var m=0,S=0;S<this.length;S++){var T=(this.words[S]|0)*h,E=(T&67108863)+(m&67108863);m>>=26,m+=T/67108864|0,m+=E>>>26,this.words[S]=E&67108863}return m!==0&&(this.words[S]=m,this.length++),f?this.ineg():this},o.prototype.muln=function(h){return this.clone().imuln(h)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(h){var f=M(h);if(f.length===0)return new o(1);for(var m=this,S=0;S<f.length&&f[S]===0;S++,m=m.sqr());if(++S<f.length)for(var T=m.sqr();S<f.length;S++,T=T.sqr())f[S]!==0&&(m=m.mul(T));return m},o.prototype.iushln=function(h){n(typeof h=="number"&&h>=0);var f=h%26,m=(h-f)/26,S=67108863>>>26-f<<26-f,T;if(f!==0){var E=0;for(T=0;T<this.length;T++){var I=this.words[T]&S,C=(this.words[T]|0)-I<<f;this.words[T]=C|E,E=I>>>26-f}E&&(this.words[T]=E,this.length++)}if(m!==0){for(T=this.length-1;T>=0;T--)this.words[T+m]=this.words[T];for(T=0;T<m;T++)this.words[T]=0;this.length+=m}return this._strip()},o.prototype.ishln=function(h){return n(this.negative===0),this.iushln(h)},o.prototype.iushrn=function(h,f,m){n(typeof h=="number"&&h>=0);var S;f?S=(f-f%26)/26:S=0;var T=h%26,E=Math.min((h-T)/26,this.length),I=67108863^67108863>>>T<<T,C=m;if(S-=E,S=Math.max(0,S),C){for(var g=0;g<E;g++)C.words[g]=this.words[g];C.length=E}if(E!==0)if(this.length>E)for(this.length-=E,g=0;g<this.length;g++)this.words[g]=this.words[g+E];else this.words[0]=0,this.length=1;var v=0;for(g=this.length-1;g>=0&&(v!==0||g>=S);g--){var j=this.words[g]|0;this.words[g]=v<<26-T|j>>>T,v=j&I}return C&&v!==0&&(C.words[C.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(h,f,m){return n(this.negative===0),this.iushrn(h,f,m)},o.prototype.shln=function(h){return this.clone().ishln(h)},o.prototype.ushln=function(h){return this.clone().iushln(h)},o.prototype.shrn=function(h){return this.clone().ishrn(h)},o.prototype.ushrn=function(h){return this.clone().iushrn(h)},o.prototype.testn=function(h){n(typeof h=="number"&&h>=0);var f=h%26,m=(h-f)/26,S=1<<f;if(this.length<=m)return!1;var T=this.words[m];return!!(T&S)},o.prototype.imaskn=function(h){n(typeof h=="number"&&h>=0);var f=h%26,m=(h-f)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(f!==0&&m++,this.length=Math.min(m,this.length),f!==0){var S=67108863^67108863>>>f<<f;this.words[this.length-1]&=S}return this._strip()},o.prototype.maskn=function(h){return this.clone().imaskn(h)},o.prototype.iaddn=function(h){return n(typeof h=="number"),n(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<=h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},o.prototype._iaddn=function(h){this.words[0]+=h;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},o.prototype.isubn=function(h){if(n(typeof h=="number"),n(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this._strip()},o.prototype.addn=function(h){return this.clone().iaddn(h)},o.prototype.subn=function(h){return this.clone().isubn(h)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(h,f,m){var S=h.length+m,T;this._expand(S);var E,I=0;for(T=0;T<h.length;T++){E=(this.words[T+m]|0)+I;var C=(h.words[T]|0)*f;E-=C&67108863,I=(E>>26)-(C/67108864|0),this.words[T+m]=E&67108863}for(;T<this.length-m;T++)E=(this.words[T+m]|0)+I,I=E>>26,this.words[T+m]=E&67108863;if(I===0)return this._strip();for(n(I===-1),I=0,T=0;T<this.length;T++)E=-(this.words[T]|0)+I,I=E>>26,this.words[T]=E&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(h,f){var m=this.length-h.length,S=this.clone(),T=h,E=T.words[T.length-1]|0,I=this._countBits(E);m=26-I,m!==0&&(T=T.ushln(m),S.iushln(m),E=T.words[T.length-1]|0);var C=S.length-T.length,g;if(f!=="mod"){g=new o(null),g.length=C+1,g.words=new Array(g.length);for(var v=0;v<g.length;v++)g.words[v]=0}var j=S.clone()._ishlnsubmul(T,1,C);j.negative===0&&(S=j,g&&(g.words[C]=1));for(var Q=C-1;Q>=0;Q--){var Z=(S.words[T.length+Q]|0)*67108864+(S.words[T.length+Q-1]|0);for(Z=Math.min(Z/E|0,67108863),S._ishlnsubmul(T,Z,Q);S.negative!==0;)Z--,S.negative=0,S._ishlnsubmul(T,1,Q),S.isZero()||(S.negative^=1);g&&(g.words[Q]=Z)}return g&&g._strip(),S._strip(),f!=="div"&&m!==0&&S.iushrn(m),{div:g||null,mod:S}},o.prototype.divmod=function(h,f,m){if(n(!h.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var S,T,E;return this.negative!==0&&h.negative===0?(E=this.neg().divmod(h,f),f!=="mod"&&(S=E.div.neg()),f!=="div"&&(T=E.mod.neg(),m&&T.negative!==0&&T.iadd(h)),{div:S,mod:T}):this.negative===0&&h.negative!==0?(E=this.divmod(h.neg(),f),f!=="mod"&&(S=E.div.neg()),{div:S,mod:E.mod}):this.negative&h.negative?(E=this.neg().divmod(h.neg(),f),f!=="div"&&(T=E.mod.neg(),m&&T.negative!==0&&T.isub(h)),{div:E.div,mod:T}):h.length>this.length||this.cmp(h)<0?{div:new o(0),mod:this}:h.length===1?f==="div"?{div:this.divn(h.words[0]),mod:null}:f==="mod"?{div:null,mod:new o(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new o(this.modrn(h.words[0]))}:this._wordDiv(h,f)},o.prototype.div=function(h){return this.divmod(h,"div",!1).div},o.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},o.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},o.prototype.divRound=function(h){var f=this.divmod(h);if(f.mod.isZero())return f.div;var m=f.div.negative!==0?f.mod.isub(h):f.mod,S=h.ushrn(1),T=h.andln(1),E=m.cmp(S);return E<0||T===1&&E===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},o.prototype.modrn=function(h){var f=h<0;f&&(h=-h),n(h<=67108863);for(var m=(1<<26)%h,S=0,T=this.length-1;T>=0;T--)S=(m*S+(this.words[T]|0))%h;return f?-S:S},o.prototype.modn=function(h){return this.modrn(h)},o.prototype.idivn=function(h){var f=h<0;f&&(h=-h),n(h<=67108863);for(var m=0,S=this.length-1;S>=0;S--){var T=(this.words[S]|0)+m*67108864;this.words[S]=T/h|0,m=T%h}return this._strip(),f?this.ineg():this},o.prototype.divn=function(h){return this.clone().idivn(h)},o.prototype.egcd=function(h){n(h.negative===0),n(!h.isZero());var f=this,m=h.clone();f.negative!==0?f=f.umod(h):f=f.clone();for(var S=new o(1),T=new o(0),E=new o(0),I=new o(1),C=0;f.isEven()&&m.isEven();)f.iushrn(1),m.iushrn(1),++C;for(var g=m.clone(),v=f.clone();!f.isZero();){for(var j=0,Q=1;!(f.words[0]&Q)&&j<26;++j,Q<<=1);if(j>0)for(f.iushrn(j);j-- >0;)(S.isOdd()||T.isOdd())&&(S.iadd(g),T.isub(v)),S.iushrn(1),T.iushrn(1);for(var Z=0,ce=1;!(m.words[0]&ce)&&Z<26;++Z,ce<<=1);if(Z>0)for(m.iushrn(Z);Z-- >0;)(E.isOdd()||I.isOdd())&&(E.iadd(g),I.isub(v)),E.iushrn(1),I.iushrn(1);f.cmp(m)>=0?(f.isub(m),S.isub(E),T.isub(I)):(m.isub(f),E.isub(S),I.isub(T))}return{a:E,b:I,gcd:m.iushln(C)}},o.prototype._invmp=function(h){n(h.negative===0),n(!h.isZero());var f=this,m=h.clone();f.negative!==0?f=f.umod(h):f=f.clone();for(var S=new o(1),T=new o(0),E=m.clone();f.cmpn(1)>0&&m.cmpn(1)>0;){for(var I=0,C=1;!(f.words[0]&C)&&I<26;++I,C<<=1);if(I>0)for(f.iushrn(I);I-- >0;)S.isOdd()&&S.iadd(E),S.iushrn(1);for(var g=0,v=1;!(m.words[0]&v)&&g<26;++g,v<<=1);if(g>0)for(m.iushrn(g);g-- >0;)T.isOdd()&&T.iadd(E),T.iushrn(1);f.cmp(m)>=0?(f.isub(m),S.isub(T)):(m.isub(f),T.isub(S))}var j;return f.cmpn(1)===0?j=S:j=T,j.cmpn(0)<0&&j.iadd(h),j},o.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var f=this.clone(),m=h.clone();f.negative=0,m.negative=0;for(var S=0;f.isEven()&&m.isEven();S++)f.iushrn(1),m.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;m.isEven();)m.iushrn(1);var T=f.cmp(m);if(T<0){var E=f;f=m,m=E}else if(T===0||m.cmpn(1)===0)break;f.isub(m)}while(!0);return m.iushln(S)},o.prototype.invm=function(h){return this.egcd(h).a.umod(h)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(h){return this.words[0]&h},o.prototype.bincn=function(h){n(typeof h=="number");var f=h%26,m=(h-f)/26,S=1<<f;if(this.length<=m)return this._expand(m+1),this.words[m]|=S,this;for(var T=S,E=m;T!==0&&E<this.length;E++){var I=this.words[E]|0;I+=T,T=I>>>26,I&=67108863,this.words[E]=I}return T!==0&&(this.words[E]=T,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(h){var f=h<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this._strip();var m;if(this.length>1)m=1;else{f&&(h=-h),n(h<=67108863,"Number is too big");var S=this.words[0]|0;m=S===h?0:S<h?-1:1}return this.negative!==0?-m|0:m},o.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var f=this.ucmp(h);return this.negative!==0?-f|0:f},o.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var f=0,m=this.length-1;m>=0;m--){var S=this.words[m]|0,T=h.words[m]|0;if(S!==T){S<T?f=-1:S>T&&(f=1);break}}return f},o.prototype.gtn=function(h){return this.cmpn(h)===1},o.prototype.gt=function(h){return this.cmp(h)===1},o.prototype.gten=function(h){return this.cmpn(h)>=0},o.prototype.gte=function(h){return this.cmp(h)>=0},o.prototype.ltn=function(h){return this.cmpn(h)===-1},o.prototype.lt=function(h){return this.cmp(h)===-1},o.prototype.lten=function(h){return this.cmpn(h)<=0},o.prototype.lte=function(h){return this.cmp(h)<=0},o.prototype.eqn=function(h){return this.cmpn(h)===0},o.prototype.eq=function(h){return this.cmp(h)===0},o.red=function(h){return new se(h)},o.prototype.toRed=function(h){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(h){return this.red=h,this},o.prototype.forceRed=function(h){return n(!this.red,"Already a number in reduction context"),this._forceRed(h)},o.prototype.redAdd=function(h){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},o.prototype.redIAdd=function(h){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},o.prototype.redSub=function(h){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},o.prototype.redISub=function(h){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},o.prototype.redShl=function(h){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},o.prototype.redMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},o.prototype.redIMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(h){return n(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var B={k256:null,p224:null,p192:null,p25519:null};function W(L,h){this.name=L,this.p=new o(h,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}W.prototype._tmp=function(){var h=new o(null);return h.words=new Array(Math.ceil(this.n/13)),h},W.prototype.ireduce=function(h){var f=h,m;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),m=f.bitLength();while(m>this.n);var S=m<this.n?-1:f.ucmp(this.p);return S===0?(f.words[0]=0,f.length=1):S>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},W.prototype.split=function(h,f){h.iushrn(this.n,0,f)},W.prototype.imulK=function(h){return h.imul(this.k)};function z(){W.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(z,W),z.prototype.split=function(h,f){for(var m=4194303,S=Math.min(h.length,9),T=0;T<S;T++)f.words[T]=h.words[T];if(f.length=S,h.length<=9){h.words[0]=0,h.length=1;return}var E=h.words[9];for(f.words[f.length++]=E&m,T=10;T<h.length;T++){var I=h.words[T]|0;h.words[T-10]=(I&m)<<4|E>>>22,E=I}E>>>=22,h.words[T-10]=E,E===0&&h.length>10?h.length-=10:h.length-=9},z.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var f=0,m=0;m<h.length;m++){var S=h.words[m]|0;f+=S*977,h.words[m]=f&67108863,f=S*64+(f/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function G(){W.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(G,W);function re(){W.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(re,W);function oe(){W.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(oe,W),oe.prototype.imulK=function(h){for(var f=0,m=0;m<h.length;m++){var S=(h.words[m]|0)*19+f,T=S&67108863;S>>>=26,h.words[m]=T,f=S}return f!==0&&(h.words[h.length++]=f),h},o._prime=function(h){if(B[h])return B[h];var f;if(h==="k256")f=new z;else if(h==="p224")f=new G;else if(h==="p192")f=new re;else if(h==="p25519")f=new oe;else throw new Error("Unknown prime "+h);return B[h]=f,f};function se(L){if(typeof L=="string"){var h=o._prime(L);this.m=h.p,this.prime=h}else n(L.gtn(1),"modulus must be greater than 1"),this.m=L,this.prime=null}se.prototype._verify1=function(h){n(h.negative===0,"red works only with positives"),n(h.red,"red works only with red numbers")},se.prototype._verify2=function(h,f){n((h.negative|f.negative)===0,"red works only with positives"),n(h.red&&h.red===f.red,"red works only with red numbers")},se.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(u(h,h.umod(this.m)._forceRed(this)),h)},se.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},se.prototype.add=function(h,f){this._verify2(h,f);var m=h.add(f);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},se.prototype.iadd=function(h,f){this._verify2(h,f);var m=h.iadd(f);return m.cmp(this.m)>=0&&m.isub(this.m),m},se.prototype.sub=function(h,f){this._verify2(h,f);var m=h.sub(f);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},se.prototype.isub=function(h,f){this._verify2(h,f);var m=h.isub(f);return m.cmpn(0)<0&&m.iadd(this.m),m},se.prototype.shl=function(h,f){return this._verify1(h),this.imod(h.ushln(f))},se.prototype.imul=function(h,f){return this._verify2(h,f),this.imod(h.imul(f))},se.prototype.mul=function(h,f){return this._verify2(h,f),this.imod(h.mul(f))},se.prototype.isqr=function(h){return this.imul(h,h.clone())},se.prototype.sqr=function(h){return this.mul(h,h)},se.prototype.sqrt=function(h){if(h.isZero())return h.clone();var f=this.m.andln(3);if(n(f%2===1),f===3){var m=this.m.add(new o(1)).iushrn(2);return this.pow(h,m)}for(var S=this.m.subn(1),T=0;!S.isZero()&&S.andln(1)===0;)T++,S.iushrn(1);n(!S.isZero());var E=new o(1).toRed(this),I=E.redNeg(),C=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new o(2*g*g).toRed(this);this.pow(g,C).cmp(I)!==0;)g.redIAdd(I);for(var v=this.pow(g,S),j=this.pow(h,S.addn(1).iushrn(1)),Q=this.pow(h,S),Z=T;Q.cmp(E)!==0;){for(var ce=Q,be=0;ce.cmp(E)!==0;be++)ce=ce.redSqr();n(be<Z);var xe=this.pow(v,new o(1).iushln(Z-be-1));j=j.redMul(xe),v=xe.redSqr(),Q=Q.redMul(v),Z=be}return j},se.prototype.invm=function(h){var f=h._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},se.prototype.pow=function(h,f){if(f.isZero())return new o(1).toRed(this);if(f.cmpn(1)===0)return h.clone();var m=4,S=new Array(1<<m);S[0]=new o(1).toRed(this),S[1]=h;for(var T=2;T<S.length;T++)S[T]=this.mul(S[T-1],h);var E=S[0],I=0,C=0,g=f.bitLength()%26;for(g===0&&(g=26),T=f.length-1;T>=0;T--){for(var v=f.words[T],j=g-1;j>=0;j--){var Q=v>>j&1;if(E!==S[0]&&(E=this.sqr(E)),Q===0&&I===0){C=0;continue}I<<=1,I|=Q,C++,!(C!==m&&(T!==0||j!==0))&&(E=this.mul(E,S[I]),C=0,I=0)}g=26}return E},se.prototype.convertTo=function(h){var f=h.umod(this.m);return f===h?f.clone():f},se.prototype.convertFrom=function(h){var f=h.clone();return f.red=null,f},o.mont=function(h){return new q(h)};function q(L){se.call(this,L),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(q,se),q.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},q.prototype.convertFrom=function(h){var f=this.imod(h.mul(this.rinv));return f.red=null,f},q.prototype.imul=function(h,f){if(h.isZero()||f.isZero())return h.words[0]=0,h.length=1,h;var m=h.imul(f),S=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=m.isub(S).iushrn(this.shift),E=T;return T.cmp(this.m)>=0?E=T.isub(this.m):T.cmpn(0)<0&&(E=T.iadd(this.m)),E._forceRed(this)},q.prototype.mul=function(h,f){if(h.isZero()||f.isZero())return new o(0)._forceRed(this);var m=h.mul(f),S=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=m.isub(S).iushrn(this.shift),E=T;return T.cmp(this.m)>=0?E=T.isub(this.m):T.cmpn(0)<0&&(E=T.iadd(this.m)),E._forceRed(this)},q.prototype.invm=function(h){var f=this.imod(h._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(e,Ar)})(Td);var c1=Td.exports;const xh=Ta(c1);var M3=Ar&&Ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fn,"__esModule",{value:!0});fn.parseAccumulatorUpdateData=fn.sliceAccumulatorUpdateData=fn.parseTwapMessage=fn.parsePriceFeedMessage=fn.isAccumulatorUpdateData=void 0;const ln=M3(c1),I3="504e4155",O3=1,R3=0,Cf=20,P3=0,N3=1;function Ad(e){return e.toString("hex").slice(0,8)===I3&&e[4]===O3&&e[5]===R3}fn.isAccumulatorUpdateData=Ad;function k3(e){let t=0;if(e.readUInt8(t)!==P3)throw new Error("Not a price feed message");t+=1;const n=e.subarray(t,t+32);t+=32;const i=new ln.default(e.subarray(t,t+8),"be");t+=8;const o=new ln.default(e.subarray(t,t+8),"be");t+=8;const s=e.readInt32BE(t);t+=4;const a=new ln.default(e.subarray(t,t+8),"be");t+=8;const c=new ln.default(e.subarray(t,t+8),"be");t+=8;const l=new ln.default(e.subarray(t,t+8),"be");t+=8;const u=new ln.default(e.subarray(t,t+8),"be");return t+=8,{feedId:n,price:i,confidence:o,exponent:s,publishTime:a,prevPublishTime:c,emaPrice:l,emaConf:u}}fn.parsePriceFeedMessage=k3;function j3(e){let t=0;if(e.readUInt8(t)!==N3)throw new Error("Not a twap message");t+=1;const n=e.subarray(t,t+32);t+=32;const i=new ln.default(e.subarray(t,t+16),"be");t+=16;const o=new ln.default(e.subarray(t,t+16),"be");t+=16;const s=new ln.default(e.subarray(t,t+8),"be");t+=8;const a=e.readInt32BE(t);t+=4;const c=new ln.default(e.subarray(t,t+8),"be");t+=8;const l=new ln.default(e.subarray(t,t+8),"be");t+=8;const u=new ln.default(e.subarray(t,t+8),"be");return t+=8,{feedId:n,cumulativePrice:i,cumulativeConf:o,numDownSlots:s,exponent:a,publishTime:c,prevPublishTime:l,publishSlot:u}}fn.parseTwapMessage=j3;function D3(e,t,r){if(!Ad(e))throw new Error("Invalid accumulator message");let n=6;const i=e.readUint8(n);n+=1+i,n+=1;const o=e.readUint16BE(n);n+=2,n+=o;const s=n,a=[],c=e.readUInt8(n);n+=1;for(let u=0;u<c;u++){const d=n,p=e.readUint16BE(n);n+=2,n+=p;const y=e.readUInt8(n);n+=1,n+=Cf*y,a.push(e.subarray(d,n))}if(n!==e.length)throw new Error("Didn't reach the end of the message");const l=a.slice(t,r);return Ef.concat([e.subarray(0,s),Ef.from([l.length]),...a.slice(t,r)])}fn.sliceAccumulatorUpdateData=D3;function L3(e){if(!Ad(e))throw new Error("Invalid accumulator message");let t=6;const r=e.readUint8(t);t+=1+r,t+=1;const n=e.readUint16BE(t);t+=2;const i=e.subarray(t,t+n);t+=n;const o=e.readUInt8(t),s=[];t+=1;for(let a=0;a<o;a++){const c=e.readUint16BE(t);t+=2;const l=e.subarray(t,t+c);t+=c;const u=e.readUInt8(t);t+=1;const d=[];for(let p=0;p<u;p++)d.push(Array.from(e.subarray(t,t+Cf))),t+=Cf;s.push({message:l,proof:d})}if(t!==e.length)throw new Error("Didn't reach the end of the message");return{vaa:i,updates:s}}fn.parseAccumulatorUpdateData=L3;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PriceFeed=e.PriceFeedMetadata=e.Price=e.parseTwapMessage=e.parsePriceFeedMessage=e.parseAccumulatorUpdateData=e.sliceAccumulatorUpdateData=e.isAccumulatorUpdateData=void 0;const t=hl;var r=fn;Object.defineProperty(e,"isAccumulatorUpdateData",{enumerable:!0,get:function(){return r.isAccumulatorUpdateData}}),Object.defineProperty(e,"sliceAccumulatorUpdateData",{enumerable:!0,get:function(){return r.sliceAccumulatorUpdateData}}),Object.defineProperty(e,"parseAccumulatorUpdateData",{enumerable:!0,get:function(){return r.parseAccumulatorUpdateData}}),Object.defineProperty(e,"parsePriceFeedMessage",{enumerable:!0,get:function(){return r.parsePriceFeedMessage}}),Object.defineProperty(e,"parseTwapMessage",{enumerable:!0,get:function(){return r.parseTwapMessage}});class n{constructor(a){gt(this,"conf");gt(this,"expo");gt(this,"price");gt(this,"publishTime");this.conf=a.conf,this.expo=a.expo,this.price=a.price,this.publishTime=a.publishTime}getPriceAsNumberUnchecked(){return Number(this.price)*10**this.expo}getConfAsNumberUnchecked(){return Number(this.conf)*10**this.expo}static fromJson(a){const c=t.Convert.toPrice(a);return new n({conf:c.conf,expo:c.expo,price:c.price,publishTime:c.publish_time})}toJson(){const a={conf:this.conf,expo:this.expo,price:this.price,publish_time:this.publishTime};return t.Convert.priceToJson(a)}}e.Price=n;class i{constructor(a){gt(this,"attestationTime");gt(this,"emitterChain");gt(this,"priceServiceReceiveTime");gt(this,"sequenceNumber");gt(this,"slot");gt(this,"prevPublishTime");this.attestationTime=a.attestationTime,this.emitterChain=a.emitterChain,this.priceServiceReceiveTime=a.receiveTime,this.sequenceNumber=a.sequenceNumber,this.slot=a.slot,this.prevPublishTime=a.prevPublishTime}static fromJson(a){if(a===void 0)return;const c=t.Convert.toPriceFeedMetadata(a);return new i({attestationTime:c.attestation_time,emitterChain:c.emitter_chain,receiveTime:c.price_service_receive_time,sequenceNumber:c.sequence_number,slot:c.slot,prevPublishTime:c.prev_publish_time})}toJson(){const a={attestation_time:this.attestationTime,emitter_chain:this.emitterChain,price_service_receive_time:this.priceServiceReceiveTime,sequence_number:this.sequenceNumber,slot:this.slot,prev_publish_time:this.prevPublishTime};return t.Convert.priceFeedMetadataToJson(a)}}e.PriceFeedMetadata=i;let o=class l1{constructor(a){gt(this,"emaPrice");gt(this,"id");gt(this,"metadata");gt(this,"vaa");gt(this,"price");this.emaPrice=a.emaPrice,this.id=a.id,this.metadata=a.metadata,this.vaa=a.vaa,this.price=a.price}static fromJson(a){const c=t.Convert.toPriceFeed(a);return new l1({emaPrice:n.fromJson(c.ema_price),id:c.id,metadata:i.fromJson(c.metadata),vaa:c.vaa,price:n.fromJson(c.price)})}toJson(){var c;const a={ema_price:this.emaPrice.toJson(),id:this.id,metadata:(c=this.metadata)==null?void 0:c.toJson(),price:this.price.toJson()};return t.Convert.priceFeedToJson(a)}getPriceUnchecked(){return this.price}getEmaPriceUnchecked(){return this.emaPrice}getPriceNoOlderThan(a){const c=this.getPriceUnchecked(),l=Math.floor(Date.now()/1e3);if(!(Math.abs(l-c.publishTime)>a))return c}getEmaPriceNoOlderThan(a){const c=this.getEmaPriceUnchecked(),l=Math.floor(Date.now()/1e3);if(!(Math.abs(l-c.publishTime)>a))return c}getMetadata(){return this.metadata}getVAA(){return this.vaa}};e.PriceFeed=o})(Cd);function u1(e,t){return function(){return e.apply(t,arguments)}}const{toString:B3}=Object.prototype,{getPrototypeOf:Md}=Object,pl=(e=>t=>{const r=B3.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Dn=e=>(e=e.toLowerCase(),t=>pl(t)===e),ml=e=>t=>typeof t===e,{isArray:Cs}=Array,da=ml("undefined");function U3(e){return e!==null&&!da(e)&&e.constructor!==null&&!da(e.constructor)&&Qr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const f1=Dn("ArrayBuffer");function F3(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&f1(e.buffer),t}const $3=ml("string"),Qr=ml("function"),d1=ml("number"),gl=e=>e!==null&&typeof e=="object",V3=e=>e===!0||e===!1,fc=e=>{if(pl(e)!=="object")return!1;const t=Md(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},z3=Dn("Date"),q3=Dn("File"),H3=Dn("Blob"),W3=Dn("FileList"),G3=e=>gl(e)&&Qr(e.pipe),K3=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Qr(e.append)&&((t=pl(e))==="formdata"||t==="object"&&Qr(e.toString)&&e.toString()==="[object FormData]"))},Y3=Dn("URLSearchParams"),[X3,J3,Z3,Q3]=["ReadableStream","Request","Response","Headers"].map(Dn),ex=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ra(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Cs(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let a;for(n=0;n<s;n++)a=o[n],t.call(null,e[a],a,e)}}function h1(e,t){t=t.toLowerCase();const r=Object.keys(e);let n=r.length,i;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const Ao=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Ar)(),p1=e=>!da(e)&&e!==Ao;function Tf(){const{caseless:e}=p1(this)&&this||{},t={},r=(n,i)=>{const o=e&&h1(t,i)||i;fc(t[o])&&fc(n)?t[o]=Tf(t[o],n):fc(n)?t[o]=Tf({},n):Cs(n)?t[o]=n.slice():t[o]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&Ra(arguments[n],r);return t}const tx=(e,t,r,{allOwnKeys:n}={})=>(Ra(t,(i,o)=>{r&&Qr(i)?e[o]=u1(i,r):e[o]=i},{allOwnKeys:n}),e),rx=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),nx=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},ix=(e,t,r,n)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&Md(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},ox=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},sx=e=>{if(!e)return null;if(Cs(e))return e;let t=e.length;if(!d1(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},ax=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Md(Uint8Array)),cx=(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=n.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},lx=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},ux=Dn("HTMLFormElement"),fx=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Sh=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),dx=Dn("RegExp"),m1=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Ra(r,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(n[o]=s||i)}),Object.defineProperties(e,n)},hx=e=>{m1(e,(t,r)=>{if(Qr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Qr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},px=(e,t)=>{const r={},n=i=>{i.forEach(o=>{r[o]=!0})};return Cs(e)?n(e):n(String(e).split(t)),r},mx=()=>{},gx=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function vx(e){return!!(e&&Qr(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const bx=e=>{const t=new Array(10),r=(n,i)=>{if(gl(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const o=Cs(n)?[]:{};return Ra(n,(s,a)=>{const c=r(s,i+1);!da(c)&&(o[a]=c)}),t[i]=void 0,o}}return n};return r(e,0)},yx=Dn("AsyncFunction"),wx=e=>e&&(gl(e)||Qr(e))&&Qr(e.then)&&Qr(e.catch),g1=((e,t)=>e?setImmediate:t?((r,n)=>(Ao.addEventListener("message",({source:i,data:o})=>{i===Ao&&o===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Ao.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Qr(Ao.postMessage)),xx=typeof queueMicrotask<"u"?queueMicrotask.bind(Ao):typeof Mn<"u"&&Mn.nextTick||g1;var le={isArray:Cs,isArrayBuffer:f1,isBuffer:U3,isFormData:K3,isArrayBufferView:F3,isString:$3,isNumber:d1,isBoolean:V3,isObject:gl,isPlainObject:fc,isReadableStream:X3,isRequest:J3,isResponse:Z3,isHeaders:Q3,isUndefined:da,isDate:z3,isFile:q3,isBlob:H3,isRegExp:dx,isFunction:Qr,isStream:G3,isURLSearchParams:Y3,isTypedArray:ax,isFileList:W3,forEach:Ra,merge:Tf,extend:tx,trim:ex,stripBOM:rx,inherits:nx,toFlatObject:ix,kindOf:pl,kindOfTest:Dn,endsWith:ox,toArray:sx,forEachEntry:cx,matchAll:lx,isHTMLForm:ux,hasOwnProperty:Sh,hasOwnProp:Sh,reduceDescriptors:m1,freezeMethods:hx,toObjectSet:px,toCamelCase:fx,noop:mx,toFiniteNumber:gx,findKey:h1,global:Ao,isContextDefined:p1,isSpecCompliantForm:vx,toJSONObject:bx,isAsyncFn:yx,isThenable:wx,setImmediate:g1,asap:xx};function ht(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}le.inherits(ht,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:le.toJSONObject(this.config),code:this.code,status:this.status}}});const v1=ht.prototype,b1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{b1[e]={value:e}});Object.defineProperties(ht,b1);Object.defineProperty(v1,"isAxiosError",{value:!0});ht.from=(e,t,r,n,i,o)=>{const s=Object.create(v1);return le.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),ht.call(s,e.message,t,r,n,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};var Sx=null;function Af(e){return le.isPlainObject(e)||le.isArray(e)}function y1(e){return le.endsWith(e,"[]")?e.slice(0,-2):e}function _h(e,t,r){return e?e.concat(t).map(function(i,o){return i=y1(i),!r&&o?"["+i+"]":i}).join(r?".":""):t}function _x(e){return le.isArray(e)&&!e.some(Af)}const Ex=le.toFlatObject(le,{},null,function(t){return/^is[A-Z]/.test(t)});function vl(e,t,r){if(!le.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=le.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,M){return!le.isUndefined(M[b])});const n=r.metaTokens,i=r.visitor||u,o=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&le.isSpecCompliantForm(t);if(!le.isFunction(i))throw new TypeError("visitor must be a function");function l(x){if(x===null)return"";if(le.isDate(x))return x.toISOString();if(!c&&le.isBlob(x))throw new ht("Blob is not supported. Use a Buffer instead.");return le.isArrayBuffer(x)||le.isTypedArray(x)?c&&typeof Blob=="function"?new Blob([x]):Ef.from(x):x}function u(x,b,M){let O=x;if(x&&!M&&typeof x=="object"){if(le.endsWith(b,"{}"))b=n?b:b.slice(0,-2),x=JSON.stringify(x);else if(le.isArray(x)&&_x(x)||(le.isFileList(x)||le.endsWith(b,"[]"))&&(O=le.toArray(x)))return b=y1(b),O.forEach(function(k,F){!(le.isUndefined(k)||k===null)&&t.append(s===!0?_h([b],F,o):s===null?b:b+"[]",l(k))}),!1}return Af(x)?!0:(t.append(_h(M,b,o),l(x)),!1)}const d=[],p=Object.assign(Ex,{defaultVisitor:u,convertValue:l,isVisitable:Af});function y(x,b){if(!le.isUndefined(x)){if(d.indexOf(x)!==-1)throw Error("Circular reference detected in "+b.join("."));d.push(x),le.forEach(x,function(O,P){(!(le.isUndefined(O)||O===null)&&i.call(t,O,le.isString(P)?P.trim():P,b,p))===!0&&y(O,b?b.concat(P):[P])}),d.pop()}}if(!le.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Eh(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Id(e,t){this._pairs=[],e&&vl(e,this,t)}const w1=Id.prototype;w1.append=function(t,r){this._pairs.push([t,r])};w1.toString=function(t){const r=t?function(n){return t.call(this,n,Eh)}:Eh;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function Cx(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function x1(e,t,r){if(!t)return e;const n=r&&r.encode||Cx;le.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let o;if(i?o=i(t,r):o=le.isURLSearchParams(t)?t.toString():new Id(t,r).toString(n),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Tx{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){le.forEach(this.handlers,function(n){n!==null&&t(n)})}}var Ch=Tx,S1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ax=typeof URLSearchParams<"u"?URLSearchParams:Id,Mx=typeof FormData<"u"?FormData:null,Ix=typeof Blob<"u"?Blob:null,Ox={isBrowser:!0,classes:{URLSearchParams:Ax,FormData:Mx,Blob:Ix},protocols:["http","https","file","blob","url","data"]};const Od=typeof window<"u"&&typeof document<"u",Mf=typeof navigator=="object"&&navigator||void 0,Rx=Od&&(!Mf||["ReactNative","NativeScript","NS"].indexOf(Mf.product)<0),Px=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Nx=Od&&window.location.href||"http://localhost";var kx=Object.freeze({__proto__:null,hasBrowserEnv:Od,hasStandardBrowserWebWorkerEnv:Px,hasStandardBrowserEnv:Rx,navigator:Mf,origin:Nx}),Rr={...kx,...Ox};function jx(e,t){return vl(e,new Rr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,o){return Rr.isNode&&le.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Dx(e){return le.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Lx(e){const t={},r=Object.keys(e);let n;const i=r.length;let o;for(n=0;n<i;n++)o=r[n],t[o]=e[o];return t}function _1(e){function t(r,n,i,o){let s=r[o++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),c=o>=r.length;return s=!s&&le.isArray(i)?i.length:s,c?(le.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!a):((!i[s]||!le.isObject(i[s]))&&(i[s]=[]),t(r,n,i[s],o)&&le.isArray(i[s])&&(i[s]=Lx(i[s])),!a)}if(le.isFormData(e)&&le.isFunction(e.entries)){const r={};return le.forEachEntry(e,(n,i)=>{t(Dx(n),i,r,0)}),r}return null}function Bx(e,t,r){if(le.isString(e))try{return(t||JSON.parse)(e),le.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Rd={transitional:S1,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,o=le.isObject(t);if(o&&le.isHTMLForm(t)&&(t=new FormData(t)),le.isFormData(t))return i?JSON.stringify(_1(t)):t;if(le.isArrayBuffer(t)||le.isBuffer(t)||le.isStream(t)||le.isFile(t)||le.isBlob(t)||le.isReadableStream(t))return t;if(le.isArrayBufferView(t))return t.buffer;if(le.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return jx(t,this.formSerializer).toString();if((a=le.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return vl(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(r.setContentType("application/json",!1),Bx(t)):t}],transformResponse:[function(t){const r=this.transitional||Rd.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(le.isResponse(t)||le.isReadableStream(t))return t;if(t&&le.isString(t)&&(n&&!this.responseType||i)){const s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?ht.from(a,ht.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Rr.classes.FormData,Blob:Rr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};le.forEach(["delete","get","head","post","put","patch"],e=>{Rd.headers[e]={}});var Pd=Rd;const Ux=le.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var Fx=e=>{const t={};let r,n,i;return e&&e.split(`
|
|
30
|
+
`).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!r||t[r]&&Ux[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};const Th=Symbol("internals");function Vs(e){return e&&String(e).trim().toLowerCase()}function dc(e){return e===!1||e==null?e:le.isArray(e)?e.map(dc):String(e)}function $x(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Vx=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function xu(e,t,r,n,i){if(le.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!le.isString(t)){if(le.isString(n))return t.indexOf(n)!==-1;if(le.isRegExp(n))return n.test(t)}}function zx(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function qx(e,t){const r=le.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,o,s){return this[n].call(this,t,i,o,s)},configurable:!0})})}class bl{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function o(a,c,l){const u=Vs(c);if(!u)throw new Error("header name must be a non-empty string");const d=le.findKey(i,u);(!d||i[d]===void 0||l===!0||l===void 0&&i[d]!==!1)&&(i[d||c]=dc(a))}const s=(a,c)=>le.forEach(a,(l,u)=>o(l,u,c));if(le.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(le.isString(t)&&(t=t.trim())&&!Vx(t))s(Fx(t),r);else if(le.isHeaders(t))for(const[a,c]of t.entries())o(c,a,n);else t!=null&&o(r,t,n);return this}get(t,r){if(t=Vs(t),t){const n=le.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return $x(i);if(le.isFunction(r))return r.call(this,i,n);if(le.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Vs(t),t){const n=le.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||xu(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function o(s){if(s=Vs(s),s){const a=le.findKey(n,s);a&&(!r||xu(n,n[a],a,r))&&(delete n[a],i=!0)}}return le.isArray(t)?t.forEach(o):o(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const o=r[n];(!t||xu(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const r=this,n={};return le.forEach(this,(i,o)=>{const s=le.findKey(n,o);if(s){r[s]=dc(i),delete r[o];return}const a=t?zx(o):String(o).trim();a!==o&&delete r[o],r[a]=dc(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return le.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&le.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
|
|
31
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[Th]=this[Th]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Vs(s);n[a]||(qx(i,s),n[a]=!0)}return le.isArray(t)?t.forEach(o):o(t),this}}bl.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);le.reduceDescriptors(bl.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});le.freezeMethods(bl);var In=bl;function Su(e,t){const r=this||Pd,n=t||r,i=In.from(n.headers);let o=n.data;return le.forEach(e,function(a){o=a.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function E1(e){return!!(e&&e.__CANCEL__)}function Ts(e,t,r){ht.call(this,e??"canceled",ht.ERR_CANCELED,t,r),this.name="CanceledError"}le.inherits(Ts,ht,{__CANCEL__:!0});function C1(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ht("Request failed with status code "+r.status,[ht.ERR_BAD_REQUEST,ht.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Hx(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Wx(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=n[o];s||(s=l),r[i]=c,n[i]=l;let d=o,p=0;for(;d!==i;)p+=r[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),l-s<t)return;const y=u&&l-u;return y?Math.round(p*1e3/y):void 0}}function Gx(e,t){let r=0,n=1e3/t,i,o;const s=(l,u=Date.now())=>{r=u,i=null,o&&(clearTimeout(o),o=null),e.apply(null,l)};return[(...l)=>{const u=Date.now(),d=u-r;d>=n?s(l,u):(i=l,o||(o=setTimeout(()=>{o=null,s(i)},n-d)))},()=>i&&s(i)]}const kc=(e,t,r=3)=>{let n=0;const i=Wx(50,250);return Gx(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,c=s-n,l=i(c),u=s<=a;n=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-s)/l:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},r)},Ah=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Mh=e=>(...t)=>le.asap(()=>e(...t));var Kx=Rr.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Rr.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Rr.origin),Rr.navigator&&/(msie|trident)/i.test(Rr.navigator.userAgent)):()=>!0,Yx=Rr.hasStandardBrowserEnv?{write(e,t,r,n,i,o){const s=[e+"="+encodeURIComponent(t)];le.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),le.isString(n)&&s.push("path="+n),le.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Xx(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Jx(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function T1(e,t,r){let n=!Xx(t);return e&&(n||r==!1)?Jx(e,t):t}const Ih=e=>e instanceof In?{...e}:e;function Ro(e,t){t=t||{};const r={};function n(l,u,d,p){return le.isPlainObject(l)&&le.isPlainObject(u)?le.merge.call({caseless:p},l,u):le.isPlainObject(u)?le.merge({},u):le.isArray(u)?u.slice():u}function i(l,u,d,p){if(le.isUndefined(u)){if(!le.isUndefined(l))return n(void 0,l,d,p)}else return n(l,u,d,p)}function o(l,u){if(!le.isUndefined(u))return n(void 0,u)}function s(l,u){if(le.isUndefined(u)){if(!le.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function a(l,u,d){if(d in t)return n(l,u);if(d in e)return n(void 0,l)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,u,d)=>i(Ih(l),Ih(u),d,!0)};return le.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=c[u]||i,p=d(e[u],t[u],u);le.isUndefined(p)&&d!==a||(r[u]=p)}),r}var A1=e=>{const t=Ro({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=In.from(s),t.url=x1(T1(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(le.isFormData(r)){if(Rr.hasStandardBrowserEnv||Rr.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[l,...u]=c?c.split(";").map(d=>d.trim()).filter(Boolean):[];s.setContentType([l||"multipart/form-data",...u].join("; "))}}if(Rr.hasStandardBrowserEnv&&(n&&le.isFunction(n)&&(n=n(t)),n||n!==!1&&Kx(t.url))){const l=i&&o&&Yx.read(o);l&&s.set(i,l)}return t};const Zx=typeof XMLHttpRequest<"u";var Qx=Zx&&function(e){return new Promise(function(r,n){const i=A1(e);let o=i.data;const s=In.from(i.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=i,u,d,p,y,x;function b(){y&&y(),x&&x(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let M=new XMLHttpRequest;M.open(i.method.toUpperCase(),i.url,!0),M.timeout=i.timeout;function O(){if(!M)return;const k=In.from("getAllResponseHeaders"in M&&M.getAllResponseHeaders()),B={data:!a||a==="text"||a==="json"?M.responseText:M.response,status:M.status,statusText:M.statusText,headers:k,config:e,request:M};C1(function(z){r(z),b()},function(z){n(z),b()},B),M=null}"onloadend"in M?M.onloadend=O:M.onreadystatechange=function(){!M||M.readyState!==4||M.status===0&&!(M.responseURL&&M.responseURL.indexOf("file:")===0)||setTimeout(O)},M.onabort=function(){M&&(n(new ht("Request aborted",ht.ECONNABORTED,e,M)),M=null)},M.onerror=function(){n(new ht("Network Error",ht.ERR_NETWORK,e,M)),M=null},M.ontimeout=function(){let F=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const B=i.transitional||S1;i.timeoutErrorMessage&&(F=i.timeoutErrorMessage),n(new ht(F,B.clarifyTimeoutError?ht.ETIMEDOUT:ht.ECONNABORTED,e,M)),M=null},o===void 0&&s.setContentType(null),"setRequestHeader"in M&&le.forEach(s.toJSON(),function(F,B){M.setRequestHeader(B,F)}),le.isUndefined(i.withCredentials)||(M.withCredentials=!!i.withCredentials),a&&a!=="json"&&(M.responseType=i.responseType),l&&([p,x]=kc(l,!0),M.addEventListener("progress",p)),c&&M.upload&&([d,y]=kc(c),M.upload.addEventListener("progress",d),M.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(u=k=>{M&&(n(!k||k.type?new Ts(null,e,M):k),M.abort(),M=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const P=Hx(i.url);if(P&&Rr.protocols.indexOf(P)===-1){n(new ht("Unsupported protocol "+P+":",ht.ERR_BAD_REQUEST,e));return}M.send(o||null)})};const e5=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const o=function(l){if(!i){i=!0,a();const u=l instanceof Error?l:this.reason;n.abort(u instanceof ht?u:new Ts(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,o(new ht(`timeout ${t} of ms exceeded`,ht.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(o):l.removeEventListener("abort",o)}),e=null)};e.forEach(l=>l.addEventListener("abort",o));const{signal:c}=n;return c.unsubscribe=()=>le.asap(a),c}};var t5=e5;const r5=function*(e,t){let r=e.byteLength;if(!t||r<t){yield e;return}let n=0,i;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},n5=async function*(e,t){for await(const r of i5(e))yield*r5(r,t)},i5=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Oh=(e,t,r,n)=>{const i=n5(e,t);let o=0,s,a=c=>{s||(s=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:l,value:u}=await i.next();if(l){a(),c.close();return}let d=u.byteLength;if(r){let p=o+=d;r(p)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),i.return()}},{highWaterMark:2})},yl=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",M1=yl&&typeof ReadableStream=="function",o5=yl&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),I1=(e,...t)=>{try{return!!e(...t)}catch{return!1}},s5=M1&&I1(()=>{let e=!1;const t=new Request(Rr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Rh=64*1024,If=M1&&I1(()=>le.isReadableStream(new Response("").body)),jc={stream:If&&(e=>e.body)};yl&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!jc[t]&&(jc[t]=le.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new ht(`Response type '${t}' is not supported`,ht.ERR_NOT_SUPPORT,n)})})})(new Response);const a5=async e=>{if(e==null)return 0;if(le.isBlob(e))return e.size;if(le.isSpecCompliantForm(e))return(await new Request(Rr.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(le.isArrayBufferView(e)||le.isArrayBuffer(e))return e.byteLength;if(le.isURLSearchParams(e)&&(e=e+""),le.isString(e))return(await o5(e)).byteLength},c5=async(e,t)=>{const r=le.toFiniteNumber(e.getContentLength());return r??a5(t)};var l5=yl&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:d="same-origin",fetchOptions:p}=A1(e);l=l?(l+"").toLowerCase():"text";let y=t5([i,o&&o.toAbortSignal()],s),x;const b=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let M;try{if(c&&s5&&r!=="get"&&r!=="head"&&(M=await c5(u,n))!==0){let B=new Request(t,{method:"POST",body:n,duplex:"half"}),W;if(le.isFormData(n)&&(W=B.headers.get("content-type"))&&u.setContentType(W),B.body){const[z,G]=Ah(M,kc(Mh(c)));n=Oh(B.body,Rh,z,G)}}le.isString(d)||(d=d?"include":"omit");const O="credentials"in Request.prototype;x=new Request(t,{...p,signal:y,method:r.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",credentials:O?d:void 0});let P=await fetch(x);const k=If&&(l==="stream"||l==="response");if(If&&(a||k&&b)){const B={};["status","statusText","headers"].forEach(re=>{B[re]=P[re]});const W=le.toFiniteNumber(P.headers.get("content-length")),[z,G]=a&&Ah(W,kc(Mh(a),!0))||[];P=new Response(Oh(P.body,Rh,z,()=>{G&&G(),b&&b()}),B)}l=l||"text";let F=await jc[le.findKey(jc,l)||"text"](P,e);return!k&&b&&b(),await new Promise((B,W)=>{C1(B,W,{data:F,headers:In.from(P.headers),status:P.status,statusText:P.statusText,config:e,request:x})})}catch(O){throw b&&b(),O&&O.name==="TypeError"&&/fetch/i.test(O.message)?Object.assign(new ht("Network Error",ht.ERR_NETWORK,e,x),{cause:O.cause||O}):ht.from(O,O&&O.code,e,x)}});const Of={http:Sx,xhr:Qx,fetch:l5};le.forEach(Of,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ph=e=>`- ${e}`,u5=e=>le.isFunction(e)||e===null||e===!1;var O1={getAdapter:e=>{e=le.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let o=0;o<t;o++){r=e[o];let s;if(n=r,!u5(r)&&(n=Of[(s=String(r)).toLowerCase()],n===void 0))throw new ht(`Unknown adapter '${s}'`);if(n)break;i[s||"#"+o]=n}if(!n){const o=Object.entries(i).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since :
|
|
32
|
+
`+o.map(Ph).join(`
|
|
33
|
+
`):" "+Ph(o[0]):"as no adapter specified";throw new ht("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return n},adapters:Of};function _u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ts(null,e)}function Nh(e){return _u(e),e.headers=In.from(e.headers),e.data=Su.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),O1.getAdapter(e.adapter||Pd.adapter)(e).then(function(n){return _u(e),n.data=Su.call(e,e.transformResponse,n),n.headers=In.from(n.headers),n},function(n){return E1(n)||(_u(e),n&&n.response&&(n.response.data=Su.call(e,e.transformResponse,n.response),n.response.headers=In.from(n.response.headers))),Promise.reject(n)})}const R1="1.8.4",wl={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wl[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const kh={};wl.transitional=function(t,r,n){function i(o,s){return"[Axios v"+R1+"] Transitional option '"+o+"'"+s+(n?". "+n:"")}return(o,s,a)=>{if(t===!1)throw new ht(i(s," has been removed"+(r?" in "+r:"")),ht.ERR_DEPRECATED);return r&&!kh[s]&&(kh[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,s,a):!0}};wl.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function f5(e,t,r){if(typeof e!="object")throw new ht("options must be an object",ht.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const o=n[i],s=t[o];if(s){const a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new ht("option "+o+" must be "+c,ht.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ht("Unknown option "+o,ht.ERR_BAD_OPTION)}}var hc={assertOptions:f5,validators:wl};const Bn=hc.validators;class Dc{constructor(t){this.defaults=t,this.interceptors={request:new Ch,response:new Ch}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
34
|
+
`+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ro(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:o}=r;n!==void 0&&hc.assertOptions(n,{silentJSONParsing:Bn.transitional(Bn.boolean),forcedJSONParsing:Bn.transitional(Bn.boolean),clarifyTimeoutError:Bn.transitional(Bn.boolean)},!1),i!=null&&(le.isFunction(i)?r.paramsSerializer={serialize:i}:hc.assertOptions(i,{encode:Bn.function,serialize:Bn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),hc.assertOptions(r,{baseUrl:Bn.spelling("baseURL"),withXsrfToken:Bn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=o&&le.merge(o.common,o[r.method]);o&&le.forEach(["delete","get","head","post","put","patch","common"],x=>{delete o[x]}),r.headers=In.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(c=c&&b.synchronous,a.unshift(b.fulfilled,b.rejected))});const l=[];this.interceptors.response.forEach(function(b){l.push(b.fulfilled,b.rejected)});let u,d=0,p;if(!c){const x=[Nh.bind(this),void 0];for(x.unshift.apply(x,a),x.push.apply(x,l),p=x.length,u=Promise.resolve(r);d<p;)u=u.then(x[d++],x[d++]);return u}p=a.length;let y=r;for(d=0;d<p;){const x=a[d++],b=a[d++];try{y=x(y)}catch(M){b.call(this,M);break}}try{u=Nh.call(this,y)}catch(x){return Promise.reject(x)}for(d=0,p=l.length;d<p;)u=u.then(l[d++],l[d++]);return u}getUri(t){t=Ro(this.defaults,t);const r=T1(t.baseURL,t.url,t.allowAbsoluteUrls);return x1(r,t.params,t.paramsSerializer)}}le.forEach(["delete","get","head","options"],function(t){Dc.prototype[t]=function(r,n){return this.request(Ro(n||{},{method:t,url:r,data:(n||{}).data}))}});le.forEach(["post","put","patch"],function(t){function r(n){return function(o,s,a){return this.request(Ro(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}Dc.prototype[t]=r(),Dc.prototype[t+"Form"]=r(!0)});var pc=Dc;class Nd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(i=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](i);n._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{n.subscribe(a),o=a}).then(i);return s.cancel=function(){n.unsubscribe(o)},s},t(function(o,s,a){n.reason||(n.reason=new Ts(o,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Nd(function(i){t=i}),cancel:t}}}var d5=Nd;function h5(e){return function(r){return e.apply(null,r)}}function p5(e){return le.isObject(e)&&e.isAxiosError===!0}const Rf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Rf).forEach(([e,t])=>{Rf[t]=e});var m5=Rf;function P1(e){const t=new pc(e),r=u1(pc.prototype.request,t);return le.extend(r,pc.prototype,t,{allOwnKeys:!0}),le.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return P1(Ro(e,i))},r}const pr=P1(Pd);pr.Axios=pc;pr.CanceledError=Ts;pr.CancelToken=d5;pr.isCancel=E1;pr.VERSION=R1;pr.toFormData=vl;pr.AxiosError=ht;pr.Cancel=pr.CanceledError;pr.all=function(t){return Promise.all(t)};pr.spread=h5;pr.isAxiosError=p5;pr.mergeConfig=Ro;pr.AxiosHeaders=In;pr.formToJSON=e=>_1(le.isHTMLForm(e)?new FormData(e):e);pr.getAdapter=O1.getAdapter;pr.HttpStatusCode=m5;pr.default=pr;var N1=pr,kd={exports:{}},rn={},k1={exports:{}};(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(k1);var g5=k1.exports,Eu={exports:{}},Cu={exports:{}},jh;function xl(){return jh||(jh=1,function(e){function t(r){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Cu)),Cu.exports}var Dh;function v5(){return Dh||(Dh=1,function(e){var t=xl().default;function r(){e.exports=r=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var n,i={},o=Object.prototype,s=o.hasOwnProperty,a=Object.defineProperty||function(E,I,C){E[I]=C.value},c=typeof Symbol=="function"?Symbol:{},l=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",d=c.toStringTag||"@@toStringTag";function p(E,I,C){return Object.defineProperty(E,I,{value:C,enumerable:!0,configurable:!0,writable:!0}),E[I]}try{p({},"")}catch{p=function(C,g,v){return C[g]=v}}function y(E,I,C,g){var v=I&&I.prototype instanceof F?I:F,j=Object.create(v.prototype),Q=new S(g||[]);return a(j,"_invoke",{value:L(E,C,Q)}),j}function x(E,I,C){try{return{type:"normal",arg:E.call(I,C)}}catch(g){return{type:"throw",arg:g}}}i.wrap=y;var b="suspendedStart",M="suspendedYield",O="executing",P="completed",k={};function F(){}function B(){}function W(){}var z={};p(z,l,function(){return this});var G=Object.getPrototypeOf,re=G&&G(G(T([])));re&&re!==o&&s.call(re,l)&&(z=re);var oe=W.prototype=F.prototype=Object.create(z);function se(E){["next","throw","return"].forEach(function(I){p(E,I,function(C){return this._invoke(I,C)})})}function q(E,I){function C(v,j,Q,Z){var ce=x(E[v],E,j);if(ce.type!=="throw"){var be=ce.arg,xe=be.value;return xe&&t(xe)=="object"&&s.call(xe,"__await")?I.resolve(xe.__await).then(function(pe){C("next",pe,Q,Z)},function(pe){C("throw",pe,Q,Z)}):I.resolve(xe).then(function(pe){be.value=pe,Q(be)},function(pe){return C("throw",pe,Q,Z)})}Z(ce.arg)}var g;a(this,"_invoke",{value:function(j,Q){function Z(){return new I(function(ce,be){C(j,Q,ce,be)})}return g=g?g.then(Z,Z):Z()}})}function L(E,I,C){var g=b;return function(v,j){if(g===O)throw Error("Generator is already running");if(g===P){if(v==="throw")throw j;return{value:n,done:!0}}for(C.method=v,C.arg=j;;){var Q=C.delegate;if(Q){var Z=h(Q,C);if(Z){if(Z===k)continue;return Z}}if(C.method==="next")C.sent=C._sent=C.arg;else if(C.method==="throw"){if(g===b)throw g=P,C.arg;C.dispatchException(C.arg)}else C.method==="return"&&C.abrupt("return",C.arg);g=O;var ce=x(E,I,C);if(ce.type==="normal"){if(g=C.done?P:M,ce.arg===k)continue;return{value:ce.arg,done:C.done}}ce.type==="throw"&&(g=P,C.method="throw",C.arg=ce.arg)}}}function h(E,I){var C=I.method,g=E.iterator[C];if(g===n)return I.delegate=null,C==="throw"&&E.iterator.return&&(I.method="return",I.arg=n,h(E,I),I.method==="throw")||C!=="return"&&(I.method="throw",I.arg=new TypeError("The iterator does not provide a '"+C+"' method")),k;var v=x(g,E.iterator,I.arg);if(v.type==="throw")return I.method="throw",I.arg=v.arg,I.delegate=null,k;var j=v.arg;return j?j.done?(I[E.resultName]=j.value,I.next=E.nextLoc,I.method!=="return"&&(I.method="next",I.arg=n),I.delegate=null,k):j:(I.method="throw",I.arg=new TypeError("iterator result is not an object"),I.delegate=null,k)}function f(E){var I={tryLoc:E[0]};1 in E&&(I.catchLoc=E[1]),2 in E&&(I.finallyLoc=E[2],I.afterLoc=E[3]),this.tryEntries.push(I)}function m(E){var I=E.completion||{};I.type="normal",delete I.arg,E.completion=I}function S(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(f,this),this.reset(!0)}function T(E){if(E||E===""){var I=E[l];if(I)return I.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var C=-1,g=function v(){for(;++C<E.length;)if(s.call(E,C))return v.value=E[C],v.done=!1,v;return v.value=n,v.done=!0,v};return g.next=g}}throw new TypeError(t(E)+" is not iterable")}return B.prototype=W,a(oe,"constructor",{value:W,configurable:!0}),a(W,"constructor",{value:B,configurable:!0}),B.displayName=p(W,d,"GeneratorFunction"),i.isGeneratorFunction=function(E){var I=typeof E=="function"&&E.constructor;return!!I&&(I===B||(I.displayName||I.name)==="GeneratorFunction")},i.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,W):(E.__proto__=W,p(E,d,"GeneratorFunction")),E.prototype=Object.create(oe),E},i.awrap=function(E){return{__await:E}},se(q.prototype),p(q.prototype,u,function(){return this}),i.AsyncIterator=q,i.async=function(E,I,C,g,v){v===void 0&&(v=Promise);var j=new q(y(E,I,C,g),v);return i.isGeneratorFunction(I)?j:j.next().then(function(Q){return Q.done?Q.value:j.next()})},se(oe),p(oe,d,"Generator"),p(oe,l,function(){return this}),p(oe,"toString",function(){return"[object Generator]"}),i.keys=function(E){var I=Object(E),C=[];for(var g in I)C.push(g);return C.reverse(),function v(){for(;C.length;){var j=C.pop();if(j in I)return v.value=j,v.done=!1,v}return v.done=!0,v}},i.values=T,S.prototype={constructor:S,reset:function(I){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(m),!I)for(var C in this)C.charAt(0)==="t"&&s.call(this,C)&&!isNaN(+C.slice(1))&&(this[C]=n)},stop:function(){this.done=!0;var I=this.tryEntries[0].completion;if(I.type==="throw")throw I.arg;return this.rval},dispatchException:function(I){if(this.done)throw I;var C=this;function g(be,xe){return Q.type="throw",Q.arg=I,C.next=be,xe&&(C.method="next",C.arg=n),!!xe}for(var v=this.tryEntries.length-1;v>=0;--v){var j=this.tryEntries[v],Q=j.completion;if(j.tryLoc==="root")return g("end");if(j.tryLoc<=this.prev){var Z=s.call(j,"catchLoc"),ce=s.call(j,"finallyLoc");if(Z&&ce){if(this.prev<j.catchLoc)return g(j.catchLoc,!0);if(this.prev<j.finallyLoc)return g(j.finallyLoc)}else if(Z){if(this.prev<j.catchLoc)return g(j.catchLoc,!0)}else{if(!ce)throw Error("try statement without catch or finally");if(this.prev<j.finallyLoc)return g(j.finallyLoc)}}}},abrupt:function(I,C){for(var g=this.tryEntries.length-1;g>=0;--g){var v=this.tryEntries[g];if(v.tryLoc<=this.prev&&s.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var j=v;break}}j&&(I==="break"||I==="continue")&&j.tryLoc<=C&&C<=j.finallyLoc&&(j=null);var Q=j?j.completion:{};return Q.type=I,Q.arg=C,j?(this.method="next",this.next=j.finallyLoc,k):this.complete(Q)},complete:function(I,C){if(I.type==="throw")throw I.arg;return I.type==="break"||I.type==="continue"?this.next=I.arg:I.type==="return"?(this.rval=this.arg=I.arg,this.method="return",this.next="end"):I.type==="normal"&&C&&(this.next=C),k},finish:function(I){for(var C=this.tryEntries.length-1;C>=0;--C){var g=this.tryEntries[C];if(g.finallyLoc===I)return this.complete(g.completion,g.afterLoc),m(g),k}},catch:function(I){for(var C=this.tryEntries.length-1;C>=0;--C){var g=this.tryEntries[C];if(g.tryLoc===I){var v=g.completion;if(v.type==="throw"){var j=v.arg;m(g)}return j}}throw Error("illegal catch attempt")},delegateYield:function(I,C,g){return this.delegate={iterator:T(I),resultName:C,nextLoc:g},this.method==="next"&&(this.arg=n),k}},i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Eu)),Eu.exports}var Tu,Lh;function b5(){if(Lh)return Tu;Lh=1;var e=v5()();Tu=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return Tu}var Au={exports:{}},Bh;function y5(){return Bh||(Bh=1,function(e){function t(n,i,o,s,a,c,l){try{var u=n[c](l),d=u.value}catch(p){return void o(p)}u.done?i(d):Promise.resolve(d).then(s,a)}function r(n){return function(){var i=this,o=arguments;return new Promise(function(s,a){var c=n.apply(i,o);function l(d){t(c,s,a,l,u,"next",d)}function u(d){t(c,s,a,l,u,"throw",d)}l(void 0)})}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Au)),Au.exports}var Mu={exports:{}},Iu={exports:{}},Ou={exports:{}},Uh;function w5(){return Uh||(Uh=1,function(e){var t=xl().default;function r(n,i){if(t(n)!="object"||!n)return n;var o=n[Symbol.toPrimitive];if(o!==void 0){var s=o.call(n,i||"default");if(t(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Ou)),Ou.exports}var Fh;function x5(){return Fh||(Fh=1,function(e){var t=xl().default,r=w5();function n(i){var o=r(i,"string");return t(o)=="symbol"?o:o+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Iu)),Iu.exports}var $h;function S5(){return $h||($h=1,function(e){var t=x5();function r(n,i,o){return(i=t(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o,n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Mu)),Mu.exports}var Ru,Vh;function _5(){if(Vh)return Ru;Vh=1;const e=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);return Ru=t=>!e.has(t&&t.code),Ru}var Pa=g5;Object.defineProperty(rn,"__esModule",{value:!0});rn.isNetworkError=Dd;rn.isRetryableError=Sl;rn.isSafeRequestError=L1;rn.isIdempotentRequestError=Ld;rn.isNetworkOrIdempotentRequestError=Bd;rn.exponentialDelay=B1;rn.default=Lo;rn.DEFAULT_OPTIONS=rn.namespace=void 0;var Lc=Pa(b5()),E5=Pa(xl()),j1=Pa(y5()),C5=Pa(S5()),T5=Pa(_5());function zh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zh(Object(r),!0).forEach(function(n){(0,C5.default)(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zh(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var jd="axios-retry";rn.namespace=jd;function Dd(e){var t=["ERR_CANCELED","ECONNABORTED"];return!e.response&&!!e.code&&!t.includes(e.code)&&(0,T5.default)(e)}var D1=["get","head","options"],A5=D1.concat(["put","delete"]);function Sl(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status>=500&&e.response.status<=599)}function L1(e){return e.config?Sl(e)&&D1.indexOf(e.config.method)!==-1:!1}function Ld(e){return e.config?Sl(e)&&A5.indexOf(e.config.method)!==-1:!1}function Bd(e){return Dd(e)||Ld(e)}function M5(){return 0}function B1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:100,r=Math.pow(2,e)*t,n=r*.2*Math.random();return r+n}var U1={retries:3,retryCondition:Bd,retryDelay:M5,shouldResetTimeout:!1,onRetry:function(){}};rn.DEFAULT_OPTIONS=U1;function I5(e,t){return Pu(Pu(Pu({},U1),t),e[jd])}function qh(e,t){var r=I5(e,t);return r.retryCount=r.retryCount||0,e[jd]=r,r}function O5(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}function R5(e,t){return Pf.apply(this,arguments)}function Pf(){return Pf=(0,j1.default)(Lc.default.mark(function e(t,r){var n,i,o,s;return Lc.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(n=t.retries,i=t.retryCondition,o=t.retryCount<n&&i(r),(0,E5.default)(o)!=="object"){c.next=13;break}return c.prev=3,c.next=6,o;case 6:return s=c.sent,c.abrupt("return",s!==!1);case 10:return c.prev=10,c.t0=c.catch(3),c.abrupt("return",!1);case 13:return c.abrupt("return",o);case 14:case"end":return c.stop()}},e,null,[[3,10]])})),Pf.apply(this,arguments)}function Lo(e,t){var r=e.interceptors.request.use(function(i){var o=qh(i,t);return o.lastRequestTime=Date.now(),i}),n=e.interceptors.response.use(null,function(){var i=(0,j1.default)(Lc.default.mark(function o(s){var a,c,l,u,d,p,y,x;return Lc.default.wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(a=s.config,a){M.next=3;break}return M.abrupt("return",Promise.reject(s));case 3:return c=qh(a,t),M.next=6,R5(c,s);case 6:if(!M.sent){M.next=21;break}if(c.retryCount+=1,l=c.retryDelay,u=c.shouldResetTimeout,d=c.onRetry,p=l(c.retryCount,s),O5(e,a),!(!u&&a.timeout&&c.lastRequestTime)){M.next=17;break}if(y=Date.now()-c.lastRequestTime,x=a.timeout-y-p,!(x<=0)){M.next=16;break}return M.abrupt("return",Promise.reject(s));case 16:a.timeout=x;case 17:return a.transformRequest=[function(O){return O}],M.next=20,d(c.retryCount,s,a);case 20:return M.abrupt("return",new Promise(function(O){return setTimeout(function(){return O(e(a))},p)}));case 21:return M.abrupt("return",Promise.reject(s));case 22:case"end":return M.stop()}},o)}));return function(o){return i.apply(this,arguments)}}());return{requestInterceptorId:r,responseInterceptorId:n}}Lo.isNetworkError=Dd;Lo.isSafeRequestError=L1;Lo.isIdempotentRequestError=Ld;Lo.isNetworkOrIdempotentRequestError=Bd;Lo.exponentialDelay=B1;Lo.isRetryableError=Sl;const F1=rn.default;kd.exports=F1;kd.exports.default=F1;var P5=kd.exports,_l={},rs=null;typeof WebSocket<"u"?rs=WebSocket:typeof MozWebSocket<"u"?rs=MozWebSocket:typeof Ar<"u"?rs=Ar.WebSocket||Ar.MozWebSocket:typeof window<"u"?rs=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(rs=self.WebSocket||self.MozWebSocket);var N5=rs,k5=Ar&&Ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_l,"__esModule",{value:!0});_l.ResilientWebSocket=void 0;const j5=k5(N5),D5=3e4+3e3;class L5{constructor(t,r){gt(this,"endpoint");gt(this,"wsClient");gt(this,"wsUserClosed");gt(this,"wsFailedAttempts");gt(this,"pingTimeout");gt(this,"logger");gt(this,"onError");gt(this,"onMessage");gt(this,"onReconnect");this.endpoint=t,this.logger=r,this.wsFailedAttempts=0,this.onError=n=>{var i;(i=this.logger)==null||i.error(n)},this.wsUserClosed=!0,this.onMessage=()=>{},this.onReconnect=()=>{}}async send(t){var r,n,i;(r=this.logger)==null||r.info(`Sending ${t}`),await this.waitForMaybeReadyWebSocket(),this.wsClient===void 0?(n=this.logger)==null||n.error("Couldn't connect to the websocket server. Error callback is called."):(i=this.wsClient)==null||i.send(t)}async startWebSocket(){var t;this.wsClient===void 0&&((t=this.logger)==null||t.info("Creating Web Socket client"),this.wsClient=new j5.default(this.endpoint),this.wsUserClosed=!1,this.wsClient.onopen=()=>{this.wsFailedAttempts=0,this.wsClient.on!==void 0&&this.heartbeat()},this.wsClient.onerror=r=>{this.onError(r.error)},this.wsClient.onmessage=r=>{this.onMessage(r.data)},this.wsClient.onclose=async()=>{var r,n;if(this.pingTimeout!==void 0&&clearInterval(this.pingTimeout),this.wsUserClosed===!1){this.wsFailedAttempts+=1,this.wsClient=void 0;const i=B5(this.wsFailedAttempts);(r=this.logger)==null||r.error(`Connection closed unexpectedly or because of timeout. Reconnecting after ${i}ms.`),await Hh(i),this.restartUnexpectedClosedWebsocket()}else(n=this.logger)==null||n.info("The connection has been closed successfully.")},this.wsClient.on!==void 0&&this.wsClient.on("ping",this.heartbeat.bind(this)))}heartbeat(){var t;(t=this.logger)==null||t.info("Heartbeat"),this.pingTimeout!==void 0&&clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n;(r=this.logger)==null||r.warn("Connection timed out. Reconnecting..."),(n=this.wsClient)==null||n.terminate(),this.restartUnexpectedClosedWebsocket()},D5)}async waitForMaybeReadyWebSocket(){let t=0;for(;this.wsClient!==void 0&&this.wsClient.readyState!==this.wsClient.OPEN;)if(t>5e3){this.wsClient.close();return}else t+=10,await Hh(10)}async restartUnexpectedClosedWebsocket(){var t;if(this.wsUserClosed!==!0){if(await this.startWebSocket(),await this.waitForMaybeReadyWebSocket(),this.wsClient===void 0){(t=this.logger)==null||t.error("Couldn't reconnect to websocket. Error callback is called.");return}this.onReconnect()}}closeWebSocket(){if(this.wsClient!==void 0){const t=this.wsClient;this.wsClient=void 0,t.close()}this.wsUserClosed=!0}}_l.ResilientWebSocket=L5;async function Hh(e){return new Promise(t=>setTimeout(t,e))}function B5(e){return 2**e*100}var ms={};Object.defineProperty(ms,"__esModule",{value:!0});ms.removeLeading0xIfExists=ms.makeWebsocketUrl=void 0;function U5(e){const t=new URL("ws",e),r=t.protocol==="https:";return t.protocol=r?"wss:":"ws:",t.toString()}ms.makeWebsocketUrl=U5;function F5(e){return e.startsWith("0x")?e.substring(2):e}ms.removeLeading0xIfExists=F5;var $1=Ar&&Ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dl,"__esModule",{value:!0});dl.PriceServiceConnection=void 0;const Nu=Cd,$5=$1(N1),Wh=$1(P5),V5=_l,ku=ms;class z5{constructor(t,r){gt(this,"httpClient");gt(this,"priceFeedCallbacks");gt(this,"wsClient");gt(this,"wsEndpoint");gt(this,"logger");gt(this,"priceFeedRequestConfig");gt(this,"onWsError");var n,i,o;this.httpClient=$5.default.create({baseURL:t,timeout:(r==null?void 0:r.timeout)||5e3}),(0,Wh.default)(this.httpClient,{retries:(r==null?void 0:r.httpRetries)||3,retryDelay:Wh.default.exponentialDelay}),this.priceFeedRequestConfig={binary:(n=r==null?void 0:r.priceFeedRequestConfig)==null?void 0:n.binary,verbose:((i=r==null?void 0:r.priceFeedRequestConfig)==null?void 0:i.verbose)??(r==null?void 0:r.verbose),allowOutOfOrder:(o=r==null?void 0:r.priceFeedRequestConfig)==null?void 0:o.allowOutOfOrder},this.priceFeedCallbacks=new Map,this.logger=(r==null?void 0:r.logger)||{trace:()=>{},debug:()=>{},info:()=>{},warn:console.warn,error:console.error},this.onWsError=s=>{this.logger.error(s),typeof Mn<"u"&&typeof Mn.exit=="function"?(this.logger.error("Halting the process due to the websocket error"),Mn.exit(1)):this.logger.error("Cannot halt process. Please handle the websocket error.")},this.wsEndpoint=(0,ku.makeWebsocketUrl)(t)}async getLatestPriceFeeds(t){return t.length===0?[]:(await this.httpClient.get("/api/latest_price_feeds",{params:{ids:t,verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary}})).data.map(i=>Nu.PriceFeed.fromJson(i))}async getLatestVaas(t){return(await this.httpClient.get("/api/latest_vaas",{params:{ids:t}})).data}async getVaa(t,r){const n=await this.httpClient.get("/api/get_vaa",{params:{id:t,publish_time:r}});return[n.data.vaa,n.data.publishTime]}async getPriceFeed(t,r){const n=await this.httpClient.get("/api/get_price_feed",{params:{id:t,publish_time:r,verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary}});return Nu.PriceFeed.fromJson(n.data)}async getPriceFeedIds(){return(await this.httpClient.get("/api/price_feed_ids")).data}async subscribePriceFeedUpdates(t,r){var o;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(s=>(0,ku.removeLeading0xIfExists)(s));const n=[];for(const s of t)this.priceFeedCallbacks.has(s)||(this.priceFeedCallbacks.set(s,new Set),n.push(s)),this.priceFeedCallbacks.get(s).add(r);const i={ids:n,type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};await((o=this.wsClient)==null?void 0:o.send(JSON.stringify(i)))}async unsubscribePriceFeedUpdates(t,r){var o;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(s=>(0,ku.removeLeading0xIfExists)(s));const n=[];for(const s of t)if(this.priceFeedCallbacks.has(s)){let a=!1;r===void 0?(this.priceFeedCallbacks.delete(s),a=!0):(this.priceFeedCallbacks.get(s).delete(r),this.priceFeedCallbacks.get(s).size===0&&(this.priceFeedCallbacks.delete(s),a=!0)),a&&n.push(s)}const i={ids:n,type:"unsubscribe"};await((o=this.wsClient)==null?void 0:o.send(JSON.stringify(i))),this.priceFeedCallbacks.size===0&&this.closeWebSocket()}async startWebSocket(){if(this.wsEndpoint===void 0)throw new Error("Websocket endpoint is undefined.");this.wsClient=new V5.ResilientWebSocket(this.wsEndpoint,this.logger),this.wsClient.onError=this.onWsError,this.wsClient.onReconnect=()=>{var t;if(this.priceFeedCallbacks.size>0){const r={ids:Array.from(this.priceFeedCallbacks.keys()),type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};this.logger.info("Resubscribing to existing price feeds."),(t=this.wsClient)==null||t.send(JSON.stringify(r))}},this.wsClient.onMessage=t=>{this.logger.info(`Received message ${t.toString()}`);let r;try{r=JSON.parse(t.toString())}catch(n){this.logger.error(`Error parsing message ${t.toString()} as JSON.`),this.logger.error(n),this.onWsError(n);return}if(r.type==="response")r.status==="error"&&(this.logger.error(`Error response from the websocket server ${r.error}.`),this.onWsError(new Error(r.error)));else if(r.type==="price_update"){let n;try{n=Nu.PriceFeed.fromJson(r.price_feed)}catch(i){this.logger.error(`Error parsing price feeds from message ${t.toString()}.`),this.logger.error(i),this.onWsError(i);return}if(this.priceFeedCallbacks.has(n.id))for(const i of this.priceFeedCallbacks.get(n.id))i(n)}else this.logger.warn(`Ignoring unsupported server response ${t.toString()}.`)},await this.wsClient.startWebSocket()}closeWebSocket(){var t;(t=this.wsClient)==null||t.closeWebSocket(),this.wsClient=void 0,this.priceFeedCallbacks.clear()}}dl.PriceServiceConnection=z5;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseAccumulatorUpdateData=e.isAccumulatorUpdateData=e.Price=e.PriceFeed=e.PriceFeedMetadata=e.PriceServiceConnection=void 0;var t=dl;Object.defineProperty(e,"PriceServiceConnection",{enumerable:!0,get:function(){return t.PriceServiceConnection}});var r=Cd;Object.defineProperty(e,"PriceFeedMetadata",{enumerable:!0,get:function(){return r.PriceFeedMetadata}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return r.PriceFeed}}),Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return r.Price}}),Object.defineProperty(e,"isAccumulatorUpdateData",{enumerable:!0,get:function(){return r.isAccumulatorUpdateData}}),Object.defineProperty(e,"parseAccumulatorUpdateData",{enumerable:!0,get:function(){return r.parseAccumulatorUpdateData}})})(Ed);Object.defineProperty(fl,"__esModule",{value:!0});fl.SuiPriceServiceConnection=void 0;const q5=Ed,H5=Oa;class W5 extends q5.PriceServiceConnection{async getPriceFeedsUpdateData(t){return(await this.getLatestVaas(t)).map(n=>H5.Buffer.from(n,"base64"))}}fl.SuiPriceServiceConnection=W5;var El={};const G5=zm(F8),Bo=zm(V6);var Ud=Object.defineProperty,K5=Object.getOwnPropertyDescriptor,Y5=Object.getOwnPropertyNames,X5=Object.prototype.hasOwnProperty,J5=(e,t)=>{for(var r in t)Ud(e,r,{get:t[r],enumerable:!0})},Z5=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Y5(t))!X5.call(e,i)&&i!==r&&Ud(e,i,{get:()=>t[i],enumerable:!(n=K5(t,i))||n.enumerable});return e},Q5=e=>Z5(Ud({},"__esModule",{value:!0}),e),V1={};J5(V1,{isValidSuiNSName:()=>rS,normalizeSuiNSName:()=>nS});var eS=Q5(V1);const z1=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,q1=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,tS=235;function rS(e){return e.length>tS?!1:e.includes("@")?z1.test(e):q1.test(e)}function nS(e,t="at"){const r=e.toLowerCase();let n;if(r.includes("@")){if(!z1.test(r))throw new Error(`Invalid SuiNS name ${e}`);const[i,o]=r.split("@");n=[...i?i.split("."):[],o]}else{if(!q1.test(r))throw new Error(`Invalid SuiNS name ${e}`);n=r.split(".").slice(0,-1)}return t==="dot"?`${n.join(".")}.sui`:`${n.slice(0,-1).join(".")}@${n[n.length-1]}`}var Fd=Object.defineProperty,iS=Object.getOwnPropertyDescriptor,oS=Object.getOwnPropertyNames,sS=Object.prototype.hasOwnProperty,aS=(e,t)=>{for(var r in t)Fd(e,r,{get:t[r],enumerable:!0})},cS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of oS(t))!sS.call(e,i)&&i!==r&&Fd(e,i,{get:()=>t[i],enumerable:!(n=iS(t,i))||n.enumerable});return e},lS=e=>cS(Fd({},"__esModule",{value:!0}),e),H1={};aS(H1,{isValidNamedPackage:()=>G1,isValidNamedType:()=>mS});var uS=lS(H1),fS=eS;const dS=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,hS=/^\d+$/,pS=64,W1="/",G1=e=>{const t=e.split(W1);if(t.length<2||t.length>3)return!1;const[r,n,i]=t;return i!==void 0&&!hS.test(i)||!(0,fS.isValidSuiNSName)(r)?!1:dS.test(n)&&n.length<pS},mS=e=>{const t=e.split(/::|<|>|,/);for(const r of t)if(r.includes(W1)&&!G1(r))return!1;return!0};var $d=Object.defineProperty,gS=Object.getOwnPropertyDescriptor,vS=Object.getOwnPropertyNames,bS=Object.prototype.hasOwnProperty,yS=(e,t)=>{for(var r in t)$d(e,r,{get:t[r],enumerable:!0})},wS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of vS(t))!bS.call(e,i)&&i!==r&&$d(e,i,{get:()=>t[i],enumerable:!(n=gS(t,i))||n.enumerable});return e},xS=e=>wS($d({},"__esModule",{value:!0}),e),K1={};yS(K1,{SUI_ADDRESS_LENGTH:()=>Vd,isValidSuiAddress:()=>J1,isValidSuiObjectId:()=>CS,isValidTransactionDigest:()=>ES,normalizeStructTag:()=>Z1,normalizeSuiAddress:()=>qd,normalizeSuiObjectId:()=>AS,parseStructTag:()=>zd});var Y1=xS(K1),X1=Bo,SS=uS;const _S=32;function ES(e){try{return(0,X1.fromBase58)(e).length===_S}catch{return!1}}const Vd=32;function J1(e){return MS(e)&&IS(e)===Vd}function CS(e){return J1(e)}function TS(e){return e.includes("::")?zd(e):e}function zd(e){const[t,r]=e.split("::"),n=(0,SS.isValidNamedPackage)(t),i=e.slice(t.length+r.length+4),o=i.includes("<")?i.slice(0,i.indexOf("<")):i,s=i.includes("<")?(0,X1.splitGenericParameters)(i.slice(i.indexOf("<")+1,i.lastIndexOf(">"))).map(a=>TS(a.trim())):[];return{address:n?t:qd(t),module:r,name:o,typeParams:s}}function Z1(e){const{address:t,module:r,name:n,typeParams:i}=typeof e=="string"?zd(e):e,o=(i==null?void 0:i.length)>0?`<${i.map(s=>typeof s=="string"?s:Z1(s)).join(",")}>`:"";return`${t}::${r}::${n}${o}`}function qd(e,t=!1){let r=e.toLowerCase();return!t&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(Vd*2,"0")}`}function AS(e,t=!1){return qd(e,t)}function MS(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function IS(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}var Hd=Object.defineProperty,OS=Object.getOwnPropertyDescriptor,RS=Object.getOwnPropertyNames,PS=Object.prototype.hasOwnProperty,NS=(e,t)=>{for(var r in t)Hd(e,r,{get:t[r],enumerable:!0})},kS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of RS(t))!PS.call(e,i)&&i!==r&&Hd(e,i,{get:()=>t[i],enumerable:!(n=OS(t,i))||n.enumerable});return e},jS=e=>kS(Hd({},"__esModule",{value:!0}),e),Q1={};NS(Q1,{TypeTagSerializer:()=>xo});var ev=jS(Q1),DS=Bo,LS=Y1;const BS=/^vector<(.+)>$/,US=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;class xo{static parseFromStr(t,r=!1){if(t==="address")return{address:null};if(t==="bool")return{bool:null};if(t==="u8")return{u8:null};if(t==="u16")return{u16:null};if(t==="u32")return{u32:null};if(t==="u64")return{u64:null};if(t==="u128")return{u128:null};if(t==="u256")return{u256:null};if(t==="signer")return{signer:null};const n=t.match(BS);if(n)return{vector:xo.parseFromStr(n[1],r)};const i=t.match(US);if(i)return{struct:{address:r?(0,LS.normalizeSuiAddress)(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:xo.parseStructTypeArgs(i[5],r)}};throw new Error(`Encountered unexpected token when parsing type args for ${t}`)}static parseStructTypeArgs(t,r=!1){return(0,DS.splitGenericParameters)(t).map(n=>xo.parseFromStr(n,r))}static tagToString(t){if("bool"in t)return"bool";if("u8"in t)return"u8";if("u16"in t)return"u16";if("u32"in t)return"u32";if("u64"in t)return"u64";if("u128"in t)return"u128";if("u256"in t)return"u256";if("address"in t)return"address";if("signer"in t)return"signer";if("vector"in t)return`vector<${xo.tagToString(t.vector)}>`;if("struct"in t){const r=t.struct,n=r.typeParams.map(xo.tagToString).join(", ");return`${r.address}::${r.module}::${r.name}${n?`<${n}>`:""}`}throw new Error("Invalid TypeTag")}}var Wd=Object.defineProperty,FS=Object.getOwnPropertyDescriptor,$S=Object.getOwnPropertyNames,VS=Object.prototype.hasOwnProperty,zS=(e,t)=>{for(var r in t)Wd(e,r,{get:t[r],enumerable:!0})},qS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $S(t))!VS.call(e,i)&&i!==r&&Wd(e,i,{get:()=>t[i],enumerable:!(n=FS(t,i))||n.enumerable});return e},HS=e=>qS(Wd({},"__esModule",{value:!0}),e),tv={};zS(tv,{Address:()=>hn,AppId:()=>vv,Argument:()=>Vn,CallArg:()=>ov,Command:()=>av,CompressedSignature:()=>wv,GasData:()=>dv,Intent:()=>bv,IntentMessage:()=>yv,IntentScope:()=>mv,IntentVersion:()=>gv,MultiSig:()=>YS,MultiSigPkMap:()=>Sv,MultiSigPublicKey:()=>_v,ObjectArg:()=>iv,ObjectDigest:()=>rv,Owner:()=>KS,PasskeyAuthenticator:()=>JS,ProgrammableMoveCall:()=>sv,ProgrammableTransaction:()=>cv,PublicKey:()=>xv,SenderSignedData:()=>XS,SenderSignedTransaction:()=>Cv,SharedObjectRef:()=>nv,StructTag:()=>fv,SuiObjectRef:()=>Bc,TransactionData:()=>pv,TransactionDataV1:()=>hv,TransactionExpiration:()=>uv,TransactionKind:()=>lv,TypeTag:()=>Yd,base64String:()=>Ev});var Gd=HS(tv),ue=Bo,zs=Y1,Gh=ev;function WS(e){return ue.bcs.u64({name:"unsafe_u64",...e}).transform({input:t=>t,output:t=>Number(t)})}function GS(e){return ue.bcs.enum("Option",{None:null,Some:e})}const hn=ue.bcs.bytes(zs.SUI_ADDRESS_LENGTH).transform({validate:e=>{const t=typeof e=="string"?e:(0,ue.toHex)(e);if(!t||!(0,zs.isValidSuiAddress)((0,zs.normalizeSuiAddress)(t)))throw new Error(`Invalid Sui address ${t}`)},input:e=>typeof e=="string"?(0,ue.fromHex)((0,zs.normalizeSuiAddress)(e)):e,output:e=>(0,zs.normalizeSuiAddress)((0,ue.toHex)(e))}),rv=ue.bcs.vector(ue.bcs.u8()).transform({name:"ObjectDigest",input:e=>(0,ue.fromBase58)(e),output:e=>(0,ue.toBase58)(new Uint8Array(e)),validate:e=>{if((0,ue.fromBase58)(e).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),Bc=ue.bcs.struct("SuiObjectRef",{objectId:hn,version:ue.bcs.u64(),digest:rv}),nv=ue.bcs.struct("SharedObjectRef",{objectId:hn,initialSharedVersion:ue.bcs.u64(),mutable:ue.bcs.bool()}),iv=ue.bcs.enum("ObjectArg",{ImmOrOwnedObject:Bc,SharedObject:nv,Receiving:Bc}),KS=ue.bcs.enum("Owner",{AddressOwner:hn,ObjectOwner:hn,Shared:ue.bcs.struct("Shared",{initialSharedVersion:ue.bcs.u64()}),Immutable:null,ConsensusV2:ue.bcs.struct("ConsensusV2",{authenticator:ue.bcs.struct("Authenticator",{SingleOwner:ue.bcs.string()}),startVersion:ue.bcs.string()})}),ov=ue.bcs.enum("CallArg",{Pure:ue.bcs.struct("Pure",{bytes:ue.bcs.vector(ue.bcs.u8()).transform({input:e=>typeof e=="string"?(0,ue.fromBase64)(e):e,output:e=>(0,ue.toBase64)(new Uint8Array(e))})}),Object:iv}),Kd=ue.bcs.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:ue.bcs.lazy(()=>Kd),struct:ue.bcs.lazy(()=>fv),u16:null,u32:null,u256:null}),Yd=Kd.transform({input:e=>typeof e=="string"?Gh.TypeTagSerializer.parseFromStr(e,!0):e,output:e=>Gh.TypeTagSerializer.tagToString(e)}),Vn=ue.bcs.enum("Argument",{GasCoin:null,Input:ue.bcs.u16(),Result:ue.bcs.u16(),NestedResult:ue.bcs.tuple([ue.bcs.u16(),ue.bcs.u16()])}),sv=ue.bcs.struct("ProgrammableMoveCall",{package:hn,module:ue.bcs.string(),function:ue.bcs.string(),typeArguments:ue.bcs.vector(Yd),arguments:ue.bcs.vector(Vn)}),av=ue.bcs.enum("Command",{MoveCall:sv,TransferObjects:ue.bcs.struct("TransferObjects",{objects:ue.bcs.vector(Vn),address:Vn}),SplitCoins:ue.bcs.struct("SplitCoins",{coin:Vn,amounts:ue.bcs.vector(Vn)}),MergeCoins:ue.bcs.struct("MergeCoins",{destination:Vn,sources:ue.bcs.vector(Vn)}),Publish:ue.bcs.struct("Publish",{modules:ue.bcs.vector(ue.bcs.vector(ue.bcs.u8()).transform({input:e=>typeof e=="string"?(0,ue.fromBase64)(e):e,output:e=>(0,ue.toBase64)(new Uint8Array(e))})),dependencies:ue.bcs.vector(hn)}),MakeMoveVec:ue.bcs.struct("MakeMoveVec",{type:GS(Yd).transform({input:e=>e===null?{None:!0}:{Some:e},output:e=>e.Some??null}),elements:ue.bcs.vector(Vn)}),Upgrade:ue.bcs.struct("Upgrade",{modules:ue.bcs.vector(ue.bcs.vector(ue.bcs.u8()).transform({input:e=>typeof e=="string"?(0,ue.fromBase64)(e):e,output:e=>(0,ue.toBase64)(new Uint8Array(e))})),dependencies:ue.bcs.vector(hn),package:hn,ticket:Vn})}),cv=ue.bcs.struct("ProgrammableTransaction",{inputs:ue.bcs.vector(ov),commands:ue.bcs.vector(av)}),lv=ue.bcs.enum("TransactionKind",{ProgrammableTransaction:cv,ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null}),uv=ue.bcs.enum("TransactionExpiration",{None:null,Epoch:WS()}),fv=ue.bcs.struct("StructTag",{address:hn,module:ue.bcs.string(),name:ue.bcs.string(),typeParams:ue.bcs.vector(Kd)}),dv=ue.bcs.struct("GasData",{payment:ue.bcs.vector(Bc),owner:hn,price:ue.bcs.u64(),budget:ue.bcs.u64()}),hv=ue.bcs.struct("TransactionDataV1",{kind:lv,sender:hn,gasData:dv,expiration:uv}),pv=ue.bcs.enum("TransactionData",{V1:hv}),mv=ue.bcs.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),gv=ue.bcs.enum("IntentVersion",{V0:null}),vv=ue.bcs.enum("AppId",{Sui:null}),bv=ue.bcs.struct("Intent",{scope:mv,version:gv,appId:vv});function yv(e){return ue.bcs.struct(`IntentMessage<${e.name}>`,{intent:bv,value:e})}const wv=ue.bcs.enum("CompressedSignature",{ED25519:ue.bcs.fixedArray(64,ue.bcs.u8()),Secp256k1:ue.bcs.fixedArray(64,ue.bcs.u8()),Secp256r1:ue.bcs.fixedArray(64,ue.bcs.u8()),ZkLogin:ue.bcs.vector(ue.bcs.u8())}),xv=ue.bcs.enum("PublicKey",{ED25519:ue.bcs.fixedArray(32,ue.bcs.u8()),Secp256k1:ue.bcs.fixedArray(33,ue.bcs.u8()),Secp256r1:ue.bcs.fixedArray(33,ue.bcs.u8()),ZkLogin:ue.bcs.vector(ue.bcs.u8())}),Sv=ue.bcs.struct("MultiSigPkMap",{pubKey:xv,weight:ue.bcs.u8()}),_v=ue.bcs.struct("MultiSigPublicKey",{pk_map:ue.bcs.vector(Sv),threshold:ue.bcs.u16()}),YS=ue.bcs.struct("MultiSig",{sigs:ue.bcs.vector(wv),bitmap:ue.bcs.u16(),multisig_pk:_v}),Ev=ue.bcs.vector(ue.bcs.u8()).transform({input:e=>typeof e=="string"?(0,ue.fromBase64)(e):e,output:e=>(0,ue.toBase64)(new Uint8Array(e))}),Cv=ue.bcs.struct("SenderSignedTransaction",{intentMessage:yv(pv),txSignatures:ue.bcs.vector(Ev)}),XS=ue.bcs.vector(Cv,{name:"SenderSignedData"}),JS=ue.bcs.struct("PasskeyAuthenticator",{authenticatorData:ue.bcs.vector(ue.bcs.u8()),clientDataJson:ue.bcs.string(),userSignature:ue.bcs.vector(ue.bcs.u8())});var Xd=Object.defineProperty,ZS=Object.getOwnPropertyDescriptor,QS=Object.getOwnPropertyNames,e7=Object.prototype.hasOwnProperty,t7=(e,t)=>{for(var r in t)Xd(e,r,{get:t[r],enumerable:!0})},r7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of QS(t))!e7.call(e,i)&&i!==r&&Xd(e,i,{get:()=>t[i],enumerable:!(n=ZS(t,i))||n.enumerable});return e},n7=e=>r7(Xd({},"__esModule",{value:!0}),e),Tv={};t7(Tv,{TransactionEffects:()=>v7});var i7=n7(Tv),me=Bo,Mt=Gd;const o7=me.bcs.enum("PackageUpgradeError",{UnableToFetchPackage:me.bcs.struct("UnableToFetchPackage",{packageId:Mt.Address}),NotAPackage:me.bcs.struct("NotAPackage",{objectId:Mt.Address}),IncompatibleUpgrade:null,DigestDoesNotMatch:me.bcs.struct("DigestDoesNotMatch",{digest:me.bcs.vector(me.bcs.u8())}),UnknownUpgradePolicy:me.bcs.struct("UnknownUpgradePolicy",{policy:me.bcs.u8()}),PackageIDDoesNotMatch:me.bcs.struct("PackageIDDoesNotMatch",{packageId:Mt.Address,ticketId:Mt.Address})}),s7=me.bcs.struct("ModuleId",{address:Mt.Address,name:me.bcs.string()}),Kh=me.bcs.struct("MoveLocation",{module:s7,function:me.bcs.u16(),instruction:me.bcs.u16(),functionName:me.bcs.option(me.bcs.string())}),a7=me.bcs.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:me.bcs.struct("IndexOutOfBounds",{idx:me.bcs.u16()}),SecondaryIndexOutOfBounds:me.bcs.struct("SecondaryIndexOutOfBounds",{resultIdx:me.bcs.u16(),secondaryIdx:me.bcs.u16()}),InvalidResultArity:me.bcs.struct("InvalidResultArity",{resultIdx:me.bcs.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null}),c7=me.bcs.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),l7=me.bcs.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:me.bcs.struct("MoveObjectTooBig",{objectSize:me.bcs.u64(),maxObjectSize:me.bcs.u64()}),MovePackageTooBig:me.bcs.struct("MovePackageTooBig",{objectSize:me.bcs.u64(),maxObjectSize:me.bcs.u64()}),CircularObjectOwnership:me.bcs.struct("CircularObjectOwnership",{object:Mt.Address}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:me.bcs.option(Kh),MoveAbort:me.bcs.tuple([Kh,me.bcs.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:me.bcs.struct("CommandArgumentError",{argIdx:me.bcs.u16(),kind:a7}),TypeArgumentError:me.bcs.struct("TypeArgumentError",{argumentIdx:me.bcs.u16(),kind:c7}),UnusedValueWithoutDrop:me.bcs.struct("UnusedValueWithoutDrop",{resultIdx:me.bcs.u16(),secondaryIdx:me.bcs.u16()}),InvalidPublicFunctionReturnType:me.bcs.struct("InvalidPublicFunctionReturnType",{idx:me.bcs.u16()}),InvalidTransferObject:null,EffectsTooLarge:me.bcs.struct("EffectsTooLarge",{currentSize:me.bcs.u64(),maxSize:me.bcs.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:me.bcs.struct("PackageUpgradeError",{upgradeError:o7}),WrittenObjectsTooLarge:me.bcs.struct("WrittenObjectsTooLarge",{currentSize:me.bcs.u64(),maxSize:me.bcs.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:me.bcs.struct("ExecutionCancelledDueToSharedObjectCongestion",{congestedObjects:me.bcs.vector(Mt.Address)}),AddressDeniedForCoin:me.bcs.struct("AddressDeniedForCoin",{address:Mt.Address,coinType:me.bcs.string()}),CoinTypeGlobalPause:me.bcs.struct("CoinTypeGlobalPause",{coinType:me.bcs.string()}),ExecutionCancelledDueToRandomnessUnavailable:null}),Av=me.bcs.enum("ExecutionStatus",{Success:null,Failed:me.bcs.struct("ExecutionFailed",{error:l7,command:me.bcs.option(me.bcs.u64())})}),Mv=me.bcs.struct("GasCostSummary",{computationCost:me.bcs.u64(),storageCost:me.bcs.u64(),storageRebate:me.bcs.u64(),nonRefundableStorageFee:me.bcs.u64()}),u7=me.bcs.struct("TransactionEffectsV1",{status:Av,executedEpoch:me.bcs.u64(),gasUsed:Mv,modifiedAtVersions:me.bcs.vector(me.bcs.tuple([Mt.Address,me.bcs.u64()])),sharedObjects:me.bcs.vector(Mt.SuiObjectRef),transactionDigest:Mt.ObjectDigest,created:me.bcs.vector(me.bcs.tuple([Mt.SuiObjectRef,Mt.Owner])),mutated:me.bcs.vector(me.bcs.tuple([Mt.SuiObjectRef,Mt.Owner])),unwrapped:me.bcs.vector(me.bcs.tuple([Mt.SuiObjectRef,Mt.Owner])),deleted:me.bcs.vector(Mt.SuiObjectRef),unwrappedThenDeleted:me.bcs.vector(Mt.SuiObjectRef),wrapped:me.bcs.vector(Mt.SuiObjectRef),gasObject:me.bcs.tuple([Mt.SuiObjectRef,Mt.Owner]),eventsDigest:me.bcs.option(Mt.ObjectDigest),dependencies:me.bcs.vector(Mt.ObjectDigest)}),Jd=me.bcs.tuple([me.bcs.u64(),Mt.ObjectDigest]),f7=me.bcs.enum("ObjectIn",{NotExist:null,Exist:me.bcs.tuple([Jd,Mt.Owner])}),d7=me.bcs.enum("ObjectOut",{NotExist:null,ObjectWrite:me.bcs.tuple([Mt.ObjectDigest,Mt.Owner]),PackageWrite:Jd}),h7=me.bcs.enum("IDOperation",{None:null,Created:null,Deleted:null}),p7=me.bcs.struct("EffectsObjectChange",{inputState:f7,outputState:d7,idOperation:h7}),m7=me.bcs.enum("UnchangedSharedKind",{ReadOnlyRoot:Jd,MutateDeleted:me.bcs.u64(),ReadDeleted:me.bcs.u64(),Cancelled:me.bcs.u64(),PerEpochConfig:null}),g7=me.bcs.struct("TransactionEffectsV2",{status:Av,executedEpoch:me.bcs.u64(),gasUsed:Mv,transactionDigest:Mt.ObjectDigest,gasObjectIndex:me.bcs.option(me.bcs.u32()),eventsDigest:me.bcs.option(Mt.ObjectDigest),dependencies:me.bcs.vector(Mt.ObjectDigest),lamportVersion:me.bcs.u64(),changedObjects:me.bcs.vector(me.bcs.tuple([Mt.Address,p7])),unchangedSharedObjects:me.bcs.vector(me.bcs.tuple([Mt.Address,m7])),auxDataDigest:me.bcs.option(Mt.ObjectDigest)}),v7=me.bcs.enum("TransactionEffects",{V1:u7,V2:g7});var Zd=Object.defineProperty,b7=Object.getOwnPropertyDescriptor,y7=Object.getOwnPropertyNames,w7=Object.prototype.hasOwnProperty,x7=(e,t)=>{for(var r in t)Zd(e,r,{get:t[r],enumerable:!0})},S7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of y7(t))!w7.call(e,i)&&i!==r&&Zd(e,i,{get:()=>t[i],enumerable:!(n=b7(t,i))||n.enumerable});return e},_7=e=>S7(Zd({},"__esModule",{value:!0}),e),Iv={};x7(Iv,{pureBcsSchemaFromTypeName:()=>Nf});var E7=_7(Iv),Un=Bo,C7=Gd;function Nf(e){switch(e){case"u8":return Un.bcs.u8();case"u16":return Un.bcs.u16();case"u32":return Un.bcs.u32();case"u64":return Un.bcs.u64();case"u128":return Un.bcs.u128();case"u256":return Un.bcs.u256();case"bool":return Un.bcs.bool();case"string":return Un.bcs.string();case"id":case"address":return C7.Address}const t=e.match(/^(vector|option)<(.+)>$/);if(t){const[r,n]=t.slice(1);return r==="vector"?Un.bcs.vector(Nf(n)):Un.bcs.option(Nf(n))}throw new Error(`Invalid Pure type name: ${e}`)}var Qd=Object.defineProperty,T7=Object.getOwnPropertyDescriptor,A7=Object.getOwnPropertyNames,M7=Object.prototype.hasOwnProperty,I7=(e,t)=>{for(var r in t)Qd(e,r,{get:t[r],enumerable:!0})},O7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of A7(t))!M7.call(e,i)&&i!==r&&Qd(e,i,{get:()=>t[i],enumerable:!(n=T7(t,i))||n.enumerable});return e},R7=e=>O7(Qd({},"__esModule",{value:!0}),e),Ov={};I7(Ov,{BcsType:()=>j7.BcsType,TypeTagSerializer:()=>k7.TypeTagSerializer,bcs:()=>L7,pureBcsSchemaFromTypeName:()=>D7.pureBcsSchemaFromTypeName});var P7=R7(Ov),Fn=Bo,Lt=Gd,N7=i7,k7=ev,j7=Bo,D7=E7;const L7={...Fn.bcs,U8:Fn.bcs.u8(),U16:Fn.bcs.u16(),U32:Fn.bcs.u32(),U64:Fn.bcs.u64(),U128:Fn.bcs.u128(),U256:Fn.bcs.u256(),ULEB128:Fn.bcs.uleb128(),Bool:Fn.bcs.bool(),String:Fn.bcs.string(),Address:Lt.Address,AppId:Lt.AppId,Argument:Lt.Argument,CallArg:Lt.CallArg,CompressedSignature:Lt.CompressedSignature,GasData:Lt.GasData,Intent:Lt.Intent,IntentMessage:Lt.IntentMessage,IntentScope:Lt.IntentScope,IntentVersion:Lt.IntentVersion,MultiSig:Lt.MultiSig,MultiSigPkMap:Lt.MultiSigPkMap,MultiSigPublicKey:Lt.MultiSigPublicKey,ObjectArg:Lt.ObjectArg,ObjectDigest:Lt.ObjectDigest,Owner:Lt.Owner,ProgrammableMoveCall:Lt.ProgrammableMoveCall,ProgrammableTransaction:Lt.ProgrammableTransaction,PublicKey:Lt.PublicKey,SenderSignedData:Lt.SenderSignedData,SenderSignedTransaction:Lt.SenderSignedTransaction,SharedObjectRef:Lt.SharedObjectRef,StructTag:Lt.StructTag,SuiObjectRef:Lt.SuiObjectRef,Command:Lt.Command,TransactionData:Lt.TransactionData,TransactionDataV1:Lt.TransactionDataV1,TransactionExpiration:Lt.TransactionExpiration,TransactionKind:Lt.TransactionKind,TypeTag:Lt.TypeTag,TransactionEffects:N7.TransactionEffects,PasskeyAuthenticator:Lt.PasskeyAuthenticator};Object.defineProperty(El,"__esModule",{value:!0});El.SuiPythClient=void 0;const Ga=G5,Ho=P7,B7=Oa,ju=16*1024;class U7{constructor(t,r,n){gt(this,"provider");gt(this,"pythStateId");gt(this,"wormholeStateId");gt(this,"pythPackageId");gt(this,"wormholePackageId");gt(this,"priceTableInfo");gt(this,"priceFeedObjectIdCache",new Map);gt(this,"baseUpdateFee");this.provider=t,this.pythStateId=r,this.wormholeStateId=n,this.pythPackageId=void 0,this.wormholePackageId=void 0}async getBaseUpdateFee(){if(this.baseUpdateFee===void 0){const t=await this.provider.getObject({id:this.pythStateId,options:{showContent:!0}});if(!t.data||!t.data.content||t.data.content.dataType!=="moveObject")throw new Error("Unable to fetch pyth state object");this.baseUpdateFee=t.data.content.fields.base_update_fee}return this.baseUpdateFee}async getPackageId(t){const r=await this.provider.getObject({id:t,options:{showContent:!0}}).then(n=>{var i,o;if(((o=(i=n.data)==null?void 0:i.content)==null?void 0:o.dataType)=="moveObject")return n.data.content.fields;throw new Error(`Cannot fetch package id for object ${t}`)});if("upgrade_cap"in r)return r.upgrade_cap.fields.package;throw new Error("upgrade_cap not found")}async verifyVaas(t,r){const n=await this.getWormholePackageId(),i=[];for(const o of t){const[s]=r.moveCall({target:`${n}::vaa::parse_and_verify`,arguments:[r.object(this.wormholeStateId),r.pure(Ho.bcs.vector(Ho.bcs.U8).serialize(Array.from(o),{maxSize:ju}).toBytes()),r.object(Ga.SUI_CLOCK_OBJECT_ID)]});i.push(s)}return i}async updatePriceFeeds(t,r,n){const i=await this.getPythPackageId();let o;if(r.length>1)throw new Error("SDK does not support sending multiple accumulator messages in a single transaction");const s=this.extractVaaBytesFromAccumulatorMessage(r[0]),a=await this.verifyVaas([s],t);[o]=t.moveCall({target:`${i}::pyth::create_authenticated_price_infos_using_accumulator`,arguments:[t.object(this.pythStateId),t.pure(Ho.bcs.vector(Ho.bcs.U8).serialize(Array.from(r[0]),{maxSize:ju}).toBytes()),a[0],t.object(Ga.SUI_CLOCK_OBJECT_ID)]});const c=[],l=await this.getBaseUpdateFee(),u=t.splitCoins(t.gas,n.map(()=>t.pure.u64(l)));let d=0;for(const p of n){const y=await this.getPriceFeedObjectId(p);if(!y)throw new Error(`Price feed ${p} not found, please create it first`);c.push(y),[o]=t.moveCall({target:`${i}::pyth::update_single_price_feed`,arguments:[t.object(this.pythStateId),o,t.object(y),u[d],t.object(Ga.SUI_CLOCK_OBJECT_ID)]}),d++}return t.moveCall({target:`${i}::hot_potato_vector::destroy`,arguments:[o],typeArguments:[`${i}::price_info::PriceInfo`]}),c}async createPriceFeed(t,r){const n=await this.getPythPackageId();if(r.length>1)throw new Error("SDK does not support sending multiple accumulator messages in a single transaction");const i=this.extractVaaBytesFromAccumulatorMessage(r[0]),o=await this.verifyVaas([i],t);t.moveCall({target:`${n}::pyth::create_price_feeds_using_accumulator`,arguments:[t.object(this.pythStateId),t.pure(Ho.bcs.vector(Ho.bcs.U8).serialize(Array.from(r[0]),{maxSize:ju}).toBytes()),o[0],t.object(Ga.SUI_CLOCK_OBJECT_ID)]})}async getWormholePackageId(){return this.wormholePackageId||(this.wormholePackageId=await this.getPackageId(this.wormholeStateId)),this.wormholePackageId}async getPythPackageId(){return this.pythPackageId||(this.pythPackageId=await this.getPackageId(this.pythStateId)),this.pythPackageId}async getPriceFeedObjectId(t){const r=t.replace("0x","");if(!this.priceFeedObjectIdCache.has(r)){const{id:n,fieldType:i}=await this.getPriceTableInfo(),o=await this.provider.getDynamicFieldObject({parentId:n,name:{type:`${i}::price_identifier::PriceIdentifier`,value:{bytes:Array.from(B7.Buffer.from(r,"hex"))}}});if(!o.data||!o.data.content)return;if(o.data.content.dataType!=="moveObject")throw new Error("Price feed type mismatch");this.priceFeedObjectIdCache.set(r,o.data.content.fields.value)}return this.priceFeedObjectIdCache.get(r)}async getPriceTableInfo(){if(this.priceTableInfo===void 0){const t=await this.provider.getDynamicFieldObject({parentId:this.pythStateId,name:{type:"vector<u8>",value:"price_info"}});if(!t.data||!t.data.type)throw new Error("Price Table not found, contract may not be initialized");let r=t.data.type.replace("0x2::table::Table<","");r=r.replace("::price_identifier::PriceIdentifier, 0x2::object::ID>",""),this.priceTableInfo={id:t.data.objectId,fieldType:r}}return this.priceTableInfo}extractVaaBytesFromAccumulatorMessage(t){const n=7+t.readUint8(6)+1,i=t.readUint16BE(n),o=n+2;return t.subarray(o,o+i)}}El.SuiPythClient=U7;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PriceFeed=e.Price=e.SuiPythClient=e.SuiPriceServiceConnection=void 0;var t=fl;Object.defineProperty(e,"SuiPriceServiceConnection",{enumerable:!0,get:function(){return t.SuiPriceServiceConnection}});var r=El;Object.defineProperty(e,"SuiPythClient",{enumerable:!0,get:function(){return r.SuiPythClient}});var n=Ed;Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return n.Price}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return n.PriceFeed}})})(_f);var F7=Object.create,e0=Object.defineProperty,$7=Object.defineProperties,V7=Object.getOwnPropertyDescriptor,z7=Object.getOwnPropertyDescriptors,Rv=Object.getOwnPropertyNames,Yh=Object.getOwnPropertySymbols,q7=Object.getPrototypeOf,Pv=Object.prototype.hasOwnProperty,H7=Object.prototype.propertyIsEnumerable,Xh=(e,t,r)=>t in e?e0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W7=(e,t)=>{for(var r in t||(t={}))Pv.call(t,r)&&Xh(e,r,t[r]);if(Yh)for(var r of Yh(t))H7.call(t,r)&&Xh(e,r,t[r]);return e},G7=(e,t)=>$7(e,z7(t)),K7=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Y7=(e,t)=>function(){return t||(0,e[Rv(e)[0]])((t={exports:{}}).exports,t),t.exports},X7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Rv(t))!Pv.call(e,i)&&i!==r&&e0(e,i,{get:()=>t[i],enumerable:!(n=V7(t,i))||n.enumerable});return e},Uo=(e,t,r)=>(r=e!=null?F7(q7(e)):{},X7(!e||!e.__esModule?e0(r,"default",{value:e,enumerable:!0}):r,e)),ct=(e,t,r)=>new Promise((n,i)=>{var o=c=>{try{a(r.next(c))}catch(l){i(l)}},s=c=>{try{a(r.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,s);a((r=r.apply(e,t)).next())}),Fo=Y7({"node_modules/bn.js/lib/bn.js"(e,t){(function(r,n){function i(h,f){if(!h)throw new Error(f||"Assertion failed")}function o(h,f){h.super_=f;var m=function(){};m.prototype=f.prototype,h.prototype=new m,h.prototype.constructor=h}function s(h,f,m){if(s.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((f==="le"||f==="be")&&(m=f,f=10),this._init(h||0,f||10,m||"be"))}typeof r=="object"?r.exports=s:n.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=K7("buffer").Buffer}catch{}s.isBN=function(f){return f instanceof s?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===s.wordSize&&Array.isArray(f.words)},s.max=function(f,m){return f.cmp(m)>0?f:m},s.min=function(f,m){return f.cmp(m)<0?f:m},s.prototype._init=function(f,m,S){if(typeof f=="number")return this._initNumber(f,m,S);if(typeof f=="object")return this._initArray(f,m,S);m==="hex"&&(m=16),i(m===(m|0)&&m>=2&&m<=36),f=f.toString().replace(/\s+/g,"");var T=0;f[0]==="-"&&(T++,this.negative=1),T<f.length&&(m===16?this._parseHex(f,T,S):(this._parseBase(f,m,T),S==="le"&&this._initArray(this.toArray(),m,S)))},s.prototype._initNumber=function(f,m,S){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(i(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),S==="le"&&this._initArray(this.toArray(),m,S)},s.prototype._initArray=function(f,m,S){if(i(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var T=0;T<this.length;T++)this.words[T]=0;var E,I,C=0;if(S==="be")for(T=f.length-1,E=0;T>=0;T-=3)I=f[T]|f[T-1]<<8|f[T-2]<<16,this.words[E]|=I<<C&67108863,this.words[E+1]=I>>>26-C&67108863,C+=24,C>=26&&(C-=26,E++);else if(S==="le")for(T=0,E=0;T<f.length;T+=3)I=f[T]|f[T+1]<<8|f[T+2]<<16,this.words[E]|=I<<C&67108863,this.words[E+1]=I>>>26-C&67108863,C+=24,C>=26&&(C-=26,E++);return this._strip()};function c(h,f){var m=h.charCodeAt(f);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;i(!1,"Invalid character in "+h)}function l(h,f,m){var S=c(h,m);return m-1>=f&&(S|=c(h,m-1)<<4),S}s.prototype._parseHex=function(f,m,S){this.length=Math.ceil((f.length-m)/6),this.words=new Array(this.length);for(var T=0;T<this.length;T++)this.words[T]=0;var E=0,I=0,C;if(S==="be")for(T=f.length-1;T>=m;T-=2)C=l(f,m,T)<<E,this.words[I]|=C&67108863,E>=18?(E-=18,I+=1,this.words[I]|=C>>>26):E+=8;else{var g=f.length-m;for(T=g%2===0?m+1:m;T<f.length;T+=2)C=l(f,m,T)<<E,this.words[I]|=C&67108863,E>=18?(E-=18,I+=1,this.words[I]|=C>>>26):E+=8}this._strip()};function u(h,f,m,S){for(var T=0,E=0,I=Math.min(h.length,m),C=f;C<I;C++){var g=h.charCodeAt(C)-48;T*=S,g>=49?E=g-49+10:g>=17?E=g-17+10:E=g,i(g>=0&&E<S,"Invalid character"),T+=E}return T}s.prototype._parseBase=function(f,m,S){this.words=[0],this.length=1;for(var T=0,E=1;E<=67108863;E*=m)T++;T--,E=E/m|0;for(var I=f.length-S,C=I%T,g=Math.min(I,I-C)+S,v=0,j=S;j<g;j+=T)v=u(f,j,j+T,m),this.imuln(E),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v);if(C!==0){var Q=1;for(v=u(f,j,f.length,m),j=0;j<C;j++)Q*=m;this.imuln(Q),this.words[0]+v<67108864?this.words[0]+=v:this._iaddn(v)}this._strip()},s.prototype.copy=function(f){f.words=new Array(this.length);for(var m=0;m<this.length;m++)f.words[m]=this.words[m];f.length=this.length,f.negative=this.negative,f.red=this.red};function d(h,f){h.words=f.words,h.length=f.length,h.negative=f.negative,h.red=f.red}if(s.prototype._move=function(f){d(f,this)},s.prototype.clone=function(){var f=new s(null);return this.copy(f),f},s.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=p}catch{s.prototype.inspect=p}else s.prototype.inspect=p;function p(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],x=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],b=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(f,m){f=f||10,m=m|0||1;var S;if(f===16||f==="hex"){S="";for(var T=0,E=0,I=0;I<this.length;I++){var C=this.words[I],g=((C<<T|E)&16777215).toString(16);E=C>>>24-T&16777215,T+=2,T>=26&&(T-=26,I--),E!==0||I!==this.length-1?S=y[6-g.length]+g+S:S=g+S}for(E!==0&&(S=E.toString(16)+S);S.length%m!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}if(f===(f|0)&&f>=2&&f<=36){var v=x[f],j=b[f];S="";var Q=this.clone();for(Q.negative=0;!Q.isZero();){var Z=Q.modrn(j).toString(f);Q=Q.idivn(j),Q.isZero()?S=Z+S:S=y[v-Z.length]+Z+S}for(this.isZero()&&(S="0"+S);S.length%m!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(f,m){return this.toArrayLike(a,f,m)}),s.prototype.toArray=function(f,m){return this.toArrayLike(Array,f,m)};var M=function(f,m){return f.allocUnsafe?f.allocUnsafe(m):new f(m)};s.prototype.toArrayLike=function(f,m,S){this._strip();var T=this.byteLength(),E=S||Math.max(1,T);i(T<=E,"byte array longer than desired length"),i(E>0,"Requested array length <= 0");var I=M(f,E),C=m==="le"?"LE":"BE";return this["_toArrayLike"+C](I,T),I},s.prototype._toArrayLikeLE=function(f,m){for(var S=0,T=0,E=0,I=0;E<this.length;E++){var C=this.words[E]<<I|T;f[S++]=C&255,S<f.length&&(f[S++]=C>>8&255),S<f.length&&(f[S++]=C>>16&255),I===6?(S<f.length&&(f[S++]=C>>24&255),T=0,I=0):(T=C>>>24,I+=2)}if(S<f.length)for(f[S++]=T;S<f.length;)f[S++]=0},s.prototype._toArrayLikeBE=function(f,m){for(var S=f.length-1,T=0,E=0,I=0;E<this.length;E++){var C=this.words[E]<<I|T;f[S--]=C&255,S>=0&&(f[S--]=C>>8&255),S>=0&&(f[S--]=C>>16&255),I===6?(S>=0&&(f[S--]=C>>24&255),T=0,I=0):(T=C>>>24,I+=2)}if(S>=0)for(f[S--]=T;S>=0;)f[S--]=0},Math.clz32?s.prototype._countBits=function(f){return 32-Math.clz32(f)}:s.prototype._countBits=function(f){var m=f,S=0;return m>=4096&&(S+=13,m>>>=13),m>=64&&(S+=7,m>>>=7),m>=8&&(S+=4,m>>>=4),m>=2&&(S+=2,m>>>=2),S+m},s.prototype._zeroBits=function(f){if(f===0)return 26;var m=f,S=0;return m&8191||(S+=13,m>>>=13),m&127||(S+=7,m>>>=7),m&15||(S+=4,m>>>=4),m&3||(S+=2,m>>>=2),m&1||S++,S},s.prototype.bitLength=function(){var f=this.words[this.length-1],m=this._countBits(f);return(this.length-1)*26+m};function O(h){for(var f=new Array(h.bitLength()),m=0;m<f.length;m++){var S=m/26|0,T=m%26;f[m]=h.words[S]>>>T&1}return f}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,m=0;m<this.length;m++){var S=this._zeroBits(this.words[m]);if(f+=S,S!==26)break}return f},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},s.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var m=0;m<f.length;m++)this.words[m]=this.words[m]|f.words[m];return this._strip()},s.prototype.ior=function(f){return i((this.negative|f.negative)===0),this.iuor(f)},s.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},s.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},s.prototype.iuand=function(f){var m;this.length>f.length?m=f:m=this;for(var S=0;S<m.length;S++)this.words[S]=this.words[S]&f.words[S];return this.length=m.length,this._strip()},s.prototype.iand=function(f){return i((this.negative|f.negative)===0),this.iuand(f)},s.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},s.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},s.prototype.iuxor=function(f){var m,S;this.length>f.length?(m=this,S=f):(m=f,S=this);for(var T=0;T<S.length;T++)this.words[T]=m.words[T]^S.words[T];if(this!==m)for(;T<m.length;T++)this.words[T]=m.words[T];return this.length=m.length,this._strip()},s.prototype.ixor=function(f){return i((this.negative|f.negative)===0),this.iuxor(f)},s.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},s.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},s.prototype.inotn=function(f){i(typeof f=="number"&&f>=0);var m=Math.ceil(f/26)|0,S=f%26;this._expand(m),S>0&&m--;for(var T=0;T<m;T++)this.words[T]=~this.words[T]&67108863;return S>0&&(this.words[T]=~this.words[T]&67108863>>26-S),this._strip()},s.prototype.notn=function(f){return this.clone().inotn(f)},s.prototype.setn=function(f,m){i(typeof f=="number"&&f>=0);var S=f/26|0,T=f%26;return this._expand(S+1),m?this.words[S]=this.words[S]|1<<T:this.words[S]=this.words[S]&~(1<<T),this._strip()},s.prototype.iadd=function(f){var m;if(this.negative!==0&&f.negative===0)return this.negative=0,m=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,m=this.isub(f),f.negative=1,m._normSign();var S,T;this.length>f.length?(S=this,T=f):(S=f,T=this);for(var E=0,I=0;I<T.length;I++)m=(S.words[I]|0)+(T.words[I]|0)+E,this.words[I]=m&67108863,E=m>>>26;for(;E!==0&&I<S.length;I++)m=(S.words[I]|0)+E,this.words[I]=m&67108863,E=m>>>26;if(this.length=S.length,E!==0)this.words[this.length]=E,this.length++;else if(S!==this)for(;I<S.length;I++)this.words[I]=S.words[I];return this},s.prototype.add=function(f){var m;return f.negative!==0&&this.negative===0?(f.negative=0,m=this.sub(f),f.negative^=1,m):f.negative===0&&this.negative!==0?(this.negative=0,m=f.sub(this),this.negative=1,m):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},s.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var m=this.iadd(f);return f.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var S=this.cmp(f);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var T,E;S>0?(T=this,E=f):(T=f,E=this);for(var I=0,C=0;C<E.length;C++)m=(T.words[C]|0)-(E.words[C]|0)+I,I=m>>26,this.words[C]=m&67108863;for(;I!==0&&C<T.length;C++)m=(T.words[C]|0)+I,I=m>>26,this.words[C]=m&67108863;if(I===0&&C<T.length&&T!==this)for(;C<T.length;C++)this.words[C]=T.words[C];return this.length=Math.max(this.length,C),T!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(f){return this.clone().isub(f)};function P(h,f,m){m.negative=f.negative^h.negative;var S=h.length+f.length|0;m.length=S,S=S-1|0;var T=h.words[0]|0,E=f.words[0]|0,I=T*E,C=I&67108863,g=I/67108864|0;m.words[0]=C;for(var v=1;v<S;v++){for(var j=g>>>26,Q=g&67108863,Z=Math.min(v,f.length-1),ce=Math.max(0,v-h.length+1);ce<=Z;ce++){var be=v-ce|0;T=h.words[be]|0,E=f.words[ce]|0,I=T*E+Q,j+=I/67108864|0,Q=I&67108863}m.words[v]=Q|0,g=j|0}return g!==0?m.words[v]=g|0:m.length--,m._strip()}var k=function(f,m,S){var T=f.words,E=m.words,I=S.words,C=0,g,v,j,Q=T[0]|0,Z=Q&8191,ce=Q>>>13,be=T[1]|0,xe=be&8191,pe=be>>>13,Le=T[2]|0,Ae=Le&8191,Je=Le>>>13,dt=T[3]|0,je=dt&8191,pt=dt>>>13,we=T[4]|0,he=we&8191,Ce=we>>>13,Ve=T[5]|0,ke=Ve&8191,Te=Ve>>>13,Me=T[6]|0,Ue=Me&8191,ut=Me>>>13,ft=T[7]|0,ze=ft&8191,kt=ft>>>13,_t=T[8]|0,Ke=_t&8191,It=_t>>>13,Ut=T[9]|0,et=Ut&8191,Et=Ut>>>13,Ot=E[0]|0,nt=Ot&8191,jt=Ot>>>13,Pt=E[1]|0,tt=Pt&8191,wt=Pt>>>13,Ct=E[2]|0,Ge=Ct&8191,mt=Ct>>>13,Nt=E[3]|0,it=Nt&8191,xt=Nt>>>13,zt=E[4]|0,N=zt&8191,_=zt>>>13,A=E[5]|0,U=A&8191,Y=A>>>13,ee=E[6]|0,ne=ee&8191,De=ee>>>13,Ze=E[7]|0,Ne=Ze&8191,V=Ze>>>13,ae=E[8]|0,fe=ae&8191,Re=ae>>>13,qe=E[9]|0,Pe=qe&8191,Fe=qe>>>13;S.negative=f.negative^m.negative,S.length=19,g=Math.imul(Z,nt),v=Math.imul(Z,jt),v=v+Math.imul(ce,nt)|0,j=Math.imul(ce,jt);var ot=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(ot>>>26)|0,ot&=67108863,g=Math.imul(xe,nt),v=Math.imul(xe,jt),v=v+Math.imul(pe,nt)|0,j=Math.imul(pe,jt),g=g+Math.imul(Z,tt)|0,v=v+Math.imul(Z,wt)|0,v=v+Math.imul(ce,tt)|0,j=j+Math.imul(ce,wt)|0;var Jt=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,g=Math.imul(Ae,nt),v=Math.imul(Ae,jt),v=v+Math.imul(Je,nt)|0,j=Math.imul(Je,jt),g=g+Math.imul(xe,tt)|0,v=v+Math.imul(xe,wt)|0,v=v+Math.imul(pe,tt)|0,j=j+Math.imul(pe,wt)|0,g=g+Math.imul(Z,Ge)|0,v=v+Math.imul(Z,mt)|0,v=v+Math.imul(ce,Ge)|0,j=j+Math.imul(ce,mt)|0;var Dt=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,g=Math.imul(je,nt),v=Math.imul(je,jt),v=v+Math.imul(pt,nt)|0,j=Math.imul(pt,jt),g=g+Math.imul(Ae,tt)|0,v=v+Math.imul(Ae,wt)|0,v=v+Math.imul(Je,tt)|0,j=j+Math.imul(Je,wt)|0,g=g+Math.imul(xe,Ge)|0,v=v+Math.imul(xe,mt)|0,v=v+Math.imul(pe,Ge)|0,j=j+Math.imul(pe,mt)|0,g=g+Math.imul(Z,it)|0,v=v+Math.imul(Z,xt)|0,v=v+Math.imul(ce,it)|0,j=j+Math.imul(ce,xt)|0;var Ft=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,g=Math.imul(he,nt),v=Math.imul(he,jt),v=v+Math.imul(Ce,nt)|0,j=Math.imul(Ce,jt),g=g+Math.imul(je,tt)|0,v=v+Math.imul(je,wt)|0,v=v+Math.imul(pt,tt)|0,j=j+Math.imul(pt,wt)|0,g=g+Math.imul(Ae,Ge)|0,v=v+Math.imul(Ae,mt)|0,v=v+Math.imul(Je,Ge)|0,j=j+Math.imul(Je,mt)|0,g=g+Math.imul(xe,it)|0,v=v+Math.imul(xe,xt)|0,v=v+Math.imul(pe,it)|0,j=j+Math.imul(pe,xt)|0,g=g+Math.imul(Z,N)|0,v=v+Math.imul(Z,_)|0,v=v+Math.imul(ce,N)|0,j=j+Math.imul(ce,_)|0;var sr=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(sr>>>26)|0,sr&=67108863,g=Math.imul(ke,nt),v=Math.imul(ke,jt),v=v+Math.imul(Te,nt)|0,j=Math.imul(Te,jt),g=g+Math.imul(he,tt)|0,v=v+Math.imul(he,wt)|0,v=v+Math.imul(Ce,tt)|0,j=j+Math.imul(Ce,wt)|0,g=g+Math.imul(je,Ge)|0,v=v+Math.imul(je,mt)|0,v=v+Math.imul(pt,Ge)|0,j=j+Math.imul(pt,mt)|0,g=g+Math.imul(Ae,it)|0,v=v+Math.imul(Ae,xt)|0,v=v+Math.imul(Je,it)|0,j=j+Math.imul(Je,xt)|0,g=g+Math.imul(xe,N)|0,v=v+Math.imul(xe,_)|0,v=v+Math.imul(pe,N)|0,j=j+Math.imul(pe,_)|0,g=g+Math.imul(Z,U)|0,v=v+Math.imul(Z,Y)|0,v=v+Math.imul(ce,U)|0,j=j+Math.imul(ce,Y)|0;var Er=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(Er>>>26)|0,Er&=67108863,g=Math.imul(Ue,nt),v=Math.imul(Ue,jt),v=v+Math.imul(ut,nt)|0,j=Math.imul(ut,jt),g=g+Math.imul(ke,tt)|0,v=v+Math.imul(ke,wt)|0,v=v+Math.imul(Te,tt)|0,j=j+Math.imul(Te,wt)|0,g=g+Math.imul(he,Ge)|0,v=v+Math.imul(he,mt)|0,v=v+Math.imul(Ce,Ge)|0,j=j+Math.imul(Ce,mt)|0,g=g+Math.imul(je,it)|0,v=v+Math.imul(je,xt)|0,v=v+Math.imul(pt,it)|0,j=j+Math.imul(pt,xt)|0,g=g+Math.imul(Ae,N)|0,v=v+Math.imul(Ae,_)|0,v=v+Math.imul(Je,N)|0,j=j+Math.imul(Je,_)|0,g=g+Math.imul(xe,U)|0,v=v+Math.imul(xe,Y)|0,v=v+Math.imul(pe,U)|0,j=j+Math.imul(pe,Y)|0,g=g+Math.imul(Z,ne)|0,v=v+Math.imul(Z,De)|0,v=v+Math.imul(ce,ne)|0,j=j+Math.imul(ce,De)|0;var ur=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(ur>>>26)|0,ur&=67108863,g=Math.imul(ze,nt),v=Math.imul(ze,jt),v=v+Math.imul(kt,nt)|0,j=Math.imul(kt,jt),g=g+Math.imul(Ue,tt)|0,v=v+Math.imul(Ue,wt)|0,v=v+Math.imul(ut,tt)|0,j=j+Math.imul(ut,wt)|0,g=g+Math.imul(ke,Ge)|0,v=v+Math.imul(ke,mt)|0,v=v+Math.imul(Te,Ge)|0,j=j+Math.imul(Te,mt)|0,g=g+Math.imul(he,it)|0,v=v+Math.imul(he,xt)|0,v=v+Math.imul(Ce,it)|0,j=j+Math.imul(Ce,xt)|0,g=g+Math.imul(je,N)|0,v=v+Math.imul(je,_)|0,v=v+Math.imul(pt,N)|0,j=j+Math.imul(pt,_)|0,g=g+Math.imul(Ae,U)|0,v=v+Math.imul(Ae,Y)|0,v=v+Math.imul(Je,U)|0,j=j+Math.imul(Je,Y)|0,g=g+Math.imul(xe,ne)|0,v=v+Math.imul(xe,De)|0,v=v+Math.imul(pe,ne)|0,j=j+Math.imul(pe,De)|0,g=g+Math.imul(Z,Ne)|0,v=v+Math.imul(Z,V)|0,v=v+Math.imul(ce,Ne)|0,j=j+Math.imul(ce,V)|0;var Zt=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,g=Math.imul(Ke,nt),v=Math.imul(Ke,jt),v=v+Math.imul(It,nt)|0,j=Math.imul(It,jt),g=g+Math.imul(ze,tt)|0,v=v+Math.imul(ze,wt)|0,v=v+Math.imul(kt,tt)|0,j=j+Math.imul(kt,wt)|0,g=g+Math.imul(Ue,Ge)|0,v=v+Math.imul(Ue,mt)|0,v=v+Math.imul(ut,Ge)|0,j=j+Math.imul(ut,mt)|0,g=g+Math.imul(ke,it)|0,v=v+Math.imul(ke,xt)|0,v=v+Math.imul(Te,it)|0,j=j+Math.imul(Te,xt)|0,g=g+Math.imul(he,N)|0,v=v+Math.imul(he,_)|0,v=v+Math.imul(Ce,N)|0,j=j+Math.imul(Ce,_)|0,g=g+Math.imul(je,U)|0,v=v+Math.imul(je,Y)|0,v=v+Math.imul(pt,U)|0,j=j+Math.imul(pt,Y)|0,g=g+Math.imul(Ae,ne)|0,v=v+Math.imul(Ae,De)|0,v=v+Math.imul(Je,ne)|0,j=j+Math.imul(Je,De)|0,g=g+Math.imul(xe,Ne)|0,v=v+Math.imul(xe,V)|0,v=v+Math.imul(pe,Ne)|0,j=j+Math.imul(pe,V)|0,g=g+Math.imul(Z,fe)|0,v=v+Math.imul(Z,Re)|0,v=v+Math.imul(ce,fe)|0,j=j+Math.imul(ce,Re)|0;var wr=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(wr>>>26)|0,wr&=67108863,g=Math.imul(et,nt),v=Math.imul(et,jt),v=v+Math.imul(Et,nt)|0,j=Math.imul(Et,jt),g=g+Math.imul(Ke,tt)|0,v=v+Math.imul(Ke,wt)|0,v=v+Math.imul(It,tt)|0,j=j+Math.imul(It,wt)|0,g=g+Math.imul(ze,Ge)|0,v=v+Math.imul(ze,mt)|0,v=v+Math.imul(kt,Ge)|0,j=j+Math.imul(kt,mt)|0,g=g+Math.imul(Ue,it)|0,v=v+Math.imul(Ue,xt)|0,v=v+Math.imul(ut,it)|0,j=j+Math.imul(ut,xt)|0,g=g+Math.imul(ke,N)|0,v=v+Math.imul(ke,_)|0,v=v+Math.imul(Te,N)|0,j=j+Math.imul(Te,_)|0,g=g+Math.imul(he,U)|0,v=v+Math.imul(he,Y)|0,v=v+Math.imul(Ce,U)|0,j=j+Math.imul(Ce,Y)|0,g=g+Math.imul(je,ne)|0,v=v+Math.imul(je,De)|0,v=v+Math.imul(pt,ne)|0,j=j+Math.imul(pt,De)|0,g=g+Math.imul(Ae,Ne)|0,v=v+Math.imul(Ae,V)|0,v=v+Math.imul(Je,Ne)|0,j=j+Math.imul(Je,V)|0,g=g+Math.imul(xe,fe)|0,v=v+Math.imul(xe,Re)|0,v=v+Math.imul(pe,fe)|0,j=j+Math.imul(pe,Re)|0,g=g+Math.imul(Z,Pe)|0,v=v+Math.imul(Z,Fe)|0,v=v+Math.imul(ce,Pe)|0,j=j+Math.imul(ce,Fe)|0;var vn=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(vn>>>26)|0,vn&=67108863,g=Math.imul(et,tt),v=Math.imul(et,wt),v=v+Math.imul(Et,tt)|0,j=Math.imul(Et,wt),g=g+Math.imul(Ke,Ge)|0,v=v+Math.imul(Ke,mt)|0,v=v+Math.imul(It,Ge)|0,j=j+Math.imul(It,mt)|0,g=g+Math.imul(ze,it)|0,v=v+Math.imul(ze,xt)|0,v=v+Math.imul(kt,it)|0,j=j+Math.imul(kt,xt)|0,g=g+Math.imul(Ue,N)|0,v=v+Math.imul(Ue,_)|0,v=v+Math.imul(ut,N)|0,j=j+Math.imul(ut,_)|0,g=g+Math.imul(ke,U)|0,v=v+Math.imul(ke,Y)|0,v=v+Math.imul(Te,U)|0,j=j+Math.imul(Te,Y)|0,g=g+Math.imul(he,ne)|0,v=v+Math.imul(he,De)|0,v=v+Math.imul(Ce,ne)|0,j=j+Math.imul(Ce,De)|0,g=g+Math.imul(je,Ne)|0,v=v+Math.imul(je,V)|0,v=v+Math.imul(pt,Ne)|0,j=j+Math.imul(pt,V)|0,g=g+Math.imul(Ae,fe)|0,v=v+Math.imul(Ae,Re)|0,v=v+Math.imul(Je,fe)|0,j=j+Math.imul(Je,Re)|0,g=g+Math.imul(xe,Pe)|0,v=v+Math.imul(xe,Fe)|0,v=v+Math.imul(pe,Pe)|0,j=j+Math.imul(pe,Fe)|0;var Vr=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,g=Math.imul(et,Ge),v=Math.imul(et,mt),v=v+Math.imul(Et,Ge)|0,j=Math.imul(Et,mt),g=g+Math.imul(Ke,it)|0,v=v+Math.imul(Ke,xt)|0,v=v+Math.imul(It,it)|0,j=j+Math.imul(It,xt)|0,g=g+Math.imul(ze,N)|0,v=v+Math.imul(ze,_)|0,v=v+Math.imul(kt,N)|0,j=j+Math.imul(kt,_)|0,g=g+Math.imul(Ue,U)|0,v=v+Math.imul(Ue,Y)|0,v=v+Math.imul(ut,U)|0,j=j+Math.imul(ut,Y)|0,g=g+Math.imul(ke,ne)|0,v=v+Math.imul(ke,De)|0,v=v+Math.imul(Te,ne)|0,j=j+Math.imul(Te,De)|0,g=g+Math.imul(he,Ne)|0,v=v+Math.imul(he,V)|0,v=v+Math.imul(Ce,Ne)|0,j=j+Math.imul(Ce,V)|0,g=g+Math.imul(je,fe)|0,v=v+Math.imul(je,Re)|0,v=v+Math.imul(pt,fe)|0,j=j+Math.imul(pt,Re)|0,g=g+Math.imul(Ae,Pe)|0,v=v+Math.imul(Ae,Fe)|0,v=v+Math.imul(Je,Pe)|0,j=j+Math.imul(Je,Fe)|0;var bn=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(bn>>>26)|0,bn&=67108863,g=Math.imul(et,it),v=Math.imul(et,xt),v=v+Math.imul(Et,it)|0,j=Math.imul(Et,xt),g=g+Math.imul(Ke,N)|0,v=v+Math.imul(Ke,_)|0,v=v+Math.imul(It,N)|0,j=j+Math.imul(It,_)|0,g=g+Math.imul(ze,U)|0,v=v+Math.imul(ze,Y)|0,v=v+Math.imul(kt,U)|0,j=j+Math.imul(kt,Y)|0,g=g+Math.imul(Ue,ne)|0,v=v+Math.imul(Ue,De)|0,v=v+Math.imul(ut,ne)|0,j=j+Math.imul(ut,De)|0,g=g+Math.imul(ke,Ne)|0,v=v+Math.imul(ke,V)|0,v=v+Math.imul(Te,Ne)|0,j=j+Math.imul(Te,V)|0,g=g+Math.imul(he,fe)|0,v=v+Math.imul(he,Re)|0,v=v+Math.imul(Ce,fe)|0,j=j+Math.imul(Ce,Re)|0,g=g+Math.imul(je,Pe)|0,v=v+Math.imul(je,Fe)|0,v=v+Math.imul(pt,Pe)|0,j=j+Math.imul(pt,Fe)|0;var ii=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(ii>>>26)|0,ii&=67108863,g=Math.imul(et,N),v=Math.imul(et,_),v=v+Math.imul(Et,N)|0,j=Math.imul(Et,_),g=g+Math.imul(Ke,U)|0,v=v+Math.imul(Ke,Y)|0,v=v+Math.imul(It,U)|0,j=j+Math.imul(It,Y)|0,g=g+Math.imul(ze,ne)|0,v=v+Math.imul(ze,De)|0,v=v+Math.imul(kt,ne)|0,j=j+Math.imul(kt,De)|0,g=g+Math.imul(Ue,Ne)|0,v=v+Math.imul(Ue,V)|0,v=v+Math.imul(ut,Ne)|0,j=j+Math.imul(ut,V)|0,g=g+Math.imul(ke,fe)|0,v=v+Math.imul(ke,Re)|0,v=v+Math.imul(Te,fe)|0,j=j+Math.imul(Te,Re)|0,g=g+Math.imul(he,Pe)|0,v=v+Math.imul(he,Fe)|0,v=v+Math.imul(Ce,Pe)|0,j=j+Math.imul(Ce,Fe)|0;var oi=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(oi>>>26)|0,oi&=67108863,g=Math.imul(et,U),v=Math.imul(et,Y),v=v+Math.imul(Et,U)|0,j=Math.imul(Et,Y),g=g+Math.imul(Ke,ne)|0,v=v+Math.imul(Ke,De)|0,v=v+Math.imul(It,ne)|0,j=j+Math.imul(It,De)|0,g=g+Math.imul(ze,Ne)|0,v=v+Math.imul(ze,V)|0,v=v+Math.imul(kt,Ne)|0,j=j+Math.imul(kt,V)|0,g=g+Math.imul(Ue,fe)|0,v=v+Math.imul(Ue,Re)|0,v=v+Math.imul(ut,fe)|0,j=j+Math.imul(ut,Re)|0,g=g+Math.imul(ke,Pe)|0,v=v+Math.imul(ke,Fe)|0,v=v+Math.imul(Te,Pe)|0,j=j+Math.imul(Te,Fe)|0;var yn=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(yn>>>26)|0,yn&=67108863,g=Math.imul(et,ne),v=Math.imul(et,De),v=v+Math.imul(Et,ne)|0,j=Math.imul(Et,De),g=g+Math.imul(Ke,Ne)|0,v=v+Math.imul(Ke,V)|0,v=v+Math.imul(It,Ne)|0,j=j+Math.imul(It,V)|0,g=g+Math.imul(ze,fe)|0,v=v+Math.imul(ze,Re)|0,v=v+Math.imul(kt,fe)|0,j=j+Math.imul(kt,Re)|0,g=g+Math.imul(Ue,Pe)|0,v=v+Math.imul(Ue,Fe)|0,v=v+Math.imul(ut,Pe)|0,j=j+Math.imul(ut,Fe)|0;var si=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(si>>>26)|0,si&=67108863,g=Math.imul(et,Ne),v=Math.imul(et,V),v=v+Math.imul(Et,Ne)|0,j=Math.imul(Et,V),g=g+Math.imul(Ke,fe)|0,v=v+Math.imul(Ke,Re)|0,v=v+Math.imul(It,fe)|0,j=j+Math.imul(It,Re)|0,g=g+Math.imul(ze,Pe)|0,v=v+Math.imul(ze,Fe)|0,v=v+Math.imul(kt,Pe)|0,j=j+Math.imul(kt,Fe)|0;var ai=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(ai>>>26)|0,ai&=67108863,g=Math.imul(et,fe),v=Math.imul(et,Re),v=v+Math.imul(Et,fe)|0,j=Math.imul(Et,Re),g=g+Math.imul(Ke,Pe)|0,v=v+Math.imul(Ke,Fe)|0,v=v+Math.imul(It,Pe)|0,j=j+Math.imul(It,Fe)|0;var D=(C+g|0)+((v&8191)<<13)|0;C=(j+(v>>>13)|0)+(D>>>26)|0,D&=67108863,g=Math.imul(et,Pe),v=Math.imul(et,Fe),v=v+Math.imul(Et,Pe)|0,j=Math.imul(Et,Fe);var K=(C+g|0)+((v&8191)<<13)|0;return C=(j+(v>>>13)|0)+(K>>>26)|0,K&=67108863,I[0]=ot,I[1]=Jt,I[2]=Dt,I[3]=Ft,I[4]=sr,I[5]=Er,I[6]=ur,I[7]=Zt,I[8]=wr,I[9]=vn,I[10]=Vr,I[11]=bn,I[12]=ii,I[13]=oi,I[14]=yn,I[15]=si,I[16]=ai,I[17]=D,I[18]=K,C!==0&&(I[19]=C,S.length++),S};Math.imul||(k=P);function F(h,f,m){m.negative=f.negative^h.negative,m.length=h.length+f.length;for(var S=0,T=0,E=0;E<m.length-1;E++){var I=T;T=0;for(var C=S&67108863,g=Math.min(E,f.length-1),v=Math.max(0,E-h.length+1);v<=g;v++){var j=E-v,Q=h.words[j]|0,Z=f.words[v]|0,ce=Q*Z,be=ce&67108863;I=I+(ce/67108864|0)|0,be=be+C|0,C=be&67108863,I=I+(be>>>26)|0,T+=I>>>26,I&=67108863}m.words[E]=C,S=I,I=T}return S!==0?m.words[E]=S:m.length--,m._strip()}function B(h,f,m){return F(h,f,m)}s.prototype.mulTo=function(f,m){var S,T=this.length+f.length;return this.length===10&&f.length===10?S=k(this,f,m):T<63?S=P(this,f,m):T<1024?S=F(this,f,m):S=B(this,f,m),S},s.prototype.mul=function(f){var m=new s(null);return m.words=new Array(this.length+f.length),this.mulTo(f,m)},s.prototype.mulf=function(f){var m=new s(null);return m.words=new Array(this.length+f.length),B(this,f,m)},s.prototype.imul=function(f){return this.clone().mulTo(f,this)},s.prototype.imuln=function(f){var m=f<0;m&&(f=-f),i(typeof f=="number"),i(f<67108864);for(var S=0,T=0;T<this.length;T++){var E=(this.words[T]|0)*f,I=(E&67108863)+(S&67108863);S>>=26,S+=E/67108864|0,S+=I>>>26,this.words[T]=I&67108863}return S!==0&&(this.words[T]=S,this.length++),m?this.ineg():this},s.prototype.muln=function(f){return this.clone().imuln(f)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(f){var m=O(f);if(m.length===0)return new s(1);for(var S=this,T=0;T<m.length&&m[T]===0;T++,S=S.sqr());if(++T<m.length)for(var E=S.sqr();T<m.length;T++,E=E.sqr())m[T]!==0&&(S=S.mul(E));return S},s.prototype.iushln=function(f){i(typeof f=="number"&&f>=0);var m=f%26,S=(f-m)/26,T=67108863>>>26-m<<26-m,E;if(m!==0){var I=0;for(E=0;E<this.length;E++){var C=this.words[E]&T,g=(this.words[E]|0)-C<<m;this.words[E]=g|I,I=C>>>26-m}I&&(this.words[E]=I,this.length++)}if(S!==0){for(E=this.length-1;E>=0;E--)this.words[E+S]=this.words[E];for(E=0;E<S;E++)this.words[E]=0;this.length+=S}return this._strip()},s.prototype.ishln=function(f){return i(this.negative===0),this.iushln(f)},s.prototype.iushrn=function(f,m,S){i(typeof f=="number"&&f>=0);var T;m?T=(m-m%26)/26:T=0;var E=f%26,I=Math.min((f-E)/26,this.length),C=67108863^67108863>>>E<<E,g=S;if(T-=I,T=Math.max(0,T),g){for(var v=0;v<I;v++)g.words[v]=this.words[v];g.length=I}if(I!==0)if(this.length>I)for(this.length-=I,v=0;v<this.length;v++)this.words[v]=this.words[v+I];else this.words[0]=0,this.length=1;var j=0;for(v=this.length-1;v>=0&&(j!==0||v>=T);v--){var Q=this.words[v]|0;this.words[v]=j<<26-E|Q>>>E,j=Q&C}return g&&j!==0&&(g.words[g.length++]=j),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(f,m,S){return i(this.negative===0),this.iushrn(f,m,S)},s.prototype.shln=function(f){return this.clone().ishln(f)},s.prototype.ushln=function(f){return this.clone().iushln(f)},s.prototype.shrn=function(f){return this.clone().ishrn(f)},s.prototype.ushrn=function(f){return this.clone().iushrn(f)},s.prototype.testn=function(f){i(typeof f=="number"&&f>=0);var m=f%26,S=(f-m)/26,T=1<<m;if(this.length<=S)return!1;var E=this.words[S];return!!(E&T)},s.prototype.imaskn=function(f){i(typeof f=="number"&&f>=0);var m=f%26,S=(f-m)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=S)return this;if(m!==0&&S++,this.length=Math.min(S,this.length),m!==0){var T=67108863^67108863>>>m<<m;this.words[this.length-1]&=T}return this._strip()},s.prototype.maskn=function(f){return this.clone().imaskn(f)},s.prototype.iaddn=function(f){return i(typeof f=="number"),i(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},s.prototype._iaddn=function(f){this.words[0]+=f;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(f){if(i(typeof f=="number"),i(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this._strip()},s.prototype.addn=function(f){return this.clone().iaddn(f)},s.prototype.subn=function(f){return this.clone().isubn(f)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(f,m,S){var T=f.length+S,E;this._expand(T);var I,C=0;for(E=0;E<f.length;E++){I=(this.words[E+S]|0)+C;var g=(f.words[E]|0)*m;I-=g&67108863,C=(I>>26)-(g/67108864|0),this.words[E+S]=I&67108863}for(;E<this.length-S;E++)I=(this.words[E+S]|0)+C,C=I>>26,this.words[E+S]=I&67108863;if(C===0)return this._strip();for(i(C===-1),C=0,E=0;E<this.length;E++)I=-(this.words[E]|0)+C,C=I>>26,this.words[E]=I&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(f,m){var S=this.length-f.length,T=this.clone(),E=f,I=E.words[E.length-1]|0,C=this._countBits(I);S=26-C,S!==0&&(E=E.ushln(S),T.iushln(S),I=E.words[E.length-1]|0);var g=T.length-E.length,v;if(m!=="mod"){v=new s(null),v.length=g+1,v.words=new Array(v.length);for(var j=0;j<v.length;j++)v.words[j]=0}var Q=T.clone()._ishlnsubmul(E,1,g);Q.negative===0&&(T=Q,v&&(v.words[g]=1));for(var Z=g-1;Z>=0;Z--){var ce=(T.words[E.length+Z]|0)*67108864+(T.words[E.length+Z-1]|0);for(ce=Math.min(ce/I|0,67108863),T._ishlnsubmul(E,ce,Z);T.negative!==0;)ce--,T.negative=0,T._ishlnsubmul(E,1,Z),T.isZero()||(T.negative^=1);v&&(v.words[Z]=ce)}return v&&v._strip(),T._strip(),m!=="div"&&S!==0&&T.iushrn(S),{div:v||null,mod:T}},s.prototype.divmod=function(f,m,S){if(i(!f.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var T,E,I;return this.negative!==0&&f.negative===0?(I=this.neg().divmod(f,m),m!=="mod"&&(T=I.div.neg()),m!=="div"&&(E=I.mod.neg(),S&&E.negative!==0&&E.iadd(f)),{div:T,mod:E}):this.negative===0&&f.negative!==0?(I=this.divmod(f.neg(),m),m!=="mod"&&(T=I.div.neg()),{div:T,mod:I.mod}):this.negative&f.negative?(I=this.neg().divmod(f.neg(),m),m!=="div"&&(E=I.mod.neg(),S&&E.negative!==0&&E.isub(f)),{div:I.div,mod:E}):f.length>this.length||this.cmp(f)<0?{div:new s(0),mod:this}:f.length===1?m==="div"?{div:this.divn(f.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new s(this.modrn(f.words[0]))}:this._wordDiv(f,m)},s.prototype.div=function(f){return this.divmod(f,"div",!1).div},s.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},s.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},s.prototype.divRound=function(f){var m=this.divmod(f);if(m.mod.isZero())return m.div;var S=m.div.negative!==0?m.mod.isub(f):m.mod,T=f.ushrn(1),E=f.andln(1),I=S.cmp(T);return I<0||E===1&&I===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(f){var m=f<0;m&&(f=-f),i(f<=67108863);for(var S=(1<<26)%f,T=0,E=this.length-1;E>=0;E--)T=(S*T+(this.words[E]|0))%f;return m?-T:T},s.prototype.modn=function(f){return this.modrn(f)},s.prototype.idivn=function(f){var m=f<0;m&&(f=-f),i(f<=67108863);for(var S=0,T=this.length-1;T>=0;T--){var E=(this.words[T]|0)+S*67108864;this.words[T]=E/f|0,S=E%f}return this._strip(),m?this.ineg():this},s.prototype.divn=function(f){return this.clone().idivn(f)},s.prototype.egcd=function(f){i(f.negative===0),i(!f.isZero());var m=this,S=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var T=new s(1),E=new s(0),I=new s(0),C=new s(1),g=0;m.isEven()&&S.isEven();)m.iushrn(1),S.iushrn(1),++g;for(var v=S.clone(),j=m.clone();!m.isZero();){for(var Q=0,Z=1;!(m.words[0]&Z)&&Q<26;++Q,Z<<=1);if(Q>0)for(m.iushrn(Q);Q-- >0;)(T.isOdd()||E.isOdd())&&(T.iadd(v),E.isub(j)),T.iushrn(1),E.iushrn(1);for(var ce=0,be=1;!(S.words[0]&be)&&ce<26;++ce,be<<=1);if(ce>0)for(S.iushrn(ce);ce-- >0;)(I.isOdd()||C.isOdd())&&(I.iadd(v),C.isub(j)),I.iushrn(1),C.iushrn(1);m.cmp(S)>=0?(m.isub(S),T.isub(I),E.isub(C)):(S.isub(m),I.isub(T),C.isub(E))}return{a:I,b:C,gcd:S.iushln(g)}},s.prototype._invmp=function(f){i(f.negative===0),i(!f.isZero());var m=this,S=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var T=new s(1),E=new s(0),I=S.clone();m.cmpn(1)>0&&S.cmpn(1)>0;){for(var C=0,g=1;!(m.words[0]&g)&&C<26;++C,g<<=1);if(C>0)for(m.iushrn(C);C-- >0;)T.isOdd()&&T.iadd(I),T.iushrn(1);for(var v=0,j=1;!(S.words[0]&j)&&v<26;++v,j<<=1);if(v>0)for(S.iushrn(v);v-- >0;)E.isOdd()&&E.iadd(I),E.iushrn(1);m.cmp(S)>=0?(m.isub(S),T.isub(E)):(S.isub(m),E.isub(T))}var Q;return m.cmpn(1)===0?Q=T:Q=E,Q.cmpn(0)<0&&Q.iadd(f),Q},s.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var m=this.clone(),S=f.clone();m.negative=0,S.negative=0;for(var T=0;m.isEven()&&S.isEven();T++)m.iushrn(1),S.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;S.isEven();)S.iushrn(1);var E=m.cmp(S);if(E<0){var I=m;m=S,S=I}else if(E===0||S.cmpn(1)===0)break;m.isub(S)}while(!0);return S.iushln(T)},s.prototype.invm=function(f){return this.egcd(f).a.umod(f)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(f){return this.words[0]&f},s.prototype.bincn=function(f){i(typeof f=="number");var m=f%26,S=(f-m)/26,T=1<<m;if(this.length<=S)return this._expand(S+1),this.words[S]|=T,this;for(var E=T,I=S;E!==0&&I<this.length;I++){var C=this.words[I]|0;C+=E,E=C>>>26,C&=67108863,this.words[I]=C}return E!==0&&(this.words[I]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(f){var m=f<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var S;if(this.length>1)S=1;else{m&&(f=-f),i(f<=67108863,"Number is too big");var T=this.words[0]|0;S=T===f?0:T<f?-1:1}return this.negative!==0?-S|0:S},s.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var m=this.ucmp(f);return this.negative!==0?-m|0:m},s.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var m=0,S=this.length-1;S>=0;S--){var T=this.words[S]|0,E=f.words[S]|0;if(T!==E){T<E?m=-1:T>E&&(m=1);break}}return m},s.prototype.gtn=function(f){return this.cmpn(f)===1},s.prototype.gt=function(f){return this.cmp(f)===1},s.prototype.gten=function(f){return this.cmpn(f)>=0},s.prototype.gte=function(f){return this.cmp(f)>=0},s.prototype.ltn=function(f){return this.cmpn(f)===-1},s.prototype.lt=function(f){return this.cmp(f)===-1},s.prototype.lten=function(f){return this.cmpn(f)<=0},s.prototype.lte=function(f){return this.cmp(f)<=0},s.prototype.eqn=function(f){return this.cmpn(f)===0},s.prototype.eq=function(f){return this.cmp(f)===0},s.red=function(f){return new q(f)},s.prototype.toRed=function(f){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(f){return this.red=f,this},s.prototype.forceRed=function(f){return i(!this.red,"Already a number in reduction context"),this._forceRed(f)},s.prototype.redAdd=function(f){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},s.prototype.redIAdd=function(f){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},s.prototype.redSub=function(f){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},s.prototype.redISub=function(f){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},s.prototype.redShl=function(f){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},s.prototype.redMul=function(f){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},s.prototype.redIMul=function(f){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(f){return i(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var W={k256:null,p224:null,p192:null,p25519:null};function z(h,f){this.name=h,this.p=new s(f,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var f=new s(null);return f.words=new Array(Math.ceil(this.n/13)),f},z.prototype.ireduce=function(f){var m=f,S;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),S=m.bitLength();while(S>this.n);var T=S<this.n?-1:m.ucmp(this.p);return T===0?(m.words[0]=0,m.length=1):T>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},z.prototype.split=function(f,m){f.iushrn(this.n,0,m)},z.prototype.imulK=function(f){return f.imul(this.k)};function G(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(G,z),G.prototype.split=function(f,m){for(var S=4194303,T=Math.min(f.length,9),E=0;E<T;E++)m.words[E]=f.words[E];if(m.length=T,f.length<=9){f.words[0]=0,f.length=1;return}var I=f.words[9];for(m.words[m.length++]=I&S,E=10;E<f.length;E++){var C=f.words[E]|0;f.words[E-10]=(C&S)<<4|I>>>22,I=C}I>>>=22,f.words[E-10]=I,I===0&&f.length>10?f.length-=10:f.length-=9},G.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var m=0,S=0;S<f.length;S++){var T=f.words[S]|0;m+=T*977,f.words[S]=m&67108863,m=T*64+(m/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function re(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(re,z);function oe(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(oe,z);function se(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(se,z),se.prototype.imulK=function(f){for(var m=0,S=0;S<f.length;S++){var T=(f.words[S]|0)*19+m,E=T&67108863;T>>>=26,f.words[S]=E,m=T}return m!==0&&(f.words[f.length++]=m),f},s._prime=function(f){if(W[f])return W[f];var m;if(f==="k256")m=new G;else if(f==="p224")m=new re;else if(f==="p192")m=new oe;else if(f==="p25519")m=new se;else throw new Error("Unknown prime "+f);return W[f]=m,m};function q(h){if(typeof h=="string"){var f=s._prime(h);this.m=f.p,this.prime=f}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}q.prototype._verify1=function(f){i(f.negative===0,"red works only with positives"),i(f.red,"red works only with red numbers")},q.prototype._verify2=function(f,m){i((f.negative|m.negative)===0,"red works only with positives"),i(f.red&&f.red===m.red,"red works only with red numbers")},q.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(d(f,f.umod(this.m)._forceRed(this)),f)},q.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},q.prototype.add=function(f,m){this._verify2(f,m);var S=f.add(m);return S.cmp(this.m)>=0&&S.isub(this.m),S._forceRed(this)},q.prototype.iadd=function(f,m){this._verify2(f,m);var S=f.iadd(m);return S.cmp(this.m)>=0&&S.isub(this.m),S},q.prototype.sub=function(f,m){this._verify2(f,m);var S=f.sub(m);return S.cmpn(0)<0&&S.iadd(this.m),S._forceRed(this)},q.prototype.isub=function(f,m){this._verify2(f,m);var S=f.isub(m);return S.cmpn(0)<0&&S.iadd(this.m),S},q.prototype.shl=function(f,m){return this._verify1(f),this.imod(f.ushln(m))},q.prototype.imul=function(f,m){return this._verify2(f,m),this.imod(f.imul(m))},q.prototype.mul=function(f,m){return this._verify2(f,m),this.imod(f.mul(m))},q.prototype.isqr=function(f){return this.imul(f,f.clone())},q.prototype.sqr=function(f){return this.mul(f,f)},q.prototype.sqrt=function(f){if(f.isZero())return f.clone();var m=this.m.andln(3);if(i(m%2===1),m===3){var S=this.m.add(new s(1)).iushrn(2);return this.pow(f,S)}for(var T=this.m.subn(1),E=0;!T.isZero()&&T.andln(1)===0;)E++,T.iushrn(1);i(!T.isZero());var I=new s(1).toRed(this),C=I.redNeg(),g=this.m.subn(1).iushrn(1),v=this.m.bitLength();for(v=new s(2*v*v).toRed(this);this.pow(v,g).cmp(C)!==0;)v.redIAdd(C);for(var j=this.pow(v,T),Q=this.pow(f,T.addn(1).iushrn(1)),Z=this.pow(f,T),ce=E;Z.cmp(I)!==0;){for(var be=Z,xe=0;be.cmp(I)!==0;xe++)be=be.redSqr();i(xe<ce);var pe=this.pow(j,new s(1).iushln(ce-xe-1));Q=Q.redMul(pe),j=pe.redSqr(),Z=Z.redMul(j),ce=xe}return Q},q.prototype.invm=function(f){var m=f._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},q.prototype.pow=function(f,m){if(m.isZero())return new s(1).toRed(this);if(m.cmpn(1)===0)return f.clone();var S=4,T=new Array(1<<S);T[0]=new s(1).toRed(this),T[1]=f;for(var E=2;E<T.length;E++)T[E]=this.mul(T[E-1],f);var I=T[0],C=0,g=0,v=m.bitLength()%26;for(v===0&&(v=26),E=m.length-1;E>=0;E--){for(var j=m.words[E],Q=v-1;Q>=0;Q--){var Z=j>>Q&1;if(I!==T[0]&&(I=this.sqr(I)),Z===0&&C===0){g=0;continue}C<<=1,C|=Z,g++,!(g!==S&&(E!==0||Q!==0))&&(I=this.mul(I,T[C]),g=0,C=0)}v=26}return I},q.prototype.convertTo=function(f){var m=f.umod(this.m);return m===f?m.clone():m},q.prototype.convertFrom=function(f){var m=f.clone();return m.red=null,m},s.mont=function(f){return new L(f)};function L(h){q.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}o(L,q),L.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},L.prototype.convertFrom=function(f){var m=this.imod(f.mul(this.rinv));return m.red=null,m},L.prototype.imul=function(f,m){if(f.isZero()||m.isZero())return f.words[0]=0,f.length=1,f;var S=f.imul(m),T=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=S.isub(T).iushrn(this.shift),I=E;return E.cmp(this.m)>=0?I=E.isub(this.m):E.cmpn(0)<0&&(I=E.iadd(this.m)),I._forceRed(this)},L.prototype.mul=function(f,m){if(f.isZero()||m.isZero())return new s(0)._forceRed(this);var S=f.mul(m),T=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=S.isub(T).iushrn(this.shift),I=E;return E.cmp(this.m)>=0?I=E.isub(this.m):E.cmpn(0)<0&&(I=E.iadd(this.m)),I._forceRed(this)},L.prototype.invm=function(f){var m=this.imod(f._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(typeof t>"u"||t,e)}}),is=9e15,no=1e9,kf="0123456789abcdef",Uc="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Fc="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",jf={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-is,maxE:is,crypto:!1},Nv,wi,st=!0,Cl="[DecimalError] ",Yi=Cl+"Invalid argument: ",kv=Cl+"Precision limit exceeded",jv=Cl+"crypto unavailable",Dv="[object Decimal]",jr=Math.floor,gr=Math.pow,J7=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Z7=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Q7=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Lv=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,On=1e7,Ye=7,e9=9007199254740991,t9=Uc.length-1,Df=Fc.length-1,ge={toStringTag:Dv};ge.absoluteValue=ge.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),He(e)};ge.ceil=function(){return He(new this.constructor(this),this.e+1,2)};ge.clampedTo=ge.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Yi+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};ge.comparedTo=ge.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,c=o.s,l=e.s;if(!s||!a)return!c||!l?NaN:c!==l?c:s===a?0:!s^c<0?1:-1;if(!s[0]||!a[0])return s[0]?c:a[0]?-l:0;if(c!==l)return c;if(o.e!==e.e)return o.e>e.e^c<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};ge.cosine=ge.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ye,n.rounding=1,r=r9(n,Vv(n,r)),n.precision=e,n.rounding=t,He(wi==2||wi==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};ge.cubeRoot=ge.cbrt=function(){var e,t,r,n,i,o,s,a,c,l,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(st=!1,o=u.s*gr(u.s*u,1/3),!o||Math.abs(o)==1/0?(r=Mr(u.d),e=u.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=gr(r,1/3),e=jr((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new d(r),n.s=u.s):n=new d(o.toString()),s=(e=d.precision)+3;;)if(a=n,c=a.times(a).times(a),l=c.plus(u),n=Gt(l.plus(u).times(a),l.plus(c),s+2,1),Mr(a.d).slice(0,s)===(r=Mr(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(He(a,e+1,0),a.times(a).times(a).eq(u))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(He(n,e+1,1),t=!n.times(n).times(n).eq(u));break}return st=!0,He(n,e,d.rounding,t)};ge.decimalPlaces=ge.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-jr(this.e/Ye))*Ye,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};ge.dividedBy=ge.div=function(e){return Gt(this,new this.constructor(e))};ge.dividedToIntegerBy=ge.divToInt=function(e){var t=this,r=t.constructor;return He(Gt(t,new r(e),0,1,1),r.precision,r.rounding)};ge.equals=ge.eq=function(e){return this.cmp(e)===0};ge.floor=function(){return He(new this.constructor(this),this.e+1,3)};ge.greaterThan=ge.gt=function(e){return this.cmp(e)>0};ge.greaterThanOrEqualTo=ge.gte=function(e){var t=this.cmp(e);return t==1||t===0};ge.hyperbolicCosine=ge.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Al(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=gs(s,1,o.times(t),new s(1),!0);for(var c,l=e,u=new s(8);l--;)c=o.times(o),o=a.minus(c.times(u.minus(c.times(u))));return He(o,s.precision=r,s.rounding=n,!0)};ge.hyperbolicSine=ge.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=gs(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Al(5,e)),i=gs(o,2,i,i,!0);for(var s,a=new o(5),c=new o(16),l=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(c.times(s).plus(l))))}return o.precision=t,o.rounding=r,He(i,t,r,!0)};ge.hyperbolicTangent=ge.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,Gt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};ge.inverseCosine=ge.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?An(r,i,o):new r(0):new r(NaN):t.isZero()?An(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=An(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};ge.inverseHyperbolicCosine=ge.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,st=!1,r=r.times(r).minus(1).sqrt().plus(r),st=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};ge.inverseHyperbolicSine=ge.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,st=!1,r=r.times(r).plus(1).sqrt().plus(r),st=!0,n.precision=e,n.rounding=t,r.ln())};ge.inverseHyperbolicTangent=ge.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?He(new o(i),e,t,!0):(o.precision=r=n-i.e,i=Gt(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};ge.inverseSine=ge.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=An(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};ge.inverseTangent=ge.atan=function(){var e,t,r,n,i,o,s,a,c,l=this,u=l.constructor,d=u.precision,p=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&d+4<=Df)return s=An(u,d+4,p).times(.25),s.s=l.s,s}else{if(!l.s)return new u(NaN);if(d+4<=Df)return s=An(u,d+4,p).times(.5),s.s=l.s,s}for(u.precision=a=d+10,u.rounding=1,r=Math.min(28,a/Ye+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(st=!1,t=Math.ceil(a/Ye),n=1,c=l.times(l),s=new u(l),i=l;e!==-1;)if(i=i.times(c),o=s.minus(i.div(n+=2)),i=i.times(c),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),st=!0,He(s,u.precision=d,u.rounding=p,!0)};ge.isFinite=function(){return!!this.d};ge.isInteger=ge.isInt=function(){return!!this.d&&jr(this.e/Ye)>this.d.length-2};ge.isNaN=function(){return!this.s};ge.isNegative=ge.isNeg=function(){return this.s<0};ge.isPositive=ge.isPos=function(){return this.s>0};ge.isZero=function(){return!!this.d&&this.d[0]===0};ge.lessThan=ge.lt=function(e){return this.cmp(e)<0};ge.lessThanOrEqualTo=ge.lte=function(e){return this.cmp(e)<1};ge.logarithm=ge.log=function(e){var t,r,n,i,o,s,a,c,l=this,u=l.constructor,d=u.precision,p=u.rounding,y=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new u(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(st=!1,a=d+y,s=qi(l,a),n=t?$c(u,a+10):qi(e,a),c=Gt(s,n,a,1),ha(c.d,i=d,p))do if(a+=10,s=qi(l,a),n=t?$c(u,a+10):qi(e,a),c=Gt(s,n,a,1),!o){+Mr(c.d).slice(i+1,i+15)+1==1e14&&(c=He(c,d+1,0));break}while(ha(c.d,i+=10,p));return st=!0,He(c,d,p)};ge.minus=ge.sub=function(e){var t,r,n,i,o,s,a,c,l,u,d,p,y=this,x=y.constructor;if(e=new x(e),!y.d||!e.d)return!y.s||!e.s?e=new x(NaN):y.d?e.s=-e.s:e=new x(e.d||y.s!==e.s?y:NaN),e;if(y.s!=e.s)return e.s=-e.s,y.plus(e);if(l=y.d,p=e.d,a=x.precision,c=x.rounding,!l[0]||!p[0]){if(p[0])e.s=-e.s;else if(l[0])e=new x(y);else return new x(c===3?-0:0);return st?He(e,a,c):e}if(r=jr(e.e/Ye),u=jr(y.e/Ye),l=l.slice(),o=u-r,o){for(d=o<0,d?(t=l,o=-o,s=p.length):(t=p,r=u,s=l.length),n=Math.max(Math.ceil(a/Ye),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=p.length,d=n<s,d&&(s=n),n=0;n<s;n++)if(l[n]!=p[n]){d=l[n]<p[n];break}o=0}for(d&&(t=l,l=p,p=t,e.s=-e.s),s=l.length,n=p.length-s;n>0;--n)l[s++]=0;for(n=p.length;n>o;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=On-1;--l[i],l[n]+=On}l[n]-=p[n]}for(;l[--s]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=Tl(l,r),st?He(e,a,c):e):new x(c===3?-0:0)};ge.modulo=ge.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?He(new n(r),n.precision,n.rounding):(st=!1,n.modulo==9?(t=Gt(r,e.abs(),0,3,1),t.s*=e.s):t=Gt(r,e,0,n.modulo,1),t=t.times(e),st=!0,r.minus(t))};ge.naturalExponential=ge.exp=function(){return Lf(this)};ge.naturalLogarithm=ge.ln=function(){return qi(this)};ge.negated=ge.neg=function(){var e=new this.constructor(this);return e.s=-e.s,He(e)};ge.plus=ge.add=function(e){var t,r,n,i,o,s,a,c,l,u,d=this,p=d.constructor;if(e=new p(e),!d.d||!e.d)return!d.s||!e.s?e=new p(NaN):d.d||(e=new p(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(l=d.d,u=e.d,a=p.precision,c=p.rounding,!l[0]||!u[0])return u[0]||(e=new p(d)),st?He(e,a,c):e;if(o=jr(d.e/Ye),n=jr(e.e/Ye),l=l.slice(),i=o-n,i){for(i<0?(r=l,i=-i,s=u.length):(r=u,n=o,s=l.length),o=Math.ceil(a/Ye),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=u.length,s-i<0&&(i=s,r=u,u=l,l=r),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/On|0,l[i]%=On;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=Tl(l,n),st?He(e,a,c):e};ge.precision=ge.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Yi+e);return r.d?(t=Bv(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};ge.round=function(){var e=this,t=e.constructor;return He(new t(e),e.e+1,t.rounding)};ge.sine=ge.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Ye,n.rounding=1,r=i9(n,Vv(n,r)),n.precision=e,n.rounding=t,He(wi>2?r.neg():r,e,t,!0)):new n(NaN)};ge.squareRoot=ge.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,c=s.e,l=s.s,u=s.constructor;if(l!==1||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(st=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=Mr(a),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=jr((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new u(t)):n=new u(l.toString()),r=(c=u.precision)+3;;)if(o=n,n=o.plus(Gt(s,o,r+2,1)).times(.5),Mr(o.d).slice(0,r)===(t=Mr(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(He(o,c+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(He(n,c+1,1),e=!n.times(n).eq(s));break}return st=!0,He(n,c,u.rounding,e)};ge.tangent=ge.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=Gt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,He(wi==2||wi==4?r.neg():r,e,t,!0)):new n(NaN)};ge.times=ge.mul=function(e){var t,r,n,i,o,s,a,c,l,u=this,d=u.constructor,p=u.d,y=(e=new d(e)).d;if(e.s*=u.s,!p||!p[0]||!y||!y[0])return new d(!e.s||p&&!p[0]&&!y||y&&!y[0]&&!p?NaN:!p||!y?e.s/0:e.s*0);for(r=jr(u.e/Ye)+jr(e.e/Ye),c=p.length,l=y.length,c<l&&(o=p,p=y,y=o,s=c,c=l,l=s),o=[],s=c+l,n=s;n--;)o.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)a=o[i]+y[n]*p[i-n-1]+t,o[i--]=a%On|0,t=a/On|0;o[i]=(o[i]+t)%On|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Tl(o,r),st?He(e,d.precision,d.rounding):e};ge.toBinary=function(e,t){return t0(this,2,e,t)};ge.toDecimalPlaces=ge.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Hr(e,0,no),t===void 0?t=n.rounding:Hr(t,0,8),He(r,e+r.e+1,t))};ge.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Jn(n,!0):(Hr(e,0,no),t===void 0?t=i.rounding:Hr(t,0,8),n=He(new i(n),e+1,t),r=Jn(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};ge.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Jn(i):(Hr(e,0,no),t===void 0?t=o.rounding:Hr(t,0,8),n=He(new o(i),e+i.e+1,t),r=Jn(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};ge.toFraction=function(e){var t,r,n,i,o,s,a,c,l,u,d,p,y=this,x=y.d,b=y.constructor;if(!x)return new b(y);if(l=r=new b(1),n=c=new b(0),t=new b(n),o=t.e=Bv(x)-y.e-1,s=o%Ye,t.d[0]=gr(10,s<0?Ye+s:s),e==null)e=o>0?t:l;else{if(a=new b(e),!a.isInt()||a.lt(l))throw Error(Yi+a);e=a.gt(t)?o>0?t:l:a}for(st=!1,a=new b(Mr(x)),u=b.precision,b.precision=o=x.length*Ye*2;d=Gt(a,t,0,1,1),i=r.plus(d.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(d.times(i)),c=i,i=t,t=a.minus(d.times(i)),a=i;return i=Gt(e.minus(r),n,0,1,1),c=c.plus(i.times(l)),r=r.plus(i.times(n)),c.s=l.s=y.s,p=Gt(l,n,o,1).minus(y).abs().cmp(Gt(c,r,o,1).minus(y).abs())<1?[l,n]:[c,r],b.precision=u,st=!0,p};ge.toHexadecimal=ge.toHex=function(e,t){return t0(this,16,e,t)};ge.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:Hr(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(st=!1,r=Gt(r,e,0,t,1).times(e),st=!0,He(r)):(e.s=r.s,r=e),r};ge.toNumber=function(){return+this};ge.toOctal=function(e,t){return t0(this,8,e,t)};ge.toPower=ge.pow=function(e){var t,r,n,i,o,s,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(gr(+a,l));if(a=new c(a),a.eq(1))return a;if(n=c.precision,o=c.rounding,e.eq(1))return He(a,n,o);if(t=jr(e.e/Ye),t>=e.d.length-1&&(r=l<0?-l:l)<=e9)return i=Uv(c,a,r,n),e.s<0?new c(1).div(i):He(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=gr(+a,l),t=r==0||!isFinite(r)?jr(l*(Math.log("0."+Mr(a.d))/Math.LN10+a.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?s/0:0):(st=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Lf(e.times(qi(a,n+r)),n),i.d&&(i=He(i,n+5,1),ha(i.d,n,o)&&(t=n+10,i=He(Lf(e.times(qi(a,t+r)),t),t+5,1),+Mr(i.d).slice(n+1,n+15)+1==1e14&&(i=He(i,n+1,0)))),i.s=s,st=!0,c.rounding=o,He(i,n,o))};ge.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Jn(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Hr(e,1,no),t===void 0?t=i.rounding:Hr(t,0,8),n=He(new i(n),e,t),r=Jn(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};ge.toSignificantDigits=ge.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Hr(e,1,no),t===void 0?t=n.rounding:Hr(t,0,8)),He(new n(r),e,t)};ge.toString=function(){var e=this,t=e.constructor,r=Jn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};ge.truncated=ge.trunc=function(){return He(new this.constructor(this),this.e+1,1)};ge.valueOf=ge.toJSON=function(){var e=this,t=e.constructor,r=Jn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Mr(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=Ye-n.length,r&&(o+=Fi(r)),o+=n;s=e[t],n=s+"",r=Ye-n.length,r&&(o+=Fi(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function Hr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Yi+e)}function ha(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=Ye,i=0):(i=Math.ceil((t+1)/Ye),t%=Ye),o=gr(10,Ye-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==gr(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==gr(10,t-3)-1,s}function mc(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=kf.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function r9(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Al(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=gs(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var Gt=function(){function e(n,i,o){var s,a=0,c=n.length;for(n=n.slice();c--;)s=n[c]*i+a,n[c]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,c;if(o!=s)c=o>s?1:-1;else for(a=c=0;a<o;a++)if(n[a]!=i[a]){c=n[a]>i[a]?1:-1;break}return c}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<i[o]?1:0,n[o]=a*s+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s,a,c){var l,u,d,p,y,x,b,M,O,P,k,F,B,W,z,G,re,oe,se,q,L=n.constructor,h=n.s==i.s?1:-1,f=n.d,m=i.d;if(!f||!f[0]||!m||!m[0])return new L(!n.s||!i.s||(f?m&&f[0]==m[0]:!m)?NaN:f&&f[0]==0||!m?h*0:h/0);for(c?(y=1,u=n.e-i.e):(c=On,y=Ye,u=jr(n.e/y)-jr(i.e/y)),se=m.length,re=f.length,O=new L(h),P=O.d=[],d=0;m[d]==(f[d]||0);d++);if(m[d]>(f[d]||0)&&u--,o==null?(W=o=L.precision,s=L.rounding):a?W=o+(n.e-i.e)+1:W=o,W<0)P.push(1),x=!0;else{if(W=W/y+2|0,d=0,se==1){for(p=0,m=m[0],W++;(d<re||p)&&W--;d++)z=p*c+(f[d]||0),P[d]=z/m|0,p=z%m|0;x=p||d<re}else{for(p=c/(m[0]+1)|0,p>1&&(m=e(m,p,c),f=e(f,p,c),se=m.length,re=f.length),G=se,k=f.slice(0,se),F=k.length;F<se;)k[F++]=0;q=m.slice(),q.unshift(0),oe=m[0],m[1]>=c/2&&++oe;do p=0,l=t(m,k,se,F),l<0?(B=k[0],se!=F&&(B=B*c+(k[1]||0)),p=B/oe|0,p>1?(p>=c&&(p=c-1),b=e(m,p,c),M=b.length,F=k.length,l=t(b,k,M,F),l==1&&(p--,r(b,se<M?q:m,M,c))):(p==0&&(l=p=1),b=m.slice()),M=b.length,M<F&&b.unshift(0),r(k,b,F,c),l==-1&&(F=k.length,l=t(m,k,se,F),l<1&&(p++,r(k,se<F?q:m,F,c))),F=k.length):l===0&&(p++,k=[0]),P[d++]=p,l&&k[0]?k[F++]=f[G]||0:(k=[f[G]],F=1);while((G++<re||k[0]!==void 0)&&W--);x=k[0]!==void 0}P[0]||P.shift()}if(y==1)O.e=u,Nv=x;else{for(d=1,p=P[0];p>=10;p/=10)d++;O.e=d+u*y-1,He(O,a?o+O.e+1:o,s,x)}return O}}();function He(e,t,r,n){var i,o,s,a,c,l,u,d,p,y=e.constructor;e:if(t!=null){if(d=e.d,!d)return e;for(i=1,a=d[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=Ye,s=t,u=d[p=0],c=u/gr(10,i-s-1)%10|0;else if(p=Math.ceil((o+1)/Ye),a=d.length,p>=a)if(n){for(;a++<=p;)d.push(0);u=c=0,i=1,o%=Ye,s=o-Ye+1}else break e;else{for(u=a=d[p],i=1;a>=10;a/=10)i++;o%=Ye,s=o-Ye+i,c=s<0?0:u/gr(10,i-s-1)%10|0}if(n=n||t<0||d[p+1]!==void 0||(s<0?u:u%gr(10,i-s-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(o>0?s>0?u/gr(10,i-s):0:d[p-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=gr(10,(Ye-t%Ye)%Ye),e.e=-t||0):d[0]=e.e=0,e;if(o==0?(d.length=p,a=1,p--):(d.length=p+1,a=gr(10,Ye-o),d[p]=s>0?(u/gr(10,i-s)%gr(10,s)|0)*a:0),l)for(;;)if(p==0){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,d[0]==On&&(d[0]=1));break}else{if(d[p]+=a,d[p]!=On)break;d[p--]=0,a=1}for(o=d.length;d[--o]===0;)d.pop()}return st&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e<y.minE&&(e.e=0,e.d=[0])),e}function Jn(e,t,r){if(!e.isFinite())return $v(e);var n,i=e.e,o=Mr(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+Fi(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Fi(-i-1)+o,r&&(n=r-s)>0&&(o+=Fi(n))):i>=s?(o+=Fi(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Fi(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=Fi(n))),o}function Tl(e,t){var r=e[0];for(t*=Ye;r>=10;r/=10)t++;return t}function $c(e,t,r){if(t>t9)throw st=!0,r&&(e.precision=r),Error(kv);return He(new e(Uc),t,1,!0)}function An(e,t,r){if(t>Df)throw Error(kv);return He(new e(Fc),t,r,!0)}function Bv(e){var t=e.length-1,r=t*Ye+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Fi(e){for(var t="";e--;)t+="0";return t}function Uv(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/Ye+4);for(st=!1;;){if(r%2&&(o=o.times(t),Zh(o.d,s)&&(i=!0)),r=jr(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),Zh(t.d,s)}return st=!0,o}function Jh(e){return e.d[e.d.length-1]&1}function Fv(e,t,r){for(var n,i=new e(t[0]),o=0;++o<t.length;)if(n=new e(t[o]),n.s)i[r](n)&&(i=n);else{i=n;break}return i}function Lf(e,t){var r,n,i,o,s,a,c,l=0,u=0,d=0,p=e.constructor,y=p.rounding,x=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(st=!1,c=x):c=t,a=new p(.03125);e.e>-2;)e=e.times(a),d+=5;for(n=Math.log(gr(2,d))/Math.LN10*2+5|0,c+=n,r=o=s=new p(1),p.precision=c;;){if(o=He(o.times(e),c,1),r=r.times(++u),a=s.plus(Gt(o,r,c,1)),Mr(a.d).slice(0,c)===Mr(s.d).slice(0,c)){for(i=d;i--;)s=He(s.times(s),c,1);if(t==null)if(l<3&&ha(s.d,c-n,y,l))p.precision=c+=10,r=o=a=new p(1),u=0,l++;else return He(s,p.precision=x,y,st=!0);else return p.precision=x,s}s=a}}function qi(e,t){var r,n,i,o,s,a,c,l,u,d,p,y=1,x=10,b=e,M=b.d,O=b.constructor,P=O.rounding,k=O.precision;if(b.s<0||!M||!M[0]||!b.e&&M[0]==1&&M.length==1)return new O(M&&!M[0]?-1/0:b.s!=1?NaN:M?0:b);if(t==null?(st=!1,u=k):u=t,O.precision=u+=x,r=Mr(M),n=r.charAt(0),Math.abs(o=b.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)b=b.times(e),r=Mr(b.d),n=r.charAt(0),y++;o=b.e,n>1?(b=new O("0."+r),o++):b=new O(n+"."+r.slice(1))}else return l=$c(O,u+2,k).times(o+""),b=qi(new O(n+"."+r.slice(1)),u-x).plus(l),O.precision=k,t==null?He(b,k,P,st=!0):b;for(d=b,c=s=b=Gt(b.minus(1),b.plus(1),u,1),p=He(b.times(b),u,1),i=3;;){if(s=He(s.times(p),u,1),l=c.plus(Gt(s,new O(i),u,1)),Mr(l.d).slice(0,u)===Mr(c.d).slice(0,u))if(c=c.times(2),o!==0&&(c=c.plus($c(O,u+2,k).times(o+""))),c=Gt(c,new O(y),u,1),t==null)if(ha(c.d,u-x,P,a))O.precision=u+=x,l=s=b=Gt(d.minus(1),d.plus(1),u,1),p=He(b.times(b),u,1),i=a=1;else return He(c,O.precision=k,P,st=!0);else return O.precision=k,c;c=l,i+=2}}function $v(e){return String(e.s*e.s/0)}function Bf(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%Ye,r<0&&(n+=Ye),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=Ye;n<i;)e.d.push(+t.slice(n,n+=Ye));t=t.slice(n),n=Ye-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),st&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function n9(e,t){var r,n,i,o,s,a,c,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Lv.test(t))return Bf(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Z7.test(t))r=16,t=t.toLowerCase();else if(J7.test(t))r=2;else if(Q7.test(t))r=8;else throw Error(Yi+t);for(o=t.search(/p/i),o>0?(c=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Uv(n,new n(r),o,o*2)),l=mc(t,r,On),u=l.length-1,o=u;l[o]===0;--o)l.pop();return o<0?new n(e.s*0):(e.e=Tl(l,u),e.d=l,st=!1,s&&(e=Gt(e,i,a*4)),c&&(e=e.times(Math.abs(c)<54?gr(2,c):Na.pow(2,c))),st=!0,e)}function i9(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:gs(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Al(5,r)),t=gs(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function gs(e,t,r,n,i){var o,s,a,c,l=e.precision,u=Math.ceil(l/Ye);for(st=!1,c=r.times(r),a=new e(n);;){if(s=Gt(a.times(c),new e(t++*t++),l,1),a=i?n.plus(s):n.minus(s),n=Gt(s.times(c),new e(t++*t++),l,1),s=a.plus(n),s.d[u]!==void 0){for(o=u;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o}return st=!0,s.d.length=u+1,s}function Al(e,t){for(var r=e;--t;)r*=e;return r}function Vv(e,t){var r,n=t.s<0,i=An(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return wi=n?4:1,t;if(r=t.divToInt(i),r.isZero())wi=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return wi=Jh(r)?n?2:3:n?4:1,t;wi=Jh(r)?n?1:4:n?3:2}return t.minus(i).abs()}function t0(e,t,r,n){var i,o,s,a,c,l,u,d,p,y=e.constructor,x=r!==void 0;if(x?(Hr(r,1,no),n===void 0?n=y.rounding:Hr(n,0,8)):(r=y.precision,n=y.rounding),!e.isFinite())u=$v(e);else{for(u=Jn(e),s=u.indexOf("."),x?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(u=u.replace(".",""),p=new y(1),p.e=u.length-s,p.d=mc(Jn(p),10,i),p.e=p.d.length),d=mc(u,10,i),o=c=d.length;d[--c]==0;)d.pop();if(!d[0])u=x?"0p+0":"0";else{if(s<0?o--:(e=new y(e),e.d=d,e.e=o,e=Gt(e,p,r,n,0,i),d=e.d,o=e.e,l=Nv),s=d[r],a=i/2,l=l||d[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&d[r-1]&1||n===(e.s<0?8:7)),d.length=r,l)for(;++d[--r]>i-1;)d[r]=0,r||(++o,d.unshift(1));for(c=d.length;!d[c-1];--c);for(s=0,u="";s<c;s++)u+=kf.charAt(d[s]);if(x){if(c>1)if(t==16||t==8){for(s=t==16?4:3,--c;c%s;c++)u+="0";for(d=mc(u,i,t),c=d.length;!d[c-1];--c);for(s=1,u="1.";s<c;s++)u+=kf.charAt(d[s])}else u=u.charAt(0)+"."+u.slice(1);u=u+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)u="0"+u;u="0."+u}else if(++o>c)for(o-=c;o--;)u+="0";else o<c&&(u=u.slice(0,o)+"."+u.slice(o))}u=(t==16?"0x":t==2?"0b":t==8?"0o":"")+u}return e.s<0?"-"+u:u}function Zh(e,t){if(e.length>t)return e.length=t,!0}function o9(e){return new this(e).abs()}function s9(e){return new this(e).acos()}function a9(e){return new this(e).acosh()}function c9(e,t){return new this(e).plus(t)}function l9(e){return new this(e).asin()}function u9(e){return new this(e).asinh()}function f9(e){return new this(e).atan()}function d9(e){return new this(e).atanh()}function h9(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=An(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?An(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=An(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(Gt(e,t,o,1)),t=An(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(Gt(e,t,o,1)),r}function p9(e){return new this(e).cbrt()}function m9(e){return He(e=new this(e),e.e+1,2)}function g9(e,t,r){return new this(e).clamp(t,r)}function v9(e){if(!e||typeof e!="object")throw Error(Cl+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,no,"rounding",0,8,"toExpNeg",-is,0,"toExpPos",0,is,"maxE",0,is,"minE",-is,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=jf[r]),(n=e[r])!==void 0)if(jr(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Yi+r+": "+n);if(r="crypto",i&&(this[r]=jf[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(jv);else this[r]=!1;else throw Error(Yi+r+": "+n);return this}function b9(e){return new this(e).cos()}function y9(e){return new this(e).cosh()}function zv(e){var t,r,n;function i(o){var s,a,c,l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,Qh(o)){l.s=o.s,st?!o.d||o.e>i.maxE?(l.e=NaN,l.d=null):o.e<i.minE?(l.e=0,l.d=[0]):(l.e=o.e,l.d=o.d.slice()):(l.e=o.e,l.d=o.d?o.d.slice():o.d);return}if(c=typeof o,c==="number"){if(o===0){l.s=1/o<0?-1:1,l.e=0,l.d=[0];return}if(o<0?(o=-o,l.s=-1):l.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;st?s>i.maxE?(l.e=NaN,l.d=null):s<i.minE?(l.e=0,l.d=[0]):(l.e=s,l.d=[o]):(l.e=s,l.d=[o]);return}else if(o*0!==0){o||(l.s=NaN),l.e=NaN,l.d=null;return}return Bf(l,o.toString())}else if(c!=="string")throw Error(Yi+o);return(a=o.charCodeAt(0))===45?(o=o.slice(1),l.s=-1):(a===43&&(o=o.slice(1)),l.s=1),Lv.test(o)?Bf(l,o):n9(l,o)}if(i.prototype=ge,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=v9,i.clone=zv,i.isDecimal=Qh,i.abs=o9,i.acos=s9,i.acosh=a9,i.add=c9,i.asin=l9,i.asinh=u9,i.atan=f9,i.atanh=d9,i.atan2=h9,i.cbrt=p9,i.ceil=m9,i.clamp=g9,i.cos=b9,i.cosh=y9,i.div=w9,i.exp=x9,i.floor=S9,i.hypot=_9,i.ln=E9,i.log=C9,i.log10=A9,i.log2=T9,i.max=M9,i.min=I9,i.mod=O9,i.mul=R9,i.pow=P9,i.random=N9,i.round=k9,i.sign=j9,i.sin=D9,i.sinh=L9,i.sqrt=B9,i.sub=U9,i.sum=F9,i.tan=$9,i.tanh=V9,i.trunc=z9,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function w9(e,t){return new this(e).div(t)}function x9(e){return new this(e).exp()}function S9(e){return He(e=new this(e),e.e+1,3)}function _9(){var e,t,r=new this(0);for(st=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return st=!0,new this(1/0);r=t}return st=!0,r.sqrt()}function Qh(e){return e instanceof Na||e&&e.toStringTag===Dv||!1}function E9(e){return new this(e).ln()}function C9(e,t){return new this(e).log(t)}function T9(e){return new this(e).log(2)}function A9(e){return new this(e).log(10)}function M9(){return Fv(this,arguments,"lt")}function I9(){return Fv(this,arguments,"gt")}function O9(e,t){return new this(e).mod(t)}function R9(e,t){return new this(e).mul(t)}function P9(e,t){return new this(e).pow(t)}function N9(e){var t,r,n,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:Hr(e,1,no),n=Math.ceil(e/Ye),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(jv);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],e%=Ye,n&&e&&(i=gr(10,Ye-e),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=Ye)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<Ye&&(r-=Ye-n)}return s.e=r,s.d=a,s}function k9(e){return He(e=new this(e),e.e+1,this.rounding)}function j9(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function D9(e){return new this(e).sin()}function L9(e){return new this(e).sinh()}function B9(e){return new this(e).sqrt()}function U9(e,t){return new this(e).sub(t)}function F9(){var e=0,t=arguments,r=new this(t[e]);for(st=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return st=!0,He(r,this.precision,this.rounding)}function $9(e){return new this(e).tan()}function V9(e){return new this(e).tanh()}function z9(e){return He(e=new this(e),e.e+1,1)}ge[Symbol.for("nodejs.util.inspect.custom")]=ge.toString;ge[Symbol.toStringTag]="Decimal";var Na=ge.constructor=zv(jf);Uc=new Na(Uc);Fc=new Na(Fc);var gc=Na,Ht=Uo(Fo()),Du=Uo(Fo()),q9=class{constructor(e){if(e!==0)throw new Error("Aftermath only supported on mainnet");this.slippage="900000000000000000",this.poolRegistry="0xfcc774493db2c45c79f688f88d28023a3e7d98e4ee9f48bbf5c7990f651577ae",this.protocolFeeVault="0xf194d9b1bcad972e45a7dd67dd49b3ee1e3357a00a50850c52cd51bb450e13b4",this.treasury="0x28e499dff5e864a2eafe476269a4f5035f1c16f338da7be18b103499abf271ce",this.insuranceFund="0xf0c40d67b078000e18032334c3325c47b9ec9f3d9ae4128be820d54663d14e3b",this.referrealVault="0x35d35b0e5b177593d8c3a801462485572fc30861e6ce96a55af6dc4730709278"}amountLimit(e){return new Du.default(e).mul(new Du.default(this.slippage)).div(new Du.default("1000000000000000000")).toString()}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s];if(r.extendedDetails==null)throw new Error("Extended details not supported");if(r.extendedDetails.aftermathLpSupplyType==null)throw new Error("LP supply type not supported");const d=[t.object(r.id),t.object(this.poolRegistry),t.object(this.protocolFeeVault),t.object(this.treasury),t.object(this.insuranceFund),t.object(this.referrealVault),t.pure.u64(this.amountLimit(r.amountOut)),t.pure.u64(this.slippage),n],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::aftermath::${c}`,typeArguments:[l,u,r.extendedDetails.aftermathLpSupplyType],arguments:d})})}},ep="0x000000000000000000000000000000000000000000000000000000000000dee9",H9=class{constructor(e){if(e!==0)throw new Error("Aftermath only supported on mainnet")}getAccountCap(e,t){return ct(this,null,function*(){let r=50,n=null;for(;;){const i=e.getOwnedObjects({owner:t,cursor:n,limit:r,filter:{MoveModule:{package:ep,module:"custodian_v2"}}});if(i!=null&&i.data!=null){if(i.data.length!==0)return i.data[0].data.objectId;if(i.data.length<50)break}else break}return null})}getOrCreateAccountCap(e,t,r){return ct(this,null,function*(){let n=yield this.getAccountCap(t,r);return n!==null?{accountCap:e.object(n),isCreate:!1}:{accountCap:e.moveCall({target:`${ep}::clob_v2::create_account`,typeArguments:[],arguments:[]}),isCreate:!0}})}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=yield this.getOrCreateAccountCap(t,e.client,e.signer),p=[t.object(r.id),n,d.accountCap,t.object(_r)],y=xr(e.publishedAtV2(),i),x=t.moveCall({target:`${y}::deepbook::${c}`,typeArguments:[l,u],arguments:p});return d.isCreate&&t.transferObjects([d.accountCap],e.signer),x})}},W9=class{constructor(e){if(e!==0)throw new Error("Kriya amm only supported on mainnet")}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(r.id),n],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::kriya_amm::${c}`,typeArguments:[l,u],arguments:d})})}},G9=class{constructor(e){if(e!==0)throw new Error("Kriya clmm only supported on mainnet");this.version="0xf5145a7ac345ca8736cf8c76047d00d6d378f30e81be6f6eb557184d9de93c78"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(r.id),n,t.object(this.version),t.object(_r)],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::kriya_clmm::${c}`,typeArguments:[l,u],arguments:d})})}},K9=class{constructor(e){if(e!==0)throw new Error("Flowx only supported on mainnet");this.container="0xb65dcbf63fd3ad5d0ebfbf334780dc9f785eff38a4459e37ab08fa79576ee511"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(this.container),n],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::flowx_amm::${c}`,typeArguments:[l,u],arguments:d})})}},Y9=class{constructor(e){if(e!==0)throw new Error("Flowx clmm only supported on mainnet");this.versioned="0x67624a1533b5aff5d0dfcf5e598684350efd38134d2d245f475524c03a64e656",this.poolRegistry="0x27565d24a4cd51127ac90e4074a841bbe356cca7bf5759ddc14a975be1632abc"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(this.poolRegistry),t.pure.u64(r.feeRate*1e6),n,t.object(this.versioned),t.object(_r)],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::flowx_clmm::${c}`,typeArguments:[l,u],arguments:d})})}},X9=class{constructor(e){if(e!==0)throw new Error("Turbos only supported on mainnet");this.versioned="0xf1cf0e81048df168ebeb1b8030fad24b3e0b53ae827c25053fff0779c1445b6f"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s];if(r.extendedDetails==null)throw new Error("Extended details not supported");if(r.extendedDetails.turbosFeeType==null)throw new Error("Turbos fee type not supported");const d=[t.object(r.id),n,t.object(_r),t.object(this.versioned)],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::turbos::${c}`,typeArguments:[l,u,r.extendedDetails.turbosFeeType],arguments:d})})}},tp=class{constructor(e,t){this.globalConfig=e===0?"0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f":"0x9774e359588ead122af1c7e7f64e14ade261cfeecdb5d0eb4a5b3b4c8ab8bd3e",this.partner=t??(e===0?"0x639b5e433da31739e800cd085f356e64cae222966d0f1b11bd9dc76b322ff58b":"0x1f5fa5c820f40d43fc47815ad06d95e40a1942ff72a732a92e8ef4aa8cde70a5")}flash_swap(e,t,r,n,i){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["flash_swap_a2b",s,a]:["flash_swap_b2a",a,s];let d=n?r.amountIn:r.amountOut;const p=[t.object(this.globalConfig),t.object(r.id),t.object(this.partner),t.pure.u64(d),t.pure.bool(n),t.object(_r)],y=xr(e.publishedAtV2(),i),x=t.moveCall({target:`${y}::cetus::${c}`,typeArguments:[l,u],arguments:p});return{targetCoin:x[0],flashReceipt:x[1],payAmount:x[2]}}repay_flash_swap(e,t,r,n,i,o){const{direction:s,from:a,target:c}=r,[l,u,d]=s?["repay_flash_swap_a2b",a,c]:["repay_flash_swap_b2a",c,a],p=[t.object(this.globalConfig),t.object(r.id),t.object(this.partner),n,i],y=xr(e.publishedAtV2(),o);return t.moveCall({target:`${y}::cetus::${l}`,typeArguments:[u,d],arguments:p})[0]}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(this.globalConfig),t.object(r.id),t.object(this.partner),n,t.object(_r)],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::cetus::${c}`,typeArguments:[l,u],arguments:d})})}};function rp(e,...t){const r=Array.isArray(t[t.length-1])?t.pop():[];let i=[e,...t].filter(Boolean).join("::");return r&&r.length&&(i+=`<${r.join(", ")}>`),i}function np(e){return e.split("::")[0]}function Rn(e){var t;try{let r=e.replace(/\s/g,"");const n=r.match(/(<.+>)$/),i=(t=n==null?void 0:n[0])==null?void 0:t.match(/(\w+::\w+::\w+)(?:<.*?>(?!>))?/g);if(i){r=r.slice(0,r.indexOf("<"));const c=Rn(r),l=G7(W7({},c),{type_arguments:i.map(u=>Rn(u).source_address)});return l.type_arguments=l.type_arguments.map(u=>zn.isSuiCoin(u)?u:Rn(u).source_address),l.source_address=rp(l.full_address,l.type_arguments),l}const o=r.split("::"),a={full_address:r,address:r===qv||r===Q9?"0x2":Jr(o[0]),module:o[1],name:o[2],type_arguments:[],source_address:""};return a.full_address=`${a.address}::${a.module}::${a.name}`,a.source_address=rp(a.full_address,a.type_arguments),a}catch{return{full_address:e,address:"",module:"",name:"",type_arguments:[],source_address:e}}}function ip(e){return Rn(e).source_address}var J9="0x2::coin::Coin",Z9=/^0x2::coin::Coin<(.+)>$/,qv="0x2::sui::SUI",Q9="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",zn=class Bi{static getCoinTypeArg(t){const r=t.type.match(Z9);return r?r[1]:null}static isSUI(t){const r=Bi.getCoinTypeArg(t);return r?Bi.getCoinSymbol(r)==="SUI":!1}static getCoinSymbol(t){return t.substring(t.lastIndexOf(":")+1)}static getBalance(t){return BigInt(t.fields.balance)}static totalBalance(t,r){let n=BigInt(0);return t.forEach(i=>{r===i.coinAddress&&(n+=BigInt(i.balance))}),n}static getID(t){return t.fields.id.id}static getCoinTypeFromArg(t){return`${J9}<${t}>`}static getCoinAssets(t,r){const n=[];return r.forEach(i=>{ip(i.coinAddress)===ip(t)&&n.push(i)}),n}static isSuiCoin(t){return Rn(t).full_address===qv}static selectCoinObjectIdGreaterThanOrEqual(t,r,n=[]){const i=Bi.selectCoinAssetGreaterThanOrEqual(t,r,n),o=i.selectedCoins.map(c=>c.coinObjectId),s=i.remainingCoins,a=i.selectedCoins.map(c=>c.balance.toString());return{objectArray:o,remainCoins:s,amountArray:a}}static selectCoinAssetGreaterThanOrEqual(t,r,n=[]){const i=Bi.sortByBalance(t.filter(l=>!n.includes(l.coinObjectId))),o=Bi.calculateTotalBalance(i);if(o<r)return{selectedCoins:[],remainingCoins:i};if(o===r)return{selectedCoins:i,remainingCoins:[]};let s=BigInt(0);const a=[],c=[...i];for(;s<o;){const l=r-s,u=c.findIndex(p=>p.balance>=l);if(u!==-1){a.push(c[u]),c.splice(u,1);break}const d=c.pop();d.balance>0&&(a.push(d),s+=d.balance)}return{selectedCoins:Bi.sortByBalance(a),remainingCoins:Bi.sortByBalance(c)}}static sortByBalance(t){return t.sort((r,n)=>r.balance<n.balance?-1:r.balance>n.balance?1:0)}static sortByBalanceDes(t){return t.sort((r,n)=>r.balance>n.balance?-1:r.balance<n.balance?0:1)}static calculateTotalBalance(t){return t.reduce((r,n)=>r+n.balance,BigInt(0))}};function Lu(e){switch(e){case 1e4:return"Calculate error";case 10001:return"Input number too large can not fit in target type";case 10002:return"No router";case 10003:return"Insufficient Liquidity";case 10004:return"Target token is detected as a HoneyPot scam";case 10005:return"Too many requests. Please try again later";default:return"Unknown error"}}function Xi(e){const t=e.indexOf("::");if(t===-1)return e;const r=e.substring(0,t),n=e.substring(t);if(!r.startsWith("0x"))return e;const i=r.substring(2);return i.length>64?e:`0x${i.padStart(64,"0")}${n}`}function e_(e,t){e=Xi(e),t=Xi(t);const r=Math.min(e.length,t.length);for(let n=0;n<r;n++){if(e[n]>t[n])return!0;if(e[n]<t[n])return!1}return!0}function Hv(e,t){return e.moveCall({target:"0x2::coin::zero",typeArguments:[t]})}function Bu(e,t,r,n){const i=zn.getCoinAssets(n,t);if(r===BigInt(0))return zn.isSuiCoin(n)||i.length===0&&!zn.isSuiCoin(n)?{targetCoin:Hv(e,n),isMintZeroCoin:!0,targetCoinAmount:0}:{targetCoin:e.object(i[0].coinObjectId),isMintZeroCoin:!1,targetCoinAmount:Number(i[0].balance.toString())};if(zn.calculateTotalBalance(i)<r)throw new AggregateError("Insufficient balance when build merge coin, coinType: "+n,"InsufficientBalance"+n);if(zn.isSuiCoin(n))return{targetCoin:e.splitCoins(e.gas,[e.pure.u64(r.toString())]),isMintZeroCoin:!0,targetCoinAmount:Number(r.toString())};let s=zn.sortByBalance(i);s.slice(0,3).reduce((p,y)=>p+y.balance,BigInt(0))<BigInt(r)&&(s=zn.sortByBalanceDes(i));let c=zn.selectCoinObjectIdGreaterThanOrEqual(s,r);const[l,...u]=c.objectArray;return u.length>0&&e.mergeCoins(l,u.map(p=>e.object(p))),{targetCoin:e.splitCoins(e.object(l),[e.pure.u64(r.toString())]),isMintZeroCoin:!1,targetCoinAmount:Number(r.toString())}}function t_(e){return!(!e.startsWith("0x")||e.length!==66)}var Wo=Uo(Fo()),Hi=Uo(Fo()),ka=Uo(Fo()),vi=new ka.default(0);new ka.default(1);var r_=new ka.default(2);r_.pow(new ka.default(128));var n_=new ka.default("18446744073709551615"),un=1e9;function i_(e,t,r){let n=vi;return t?n=e.mul(new Hi.default(un-r*un)).div(new Hi.default(un)):n=e.mul(new Hi.default(un+r*un)).div(new Hi.default(un)),Number(n.toString())}function op(e,t,r){let n=vi;return t?n=e.mul(new Hi.default(un-r*un)).div(new Hi.default(un)):n=e.mul(new Hi.default(un+r*un)).div(new Hi.default(un)),n}function o_(e,t,r){return new gc(e).mul(gc.pow(2,-64)).pow(2).mul(gc.pow(10,t-r))}function s_(e,t,r,n){return ct(this,null,function*(){var i,o,s,a,c;const{from:l,target:u,amount:d,byAmountIn:p,pools:y}=t,x=Xi(l),b=Xi(u),M=new To,O=e_(x,b),P=n===0?"0x2d8c2e0fc6dd25b0214b3fa747e0fd27fd54608142cd2e4f64c1cd350cc4add4":"0x4f920e1ef6318cfba77e20a0538a419a5a504c14230169438b99aba485db40a6",k=O?x:b,F=O?b:x,B=[k,F];for(let C=0;C<y.length;C++){const g=[M.object(y[C]),M.pure.bool(O),M.pure.bool(p),M.pure.u64(d.toString())];M.moveCall({target:`${P}::fetcher_script::calculate_swap_result`,arguments:g,typeArguments:B})}if(!t_(r))throw new AggregateError("Aggregator package not set","InvalidWallet");const W=yield e.devInspectTransactionBlock({transactionBlock:M,sender:r});if(W.error!=null)throw new AggregateError("Aggregator package not set","SimulateError");const z=(i=W.events)==null?void 0:i.filter(C=>C.type.includes("CalculatedSwapResultEvent"));if(z.length===0||z.length!==y.length)throw new AggregateError("Simulate event result error","simulateEventError");let G=p?vi:n_,re=0;for(let C=0;C<z.length;C+=1)if(!z[C].parsedJson.data.is_exceed)if(t.byAmountIn){const g=new Wo.BN(z[C].parsedJson.data.amount_out);g.gt(G)&&(re=C,G=g)}else{const g=new Wo.BN(z[C].parsedJson.data.amount_out);g.lt(G)&&(re=C,G=g)}const oe=z[re].parsedJson.data,se=oe.step_results[0].current_sqrt_price,[q,L]=yield Promise.all([e.getCoinMetadata({coinType:k}).then(C=>C==null?void 0:C.decimals),e.getCoinMetadata({coinType:F}).then(C=>C==null?void 0:C.decimals)]);if(q==null||L==null)throw new AggregateError("Simulate event result error","CannotGetDecimals");const h=o_(se,q,L),f=Number(oe.fee_rate)/1e6,m=new Wo.BN((o=oe.amount_in)!=null?o:0),S=new Wo.BN((s=oe.fee_amount)!=null?s:0),T=m.add(S),E={amountIn:T,amountOut:new Wo.BN((a=oe.amount_out)!=null?a:0),routes:[{path:[{id:y[re],direction:O,provider:"CETUS",from:x,target:b,feeRate:f,amountIn:oe.amount_in,amountOut:oe.amount_out,extendedDetails:{afterSqrtPrice:oe.after_sqrt_price}}],amountIn:T,amountOut:new Wo.BN((c=oe.amount_out)!=null?c:0),initialPrice:h}],insufficientLiquidity:!1,byAmountIn:t.byAmountIn};return{isExceed:oe.is_exceed,routeData:E}})}var a_=class{constructor(e){if(e!==0)throw new Error("Haedal only supported on mainnet")}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o}=r,s=o?"swap_a2b":"swap_b2a",a=[t.object(r.id),t.object("0x5"),n],c=xr(e.publishedAtV2(),i);return t.moveCall({target:`${c}::haedal::${s}`,typeArguments:[],arguments:a})})}},c_=class{constructor(e){if(e!==0)throw new Error("Afsui only supported on mainnet");this.stakedSuiVault="0x2f8f6d5da7f13ea37daa397724280483ed062769813b6f31e9788e59cc88994d",this.safe="0xeb685899830dd5837b47007809c76d91a098d52aabbf61e8ac467c59e5cc4610",this.referVault="0x4ce9a19b594599536c53edb25d22532f82f18038dc8ef618afd00fbbfb9845ef",this.validator="0xd30018ec3f5ff1a3c75656abf927a87d7f0529e6dc89c7ddd1bd27ecb05e3db2"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o}=r;if(!o)throw new Error("Afsui not support b2a swap");const s="swap_a2b",a=[t.object(this.stakedSuiVault),t.object(this.safe),t.object("0x5"),t.object(this.referVault),t.object(this.validator),n],c=xr(e.publishedAtV2(),i);return t.moveCall({target:`${c}::afsui::${s}`,typeArguments:[],arguments:a})})}},l_=class{constructor(e){if(e!==0)throw new Error("Volo only supported on mainnet");this.nativePool="0x7fa2faa111b8c65bea48a23049bfd81ca8f971a262d981dcd9a17c3825cb5baf",this.metadata="0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o}=r;if(!o)throw new Error("Volo not support b2a swap");const s="swap_a2b",a=[t.object(this.nativePool),t.object(this.metadata),t.object("0x5"),n],c=xr(e.publishedAtV2(),i);return t.moveCall({target:`${c}::volo::${s}`,typeArguments:[],arguments:a})})}},u_=class{constructor(e){if(e!==0)throw new Error("Bluemove only supported on mainnet");this.dexInfo="0x3f2d9f724f4a1ce5e71676448dc452be9a6243dac9c5b975a588c8c867066e92"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(this.dexInfo),n],p=xr(e.publishedAtV2(),i);return t.moveCall({target:`${p}::bluemove::${c}`,typeArguments:[l,u],arguments:d})})}},f_=class{constructor(e){this.deepbookV3Config=e===0?"0x699d455ab8c5e02075b4345ea1f91be55bf46064ae6026cc2528e701ce3ac135":"0xe19b5d072346cae83a037d4e3c8492068a74410a74e5830b3a68012db38296aa"}swap(e,t,r,n,i,o){return ct(this,null,function*(){const{direction:s,from:a,target:c}=r,[l,u,d]=s?["swap_a2b_v2",a,c]:["swap_b2a_v2",c,a];let p;o?p=o:p=Hv(t,e.deepbookv3DeepFeeType());const y=[t.object(this.deepbookV3Config),t.object(r.id),n,p,t.object(_r)],x=Nn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${x}::deepbookv3::${l}`,typeArguments:[u,d],arguments:y})})}},d_=class{constructor(e){if(e!==0)throw new Error("Scallop only supported on mainnet");this.version=e===0?"0x07871c4b3c847a0f674510d4978d5cf6f960452795e8ff6f189fd2088a3f6ac7":"0x0",this.market=e===0?"0xa757975255146dc9686aa823b7838b507f315d704f428cbadad2f4ea061939d9":"0x0"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",s,a];if(r.extendedDetails==null)throw new Error("Extended details not supported");if(r.extendedDetails.scallopScoinTreasury==null)throw new Error("Scallop coin treasury not supported");const d=[t.object(this.version),t.object(this.market),t.object(r.extendedDetails.scallopScoinTreasury),n,t.object(_r)],p=Nn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${p}::scallop::${c}`,typeArguments:[l,u],arguments:d})})}},sp=class{constructor(e){if(e!==0)throw new Error("Suilend only supported on mainnet");this.sui_system_state=e===0?"0x0000000000000000000000000000000000000000000000000000000000000005":"0x0"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l]=o?["swap_a2b",a]:["swap_b2a",s],u=[t.object(r.id),t.object(this.sui_system_state),n],d=Nn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${d}::suilend::${c}`,typeArguments:[l],arguments:u})})}},h_=class{constructor(e){if(e!==0)throw new Error("Bluefin only supported on mainnet");this.globalConfig="0x03db251ba509a8d5d8777b6338836082335d93eecbdd09a11e190a1cff51c352"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(this.globalConfig),t.object(r.id),n,t.object(_r)],p=Nn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${p}::bluefin::${c}`,typeArguments:[l,u],arguments:d})})}},p_=class{constructor(e,t){if(e===1)throw new Error("HaedalPmm is not supported on testnet");this.pythPriceIDs=t}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s];let d,p;if(r.extendedDetails==null)throw new Error("Extended details not supported haedal pmm");if(!r.extendedDetails.haedalPmmBasePriceSeed||!r.extendedDetails.haedalPmmQuotePriceSeed)throw new Error("Base price seed or quote price seed not supported");d=r.extendedDetails.haedalPmmBasePriceSeed,p=r.extendedDetails.haedalPmmQuotePriceSeed;const y=this.pythPriceIDs.get(d),x=this.pythPriceIDs.get(p);if(!y||!x)throw new Error("Base price info object id or quote price info object id not found");const b=[t.object(r.id),t.object(y),t.object(x),n,t.object(_r)],M=Nn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${M}::haedalpmm::${c}`,typeArguments:[l,u],arguments:b})})}},m_=class{constructor(e){if(e!==0)throw new Error("Alphafi only supported on mainnet");this.sui_system_state=e===0?"0x0000000000000000000000000000000000000000000000000000000000000005":"0x0"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l]=o?["swap_a2b",a]:["swap_b2a",s],u=[t.object(r.id),t.object(this.sui_system_state),n],d=Nn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${d}::alphafi::${c}`,typeArguments:[l],arguments:u})})}},g_=class{constructor(e){if(e!==0)throw new Error("Steamm only supported on mainnet")}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b_v2",s,a]:["swap_b2a_v2",a,s];if(r.extendedDetails==null)throw new Error("Extended details not supported");if(r.extendedDetails.steammBankA==null)throw new Error("Steamm bank a type not supported");if(r.extendedDetails.steammBankB==null)throw new Error("Steamm bank b type not supported");if(r.extendedDetails.steammLendingMarket==null)throw new Error("Steamm lending market not supported");if(r.extendedDetails.steammLendingMarketType==null)throw new Error("Steamm lending market type not supported");if(r.extendedDetails.steammBCoinAType==null)throw new Error("Steamm b coin a type not supported");if(r.extendedDetails.steammBCoinBType==null)throw new Error("Steamm b coin b type not supported");if(r.extendedDetails.steammLPToken==null)throw new Error("Steamm lp token not supported");const d=[t.object(r.id),t.object(r.extendedDetails.steammBankA),t.object(r.extendedDetails.steammBankB),t.object(r.extendedDetails.steammLendingMarket),n,t.object(_r)],p=s0(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${p}::steamm_cpmm::${c}`,typeArguments:[r.extendedDetails.steammLendingMarketType,l,u,r.extendedDetails.steammBCoinAType,r.extendedDetails.steammBCoinBType,r.extendedDetails.steammLPToken],arguments:d})})}},v_=class{constructor(e,t){if(e!==0)throw new Error("Steamm only supported on mainnet");this.pythPriceIDs=t,this.oraclePackageId="0xe84b649199654d18c38e727212f5d8dacfc3cf78d60d0a7fc85fd589f280eb2b"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r;if(r.extendedDetails==null)throw new Error("Extended details not supported");if(r.extendedDetails.steammBankA==null)throw new Error("Steamm bank a type not supported");if(r.extendedDetails.steammBankB==null)throw new Error("Steamm bank b type not supported");if(r.extendedDetails.steammLendingMarket==null)throw new Error("Steamm lending market not supported");if(r.extendedDetails.steammLendingMarketType==null)throw new Error("Steamm lending market type not supported");if(r.extendedDetails.steammBCoinAType==null)throw new Error("Steamm b coin a type not supported");if(r.extendedDetails.steammBCoinBType==null)throw new Error("Steamm b coin b type not supported");if(r.extendedDetails.steammLPToken==null)throw new Error("Steamm lp token not supported");if(r.extendedDetails.steammOracleRegistryId==null)throw new Error("Steamm oracle registry id not supported");if(r.extendedDetails.steammOracleIndexA==null)throw new Error("Steamm oracle index a not supported");if(r.extendedDetails.steammOracleIndexB==null)throw new Error("Steamm oracle index b not supported");if(r.extendedDetails.steammOraclePythPriceSeedA==null)throw new Error("Steamm oracle pyth price seed a not supported");if(r.extendedDetails.steammOraclePythPriceSeedB==null)throw new Error("Steamm oracle pyth price seed b not supported");const[c,l,u]=o?["swap_a2b_v2",s,a]:["swap_b2a_v2",a,s],d=r.extendedDetails.steammOraclePythPriceSeedA,p=r.extendedDetails.steammOraclePythPriceSeedB,y=this.pythPriceIDs.get(d),x=this.pythPriceIDs.get(p);if(!y||!x)throw new Error("Base price info object id or quote price info object id not found");const b=t.moveCall({target:`${this.oraclePackageId}::oracles::get_pyth_price`,typeArguments:[],arguments:[t.object(r.extendedDetails.steammOracleRegistryId),t.object(y),t.pure.u64(r.extendedDetails.steammOracleIndexA),t.object(_r)]}),M=t.moveCall({target:`${this.oraclePackageId}::oracles::get_pyth_price`,typeArguments:[],arguments:[t.object(r.extendedDetails.steammOracleRegistryId),t.object(x),t.pure.u64(r.extendedDetails.steammOracleIndexB),t.object(_r)]}),O=[t.object(r.id),t.object(r.extendedDetails.steammBankA),t.object(r.extendedDetails.steammBankB),t.object(r.extendedDetails.steammLendingMarket),b,M,n,t.object(_r)],P=s0(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${P}::steamm_omm::${c}`,typeArguments:[r.extendedDetails.steammLendingMarketType,l,u,r.extendedDetails.steammBCoinAType,r.extendedDetails.steammBCoinBType,r.extendedDetails.steammLPToken],arguments:O})})}},b_="0x790f258062909e3a0ffc78b3c53ac2f62d7084c3bab95644bdeb05add7250001::super_sui::SUPER_SUI",y_="0xe44df51c0b21a27ab915fa1fe2ca610cd3eaa6d9666fe5e62b988bf7f0bd8722::musd::MUSD",w_="0xccd628c2334c5ed33e6c47d6c21bb664f8b6307b2ac32c2462a61f69a31ebcee::meth::METH",x_=class{constructor(e,t){if(e!==0)throw new Error("Metastable only supported on mainnet");this.versionID="0x4696559327b35ff2ab26904e7426a1646312e9c836d5c6cff6709a5ccc30915c",this.pythPriceIDs=t}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u,d]=o?["swap_a2b","create_deposit_cap",s,a]:["swap_b2a","create_withdraw_cap",a,s];let p="",y="pyth",x="";if(r.extendedDetails==null)throw new Error("Extended details not supported metastable");if(!r.extendedDetails.metastableCreateCapPkgId||!r.extendedDetails.metastableCreateCapModule||!r.extendedDetails.metastableRegistryId||!r.extendedDetails.metastableWhitelistedAppId)throw new Error("CreateCapPkgId or CreateCapModule or RegistryId or WhitelistedAppId or CreateCapAllTypeParams not supported");p=r.extendedDetails.metastableCreateCapPkgId,y=r.extendedDetails.metastableCreateCapModule,x=r.extendedDetails.metastableWhitelistedAppId;const b=[d];r.extendedDetails.metastableCreateCapAllTypeParams&&b.push(u);const M=[t.object(x),t.object(r.id)];switch(d){case b_:{if(!r.extendedDetails.metastableRegistryId)throw new Error("Not found registry id for super sui");M.push(t.object(r.extendedDetails.metastableRegistryId));break}case y_:{if(r.extendedDetails.metastablePriceSeed!=null){const B=this.pythPriceIDs.get(r.extendedDetails.metastablePriceSeed);if(B==null)throw new Error("Invalid Pyth price feed: "+r.extendedDetails.metastablePriceSeed);M.push(t.object(B))}if(r.extendedDetails.metastableETHPriceSeed!=null){const B=this.pythPriceIDs.get(r.extendedDetails.metastableETHPriceSeed);if(B==null)throw new Error("Invalid Pyth price feed: "+r.extendedDetails.metastableETHPriceSeed);M.push(t.object(B))}M.push(t.object(_r));break}case w_:{if(r.extendedDetails.metastablePriceSeed!=null){const B=this.pythPriceIDs.get(r.extendedDetails.metastablePriceSeed);if(B==null)throw new Error("Invalid Pyth price feed: "+r.extendedDetails.metastablePriceSeed);M.push(t.object(B))}if(r.extendedDetails.metastableETHPriceSeed!=null){const B=this.pythPriceIDs.get(r.extendedDetails.metastableETHPriceSeed);if(B==null)throw new Error("Invalid Pyth price feed: "+r.extendedDetails.metastableETHPriceSeed);M.push(t.object(B))}M.push(t.object(_r));break}default:throw new Error("Invalid Metacoin: "+d)}const O=t.moveCall({target:`${p}::${y}::${l}`,typeArguments:b,arguments:M}),P=[t.object(r.id),t.object(this.versionID),O,n],k=Nn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${k}::metastable::${c}`,typeArguments:[u,d],arguments:P})})}},S_=class{constructor(e,t){if(e===1)throw new Error("Obric is not supported on testnet");this.pythPriceIDs=t,this.pythStateObjectId="0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s];let d,p,y,x;if(r.extendedDetails==null)throw new Error("Extended details not supported in obric");if(r.extendedDetails.obricCoinAPriceSeed&&r.extendedDetails.obricCoinBPriceSeed)d=r.extendedDetails.obricCoinAPriceSeed,y=this.pythPriceIDs.get(d),p=r.extendedDetails.obricCoinBPriceSeed,x=this.pythPriceIDs.get(p);else{if(!r.extendedDetails.obricCoinAPriceId||!r.extendedDetails.obricCoinBPriceId)throw new Error("Base price id or quote price id not supported");y=r.extendedDetails.obricCoinAPriceId,x=r.extendedDetails.obricCoinBPriceId}if(!y||!x)throw new Error("Base price info object id or quote price info object id not found");const b=[t.object(r.id),n,t.object(this.pythStateObjectId),t.object(y),t.object(x),t.object(_r)],M=Nn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${M}::obric::${c}`,typeArguments:[l,u],arguments:b})})}},__=class{constructor(e){if(e!==0)throw new Error("HaWAL only supported on mainnet");this.staking=e===0?"0x10b9d30c28448939ce6c4d6c6e0ffce4a7f8a4ada8248bdad09ef8b70e4a3904":"0x0",this.validator=e===0?"0x7b3ba6de2ae58283f60d5b8dc04bb9e90e4796b3b2e0dea75569f491275242e7":"0x0"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o}=r,s=o?"swap_a2b":"swap_b2a",a=[t.object(this.staking),t.object(r.id),n,t.object(this.validator)],c=Nn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${c}::hawal::${s}`,typeArguments:[],arguments:a})})}},E_=class{constructor(e){if(e!==0)throw new Error("Momentum only supported on mainnet");this.version="0x2375a0b1ec12010aaea3b2545acfa2ad34cfbba03ce4b59f4c39e1e25eed1b2a"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:o,from:s,target:a}=r,[c,l,u]=o?["swap_a2b",s,a]:["swap_b2a",a,s],d=[t.object(r.id),n,t.object(this.version),t.object(_r)],p=s0(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${p}::momentum::${c}`,typeArguments:[l,u],arguments:d})})}},Wv="CETUS",C_="DEEPBOOK",T_="KRIYA",A_="FLOWX",M_="FLOWXV3",I_="KRIYAV3",Gv="TURBOS",Uf="AFTERMATH",O_="HAEDAL",R_="VOLO",P_="AFSUI",N_="BLUEMOVE",Kv="DEEPBOOKV3",Yv="SCALLOP",k_="SUILEND",j_="BLUEFIN",r0="HAEDALPMM",D_="ALPHAFI",L_="SPRINGSUI",Xv="STEAMM",n0="METASTABLE",i0="OBRIC",B_="HAWAL",o0="STEAMM_OMM",U_="MOMENTUM",F_="https://api-sui.cetus.zone/router_v2";function Uu(e){return Array.isArray(e.routers)}function Fu(e){return Array.isArray(e.routers)}var Jv=class Zv{constructor(t){var r,n;this.endpoint=t.endpoint?H_(t.endpoint):F_,this.client=t.client||new ps({url:Zm("mainnet")}),this.signer=t.signer||"",this.env=t.env||0,this.allCoins=new Map;const i=Zv.CONFIG[this.env];if(this.pythConnections=this.newPythClients((r=t.pythUrls)!=null?r:[]),this.pythClient=new _f.SuiPythClient(this.client,i.pythStateId,i.wormholeStateId),this.apiKey=t.apiKey||"",this.partner=t.partner,t.overlayFeeRate)if(t.overlayFeeRate>0&&t.overlayFeeRate<=.01)this.overlayFeeRate=t.overlayFeeRate*1e6;else throw new Error("Overlay fee rate must be between 0 and 0.01");else this.overlayFeeRate=0;this.overlayFeeReceiver=(n=t.overlayFeeReceiver)!=null?n:"0x0"}newPythClients(t){return t.includes("https://hermes.pyth.network")||t.push("https://hermes.pyth.network"),t.map(n=>new _f.SuiPriceServiceConnection(n,{timeout:3e3}))}getCoins(t,r=!0){return ct(this,null,function*(){if(this.signer==="")throw new Error("Signer is required, but not provided.");let n=null,i=50;if(!r){const s=this.allCoins.get(t);if(s)return s}const o=[];for(;;)try{const s=yield this.client.getCoins({owner:this.signer,coinType:t,cursor:n,limit:i});for(const a of s.data)o.push({coinAddress:Rn(a.coinType).source_address,coinObjectId:a.coinObjectId,balance:BigInt(a.balance)});if(!s.hasNextPage)break;n=s.nextCursor}catch(s){console.error("getCoins error:",s);break}return this.allCoins.set(t,o),o})}findRouters(t){return ct(this,null,function*(){return W_(this.endpoint,this.apiKey,t,this.overlayFeeRate,this.overlayFeeReceiver)})}executeFlexibleInputSwap(t,r,n,i,o,s,a,c,l){return ct(this,null,function*(){if(n.length===0)throw new Error("No router found");const u=n[0].path[n[0].path.length-1].target,d=[];for(let b=0;b<n.length-1;b++){if(n[b].path.length===0)throw new Error("Empty path");let O=t.splitCoins(r,[n[b].amountIn.toString()])[0];for(const P of n[b].path)O=yield this.newDex(P.provider,s,a).swap(this,t,P,O,l,c);d.push(O)}if(n[n.length-1].path.length===0)throw new Error("Empty path");let p=r;for(const b of n[n.length-1].path)p=yield this.newDex(b.provider,s,a).swap(this,t,b,p,l,c);d.push(p);const y=Nn(this.publishedAtV2Extend(),l);return this.checkCoinThresholdAndMergeCoin(t,d,u,i,o,y)})}expectInputSwap(t,r,n,i,o,s,a,c,l){return ct(this,null,function*(){if(n.length===0)throw new Error("No router found");const u=n.map(P=>P.amountIn.toString()),d=n[0].path[0].from,p=n[0].path[n[0].path.length-1].target,y=t.splitCoins(r,u),x=[];for(let P=0;P<n.length;P++){if(n[P].path.length===0)throw new Error("Empty path");let k=y[P];for(const F of n[P].path)k=yield this.newDex(F.provider,s,a).swap(this,t,F,k,l,c);x.push(k)}const b=xr(this.publishedAtV2(),l),M=Nn(this.publishedAtV2Extend(),l);return this.transferOrDestoryCoin(t,r,d,b),this.checkCoinThresholdAndMergeCoin(t,x,p,i,o,M)})}expectOutputSwap(t,r,n,i,o){return ct(this,null,function*(){const s=[],a=[],c=[],l=new tp(this.env,i),u=xr(this.publishedAtV2(),o);for(let p=0;p<n.length;p++){const y=n[p];for(let b=y.path.length-1;b>=0;b--){const M=y.path[b],O=l.flash_swap(this,t,M,!1);s.unshift(O.targetCoin),a.unshift(O.flashReceipt)}let x=r;for(let b=0;b<y.path.length;b++){const M=y.path[b],O=l.repay_flash_swap(this,t,M,x,a[b]);x=s[b],b===0?r=O:this.transferOrDestoryCoin(t,O,M.from,u),b===y.path.length-1&&c.push(x)}}const d=n[0].path[0].from;if(this.transferOrDestoryCoin(t,r,d,u),c.length>1){const p=t.makeMoveVec({elements:c.slice(1)});t.moveCall({target:`${fa}::pay::join_vec`,typeArguments:[n[0].path[n[0].path.length-1].target],arguments:[c[0],p]})}return c[0]})}swapInPools(t){return ct(this,null,function*(){let r;try{r=yield s_(this.client,t,this.signer,this.env)}catch(n){return console.error("swapInPools error:",n),null}return r})}routerSwap(t){return ct(this,null,function*(){const{routers:r,inputCoin:n,slippage:i,txb:o,deepbookv3DeepFee:s,partner:a}=t;if(i>1||i<0)throw new Error("Invalid slippage value. Must be between 0 and 1 (e.g., 0.01 represents 1% slippage)");const c=Array.isArray(r)?r:r.routes,l=Uu(t)?t.byAmountIn:t.routers.byAmountIn,u=c.reduce((z,G)=>z.add(G.amountIn),new Ht.default(0)),d=c.reduce((z,G)=>z.add(G.amountOut),new Ht.default(0));let p=new Ht.default(0);this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(l?p=d.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)):p=u.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)));const y=l?d.sub(p):d,x=l?u:u.add(p),b=op(l?y:x,l,i),M=Uu(t)?void 0:t.routers.packages,O=xr(this.publishedAtV2(),M),P=ap(c),k=P.length>0?yield this.updatePythPriceIDs(P,o):new Map;if(l)return yield this.expectInputSwap(o,n,c,d.toString(),b.toString(),k,a??this.partner,s,M);const F=o.splitCoins(n,[p.toString()]);this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&o.transferObjects([F],this.overlayFeeReceiver);const B=o.splitCoins(n,[b.sub(p).toString()]);return this.transferOrDestoryCoin(o,n,c[0].path[0].from,O),yield this.expectOutputSwap(o,B[0],c,a??this.partner)})}fixableRouterSwap(t){return ct(this,null,function*(){const{routers:r,inputCoin:n,slippage:i,txb:o,deepbookv3DeepFee:s,partner:a}=t,c=Array.isArray(r)?r:r.routes,l=t.routers.byAmountIn,u=c.reduce((F,B)=>F.add(B.amountIn),new Ht.default(0)),d=c.reduce((F,B)=>F.add(B.amountOut),new Ht.default(0));let p=0;this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(l?p=Number(d.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)).toString()):p=Number(u.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)).toString()));const y=l?d.sub(new Ht.default(p)):d,x=l?u:u.add(new Ht.default(p)),b=op(l?y:x,l,i),M=Uu(t)?void 0:t.routers.packages,O=ap(c),P=O.length>0?yield this.updatePythPriceIDs(O,o):new Map;return l?yield this.executeFlexibleInputSwap(o,n,c,y.toString(),b.toString(),P,a??this.partner,s,M):yield this.expectOutputSwap(o,n,c,a??this.partner)})}fastRouterSwap(t){return ct(this,null,function*(){const{routers:r,slippage:n,txb:i,partner:o,refreshAllCoins:s,payDeepFeeAmount:a}=t,c=Array.isArray(r)?r:r.routes,l=c[0].path[0].from;let u=yield this.getCoins(l,s);const d=c[0].path[c[0].path.length-1].target,p=c.reduce((G,re)=>G.add(re.amountIn),new Ht.default(0)),y=c.reduce((G,re)=>G.add(re.amountOut),new Ht.default(0)),x=Fu(t)?t.byAmountIn:t.routers.byAmountIn;let b=0;this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(x?b=Number(y.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)).toString()):b=Number(p.mul(new Ht.default(this.overlayFeeRate)).div(new Ht.default(1e6)).toString()));const M=x?y.sub(new Ht.default(b)):y,O=x?p:p.add(new Ht.default(b)),P=i_(x?M:O,x,n),F=Bu(i,u,BigInt((x?O:P).toString()),l);let B;if(a&&a>0){let G=yield this.getCoins(this.deepbookv3DeepFeeType());B=Bu(i,G,BigInt(a),this.deepbookv3DeepFeeType()).targetCoin}const W=Fu(t)?{routers:c,inputCoin:F.targetCoin,slippage:n,byAmountIn:x,txb:i,partner:o??this.partner,deepbookv3DeepFee:B}:{routers:t.routers,inputCoin:F.targetCoin,slippage:n,byAmountIn:x,txb:i,partner:o??this.partner,deepbookv3DeepFee:B},z=yield this.routerSwap(W);if(zn.isSuiCoin(d))i.mergeCoins(i.gas,[z]);else{let G=yield this.getCoins(d,s);const re=Bu(i,G,BigInt(0),d),oe=Fu(t)?void 0:t.routers.packages,se=xr(this.publishedAtV2(),oe);i.mergeCoins(re.targetCoin,[z]),re.isMintZeroCoin&&this.transferOrDestoryCoin(i,re.targetCoin,d,se)}})}publishedAtV2(){return this.env===0?"0x3864c7c59a4889fec05d1aae4bc9dba5a0e0940594b424fbed44cb3f6ac4c032":"0x52eae33adeb44de55cfb3f281d4cc9e02d976181c0952f5323648b5717b33934"}publishedAtV2Extend(){return this.env===0?"0x39402d188b7231036e52266ebafad14413b4bf3daea4ac17115989444e6cd516":"0xabb6a81c8a216828e317719e06125de5bb2cb0fe8f9916ff8c023ca5be224c78"}publishedAtV2Extend2(){return this.env===0?"0x0018f7bbbece22f4272ed2281b290f745e5aa69d870f599810a30b4eeffc1a5e":"0x0"}deepbookv3DeepFeeType(){return this.env===0?"0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP":"0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP"}transferOrDestoryCoin(t,r,n,i){t.moveCall({target:`${i}::utils::transfer_or_destroy_coin`,typeArguments:[n],arguments:[r]})}checkCoinThresholdAndMergeCoin(t,r,n,i,o,s){let a=r[0];if(r.length>1){let c=t.makeMoveVec({elements:r.slice(1)});t.moveCall({target:`${fa}::pay::join_vec`,typeArguments:[n],arguments:[r[0],c]}),a=r[0]}return this.overlayFeeRate===0||this.overlayFeeReceiver==="0x0"?t.moveCall({target:`${s}::utils::check_coin_threshold_v1`,typeArguments:[n],arguments:[a,t.pure.u64(i),t.pure.u64(o)]}):t.moveCall({target:`${s}::utils::check_coin_threshold_v2`,typeArguments:[n],arguments:[a,t.pure.u64(i),t.pure.u64(o),t.pure.u64(this.overlayFeeRate),t.pure.address(this.overlayFeeReceiver)]}),a}newDex(t,r,n){switch(t){case Wv:return new tp(this.env,n);case C_:return new H9(this.env);case Kv:return new f_(this.env);case T_:return new W9(this.env);case I_:return new G9(this.env);case A_:return new K9(this.env);case M_:return new Y9(this.env);case Gv:return new X9(this.env);case Uf:return new q9(this.env);case O_:return new a_(this.env);case P_:return new c_(this.env);case R_:return new l_(this.env);case N_:return new u_(this.env);case Yv:return new d_(this.env);case k_:return new sp(this.env);case L_:return new sp(this.env);case j_:return new h_(this.env);case r0:return new p_(this.env,r);case D_:return new m_(this.env);case Xv:return new g_(this.env);case o0:return new v_(this.env,r);case n0:return new x_(this.env,r);case i0:return new S_(this.env,r);case B_:return new __(this.env);case U_:return new E_(this.env);default:throw new Error(`Unsupported dex ${t}`)}}signAndExecuteTransaction(t,r){return ct(this,null,function*(){return yield this.client.signAndExecuteTransaction({transaction:t,signer:r,options:{showEffects:!0,showEvents:!0,showInput:!0,showBalanceChanges:!0}})})}devInspectTransactionBlock(t){return ct(this,null,function*(){return yield this.client.devInspectTransactionBlock({transactionBlock:t,sender:this.signer})})}sendTransaction(t,r){return ct(this,null,function*(){return yield this.client.signAndExecuteTransaction({transaction:t,signer:r})})}getDeepbookV3Config(){return ct(this,null,function*(){const t=yield Y_(this.endpoint);return t?t.data:null})}updatePythPriceIDs(t,r){return ct(this,null,function*(){let n=null,i=null;for(const a of this.pythConnections)try{n=yield a.getPriceFeedsUpdateData(t);break}catch(c){i=c;continue}if(n==null)throw new Error(`All Pyth price nodes are unavailable. Cannot fetch price data. Please switch to or add new available Pyth nodes. Detailed error: ${i==null?void 0:i.message}`);let o=[];try{o=yield this.pythClient.updatePriceFeeds(r,n,t)}catch(a){throw new Error(`All Pyth price nodes are unavailable. Cannot fetch price data. Please switch to or add new available Pyth nodes in the pythUrls parameter when initializing AggregatorClient, for example: new AggregatorClient({ pythUrls: ["https://your-pyth-node-url"] }). Detailed error: ${a}`)}let s=new Map;for(let a=0;a<t.length;a++)s.set(t[a],o[a]);return s})}};Jv.CONFIG={1:{wormholeStateId:"0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790",pythStateId:"0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c"},0:{wormholeStateId:"0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c",pythStateId:"0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8"}};var Qv=Jv;function ap(e){const t=new Set;for(const r of e)for(const n of r.path)n.provider===r0&&n.extendedDetails&&n.extendedDetails.haedalPmmBasePriceSeed&&n.extendedDetails.haedalPmmQuotePriceSeed&&(t.add(n.extendedDetails.haedalPmmBasePriceSeed),t.add(n.extendedDetails.haedalPmmQuotePriceSeed)),n.provider===n0&&(n.extendedDetails&&n.extendedDetails.metastablePriceSeed&&t.add(n.extendedDetails.metastablePriceSeed),n.extendedDetails&&n.extendedDetails.metastableETHPriceSeed&&t.add(n.extendedDetails.metastableETHPriceSeed)),n.provider===i0&&(n.extendedDetails&&n.extendedDetails.obricCoinAPriceSeed&&t.add(n.extendedDetails.obricCoinAPriceSeed),n.extendedDetails&&n.extendedDetails.obricCoinBPriceSeed&&t.add(n.extendedDetails.obricCoinBPriceSeed)),n.provider===o0&&(n.extendedDetails&&n.extendedDetails.steammOraclePythPriceSeedA&&t.add(n.extendedDetails.steammOraclePythPriceSeedA),n.extendedDetails&&n.extendedDetails.steammOraclePythPriceSeedB&&t.add(n.extendedDetails.steammOraclePythPriceSeedB));return Array.from(t)}function $_(e,t){let r=0;for(const o of e.routes)for(const s of o.path)s.extended_details&&s.extended_details.deepbookv3_deep_fee&&(r+=Number(s.extended_details.deepbookv3_deep_fee));let n;if(e.packages!=null){n=new Map;for(const[o,s]of Object.entries(e.packages))n.set(o,s)}return{amountIn:new Ht.default(e.amount_in.toString()),amountOut:new Ht.default(e.amount_out.toString()),byAmountIn:t,insufficientLiquidity:!1,routes:e.routes.map(o=>({path:o.path.map(s=>{var a,c,l,u,d,p,y,x,b,M,O,P,k,F,B,W,z,G,re,oe,se,q,L,h,f,m,S,T,E,I;let C;s.provider===Uf&&(C=s.extended_details.aftermath_pool_flatness===0?"v2":"v3");let g;return(s.provider===Gv||s.provider===Uf||s.provider===Wv||s.provider===Kv||s.provider===Yv||s.provider===r0||s.provider===n0||s.provider===i0||s.provider===Xv||s.provider===o0)&&(g={aftermathLpSupplyType:(a=s.extended_details)==null?void 0:a.aftermath_lp_supply_type,turbosFeeType:(c=s.extended_details)==null?void 0:c.turbos_fee_type,afterSqrtPrice:(l=s.extended_details)==null?void 0:l.after_sqrt_price,deepbookv3DeepFee:(u=s.extended_details)==null?void 0:u.deepbookv3_deep_fee,scallopScoinTreasury:(d=s.extended_details)==null?void 0:d.scallop_scoin_treasury,haedalPmmBasePriceSeed:(p=s.extended_details)==null?void 0:p.haedal_pmm_base_price_seed,haedalPmmQuotePriceSeed:(y=s.extended_details)==null?void 0:y.haedal_pmm_quote_price_seed,steammBankA:(x=s.extended_details)==null?void 0:x.steamm_bank_a,steammBankB:(b=s.extended_details)==null?void 0:b.steamm_bank_b,steammLendingMarket:(M=s.extended_details)==null?void 0:M.steamm_lending_market,steammLendingMarketType:(O=s.extended_details)==null?void 0:O.steamm_lending_market_type,steammBCoinAType:(P=s.extended_details)==null?void 0:P.steamm_btoken_a_type,steammBCoinBType:(k=s.extended_details)==null?void 0:k.steamm_btoken_b_type,steammLPToken:(F=s.extended_details)==null?void 0:F.steamm_lp_token_type,steammOracleRegistryId:(B=s.extended_details)==null?void 0:B.steamm_oracle_registry_id,steammOracleIndexA:(W=s.extended_details)==null?void 0:W.steamm_oracle_index_a,steammOracleIndexB:(z=s.extended_details)==null?void 0:z.steamm_oracle_index_b,steammOraclePythPriceSeedA:(G=s.extended_details)==null?void 0:G.steamm_oracle_pyth_price_seed_a,steammOraclePythPriceSeedB:(re=s.extended_details)==null?void 0:re.steamm_oracle_pyth_price_seed_b,metastablePriceSeed:(oe=s.extended_details)==null?void 0:oe.metastable_price_seed,metastableETHPriceSeed:(se=s.extended_details)==null?void 0:se.metastable_eth_price_seed,metastableWhitelistedAppId:(q=s.extended_details)==null?void 0:q.metastable_whitelisted_app_id,metastableCreateCapPkgId:(L=s.extended_details)==null?void 0:L.metastable_create_cap_pkg_id,metastableCreateCapModule:(h=s.extended_details)==null?void 0:h.metastable_create_cap_module,metastableCreateCapAllTypeParams:(f=s.extended_details)==null?void 0:f.metastable_create_cap_all_type_params,metastableRegistryId:(m=s.extended_details)==null?void 0:m.metastable_registry_id,obricCoinAPriceSeed:(S=s.extended_details)==null?void 0:S.obric_coin_a_price_seed,obricCoinBPriceSeed:(T=s.extended_details)==null?void 0:T.obric_coin_b_price_seed,obricCoinAPriceId:(E=s.extended_details)==null?void 0:E.obric_coin_a_price_id,obricCoinBPriceId:(I=s.extended_details)==null?void 0:I.obric_coin_b_price_id}),{id:s.id,direction:s.direction,provider:s.provider,from:s.from,target:s.target,feeRate:s.fee_rate,amountIn:s.amount_in,amountOut:s.amount_out,extendedDetails:g,version:C}}),amountIn:new Ht.default(o.amount_in.toString()),amountOut:new Ht.default(o.amount_out.toString()),initialPrice:new gc(o.initial_price.toString())})),totalDeepFee:r,packages:n}}var _r=Zg,V_="aggregator_v2",z_="aggregator_v2_extend",q_="aggregator_v2_extend2";function xr(e,t){var r;return t instanceof Map&&(r=t.get(V_))!=null?r:e}function Nn(e,t){var r;return t instanceof Map&&(r=t.get(z_))!=null?r:e}function s0(e,t){var r;return t instanceof Map&&(r=t.get(q_))!=null?r:e}Uo(Fo());function H_(e){return e.endsWith("/find_routes")?e.replace("/find_routes",""):e}var Ka=Uo(Fo()),eb=1000800;function W_(e,t,r,n,i){return ct(this,null,function*(){let o;if(r.liquidityChanges&&r.liquidityChanges.length>0?o=yield K_(e,r):o=yield G_(e,t,r),!o)return null;if(!o.ok){let c=10001;return o.status===429&&(c=10005),{amountIn:vi,amountOut:vi,routes:[],byAmountIn:r.byAmountIn,insufficientLiquidity:!1,error:{code:c,msg:Lu(c)}}}const s=yield o.json(),a=s.msg==="liquidity is not enough";if(s.msg&&s.msg.indexOf("HoneyPot scam")>-1)return{amountIn:vi,amountOut:vi,routes:[],byAmountIn:r.byAmountIn,insufficientLiquidity:a,error:{code:10004,msg:Lu(10004)}};if(s.data!=null){const c=$_(s.data,r.byAmountIn);if(n>0&&i!=="0x0")if(r.byAmountIn){const l=c.amountOut.mul(new Ka.default(n)).div(new Ka.default(1e6));c.overlayFee=Number(l.toString()),c.amountOut=c.amountOut.sub(l)}else{const l=c.amountIn.mul(new Ka.default(n)).div(new Ka.default(1e6));c.overlayFee=Number(l.toString()),c.amountIn=c.amountIn.add(l)}return c}return{amountIn:vi,amountOut:vi,routes:[],insufficientLiquidity:a,byAmountIn:r.byAmountIn,error:{code:10003,msg:Lu(10003)}}})}function G_(e,t,r){return ct(this,null,function*(){try{const{from:n,target:i,amount:o,byAmountIn:s,depth:a,splitAlgorithm:c,splitFactor:l,splitCount:u,providers:d}=r,p=Xi(n),y=Xi(i);let x=`${e}/find_routes?from=${p}&target=${y}&amount=${o.toString()}&by_amount_in=${s}`;return a&&(x+=`&depth=${a}`),c&&(x+=`&split_algorithm=${c}`),l&&(x+=`&split_factor=${l}`),u&&(x+=`&split_count=${u}`),d&&d.length>0&&(x+=`&providers=${d.join(",")}`),t.length>0&&(x+=`&apiKey=${t}`),x+=`&v=${eb}`,yield fetch(x)}catch(n){return console.error(n),null}})}function K_(e,t){return ct(this,null,function*(){const{from:r,target:n,amount:i,byAmountIn:o,depth:s,splitAlgorithm:a,splitFactor:c,splitCount:l,providers:u,liquidityChanges:d}=t,p=Xi(r),y=Xi(n),x=`${e}/find_routes`,b=u==null?void 0:u.join(","),M={from:p,target:y,amount:Number(i.toString()),by_amount_in:o,depth:s,split_algorithm:a,split_factor:c,split_count:l,providers:b,liquidity_changes:d.map(O=>({pool:O.poolID,tick_lower:O.ticklower,tick_upper:O.tickUpper,delta_liquidity:O.deltaLiquidity})),v:eb};try{return yield fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})}catch(O){return console.error("Error:",O),null}})}function Y_(e){return ct(this,null,function*(){const t=`${e}/deepbookv3_config`;try{return(yield fetch(t)).json()}catch(r){return console.error("Error:",r),null}})}var a0=(e=>(e[e.Mainnet=0]="Mainnet",e[e.Testnet=1]="Testnet",e))(a0||{});const tb="0x2::sui::SUI",X_="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";function rb(e){return kr(e).full_address===tb}function cp(e,...t){const r=Array.isArray(t[t.length-1])?t.pop():[];let i=[e,...t].filter(Boolean).join("::");return r&&r.length&&(i+=`<${r.join(", ")}>`),i}function kr(e){var t;try{let r=e.replace(/\s/g,"");const n=r.match(/(<.+>)$/),i=(t=n==null?void 0:n[0])==null?void 0:t.match(/(\w+::\w+::\w+)(?:<.*?>(?!>))?/g);if(i){r=r.slice(0,r.indexOf("<"));const l={...kr(r),type_arguments:i.map(u=>kr(u).source_address)};return l.type_arguments=l.type_arguments.map(u=>rb(u)?u:kr(u).source_address),l.source_address=cp(l.full_address,l.type_arguments),l}const o=r.split("::"),a={full_address:r,address:r===tb||r===X_?"0x2":Jr(o[0]),module:o[1],name:o[2],type_arguments:[],source_address:""};return a.full_address=`${a.address}::${a.module}::${a.name}`,a.source_address=cp(a.full_address,a.type_arguments),a}catch{return{full_address:e,address:"",module:"",name:"",type_arguments:[],source_address:e}}}function J_(e){return e.startsWith("0x")?`${e.slice(2)}`:e}const Ti=(e,t=!0)=>{const r=e.split("::"),n=r.shift();let i=Jr(n);return t&&(i=J_(i)),`${i}::${r.join("::")}`};/*!
|
|
35
35
|
* decimal.js v10.5.0
|
|
36
36
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
37
37
|
* https://github.com/MikeMcl/decimal.js
|
|
38
38
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
39
39
|
* MIT Licence
|
|
40
|
-
*/var os=9e15,io=1e9,Ff="0123456789abcdef",Vc="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",zc="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",$f={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-os,maxE:os,crypto:!1},tb,xi,at=!0,Ml="[DecimalError] ",Ji=Ml+"Invalid argument: ",rb=Ml+"Precision limit exceeded",nb=Ml+"crypto unavailable",ib="[object Decimal]",jr=Math.floor,vr=Math.pow,W_=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,G_=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,K_=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ob=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Nn=1e7,Xe=7,Y_=9007199254740991,X_=Vc.length-1,Vf=zc.length-1,ve={toStringTag:ib};ve.absoluteValue=ve.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),We(e)};ve.ceil=function(){return We(new this.constructor(this),this.e+1,2)};ve.clampedTo=ve.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Ji+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};ve.comparedTo=ve.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,c=o.s,l=e.s;if(!s||!a)return!c||!l?NaN:c!==l?c:s===a?0:!s^c<0?1:-1;if(!s[0]||!a[0])return s[0]?c:a[0]?-l:0;if(c!==l)return c;if(o.e!==e.e)return o.e>e.e^c<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};ve.cosine=ve.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Xe,n.rounding=1,r=J_(n,ub(n,r)),n.precision=e,n.rounding=t,We(xi==2||xi==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};ve.cubeRoot=ve.cbrt=function(){var e,t,r,n,i,o,s,a,c,l,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(at=!1,o=u.s*vr(u.s*u,1/3),!o||Math.abs(o)==1/0?(r=Mr(u.d),e=u.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=vr(r,1/3),e=jr((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new d(r),n.s=u.s):n=new d(o.toString()),s=(e=d.precision)+3;;)if(a=n,c=a.times(a).times(a),l=c.plus(u),n=Kt(l.plus(u).times(a),l.plus(c),s+2,1),Mr(a.d).slice(0,s)===(r=Mr(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(We(a,e+1,0),a.times(a).times(a).eq(u))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(We(n,e+1,1),t=!n.times(n).times(n).eq(u));break}return at=!0,We(n,e,d.rounding,t)};ve.decimalPlaces=ve.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-jr(this.e/Xe))*Xe,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};ve.dividedBy=ve.div=function(e){return Kt(this,new this.constructor(e))};ve.dividedToIntegerBy=ve.divToInt=function(e){var t=this,r=t.constructor;return We(Kt(t,new r(e),0,1,1),r.precision,r.rounding)};ve.equals=ve.eq=function(e){return this.cmp(e)===0};ve.floor=function(){return We(new this.constructor(this),this.e+1,3)};ve.greaterThan=ve.gt=function(e){return this.cmp(e)>0};ve.greaterThanOrEqualTo=ve.gte=function(e){var t=this.cmp(e);return t==1||t===0};ve.hyperbolicCosine=ve.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Rl(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=vs(s,1,o.times(t),new s(1),!0);for(var c,l=e,u=new s(8);l--;)c=o.times(o),o=a.minus(c.times(u.minus(c.times(u))));return We(o,s.precision=r,s.rounding=n,!0)};ve.hyperbolicSine=ve.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=vs(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Rl(5,e)),i=vs(o,2,i,i,!0);for(var s,a=new o(5),c=new o(16),l=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(c.times(s).plus(l))))}return o.precision=t,o.rounding=r,We(i,t,r,!0)};ve.hyperbolicTangent=ve.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,Kt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};ve.inverseCosine=ve.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?Kn(t,n,i):new t(0):new t(NaN):e.isZero()?Kn(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};ve.inverseHyperbolicCosine=ve.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,at=!1,r=r.times(r).minus(1).sqrt().plus(r),at=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};ve.inverseHyperbolicSine=ve.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,at=!1,r=r.times(r).plus(1).sqrt().plus(r),at=!0,n.precision=e,n.rounding=t,r.ln())};ve.inverseHyperbolicTangent=ve.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?We(new o(i),e,t,!0):(o.precision=r=n-i.e,i=Kt(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};ve.inverseSine=ve.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=Kn(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};ve.inverseTangent=ve.atan=function(){var e,t,r,n,i,o,s,a,c,l=this,u=l.constructor,d=u.precision,p=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&d+4<=Vf)return s=Kn(u,d+4,p).times(.25),s.s=l.s,s}else{if(!l.s)return new u(NaN);if(d+4<=Vf)return s=Kn(u,d+4,p).times(.5),s.s=l.s,s}for(u.precision=a=d+10,u.rounding=1,r=Math.min(28,a/Xe+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(at=!1,t=Math.ceil(a/Xe),n=1,c=l.times(l),s=new u(l),i=l;e!==-1;)if(i=i.times(c),o=s.minus(i.div(n+=2)),i=i.times(c),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),at=!0,We(s,u.precision=d,u.rounding=p,!0)};ve.isFinite=function(){return!!this.d};ve.isInteger=ve.isInt=function(){return!!this.d&&jr(this.e/Xe)>this.d.length-2};ve.isNaN=function(){return!this.s};ve.isNegative=ve.isNeg=function(){return this.s<0};ve.isPositive=ve.isPos=function(){return this.s>0};ve.isZero=function(){return!!this.d&&this.d[0]===0};ve.lessThan=ve.lt=function(e){return this.cmp(e)<0};ve.lessThanOrEqualTo=ve.lte=function(e){return this.cmp(e)<1};ve.logarithm=ve.log=function(e){var t,r,n,i,o,s,a,c,l=this,u=l.constructor,d=u.precision,p=u.rounding,y=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new u(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(at=!1,a=d+y,s=Wi(l,a),n=t?qc(u,a+10):Wi(e,a),c=Kt(s,n,a,1),pa(c.d,i=d,p))do if(a+=10,s=Wi(l,a),n=t?qc(u,a+10):Wi(e,a),c=Kt(s,n,a,1),!o){+Mr(c.d).slice(i+1,i+15)+1==1e14&&(c=We(c,d+1,0));break}while(pa(c.d,i+=10,p));return at=!0,We(c,d,p)};ve.minus=ve.sub=function(e){var t,r,n,i,o,s,a,c,l,u,d,p,y=this,x=y.constructor;if(e=new x(e),!y.d||!e.d)return!y.s||!e.s?e=new x(NaN):y.d?e.s=-e.s:e=new x(e.d||y.s!==e.s?y:NaN),e;if(y.s!=e.s)return e.s=-e.s,y.plus(e);if(l=y.d,p=e.d,a=x.precision,c=x.rounding,!l[0]||!p[0]){if(p[0])e.s=-e.s;else if(l[0])e=new x(y);else return new x(c===3?-0:0);return at?We(e,a,c):e}if(r=jr(e.e/Xe),u=jr(y.e/Xe),l=l.slice(),o=u-r,o){for(d=o<0,d?(t=l,o=-o,s=p.length):(t=p,r=u,s=l.length),n=Math.max(Math.ceil(a/Xe),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=p.length,d=n<s,d&&(s=n),n=0;n<s;n++)if(l[n]!=p[n]){d=l[n]<p[n];break}o=0}for(d&&(t=l,l=p,p=t,e.s=-e.s),s=l.length,n=p.length-s;n>0;--n)l[s++]=0;for(n=p.length;n>o;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=Nn-1;--l[i],l[n]+=Nn}l[n]-=p[n]}for(;l[--s]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=Il(l,r),at?We(e,a,c):e):new x(c===3?-0:0)};ve.modulo=ve.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?We(new n(r),n.precision,n.rounding):(at=!1,n.modulo==9?(t=Kt(r,e.abs(),0,3,1),t.s*=e.s):t=Kt(r,e,0,n.modulo,1),t=t.times(e),at=!0,r.minus(t))};ve.naturalExponential=ve.exp=function(){return zf(this)};ve.naturalLogarithm=ve.ln=function(){return Wi(this)};ve.negated=ve.neg=function(){var e=new this.constructor(this);return e.s=-e.s,We(e)};ve.plus=ve.add=function(e){var t,r,n,i,o,s,a,c,l,u,d=this,p=d.constructor;if(e=new p(e),!d.d||!e.d)return!d.s||!e.s?e=new p(NaN):d.d||(e=new p(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(l=d.d,u=e.d,a=p.precision,c=p.rounding,!l[0]||!u[0])return u[0]||(e=new p(d)),at?We(e,a,c):e;if(o=jr(d.e/Xe),n=jr(e.e/Xe),l=l.slice(),i=o-n,i){for(i<0?(r=l,i=-i,s=u.length):(r=u,n=o,s=l.length),o=Math.ceil(a/Xe),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=u.length,s-i<0&&(i=s,r=u,u=l,l=r),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/Nn|0,l[i]%=Nn;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=Il(l,n),at?We(e,a,c):e};ve.precision=ve.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ji+e);return r.d?(t=sb(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};ve.round=function(){var e=this,t=e.constructor;return We(new t(e),e.e+1,t.rounding)};ve.sine=ve.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Xe,n.rounding=1,r=Q_(n,ub(n,r)),n.precision=e,n.rounding=t,We(xi>2?r.neg():r,e,t,!0)):new n(NaN)};ve.squareRoot=ve.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,c=s.e,l=s.s,u=s.constructor;if(l!==1||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(at=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=Mr(a),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=jr((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new u(t)):n=new u(l.toString()),r=(c=u.precision)+3;;)if(o=n,n=o.plus(Kt(s,o,r+2,1)).times(.5),Mr(o.d).slice(0,r)===(t=Mr(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(We(o,c+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(We(n,c+1,1),e=!n.times(n).eq(s));break}return at=!0,We(n,c,u.rounding,e)};ve.tangent=ve.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=Kt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,We(xi==2||xi==4?r.neg():r,e,t,!0)):new n(NaN)};ve.times=ve.mul=function(e){var t,r,n,i,o,s,a,c,l,u=this,d=u.constructor,p=u.d,y=(e=new d(e)).d;if(e.s*=u.s,!p||!p[0]||!y||!y[0])return new d(!e.s||p&&!p[0]&&!y||y&&!y[0]&&!p?NaN:!p||!y?e.s/0:e.s*0);for(r=jr(u.e/Xe)+jr(e.e/Xe),c=p.length,l=y.length,c<l&&(o=p,p=y,y=o,s=c,c=l,l=s),o=[],s=c+l,n=s;n--;)o.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)a=o[i]+y[n]*p[i-n-1]+t,o[i--]=a%Nn|0,t=a/Nn|0;o[i]=(o[i]+t)%Nn|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Il(o,r),at?We(e,d.precision,d.rounding):e};ve.toBinary=function(e,t){return s0(this,2,e,t)};ve.toDecimalPlaces=ve.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Wr(e,0,io),t===void 0?t=n.rounding:Wr(t,0,8),We(r,e+r.e+1,t))};ve.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Zn(n,!0):(Wr(e,0,io),t===void 0?t=i.rounding:Wr(t,0,8),n=We(new i(n),e+1,t),r=Zn(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};ve.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Zn(i):(Wr(e,0,io),t===void 0?t=o.rounding:Wr(t,0,8),n=We(new o(i),e+i.e+1,t),r=Zn(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};ve.toFraction=function(e){var t,r,n,i,o,s,a,c,l,u,d,p,y=this,x=y.d,b=y.constructor;if(!x)return new b(y);if(l=r=new b(1),n=c=new b(0),t=new b(n),o=t.e=sb(x)-y.e-1,s=o%Xe,t.d[0]=vr(10,s<0?Xe+s:s),e==null)e=o>0?t:l;else{if(a=new b(e),!a.isInt()||a.lt(l))throw Error(Ji+a);e=a.gt(t)?o>0?t:l:a}for(at=!1,a=new b(Mr(x)),u=b.precision,b.precision=o=x.length*Xe*2;d=Kt(a,t,0,1,1),i=r.plus(d.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(d.times(i)),c=i,i=t,t=a.minus(d.times(i)),a=i;return i=Kt(e.minus(r),n,0,1,1),c=c.plus(i.times(l)),r=r.plus(i.times(n)),c.s=l.s=y.s,p=Kt(l,n,o,1).minus(y).abs().cmp(Kt(c,r,o,1).minus(y).abs())<1?[l,n]:[c,r],b.precision=u,at=!0,p};ve.toHexadecimal=ve.toHex=function(e,t){return s0(this,16,e,t)};ve.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:Wr(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(at=!1,r=Kt(r,e,0,t,1).times(e),at=!0,We(r)):(e.s=r.s,r=e),r};ve.toNumber=function(){return+this};ve.toOctal=function(e,t){return s0(this,8,e,t)};ve.toPower=ve.pow=function(e){var t,r,n,i,o,s,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(vr(+a,l));if(a=new c(a),a.eq(1))return a;if(n=c.precision,o=c.rounding,e.eq(1))return We(a,n,o);if(t=jr(e.e/Xe),t>=e.d.length-1&&(r=l<0?-l:l)<=Y_)return i=ab(c,a,r,n),e.s<0?new c(1).div(i):We(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=vr(+a,l),t=r==0||!isFinite(r)?jr(l*(Math.log("0."+Mr(a.d))/Math.LN10+a.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?s/0:0):(at=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),i=zf(e.times(Wi(a,n+r)),n),i.d&&(i=We(i,n+5,1),pa(i.d,n,o)&&(t=n+10,i=We(zf(e.times(Wi(a,t+r)),t),t+5,1),+Mr(i.d).slice(n+1,n+15)+1==1e14&&(i=We(i,n+1,0)))),i.s=s,at=!0,c.rounding=o,We(i,n,o))};ve.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Zn(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Wr(e,1,io),t===void 0?t=i.rounding:Wr(t,0,8),n=We(new i(n),e,t),r=Zn(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};ve.toSignificantDigits=ve.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Wr(e,1,io),t===void 0?t=n.rounding:Wr(t,0,8)),We(new n(r),e,t)};ve.toString=function(){var e=this,t=e.constructor,r=Zn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};ve.truncated=ve.trunc=function(){return We(new this.constructor(this),this.e+1,1)};ve.valueOf=ve.toJSON=function(){var e=this,t=e.constructor,r=Zn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Mr(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=Xe-n.length,r&&(o+=$i(r)),o+=n;s=e[t],n=s+"",r=Xe-n.length,r&&(o+=$i(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function Wr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Ji+e)}function pa(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=Xe,i=0):(i=Math.ceil((t+1)/Xe),t%=Xe),o=vr(10,Xe-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==vr(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==vr(10,t-3)-1,s}function vc(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=Ff.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function J_(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Rl(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=vs(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var Kt=function(){function e(n,i,o){var s,a=0,c=n.length;for(n=n.slice();c--;)s=n[c]*i+a,n[c]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,c;if(o!=s)c=o>s?1:-1;else for(a=c=0;a<o;a++)if(n[a]!=i[a]){c=n[a]>i[a]?1:-1;break}return c}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<i[o]?1:0,n[o]=a*s+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s,a,c){var l,u,d,p,y,x,b,M,R,P,k,F,B,W,z,G,re,oe,se,q,L=n.constructor,h=n.s==i.s?1:-1,f=n.d,m=i.d;if(!f||!f[0]||!m||!m[0])return new L(!n.s||!i.s||(f?m&&f[0]==m[0]:!m)?NaN:f&&f[0]==0||!m?h*0:h/0);for(c?(y=1,u=n.e-i.e):(c=Nn,y=Xe,u=jr(n.e/y)-jr(i.e/y)),se=m.length,re=f.length,R=new L(h),P=R.d=[],d=0;m[d]==(f[d]||0);d++);if(m[d]>(f[d]||0)&&u--,o==null?(W=o=L.precision,s=L.rounding):a?W=o+(n.e-i.e)+1:W=o,W<0)P.push(1),x=!0;else{if(W=W/y+2|0,d=0,se==1){for(p=0,m=m[0],W++;(d<re||p)&&W--;d++)z=p*c+(f[d]||0),P[d]=z/m|0,p=z%m|0;x=p||d<re}else{for(p=c/(m[0]+1)|0,p>1&&(m=e(m,p,c),f=e(f,p,c),se=m.length,re=f.length),G=se,k=f.slice(0,se),F=k.length;F<se;)k[F++]=0;q=m.slice(),q.unshift(0),oe=m[0],m[1]>=c/2&&++oe;do p=0,l=t(m,k,se,F),l<0?(B=k[0],se!=F&&(B=B*c+(k[1]||0)),p=B/oe|0,p>1?(p>=c&&(p=c-1),b=e(m,p,c),M=b.length,F=k.length,l=t(b,k,M,F),l==1&&(p--,r(b,se<M?q:m,M,c))):(p==0&&(l=p=1),b=m.slice()),M=b.length,M<F&&b.unshift(0),r(k,b,F,c),l==-1&&(F=k.length,l=t(m,k,se,F),l<1&&(p++,r(k,se<F?q:m,F,c))),F=k.length):l===0&&(p++,k=[0]),P[d++]=p,l&&k[0]?k[F++]=f[G]||0:(k=[f[G]],F=1);while((G++<re||k[0]!==void 0)&&W--);x=k[0]!==void 0}P[0]||P.shift()}if(y==1)R.e=u,tb=x;else{for(d=1,p=P[0];p>=10;p/=10)d++;R.e=d+u*y-1,We(R,a?o+R.e+1:o,s,x)}return R}}();function We(e,t,r,n){var i,o,s,a,c,l,u,d,p,y=e.constructor;e:if(t!=null){if(d=e.d,!d)return e;for(i=1,a=d[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=Xe,s=t,u=d[p=0],c=u/vr(10,i-s-1)%10|0;else if(p=Math.ceil((o+1)/Xe),a=d.length,p>=a)if(n){for(;a++<=p;)d.push(0);u=c=0,i=1,o%=Xe,s=o-Xe+1}else break e;else{for(u=a=d[p],i=1;a>=10;a/=10)i++;o%=Xe,s=o-Xe+i,c=s<0?0:u/vr(10,i-s-1)%10|0}if(n=n||t<0||d[p+1]!==void 0||(s<0?u:u%vr(10,i-s-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(o>0?s>0?u/vr(10,i-s):0:d[p-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=vr(10,(Xe-t%Xe)%Xe),e.e=-t||0):d[0]=e.e=0,e;if(o==0?(d.length=p,a=1,p--):(d.length=p+1,a=vr(10,Xe-o),d[p]=s>0?(u/vr(10,i-s)%vr(10,s)|0)*a:0),l)for(;;)if(p==0){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,d[0]==Nn&&(d[0]=1));break}else{if(d[p]+=a,d[p]!=Nn)break;d[p--]=0,a=1}for(o=d.length;d[--o]===0;)d.pop()}return at&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e<y.minE&&(e.e=0,e.d=[0])),e}function Zn(e,t,r){if(!e.isFinite())return lb(e);var n,i=e.e,o=Mr(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+$i(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+$i(-i-1)+o,r&&(n=r-s)>0&&(o+=$i(n))):i>=s?(o+=$i(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+$i(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=$i(n))),o}function Il(e,t){var r=e[0];for(t*=Xe;r>=10;r/=10)t++;return t}function qc(e,t,r){if(t>X_)throw at=!0,r&&(e.precision=r),Error(rb);return We(new e(Vc),t,1,!0)}function Kn(e,t,r){if(t>Vf)throw Error(rb);return We(new e(zc),t,r,!0)}function sb(e){var t=e.length-1,r=t*Xe+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function $i(e){for(var t="";e--;)t+="0";return t}function ab(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/Xe+4);for(at=!1;;){if(r%2&&(o=o.times(t),cp(o.d,s)&&(i=!0)),r=jr(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),cp(t.d,s)}return at=!0,o}function ap(e){return e.d[e.d.length-1]&1}function cb(e,t,r){for(var n,i,o=new e(t[0]),s=0;++s<t.length;){if(i=new e(t[s]),!i.s){o=i;break}n=o.cmp(i),(n===r||n===0&&o.s===r)&&(o=i)}return o}function zf(e,t){var r,n,i,o,s,a,c,l=0,u=0,d=0,p=e.constructor,y=p.rounding,x=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(at=!1,c=x):c=t,a=new p(.03125);e.e>-2;)e=e.times(a),d+=5;for(n=Math.log(vr(2,d))/Math.LN10*2+5|0,c+=n,r=o=s=new p(1),p.precision=c;;){if(o=We(o.times(e),c,1),r=r.times(++u),a=s.plus(Kt(o,r,c,1)),Mr(a.d).slice(0,c)===Mr(s.d).slice(0,c)){for(i=d;i--;)s=We(s.times(s),c,1);if(t==null)if(l<3&&pa(s.d,c-n,y,l))p.precision=c+=10,r=o=a=new p(1),u=0,l++;else return We(s,p.precision=x,y,at=!0);else return p.precision=x,s}s=a}}function Wi(e,t){var r,n,i,o,s,a,c,l,u,d,p,y=1,x=10,b=e,M=b.d,R=b.constructor,P=R.rounding,k=R.precision;if(b.s<0||!M||!M[0]||!b.e&&M[0]==1&&M.length==1)return new R(M&&!M[0]?-1/0:b.s!=1?NaN:M?0:b);if(t==null?(at=!1,u=k):u=t,R.precision=u+=x,r=Mr(M),n=r.charAt(0),Math.abs(o=b.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)b=b.times(e),r=Mr(b.d),n=r.charAt(0),y++;o=b.e,n>1?(b=new R("0."+r),o++):b=new R(n+"."+r.slice(1))}else return l=qc(R,u+2,k).times(o+""),b=Wi(new R(n+"."+r.slice(1)),u-x).plus(l),R.precision=k,t==null?We(b,k,P,at=!0):b;for(d=b,c=s=b=Kt(b.minus(1),b.plus(1),u,1),p=We(b.times(b),u,1),i=3;;){if(s=We(s.times(p),u,1),l=c.plus(Kt(s,new R(i),u,1)),Mr(l.d).slice(0,u)===Mr(c.d).slice(0,u))if(c=c.times(2),o!==0&&(c=c.plus(qc(R,u+2,k).times(o+""))),c=Kt(c,new R(y),u,1),t==null)if(pa(c.d,u-x,P,a))R.precision=u+=x,l=s=b=Kt(d.minus(1),d.plus(1),u,1),p=We(b.times(b),u,1),i=a=1;else return We(c,R.precision=k,P,at=!0);else return R.precision=k,c;c=l,i+=2}}function lb(e){return String(e.s*e.s/0)}function bc(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%Xe,r<0&&(n+=Xe),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=Xe;n<i;)e.d.push(+t.slice(n,n+=Xe));t=t.slice(n),n=Xe-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),at&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Z_(e,t){var r,n,i,o,s,a,c,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ob.test(t))return bc(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(G_.test(t))r=16,t=t.toLowerCase();else if(W_.test(t))r=2;else if(K_.test(t))r=8;else throw Error(Ji+t);for(o=t.search(/p/i),o>0?(c=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=ab(n,new n(r),o,o*2)),l=vc(t,r,Nn),u=l.length-1,o=u;l[o]===0;--o)l.pop();return o<0?new n(e.s*0):(e.e=Il(l,u),e.d=l,at=!1,s&&(e=Kt(e,i,a*4)),c&&(e=e.times(Math.abs(c)<54?vr(2,c):Ur.pow(2,c))),at=!0,e)}function Q_(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:vs(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Rl(5,r)),t=vs(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function vs(e,t,r,n,i){var o,s,a,c,l=e.precision,u=Math.ceil(l/Xe);for(at=!1,c=r.times(r),a=new e(n);;){if(s=Kt(a.times(c),new e(t++*t++),l,1),a=i?n.plus(s):n.minus(s),n=Kt(s.times(c),new e(t++*t++),l,1),s=a.plus(n),s.d[u]!==void 0){for(o=u;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o}return at=!0,s.d.length=u+1,s}function Rl(e,t){for(var r=e;--t;)r*=e;return r}function ub(e,t){var r,n=t.s<0,i=Kn(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return xi=n?4:1,t;if(r=t.divToInt(i),r.isZero())xi=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return xi=ap(r)?n?2:3:n?4:1,t;xi=ap(r)?n?1:4:n?3:2}return t.minus(i).abs()}function s0(e,t,r,n){var i,o,s,a,c,l,u,d,p,y=e.constructor,x=r!==void 0;if(x?(Wr(r,1,io),n===void 0?n=y.rounding:Wr(n,0,8)):(r=y.precision,n=y.rounding),!e.isFinite())u=lb(e);else{for(u=Zn(e),s=u.indexOf("."),x?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(u=u.replace(".",""),p=new y(1),p.e=u.length-s,p.d=vc(Zn(p),10,i),p.e=p.d.length),d=vc(u,10,i),o=c=d.length;d[--c]==0;)d.pop();if(!d[0])u=x?"0p+0":"0";else{if(s<0?o--:(e=new y(e),e.d=d,e.e=o,e=Kt(e,p,r,n,0,i),d=e.d,o=e.e,l=tb),s=d[r],a=i/2,l=l||d[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&d[r-1]&1||n===(e.s<0?8:7)),d.length=r,l)for(;++d[--r]>i-1;)d[r]=0,r||(++o,d.unshift(1));for(c=d.length;!d[c-1];--c);for(s=0,u="";s<c;s++)u+=Ff.charAt(d[s]);if(x){if(c>1)if(t==16||t==8){for(s=t==16?4:3,--c;c%s;c++)u+="0";for(d=vc(u,i,t),c=d.length;!d[c-1];--c);for(s=1,u="1.";s<c;s++)u+=Ff.charAt(d[s])}else u=u.charAt(0)+"."+u.slice(1);u=u+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)u="0"+u;u="0."+u}else if(++o>c)for(o-=c;o--;)u+="0";else o<c&&(u=u.slice(0,o)+"."+u.slice(o))}u=(t==16?"0x":t==2?"0b":t==8?"0o":"")+u}return e.s<0?"-"+u:u}function cp(e,t){if(e.length>t)return e.length=t,!0}function eE(e){return new this(e).abs()}function tE(e){return new this(e).acos()}function rE(e){return new this(e).acosh()}function nE(e,t){return new this(e).plus(t)}function iE(e){return new this(e).asin()}function oE(e){return new this(e).asinh()}function sE(e){return new this(e).atan()}function aE(e){return new this(e).atanh()}function cE(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Kn(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Kn(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Kn(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(Kt(e,t,o,1)),t=Kn(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(Kt(e,t,o,1)),r}function lE(e){return new this(e).cbrt()}function uE(e){return We(e=new this(e),e.e+1,2)}function fE(e,t,r){return new this(e).clamp(t,r)}function dE(e){if(!e||typeof e!="object")throw Error(Ml+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,io,"rounding",0,8,"toExpNeg",-os,0,"toExpPos",0,os,"maxE",0,os,"minE",-os,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=$f[r]),(n=e[r])!==void 0)if(jr(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Ji+r+": "+n);if(r="crypto",i&&(this[r]=$f[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(nb);else this[r]=!1;else throw Error(Ji+r+": "+n);return this}function hE(e){return new this(e).cos()}function pE(e){return new this(e).cosh()}function fb(e){var t,r,n;function i(o){var s,a,c,l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,lp(o)){l.s=o.s,at?!o.d||o.e>i.maxE?(l.e=NaN,l.d=null):o.e<i.minE?(l.e=0,l.d=[0]):(l.e=o.e,l.d=o.d.slice()):(l.e=o.e,l.d=o.d?o.d.slice():o.d);return}if(c=typeof o,c==="number"){if(o===0){l.s=1/o<0?-1:1,l.e=0,l.d=[0];return}if(o<0?(o=-o,l.s=-1):l.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;at?s>i.maxE?(l.e=NaN,l.d=null):s<i.minE?(l.e=0,l.d=[0]):(l.e=s,l.d=[o]):(l.e=s,l.d=[o]);return}if(o*0!==0){o||(l.s=NaN),l.e=NaN,l.d=null;return}return bc(l,o.toString())}if(c==="string")return(a=o.charCodeAt(0))===45?(o=o.slice(1),l.s=-1):(a===43&&(o=o.slice(1)),l.s=1),ob.test(o)?bc(l,o):Z_(l,o);if(c==="bigint")return o<0?(o=-o,l.s=-1):l.s=1,bc(l,o.toString());throw Error(Ji+o)}if(i.prototype=ve,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=dE,i.clone=fb,i.isDecimal=lp,i.abs=eE,i.acos=tE,i.acosh=rE,i.add=nE,i.asin=iE,i.asinh=oE,i.atan=sE,i.atanh=aE,i.atan2=cE,i.cbrt=lE,i.ceil=uE,i.clamp=fE,i.cos=hE,i.cosh=pE,i.div=mE,i.exp=gE,i.floor=vE,i.hypot=bE,i.ln=yE,i.log=wE,i.log10=SE,i.log2=xE,i.max=_E,i.min=EE,i.mod=CE,i.mul=TE,i.pow=AE,i.random=ME,i.round=IE,i.sign=RE,i.sin=OE,i.sinh=PE,i.sqrt=NE,i.sub=kE,i.sum=jE,i.tan=DE,i.tanh=LE,i.trunc=BE,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function mE(e,t){return new this(e).div(t)}function gE(e){return new this(e).exp()}function vE(e){return We(e=new this(e),e.e+1,3)}function bE(){var e,t,r=new this(0);for(at=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return at=!0,new this(1/0);r=t}return at=!0,r.sqrt()}function lp(e){return e instanceof Ur||e&&e.toStringTag===ib||!1}function yE(e){return new this(e).ln()}function wE(e,t){return new this(e).log(t)}function xE(e){return new this(e).log(2)}function SE(e){return new this(e).log(10)}function _E(){return cb(this,arguments,-1)}function EE(){return cb(this,arguments,1)}function CE(e,t){return new this(e).mod(t)}function TE(e,t){return new this(e).mul(t)}function AE(e,t){return new this(e).pow(t)}function ME(e){var t,r,n,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:Wr(e,1,io),n=Math.ceil(e/Xe),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(nb);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],e%=Xe,n&&e&&(i=vr(10,Xe-e),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=Xe)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<Xe&&(r-=Xe-n)}return s.e=r,s.d=a,s}function IE(e){return We(e=new this(e),e.e+1,this.rounding)}function RE(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function OE(e){return new this(e).sin()}function PE(e){return new this(e).sinh()}function NE(e){return new this(e).sqrt()}function kE(e,t){return new this(e).sub(t)}function jE(){var e=0,t=arguments,r=new this(t[e]);for(at=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return at=!0,We(r,this.precision,this.rounding)}function DE(e){return new this(e).tan()}function LE(e){return new this(e).tanh()}function BE(e){return We(e=new this(e),e.e+1,1)}ve[Symbol.for("nodejs.util.inspect.custom")]=ve.toString;ve[Symbol.toStringTag]="Decimal";var Ur=ve.constructor=fb($f);Vc=new Ur(Vc);zc=new Ur(zc);Ur.config({precision:256,rounding:Ur.ROUND_DOWN,toExpNeg:-256,toExpPos:256});const Pr=(e,t,r,n=Ur.ROUND_HALF_DOWN)=>{if(e==="∞")return"∞";if(e!=="0"&&!e||Be(e).equals(0))return"0";if(t!==void 0){const l=ho(e,t,n);if(!Be(l).equals(0))return r?l:bs(l)}const i=Be(e).toString(),o=i.split("."),s=o[0],a=o[1];let c;if(Be(s).gt(0))!a||Be(s.length).gte(9)?c=ho(i,0,n):Be(s.length).gte(4)?c=ho(i,2,n):c=ho(i,4,n);else{ho(i,6,n);const l=$E(a);if(l<6)c=ho(i,l+6,n);else{if(l>30)return"0";c=ho(i,9+(l-6),n)}}return r||Be(s).lt(1)?c:bs(c)},db=(e,t,r,n)=>{try{if(e===void 0||e==="--")return"$--";const i=Pr(e,t,!0,Ur.ROUND_DOWN).toString();if(Be(i).equals(0))return"$0";const o=i.startsWith("-");let s=n?i:bs(i).toString();return s.includes("e")&&(s=n?i:bs(i).toString()),!r&&Number(i)<Math.pow(10,-t)?o?`-$${s.slice(1)}`:`<$${Math.pow(10,-t).toFixed(t)}`:o?`-$${s.slice(1)}`:`$${s}`}catch{return"$--"}},UE=(e,t,r=!0)=>{if(`${e}`=="0")return!parseFloat(t)||!r?"0":"0.".padEnd(t+2,"0");if(!e)return"--";const n=parseFloat(e),i=e.toString(),o=n<0;let s=i;if(i.toLowerCase().includes("e")){const a=i.match(/(\d+?)(?:\.(\d*))?e([+-])(\d+)/),c=a[1],l=a[2],u=a[3],d=a[4];let p="",y=l?l.substr(d):"";if(y&&(y=`.${y}`),u!=="-"){for(let x=0;x<d;x+=1){const b=l[x]||"0";p+=b}s=c+p+y}else{let x="0";for(let b=0;b<d;b+=1)p=(c[c.length-b-1]||"0")+p;c.length>d&&(x=c.substr(0,c.length-d)),s=`${x}.${p}${l}`}}if(t&&r){let a=`${s.split(".")[0]}.`;const c=s.split(".")[1]||"";for(let l=0;l<t;l+=1)a+=c[l]||"0";s=a}if(s.length>14){const a=s.split(".");a[0].length>14?s=`${a[0].slice(0,14)}+`:(s=s.slice(0,13),s.indexOf(".")===12&&(s=s.slice(0,12)))}return`${o?"-":""}${s}`},Be=e=>Ur.isDecimal(e)?e:new Ur(typeof e>"u"||e==="undefined"||!e?0:e);function FE(e,t){return t===void 0?"":Be(e==null?void 0:e.toString()).div(Math.pow(10,t)).toString()}const ho=(e,t,r)=>Be(e).toDP(t,r).toString(),bs=e=>{const[t,r]=e.split(".");let n="";for(let i=t.length-1,o=0;i>=0;i--,o++)n=t[i]+n,o%3===2&&i!==0&&(n=","+n);return r?`${n}.${r}`:n};function $E(e){let t=0;if(e)for(;t<e.length;){if(Be(e[t]).gt(0))return t+1;t++}return 0}function VE(e,t){const r=hb(Be(t));return Number(Be(e).mul(r))}function zE(e,t){const r=hb(Be(t));return Number(Be(e).div(r))}function hb(e){return Be(10).pow(Be(e).abs())}function qf(e,t){const r=zE(e,t);return qE(r.toString(),Number(t))}function qE(e,t=9){if(e===void 0)return"";const r=e.toLowerCase();if(r.includes("e")){if(r.includes("+"))return UE(r,t);const[n,i]=r.split("e");let o=n;const s=Math.abs(parseInt(i,10));let a="",c=o.length;if(n.includes(".")){const[l,u]=n.split(".");o=l+u,c=l.length}for(let l=0;l<s-c;l++)a+="0";return`0.${a}${o}`.slice(0,t+2)}return e}function Ol(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}const Po=(e,t="")=>t=="long"?e&&e.length>40?e.substring(0,40)+"...":e&&e.length<40?e:"":e?e.substring(0,6)+"..."+e.substring(e.length-4):"",a0=(e,t)=>{if(e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r)if(!a0(e[i],t[i]))return!1;return!0};function up(e){return!e||Object.keys(e).length===0}function pb(e){var t;return((t=e.split("::"))==null?void 0:t.length)===3}const fp=async e=>new Promise(t=>{setTimeout(()=>{t(1)},e)});function HE(e,t,r=!1){var a;const n=e.balanceChanges,i=(a=e.effects)==null?void 0:a.gasUsed,o={};let s="0";return i&&(s=Be(i.computationCost).add(i.storageCost).sub(i.storageRebate).mul(-1).toFixed(0)),n&&n.forEach(c=>{const l=Pn(c.coinType).full_address;if(c.owner.AddressOwner===t){const u=l===ul;let d=c.amount;u&&(d=r?d:Be(d).sub(s).toFixed(0));const p={coinType:l,amount:d};o[l]=p}}),o}function dp(e,t){if(t){const r=e[Pn(t.coin_type).full_address];if(r)return qf(Be(r.amount).abs().toFixed(0),t.decimals)}}function Ot(e){return`https://archive.cetus.zone/assets/terminal${e}`}const dn=(e,t=10)=>e&&(e==null?void 0:e.length)>t&&Be(t).gt(0)?`${e.slice(0,t)}...`:e,Ya=(e,t)=>Ti(e||"")===Ti(t||""),WE=e=>e===null||typeof e!="object"||Array.isArray(e)?!1:Object.keys(e).length>0,GE=async function(e,t,r=3e4){const n=[];let i="";if(t){for(const c in t){const l=`${c}=${t[c]}`;n.push(l)}const a=n.join("&");i=`${e}?${a}`}else i=e;const o=new AbortController,s=setTimeout(()=>{o.abort()},r);try{const a=await fetch(i,{signal:o.signal});if(clearTimeout(s),!a.ok)throw new Error("Request failed");const c=await a.json();return(c==null?void 0:c.data)||c}catch(a){throw clearTimeout(s),a.name==="AbortError"?new Error("request time out"):a}},KE=async function(e,t,r=3e4){const n=new AbortController,i=setTimeout(()=>{n.abort()},r);try{const o=await fetch(e,{body:JSON.stringify(t),method:"POST",signal:n.signal});if(clearTimeout(i),!o.ok)throw new Error("Request failed");return o.json()}catch(o){throw clearTimeout(i),o.name==="AbortError"?new Error("request time out"):o}},Hf="tokenMap",mb="trustedTokenList",gb="collectTokenMap",vb="importTokenList";function Xa(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var bb={exports:{}};/*!
|
|
40
|
+
*/var os=9e15,io=1e9,Ff="0123456789abcdef",Vc="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",zc="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",$f={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-os,maxE:os,crypto:!1},nb,xi,at=!0,Ml="[DecimalError] ",Ji=Ml+"Invalid argument: ",ib=Ml+"Precision limit exceeded",ob=Ml+"crypto unavailable",sb="[object Decimal]",Dr=Math.floor,vr=Math.pow,Z_=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Q_=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,eE=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ab=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Pn=1e7,Xe=7,tE=9007199254740991,rE=Vc.length-1,Vf=zc.length-1,ve={toStringTag:sb};ve.absoluteValue=ve.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),We(e)};ve.ceil=function(){return We(new this.constructor(this),this.e+1,2)};ve.clampedTo=ve.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Ji+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};ve.comparedTo=ve.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,c=o.s,l=e.s;if(!s||!a)return!c||!l?NaN:c!==l?c:s===a?0:!s^c<0?1:-1;if(!s[0]||!a[0])return s[0]?c:a[0]?-l:0;if(c!==l)return c;if(o.e!==e.e)return o.e>e.e^c<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1};ve.cosine=ve.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Xe,n.rounding=1,r=nE(n,db(n,r)),n.precision=e,n.rounding=t,We(xi==2||xi==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};ve.cubeRoot=ve.cbrt=function(){var e,t,r,n,i,o,s,a,c,l,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(at=!1,o=u.s*vr(u.s*u,1/3),!o||Math.abs(o)==1/0?(r=Ir(u.d),e=u.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=vr(r,1/3),e=Dr((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new d(r),n.s=u.s):n=new d(o.toString()),s=(e=d.precision)+3;;)if(a=n,c=a.times(a).times(a),l=c.plus(u),n=Kt(l.plus(u).times(a),l.plus(c),s+2,1),Ir(a.d).slice(0,s)===(r=Ir(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(We(a,e+1,0),a.times(a).times(a).eq(u))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(We(n,e+1,1),t=!n.times(n).times(n).eq(u));break}return at=!0,We(n,e,d.rounding,t)};ve.decimalPlaces=ve.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Dr(this.e/Xe))*Xe,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};ve.dividedBy=ve.div=function(e){return Kt(this,new this.constructor(e))};ve.dividedToIntegerBy=ve.divToInt=function(e){var t=this,r=t.constructor;return We(Kt(t,new r(e),0,1,1),r.precision,r.rounding)};ve.equals=ve.eq=function(e){return this.cmp(e)===0};ve.floor=function(){return We(new this.constructor(this),this.e+1,3)};ve.greaterThan=ve.gt=function(e){return this.cmp(e)>0};ve.greaterThanOrEqualTo=ve.gte=function(e){var t=this.cmp(e);return t==1||t===0};ve.hyperbolicCosine=ve.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Ol(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=vs(s,1,o.times(t),new s(1),!0);for(var c,l=e,u=new s(8);l--;)c=o.times(o),o=a.minus(c.times(u.minus(c.times(u))));return We(o,s.precision=r,s.rounding=n,!0)};ve.hyperbolicSine=ve.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=vs(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Ol(5,e)),i=vs(o,2,i,i,!0);for(var s,a=new o(5),c=new o(16),l=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(c.times(s).plus(l))))}return o.precision=t,o.rounding=r,We(i,t,r,!0)};ve.hyperbolicTangent=ve.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,Kt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};ve.inverseCosine=ve.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?Kn(t,n,i):new t(0):new t(NaN):e.isZero()?Kn(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};ve.inverseHyperbolicCosine=ve.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,at=!1,r=r.times(r).minus(1).sqrt().plus(r),at=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};ve.inverseHyperbolicSine=ve.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,at=!1,r=r.times(r).plus(1).sqrt().plus(r),at=!0,n.precision=e,n.rounding=t,r.ln())};ve.inverseHyperbolicTangent=ve.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?We(new o(i),e,t,!0):(o.precision=r=n-i.e,i=Kt(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};ve.inverseSine=ve.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=Kn(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};ve.inverseTangent=ve.atan=function(){var e,t,r,n,i,o,s,a,c,l=this,u=l.constructor,d=u.precision,p=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&d+4<=Vf)return s=Kn(u,d+4,p).times(.25),s.s=l.s,s}else{if(!l.s)return new u(NaN);if(d+4<=Vf)return s=Kn(u,d+4,p).times(.5),s.s=l.s,s}for(u.precision=a=d+10,u.rounding=1,r=Math.min(28,a/Xe+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(at=!1,t=Math.ceil(a/Xe),n=1,c=l.times(l),s=new u(l),i=l;e!==-1;)if(i=i.times(c),o=s.minus(i.div(n+=2)),i=i.times(c),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),at=!0,We(s,u.precision=d,u.rounding=p,!0)};ve.isFinite=function(){return!!this.d};ve.isInteger=ve.isInt=function(){return!!this.d&&Dr(this.e/Xe)>this.d.length-2};ve.isNaN=function(){return!this.s};ve.isNegative=ve.isNeg=function(){return this.s<0};ve.isPositive=ve.isPos=function(){return this.s>0};ve.isZero=function(){return!!this.d&&this.d[0]===0};ve.lessThan=ve.lt=function(e){return this.cmp(e)<0};ve.lessThanOrEqualTo=ve.lte=function(e){return this.cmp(e)<1};ve.logarithm=ve.log=function(e){var t,r,n,i,o,s,a,c,l=this,u=l.constructor,d=u.precision,p=u.rounding,y=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new u(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(at=!1,a=d+y,s=Wi(l,a),n=t?qc(u,a+10):Wi(e,a),c=Kt(s,n,a,1),pa(c.d,i=d,p))do if(a+=10,s=Wi(l,a),n=t?qc(u,a+10):Wi(e,a),c=Kt(s,n,a,1),!o){+Ir(c.d).slice(i+1,i+15)+1==1e14&&(c=We(c,d+1,0));break}while(pa(c.d,i+=10,p));return at=!0,We(c,d,p)};ve.minus=ve.sub=function(e){var t,r,n,i,o,s,a,c,l,u,d,p,y=this,x=y.constructor;if(e=new x(e),!y.d||!e.d)return!y.s||!e.s?e=new x(NaN):y.d?e.s=-e.s:e=new x(e.d||y.s!==e.s?y:NaN),e;if(y.s!=e.s)return e.s=-e.s,y.plus(e);if(l=y.d,p=e.d,a=x.precision,c=x.rounding,!l[0]||!p[0]){if(p[0])e.s=-e.s;else if(l[0])e=new x(y);else return new x(c===3?-0:0);return at?We(e,a,c):e}if(r=Dr(e.e/Xe),u=Dr(y.e/Xe),l=l.slice(),o=u-r,o){for(d=o<0,d?(t=l,o=-o,s=p.length):(t=p,r=u,s=l.length),n=Math.max(Math.ceil(a/Xe),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=p.length,d=n<s,d&&(s=n),n=0;n<s;n++)if(l[n]!=p[n]){d=l[n]<p[n];break}o=0}for(d&&(t=l,l=p,p=t,e.s=-e.s),s=l.length,n=p.length-s;n>0;--n)l[s++]=0;for(n=p.length;n>o;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=Pn-1;--l[i],l[n]+=Pn}l[n]-=p[n]}for(;l[--s]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=Il(l,r),at?We(e,a,c):e):new x(c===3?-0:0)};ve.modulo=ve.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?We(new n(r),n.precision,n.rounding):(at=!1,n.modulo==9?(t=Kt(r,e.abs(),0,3,1),t.s*=e.s):t=Kt(r,e,0,n.modulo,1),t=t.times(e),at=!0,r.minus(t))};ve.naturalExponential=ve.exp=function(){return zf(this)};ve.naturalLogarithm=ve.ln=function(){return Wi(this)};ve.negated=ve.neg=function(){var e=new this.constructor(this);return e.s=-e.s,We(e)};ve.plus=ve.add=function(e){var t,r,n,i,o,s,a,c,l,u,d=this,p=d.constructor;if(e=new p(e),!d.d||!e.d)return!d.s||!e.s?e=new p(NaN):d.d||(e=new p(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(l=d.d,u=e.d,a=p.precision,c=p.rounding,!l[0]||!u[0])return u[0]||(e=new p(d)),at?We(e,a,c):e;if(o=Dr(d.e/Xe),n=Dr(e.e/Xe),l=l.slice(),i=o-n,i){for(i<0?(r=l,i=-i,s=u.length):(r=u,n=o,s=l.length),o=Math.ceil(a/Xe),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=u.length,s-i<0&&(i=s,r=u,u=l,l=r),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/Pn|0,l[i]%=Pn;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=Il(l,n),at?We(e,a,c):e};ve.precision=ve.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ji+e);return r.d?(t=cb(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};ve.round=function(){var e=this,t=e.constructor;return We(new t(e),e.e+1,t.rounding)};ve.sine=ve.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+Xe,n.rounding=1,r=oE(n,db(n,r)),n.precision=e,n.rounding=t,We(xi>2?r.neg():r,e,t,!0)):new n(NaN)};ve.squareRoot=ve.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,c=s.e,l=s.s,u=s.constructor;if(l!==1||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(at=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=Ir(a),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=Dr((c+1)/2)-(c<0||c%2),l==1/0?t="5e"+c:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+c),n=new u(t)):n=new u(l.toString()),r=(c=u.precision)+3;;)if(o=n,n=o.plus(Kt(s,o,r+2,1)).times(.5),Ir(o.d).slice(0,r)===(t=Ir(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(We(o,c+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(We(n,c+1,1),e=!n.times(n).eq(s));break}return at=!0,We(n,c,u.rounding,e)};ve.tangent=ve.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=Kt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,We(xi==2||xi==4?r.neg():r,e,t,!0)):new n(NaN)};ve.times=ve.mul=function(e){var t,r,n,i,o,s,a,c,l,u=this,d=u.constructor,p=u.d,y=(e=new d(e)).d;if(e.s*=u.s,!p||!p[0]||!y||!y[0])return new d(!e.s||p&&!p[0]&&!y||y&&!y[0]&&!p?NaN:!p||!y?e.s/0:e.s*0);for(r=Dr(u.e/Xe)+Dr(e.e/Xe),c=p.length,l=y.length,c<l&&(o=p,p=y,y=o,s=c,c=l,l=s),o=[],s=c+l,n=s;n--;)o.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)a=o[i]+y[n]*p[i-n-1]+t,o[i--]=a%Pn|0,t=a/Pn|0;o[i]=(o[i]+t)%Pn|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=Il(o,r),at?We(e,d.precision,d.rounding):e};ve.toBinary=function(e,t){return c0(this,2,e,t)};ve.toDecimalPlaces=ve.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Wr(e,0,io),t===void 0?t=n.rounding:Wr(t,0,8),We(r,e+r.e+1,t))};ve.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Zn(n,!0):(Wr(e,0,io),t===void 0?t=i.rounding:Wr(t,0,8),n=We(new i(n),e+1,t),r=Zn(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};ve.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Zn(i):(Wr(e,0,io),t===void 0?t=o.rounding:Wr(t,0,8),n=We(new o(i),e+i.e+1,t),r=Zn(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};ve.toFraction=function(e){var t,r,n,i,o,s,a,c,l,u,d,p,y=this,x=y.d,b=y.constructor;if(!x)return new b(y);if(l=r=new b(1),n=c=new b(0),t=new b(n),o=t.e=cb(x)-y.e-1,s=o%Xe,t.d[0]=vr(10,s<0?Xe+s:s),e==null)e=o>0?t:l;else{if(a=new b(e),!a.isInt()||a.lt(l))throw Error(Ji+a);e=a.gt(t)?o>0?t:l:a}for(at=!1,a=new b(Ir(x)),u=b.precision,b.precision=o=x.length*Xe*2;d=Kt(a,t,0,1,1),i=r.plus(d.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(d.times(i)),c=i,i=t,t=a.minus(d.times(i)),a=i;return i=Kt(e.minus(r),n,0,1,1),c=c.plus(i.times(l)),r=r.plus(i.times(n)),c.s=l.s=y.s,p=Kt(l,n,o,1).minus(y).abs().cmp(Kt(c,r,o,1).minus(y).abs())<1?[l,n]:[c,r],b.precision=u,at=!0,p};ve.toHexadecimal=ve.toHex=function(e,t){return c0(this,16,e,t)};ve.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:Wr(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(at=!1,r=Kt(r,e,0,t,1).times(e),at=!0,We(r)):(e.s=r.s,r=e),r};ve.toNumber=function(){return+this};ve.toOctal=function(e,t){return c0(this,8,e,t)};ve.toPower=ve.pow=function(e){var t,r,n,i,o,s,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(vr(+a,l));if(a=new c(a),a.eq(1))return a;if(n=c.precision,o=c.rounding,e.eq(1))return We(a,n,o);if(t=Dr(e.e/Xe),t>=e.d.length-1&&(r=l<0?-l:l)<=tE)return i=lb(c,a,r,n),e.s<0?new c(1).div(i):We(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=vr(+a,l),t=r==0||!isFinite(r)?Dr(l*(Math.log("0."+Ir(a.d))/Math.LN10+a.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?s/0:0):(at=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),i=zf(e.times(Wi(a,n+r)),n),i.d&&(i=We(i,n+5,1),pa(i.d,n,o)&&(t=n+10,i=We(zf(e.times(Wi(a,t+r)),t),t+5,1),+Ir(i.d).slice(n+1,n+15)+1==1e14&&(i=We(i,n+1,0)))),i.s=s,at=!0,c.rounding=o,We(i,n,o))};ve.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Zn(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Wr(e,1,io),t===void 0?t=i.rounding:Wr(t,0,8),n=We(new i(n),e,t),r=Zn(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};ve.toSignificantDigits=ve.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Wr(e,1,io),t===void 0?t=n.rounding:Wr(t,0,8)),We(new n(r),e,t)};ve.toString=function(){var e=this,t=e.constructor,r=Zn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};ve.truncated=ve.trunc=function(){return We(new this.constructor(this),this.e+1,1)};ve.valueOf=ve.toJSON=function(){var e=this,t=e.constructor,r=Zn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Ir(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=Xe-n.length,r&&(o+=$i(r)),o+=n;s=e[t],n=s+"",r=Xe-n.length,r&&(o+=$i(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function Wr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Ji+e)}function pa(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=Xe,i=0):(i=Math.ceil((t+1)/Xe),t%=Xe),o=vr(10,Xe-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==vr(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==vr(10,t-3)-1,s}function vc(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=Ff.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function nE(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Ol(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=vs(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var Kt=function(){function e(n,i,o){var s,a=0,c=n.length;for(n=n.slice();c--;)s=n[c]*i+a,n[c]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,c;if(o!=s)c=o>s?1:-1;else for(a=c=0;a<o;a++)if(n[a]!=i[a]){c=n[a]>i[a]?1:-1;break}return c}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<i[o]?1:0,n[o]=a*s+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s,a,c){var l,u,d,p,y,x,b,M,O,P,k,F,B,W,z,G,re,oe,se,q,L=n.constructor,h=n.s==i.s?1:-1,f=n.d,m=i.d;if(!f||!f[0]||!m||!m[0])return new L(!n.s||!i.s||(f?m&&f[0]==m[0]:!m)?NaN:f&&f[0]==0||!m?h*0:h/0);for(c?(y=1,u=n.e-i.e):(c=Pn,y=Xe,u=Dr(n.e/y)-Dr(i.e/y)),se=m.length,re=f.length,O=new L(h),P=O.d=[],d=0;m[d]==(f[d]||0);d++);if(m[d]>(f[d]||0)&&u--,o==null?(W=o=L.precision,s=L.rounding):a?W=o+(n.e-i.e)+1:W=o,W<0)P.push(1),x=!0;else{if(W=W/y+2|0,d=0,se==1){for(p=0,m=m[0],W++;(d<re||p)&&W--;d++)z=p*c+(f[d]||0),P[d]=z/m|0,p=z%m|0;x=p||d<re}else{for(p=c/(m[0]+1)|0,p>1&&(m=e(m,p,c),f=e(f,p,c),se=m.length,re=f.length),G=se,k=f.slice(0,se),F=k.length;F<se;)k[F++]=0;q=m.slice(),q.unshift(0),oe=m[0],m[1]>=c/2&&++oe;do p=0,l=t(m,k,se,F),l<0?(B=k[0],se!=F&&(B=B*c+(k[1]||0)),p=B/oe|0,p>1?(p>=c&&(p=c-1),b=e(m,p,c),M=b.length,F=k.length,l=t(b,k,M,F),l==1&&(p--,r(b,se<M?q:m,M,c))):(p==0&&(l=p=1),b=m.slice()),M=b.length,M<F&&b.unshift(0),r(k,b,F,c),l==-1&&(F=k.length,l=t(m,k,se,F),l<1&&(p++,r(k,se<F?q:m,F,c))),F=k.length):l===0&&(p++,k=[0]),P[d++]=p,l&&k[0]?k[F++]=f[G]||0:(k=[f[G]],F=1);while((G++<re||k[0]!==void 0)&&W--);x=k[0]!==void 0}P[0]||P.shift()}if(y==1)O.e=u,nb=x;else{for(d=1,p=P[0];p>=10;p/=10)d++;O.e=d+u*y-1,We(O,a?o+O.e+1:o,s,x)}return O}}();function We(e,t,r,n){var i,o,s,a,c,l,u,d,p,y=e.constructor;e:if(t!=null){if(d=e.d,!d)return e;for(i=1,a=d[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=Xe,s=t,u=d[p=0],c=u/vr(10,i-s-1)%10|0;else if(p=Math.ceil((o+1)/Xe),a=d.length,p>=a)if(n){for(;a++<=p;)d.push(0);u=c=0,i=1,o%=Xe,s=o-Xe+1}else break e;else{for(u=a=d[p],i=1;a>=10;a/=10)i++;o%=Xe,s=o-Xe+i,c=s<0?0:u/vr(10,i-s-1)%10|0}if(n=n||t<0||d[p+1]!==void 0||(s<0?u:u%vr(10,i-s-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(o>0?s>0?u/vr(10,i-s):0:d[p-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=vr(10,(Xe-t%Xe)%Xe),e.e=-t||0):d[0]=e.e=0,e;if(o==0?(d.length=p,a=1,p--):(d.length=p+1,a=vr(10,Xe-o),d[p]=s>0?(u/vr(10,i-s)%vr(10,s)|0)*a:0),l)for(;;)if(p==0){for(o=1,s=d[0];s>=10;s/=10)o++;for(s=d[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,d[0]==Pn&&(d[0]=1));break}else{if(d[p]+=a,d[p]!=Pn)break;d[p--]=0,a=1}for(o=d.length;d[--o]===0;)d.pop()}return at&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e<y.minE&&(e.e=0,e.d=[0])),e}function Zn(e,t,r){if(!e.isFinite())return fb(e);var n,i=e.e,o=Ir(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+$i(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+$i(-i-1)+o,r&&(n=r-s)>0&&(o+=$i(n))):i>=s?(o+=$i(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+$i(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=$i(n))),o}function Il(e,t){var r=e[0];for(t*=Xe;r>=10;r/=10)t++;return t}function qc(e,t,r){if(t>rE)throw at=!0,r&&(e.precision=r),Error(ib);return We(new e(Vc),t,1,!0)}function Kn(e,t,r){if(t>Vf)throw Error(ib);return We(new e(zc),t,r,!0)}function cb(e){var t=e.length-1,r=t*Xe+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function $i(e){for(var t="";e--;)t+="0";return t}function lb(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/Xe+4);for(at=!1;;){if(r%2&&(o=o.times(t),up(o.d,s)&&(i=!0)),r=Dr(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),up(t.d,s)}return at=!0,o}function lp(e){return e.d[e.d.length-1]&1}function ub(e,t,r){for(var n,i,o=new e(t[0]),s=0;++s<t.length;){if(i=new e(t[s]),!i.s){o=i;break}n=o.cmp(i),(n===r||n===0&&o.s===r)&&(o=i)}return o}function zf(e,t){var r,n,i,o,s,a,c,l=0,u=0,d=0,p=e.constructor,y=p.rounding,x=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:0/0);for(t==null?(at=!1,c=x):c=t,a=new p(.03125);e.e>-2;)e=e.times(a),d+=5;for(n=Math.log(vr(2,d))/Math.LN10*2+5|0,c+=n,r=o=s=new p(1),p.precision=c;;){if(o=We(o.times(e),c,1),r=r.times(++u),a=s.plus(Kt(o,r,c,1)),Ir(a.d).slice(0,c)===Ir(s.d).slice(0,c)){for(i=d;i--;)s=We(s.times(s),c,1);if(t==null)if(l<3&&pa(s.d,c-n,y,l))p.precision=c+=10,r=o=a=new p(1),u=0,l++;else return We(s,p.precision=x,y,at=!0);else return p.precision=x,s}s=a}}function Wi(e,t){var r,n,i,o,s,a,c,l,u,d,p,y=1,x=10,b=e,M=b.d,O=b.constructor,P=O.rounding,k=O.precision;if(b.s<0||!M||!M[0]||!b.e&&M[0]==1&&M.length==1)return new O(M&&!M[0]?-1/0:b.s!=1?NaN:M?0:b);if(t==null?(at=!1,u=k):u=t,O.precision=u+=x,r=Ir(M),n=r.charAt(0),Math.abs(o=b.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)b=b.times(e),r=Ir(b.d),n=r.charAt(0),y++;o=b.e,n>1?(b=new O("0."+r),o++):b=new O(n+"."+r.slice(1))}else return l=qc(O,u+2,k).times(o+""),b=Wi(new O(n+"."+r.slice(1)),u-x).plus(l),O.precision=k,t==null?We(b,k,P,at=!0):b;for(d=b,c=s=b=Kt(b.minus(1),b.plus(1),u,1),p=We(b.times(b),u,1),i=3;;){if(s=We(s.times(p),u,1),l=c.plus(Kt(s,new O(i),u,1)),Ir(l.d).slice(0,u)===Ir(c.d).slice(0,u))if(c=c.times(2),o!==0&&(c=c.plus(qc(O,u+2,k).times(o+""))),c=Kt(c,new O(y),u,1),t==null)if(pa(c.d,u-x,P,a))O.precision=u+=x,l=s=b=Kt(d.minus(1),d.plus(1),u,1),p=We(b.times(b),u,1),i=a=1;else return We(c,O.precision=k,P,at=!0);else return O.precision=k,c;c=l,i+=2}}function fb(e){return String(e.s*e.s/0)}function bc(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%Xe,r<0&&(n+=Xe),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=Xe;n<i;)e.d.push(+t.slice(n,n+=Xe));t=t.slice(n),n=Xe-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),at&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function iE(e,t){var r,n,i,o,s,a,c,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ab.test(t))return bc(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Q_.test(t))r=16,t=t.toLowerCase();else if(Z_.test(t))r=2;else if(eE.test(t))r=8;else throw Error(Ji+t);for(o=t.search(/p/i),o>0?(c=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=lb(n,new n(r),o,o*2)),l=vc(t,r,Pn),u=l.length-1,o=u;l[o]===0;--o)l.pop();return o<0?new n(e.s*0):(e.e=Il(l,u),e.d=l,at=!1,s&&(e=Kt(e,i,a*4)),c&&(e=e.times(Math.abs(c)<54?vr(2,c):Fr.pow(2,c))),at=!0,e)}function oE(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:vs(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Ol(5,r)),t=vs(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function vs(e,t,r,n,i){var o,s,a,c,l=e.precision,u=Math.ceil(l/Xe);for(at=!1,c=r.times(r),a=new e(n);;){if(s=Kt(a.times(c),new e(t++*t++),l,1),a=i?n.plus(s):n.minus(s),n=Kt(s.times(c),new e(t++*t++),l,1),s=a.plus(n),s.d[u]!==void 0){for(o=u;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o}return at=!0,s.d.length=u+1,s}function Ol(e,t){for(var r=e;--t;)r*=e;return r}function db(e,t){var r,n=t.s<0,i=Kn(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return xi=n?4:1,t;if(r=t.divToInt(i),r.isZero())xi=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return xi=lp(r)?n?2:3:n?4:1,t;xi=lp(r)?n?1:4:n?3:2}return t.minus(i).abs()}function c0(e,t,r,n){var i,o,s,a,c,l,u,d,p,y=e.constructor,x=r!==void 0;if(x?(Wr(r,1,io),n===void 0?n=y.rounding:Wr(n,0,8)):(r=y.precision,n=y.rounding),!e.isFinite())u=fb(e);else{for(u=Zn(e),s=u.indexOf("."),x?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(u=u.replace(".",""),p=new y(1),p.e=u.length-s,p.d=vc(Zn(p),10,i),p.e=p.d.length),d=vc(u,10,i),o=c=d.length;d[--c]==0;)d.pop();if(!d[0])u=x?"0p+0":"0";else{if(s<0?o--:(e=new y(e),e.d=d,e.e=o,e=Kt(e,p,r,n,0,i),d=e.d,o=e.e,l=nb),s=d[r],a=i/2,l=l||d[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&d[r-1]&1||n===(e.s<0?8:7)),d.length=r,l)for(;++d[--r]>i-1;)d[r]=0,r||(++o,d.unshift(1));for(c=d.length;!d[c-1];--c);for(s=0,u="";s<c;s++)u+=Ff.charAt(d[s]);if(x){if(c>1)if(t==16||t==8){for(s=t==16?4:3,--c;c%s;c++)u+="0";for(d=vc(u,i,t),c=d.length;!d[c-1];--c);for(s=1,u="1.";s<c;s++)u+=Ff.charAt(d[s])}else u=u.charAt(0)+"."+u.slice(1);u=u+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)u="0"+u;u="0."+u}else if(++o>c)for(o-=c;o--;)u+="0";else o<c&&(u=u.slice(0,o)+"."+u.slice(o))}u=(t==16?"0x":t==2?"0b":t==8?"0o":"")+u}return e.s<0?"-"+u:u}function up(e,t){if(e.length>t)return e.length=t,!0}function sE(e){return new this(e).abs()}function aE(e){return new this(e).acos()}function cE(e){return new this(e).acosh()}function lE(e,t){return new this(e).plus(t)}function uE(e){return new this(e).asin()}function fE(e){return new this(e).asinh()}function dE(e){return new this(e).atan()}function hE(e){return new this(e).atanh()}function pE(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Kn(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Kn(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Kn(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(Kt(e,t,o,1)),t=Kn(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(Kt(e,t,o,1)),r}function mE(e){return new this(e).cbrt()}function gE(e){return We(e=new this(e),e.e+1,2)}function vE(e,t,r){return new this(e).clamp(t,r)}function bE(e){if(!e||typeof e!="object")throw Error(Ml+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,io,"rounding",0,8,"toExpNeg",-os,0,"toExpPos",0,os,"maxE",0,os,"minE",-os,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=$f[r]),(n=e[r])!==void 0)if(Dr(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Ji+r+": "+n);if(r="crypto",i&&(this[r]=$f[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(ob);else this[r]=!1;else throw Error(Ji+r+": "+n);return this}function yE(e){return new this(e).cos()}function wE(e){return new this(e).cosh()}function hb(e){var t,r,n;function i(o){var s,a,c,l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,fp(o)){l.s=o.s,at?!o.d||o.e>i.maxE?(l.e=NaN,l.d=null):o.e<i.minE?(l.e=0,l.d=[0]):(l.e=o.e,l.d=o.d.slice()):(l.e=o.e,l.d=o.d?o.d.slice():o.d);return}if(c=typeof o,c==="number"){if(o===0){l.s=1/o<0?-1:1,l.e=0,l.d=[0];return}if(o<0?(o=-o,l.s=-1):l.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;at?s>i.maxE?(l.e=NaN,l.d=null):s<i.minE?(l.e=0,l.d=[0]):(l.e=s,l.d=[o]):(l.e=s,l.d=[o]);return}if(o*0!==0){o||(l.s=NaN),l.e=NaN,l.d=null;return}return bc(l,o.toString())}if(c==="string")return(a=o.charCodeAt(0))===45?(o=o.slice(1),l.s=-1):(a===43&&(o=o.slice(1)),l.s=1),ab.test(o)?bc(l,o):iE(l,o);if(c==="bigint")return o<0?(o=-o,l.s=-1):l.s=1,bc(l,o.toString());throw Error(Ji+o)}if(i.prototype=ve,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=bE,i.clone=hb,i.isDecimal=fp,i.abs=sE,i.acos=aE,i.acosh=cE,i.add=lE,i.asin=uE,i.asinh=fE,i.atan=dE,i.atanh=hE,i.atan2=pE,i.cbrt=mE,i.ceil=gE,i.clamp=vE,i.cos=yE,i.cosh=wE,i.div=xE,i.exp=SE,i.floor=_E,i.hypot=EE,i.ln=CE,i.log=TE,i.log10=ME,i.log2=AE,i.max=IE,i.min=OE,i.mod=RE,i.mul=PE,i.pow=NE,i.random=kE,i.round=jE,i.sign=DE,i.sin=LE,i.sinh=BE,i.sqrt=UE,i.sub=FE,i.sum=$E,i.tan=VE,i.tanh=zE,i.trunc=qE,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function xE(e,t){return new this(e).div(t)}function SE(e){return new this(e).exp()}function _E(e){return We(e=new this(e),e.e+1,3)}function EE(){var e,t,r=new this(0);for(at=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return at=!0,new this(1/0);r=t}return at=!0,r.sqrt()}function fp(e){return e instanceof Fr||e&&e.toStringTag===sb||!1}function CE(e){return new this(e).ln()}function TE(e,t){return new this(e).log(t)}function AE(e){return new this(e).log(2)}function ME(e){return new this(e).log(10)}function IE(){return ub(this,arguments,-1)}function OE(){return ub(this,arguments,1)}function RE(e,t){return new this(e).mod(t)}function PE(e,t){return new this(e).mul(t)}function NE(e,t){return new this(e).pow(t)}function kE(e){var t,r,n,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:Wr(e,1,io),n=Math.ceil(e/Xe),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(ob);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],e%=Xe,n&&e&&(i=vr(10,Xe-e),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=Xe)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<Xe&&(r-=Xe-n)}return s.e=r,s.d=a,s}function jE(e){return We(e=new this(e),e.e+1,this.rounding)}function DE(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function LE(e){return new this(e).sin()}function BE(e){return new this(e).sinh()}function UE(e){return new this(e).sqrt()}function FE(e,t){return new this(e).sub(t)}function $E(){var e=0,t=arguments,r=new this(t[e]);for(at=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return at=!0,We(r,this.precision,this.rounding)}function VE(e){return new this(e).tan()}function zE(e){return new this(e).tanh()}function qE(e){return We(e=new this(e),e.e+1,1)}ve[Symbol.for("nodejs.util.inspect.custom")]=ve.toString;ve[Symbol.toStringTag]="Decimal";var Fr=ve.constructor=hb($f);Vc=new Fr(Vc);zc=new Fr(zc);Fr.config({precision:256,rounding:Fr.ROUND_DOWN,toExpNeg:-256,toExpPos:256});const Nr=(e,t,r,n=Fr.ROUND_HALF_DOWN)=>{if(e==="∞")return"∞";if(e!=="0"&&!e||Be(e).equals(0))return"0";if(t!==void 0){const l=ho(e,t,n);if(!Be(l).equals(0))return r?l:bs(l)}const i=Be(e).toString(),o=i.split("."),s=o[0],a=o[1];let c;if(Be(s).gt(0))!a||Be(s.length).gte(9)?c=ho(i,0,n):Be(s.length).gte(4)?c=ho(i,2,n):c=ho(i,4,n);else{ho(i,6,n);const l=GE(a);if(l<6)c=ho(i,l+6,n);else{if(l>30)return"0";c=ho(i,9+(l-6),n)}}return r||Be(s).lt(1)?c:bs(c)},pb=(e,t,r,n)=>{try{if(e===void 0||e==="--")return"$--";const i=Nr(e,t,!0,Fr.ROUND_DOWN).toString();if(Be(i).equals(0))return"$0";const o=i.startsWith("-");let s=n?i:bs(i).toString();return s.includes("e")&&(s=n?i:bs(i).toString()),!r&&Number(i)<Math.pow(10,-t)?o?`-$${s.slice(1)}`:`<$${Math.pow(10,-t).toFixed(t)}`:o?`-$${s.slice(1)}`:`$${s}`}catch{return"$--"}},HE=(e,t,r=!0)=>{if(`${e}`=="0")return!parseFloat(t)||!r?"0":"0.".padEnd(t+2,"0");if(!e)return"--";const n=parseFloat(e),i=e.toString(),o=n<0;let s=i;if(i.toLowerCase().includes("e")){const a=i.match(/(\d+?)(?:\.(\d*))?e([+-])(\d+)/),c=a[1],l=a[2],u=a[3],d=a[4];let p="",y=l?l.substr(d):"";if(y&&(y=`.${y}`),u!=="-"){for(let x=0;x<d;x+=1){const b=l[x]||"0";p+=b}s=c+p+y}else{let x="0";for(let b=0;b<d;b+=1)p=(c[c.length-b-1]||"0")+p;c.length>d&&(x=c.substr(0,c.length-d)),s=`${x}.${p}${l}`}}if(t&&r){let a=`${s.split(".")[0]}.`;const c=s.split(".")[1]||"";for(let l=0;l<t;l+=1)a+=c[l]||"0";s=a}if(s.length>14){const a=s.split(".");a[0].length>14?s=`${a[0].slice(0,14)}+`:(s=s.slice(0,13),s.indexOf(".")===12&&(s=s.slice(0,12)))}return`${o?"-":""}${s}`},Be=e=>Fr.isDecimal(e)?e:new Fr(typeof e>"u"||e==="undefined"||!e?0:e);function WE(e,t){return t===void 0?"":Be(e==null?void 0:e.toString()).div(Math.pow(10,t)).toString()}const ho=(e,t,r)=>Be(e).toDP(t,r).toString(),bs=e=>{const[t,r]=e.split(".");let n="";for(let i=t.length-1,o=0;i>=0;i--,o++)n=t[i]+n,o%3===2&&i!==0&&(n=","+n);return r?`${n}.${r}`:n};function GE(e){let t=0;if(e)for(;t<e.length;){if(Be(e[t]).gt(0))return t+1;t++}return 0}function KE(e,t){const r=mb(Be(t));return Number(Be(e).mul(r))}function YE(e,t){const r=mb(Be(t));return Number(Be(e).div(r))}function mb(e){return Be(10).pow(Be(e).abs())}function qf(e,t){const r=YE(e,t);return XE(r.toString(),Number(t))}function XE(e,t=9){if(e===void 0)return"";const r=e.toLowerCase();if(r.includes("e")){if(r.includes("+"))return HE(r,t);const[n,i]=r.split("e");let o=n;const s=Math.abs(parseInt(i,10));let a="",c=o.length;if(n.includes(".")){const[l,u]=n.split(".");o=l+u,c=l.length}for(let l=0;l<s-c;l++)a+="0";return`0.${a}${o}`.slice(0,t+2)}return e}function Rl(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}const Po=(e,t="")=>t=="long"?e&&e.length>40?e.substring(0,40)+"...":e&&e.length<40?e:"":e?e.substring(0,6)+"..."+e.substring(e.length-4):"",l0=(e,t)=>{if(e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r)if(!l0(e[i],t[i]))return!1;return!0};function dp(e){return!e||Object.keys(e).length===0}function gb(e){var t;return((t=e.split("::"))==null?void 0:t.length)===3}const hp=async e=>new Promise(t=>{setTimeout(()=>{t(1)},e)});function JE(e,t,r=!1){var a;const n=e.balanceChanges,i=(a=e.effects)==null?void 0:a.gasUsed,o={};let s="0";return i&&(s=Be(i.computationCost).add(i.storageCost).sub(i.storageRebate).mul(-1).toFixed(0)),n&&n.forEach(c=>{const l=Rn(c.coinType).full_address;if(c.owner.AddressOwner===t){const u=l===ul;let d=c.amount;u&&(d=r?d:Be(d).sub(s).toFixed(0));const p={coinType:l,amount:d};o[l]=p}}),o}function pp(e,t){if(t){const r=e[Rn(t.coin_type).full_address];if(r)return qf(Be(r.amount).abs().toFixed(0),t.decimals)}}function At(e){return`https://archive.cetus.zone/assets/terminal${e}`}const dn=(e,t=10)=>e&&(e==null?void 0:e.length)>t&&Be(t).gt(0)?`${e.slice(0,t)}...`:e,Ya=(e,t)=>Ti(e||"")===Ti(t||""),ZE=e=>e===null||typeof e!="object"||Array.isArray(e)?!1:Object.keys(e).length>0,QE=async function(e,t,r=3e4){const n=[];let i="";if(t){for(const c in t){const l=`${c}=${t[c]}`;n.push(l)}const a=n.join("&");i=`${e}?${a}`}else i=e;const o=new AbortController,s=setTimeout(()=>{o.abort()},r);try{const a=await fetch(i,{signal:o.signal});if(clearTimeout(s),!a.ok)throw new Error("Request failed");const c=await a.json();return(c==null?void 0:c.data)||c}catch(a){throw clearTimeout(s),a.name==="AbortError"?new Error("request time out"):a}},eC=async function(e,t,r=3e4){const n=new AbortController,i=setTimeout(()=>{n.abort()},r);try{const o=await fetch(e,{body:JSON.stringify(t),method:"POST",signal:n.signal});if(clearTimeout(i),!o.ok)throw new Error("Request failed");return o.json()}catch(o){throw clearTimeout(i),o.name==="AbortError"?new Error("request time out"):o}},Hf="tokenMap",vb="trustedTokenList",bb="collectTokenMap",yb="importTokenList";function Xa(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var wb={exports:{}};/*!
|
|
41
41
|
localForage -- Offline Storage, Improved
|
|
42
42
|
Version 1.10.0
|
|
43
43
|
https://localforage.github.io/localForage
|
|
44
44
|
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
45
|
-
*/(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,o){function s(l,u){if(!i[l]){if(!n[l]){var d=typeof Xa=="function"&&Xa;if(!u&&d)return d(l,!0);if(a)return a(l,!0);var p=new Error("Cannot find module '"+l+"'");throw p.code="MODULE_NOT_FOUND",p}var y=i[l]={exports:{}};n[l][0].call(y.exports,function(x){var b=n[l][1][x];return s(b||x)},y,y.exports,r,n,i,o)}return i[l].exports}for(var a=typeof Xa=="function"&&Xa,c=0;c<o.length;c++)s(o[c]);return s}({1:[function(r,n,i){(function(o){var s=o.MutationObserver||o.WebKitMutationObserver,a;if(s){var c=0,l=new s(x),u=o.document.createTextNode("");l.observe(u,{characterData:!0}),a=function(){u.data=c=++c%2}}else if(!o.setImmediate&&typeof o.MessageChannel<"u"){var d=new o.MessageChannel;d.port1.onmessage=x,a=function(){d.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?a=function(){var M=o.document.createElement("script");M.onreadystatechange=function(){x(),M.onreadystatechange=null,M.parentNode.removeChild(M),M=null},o.document.documentElement.appendChild(M)}:a=function(){setTimeout(x,0)};var p,y=[];function x(){p=!0;for(var M,R,P=y.length;P;){for(R=y,y=[],M=-1;++M<P;)R[M]();P=y.length}p=!1}n.exports=b;function b(M){y.push(M)===1&&!p&&a()}}).call(this,typeof Tr<"u"?Tr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,n,i){var o=r(1);function s(){}var a={},c=["REJECTED"],l=["FULFILLED"],u=["PENDING"];n.exports=d;function d(B){if(typeof B!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,B!==s&&b(this,B)}d.prototype.catch=function(B){return this.then(null,B)},d.prototype.then=function(B,W){if(typeof B!="function"&&this.state===l||typeof W!="function"&&this.state===c)return this;var z=new this.constructor(s);if(this.state!==u){var G=this.state===l?B:W;y(z,G,this.outcome)}else this.queue.push(new p(z,B,W));return z};function p(B,W,z){this.promise=B,typeof W=="function"&&(this.onFulfilled=W,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}p.prototype.callFulfilled=function(B){a.resolve(this.promise,B)},p.prototype.otherCallFulfilled=function(B){y(this.promise,this.onFulfilled,B)},p.prototype.callRejected=function(B){a.reject(this.promise,B)},p.prototype.otherCallRejected=function(B){y(this.promise,this.onRejected,B)};function y(B,W,z){o(function(){var G;try{G=W(z)}catch(re){return a.reject(B,re)}G===B?a.reject(B,new TypeError("Cannot resolve promise with itself")):a.resolve(B,G)})}a.resolve=function(B,W){var z=M(x,W);if(z.status==="error")return a.reject(B,z.value);var G=z.value;if(G)b(B,G);else{B.state=l,B.outcome=W;for(var re=-1,oe=B.queue.length;++re<oe;)B.queue[re].callFulfilled(W)}return B},a.reject=function(B,W){B.state=c,B.outcome=W;for(var z=-1,G=B.queue.length;++z<G;)B.queue[z].callRejected(W);return B};function x(B){var W=B&&B.then;if(B&&(typeof B=="object"||typeof B=="function")&&typeof W=="function")return function(){W.apply(B,arguments)}}function b(B,W){var z=!1;function G(q){z||(z=!0,a.reject(B,q))}function re(q){z||(z=!0,a.resolve(B,q))}function oe(){W(re,G)}var se=M(oe);se.status==="error"&&G(se.value)}function M(B,W){var z={};try{z.value=B(W),z.status="success"}catch(G){z.status="error",z.value=G}return z}d.resolve=R;function R(B){return B instanceof this?B:a.resolve(new this(s),B)}d.reject=P;function P(B){var W=new this(s);return a.reject(W,B)}d.all=k;function k(B){var W=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=B.length,G=!1;if(!z)return this.resolve([]);for(var re=new Array(z),oe=0,se=-1,q=new this(s);++se<z;)L(B[se],se);return q;function L(h,f){W.resolve(h).then(m,function(S){G||(G=!0,a.reject(q,S))});function m(S){re[f]=S,++oe===z&&!G&&(G=!0,a.resolve(q,re))}}}d.race=F;function F(B){var W=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=B.length,G=!1;if(!z)return this.resolve([]);for(var re=-1,oe=new this(s);++re<z;)se(B[re]);return oe;function se(q){W.resolve(q).then(function(L){G||(G=!0,a.resolve(oe,L))},function(L){G||(G=!0,a.reject(oe,L))})}}},{1:1}],3:[function(r,n,i){(function(o){typeof o.Promise!="function"&&(o.Promise=r(2))}).call(this,typeof Tr<"u"?Tr:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,n,i){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D};function s(D,K){if(!(D instanceof K))throw new TypeError("Cannot call a class as a function")}function a(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=a();function l(){try{if(!c||!c.open)return!1;var D=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),K=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!D||K)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function u(D,K){D=D||[],K=K||{};try{return new Blob(D,K)}catch(X){if(X.name!=="TypeError")throw X;for(var $=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,J=new $,te=0;te<D.length;te+=1)J.append(D[te]);return J.getBlob(K.type)}}typeof Promise>"u"&&r(3);var d=Promise;function p(D,K){K&&D.then(function($){K(null,$)},function($){K($)})}function y(D,K,$){typeof K=="function"&&D.then(K),typeof $=="function"&&D.catch($)}function x(D){return typeof D!="string"&&(console.warn(D+" used as a key, but it is not a string."),D=String(D)),D}function b(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var M="local-forage-detect-blob-support",R=void 0,P={},k=Object.prototype.toString,F="readonly",B="readwrite";function W(D){for(var K=D.length,$=new ArrayBuffer(K),J=new Uint8Array($),te=0;te<K;te++)J[te]=D.charCodeAt(te);return $}function z(D){return new d(function(K){var $=D.transaction(M,B),J=u([""]);$.objectStore(M).put(J,"key"),$.onabort=function(te){te.preventDefault(),te.stopPropagation(),K(!1)},$.oncomplete=function(){var te=navigator.userAgent.match(/Chrome\/(\d+)/),X=navigator.userAgent.match(/Edge\//);K(X||!te||parseInt(te[1],10)>=43)}}).catch(function(){return!1})}function G(D){return typeof R=="boolean"?d.resolve(R):z(D).then(function(K){return R=K,R})}function re(D){var K=P[D.name],$={};$.promise=new d(function(J,te){$.resolve=J,$.reject=te}),K.deferredOperations.push($),K.dbReady?K.dbReady=K.dbReady.then(function(){return $.promise}):K.dbReady=$.promise}function oe(D){var K=P[D.name],$=K.deferredOperations.pop();if($)return $.resolve(),$.promise}function se(D,K){var $=P[D.name],J=$.deferredOperations.pop();if(J)return J.reject(K),J.promise}function q(D,K){return new d(function($,J){if(P[D.name]=P[D.name]||g(),D.db)if(K)re(D),D.db.close();else return $(D.db);var te=[D.name];K&&te.push(D.version);var X=c.open.apply(c,te);K&&(X.onupgradeneeded=function(de){var ye=X.result;try{ye.createObjectStore(D.storeName),de.oldVersion<=1&&ye.createObjectStore(M)}catch(Se){if(Se.name==="ConstraintError")console.warn('The database "'+D.name+'" has been upgraded from version '+de.oldVersion+" to version "+de.newVersion+', but the storage "'+D.storeName+'" already exists.');else throw Se}}),X.onerror=function(de){de.preventDefault(),J(X.error)},X.onsuccess=function(){var de=X.result;de.onversionchange=function(ye){ye.target.close()},$(de),oe(D)}})}function L(D){return q(D,!1)}function h(D){return q(D,!0)}function f(D,K){if(!D.db)return!0;var $=!D.db.objectStoreNames.contains(D.storeName),J=D.version<D.db.version,te=D.version>D.db.version;if(J&&(D.version!==K&&console.warn('The database "'+D.name+`" can't be downgraded from version `+D.db.version+" to version "+D.version+"."),D.version=D.db.version),te||$){if($){var X=D.db.version+1;X>D.version&&(D.version=X)}return!0}return!1}function m(D){return new d(function(K,$){var J=new FileReader;J.onerror=$,J.onloadend=function(te){var X=btoa(te.target.result||"");K({__local_forage_encoded_blob:!0,data:X,type:D.type})},J.readAsBinaryString(D)})}function S(D){var K=W(atob(D.data));return u([K],{type:D.type})}function T(D){return D&&D.__local_forage_encoded_blob}function E(D){var K=this,$=K._initReady().then(function(){var J=P[K._dbInfo.name];if(J&&J.dbReady)return J.dbReady});return y($,D,D),$}function I(D){re(D);for(var K=P[D.name],$=K.forages,J=0;J<$.length;J++){var te=$[J];te._dbInfo.db&&(te._dbInfo.db.close(),te._dbInfo.db=null)}return D.db=null,L(D).then(function(X){return D.db=X,f(D)?h(D):X}).then(function(X){D.db=K.db=X;for(var de=0;de<$.length;de++)$[de]._dbInfo.db=X}).catch(function(X){throw se(D,X),X})}function C(D,K,$,J){J===void 0&&(J=1);try{var te=D.db.transaction(D.storeName,K);$(null,te)}catch(X){if(J>0&&(!D.db||X.name==="InvalidStateError"||X.name==="NotFoundError"))return d.resolve().then(function(){if(!D.db||X.name==="NotFoundError"&&!D.db.objectStoreNames.contains(D.storeName)&&D.version<=D.db.version)return D.db&&(D.version=D.db.version+1),h(D)}).then(function(){return I(D).then(function(){C(D,K,$,J-1)})}).catch($);$(X)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function v(D){var K=this,$={db:null};if(D)for(var J in D)$[J]=D[J];var te=P[$.name];te||(te=g(),P[$.name]=te),te.forages.push(K),K._initReady||(K._initReady=K.ready,K.ready=E);var X=[];function de(){return d.resolve()}for(var ye=0;ye<te.forages.length;ye++){var Se=te.forages[ye];Se!==K&&X.push(Se._initReady().catch(de))}var _e=te.forages.slice(0);return d.all(X).then(function(){return $.db=te.db,L($)}).then(function(Ee){return $.db=Ee,f($,K._defaultConfig.version)?h($):Ee}).then(function(Ee){$.db=te.db=Ee,K._dbInfo=$;for(var $e=0;$e<_e.length;$e++){var bt=_e[$e];bt!==K&&(bt._dbInfo.db=$.db,bt._dbInfo.version=$.version)}})}function j(D,K){var $=this;D=x(D);var J=new d(function(te,X){$.ready().then(function(){C($._dbInfo,F,function(de,ye){if(de)return X(de);try{var Se=ye.objectStore($._dbInfo.storeName),_e=Se.get(D);_e.onsuccess=function(){var Ee=_e.result;Ee===void 0&&(Ee=null),T(Ee)&&(Ee=S(Ee)),te(Ee)},_e.onerror=function(){X(_e.error)}}catch(Ee){X(Ee)}})}).catch(X)});return p(J,K),J}function Q(D,K){var $=this,J=new d(function(te,X){$.ready().then(function(){C($._dbInfo,F,function(de,ye){if(de)return X(de);try{var Se=ye.objectStore($._dbInfo.storeName),_e=Se.openCursor(),Ee=1;_e.onsuccess=function(){var $e=_e.result;if($e){var bt=$e.value;T(bt)&&(bt=S(bt));var $t=D(bt,$e.key,Ee++);$t!==void 0?te($t):$e.continue()}else te()},_e.onerror=function(){X(_e.error)}}catch($e){X($e)}})}).catch(X)});return p(J,K),J}function Z(D,K,$){var J=this;D=x(D);var te=new d(function(X,de){var ye;J.ready().then(function(){return ye=J._dbInfo,k.call(K)==="[object Blob]"?G(ye.db).then(function(Se){return Se?K:m(K)}):K}).then(function(Se){C(J._dbInfo,B,function(_e,Ee){if(_e)return de(_e);try{var $e=Ee.objectStore(J._dbInfo.storeName);Se===null&&(Se=void 0);var bt=$e.put(Se,D);Ee.oncomplete=function(){Se===void 0&&(Se=null),X(Se)},Ee.onabort=Ee.onerror=function(){var $t=bt.error?bt.error:bt.transaction.error;de($t)}}catch($t){de($t)}})}).catch(de)});return p(te,$),te}function ce(D,K){var $=this;D=x(D);var J=new d(function(te,X){$.ready().then(function(){C($._dbInfo,B,function(de,ye){if(de)return X(de);try{var Se=ye.objectStore($._dbInfo.storeName),_e=Se.delete(D);ye.oncomplete=function(){te()},ye.onerror=function(){X(_e.error)},ye.onabort=function(){var Ee=_e.error?_e.error:_e.transaction.error;X(Ee)}}catch(Ee){X(Ee)}})}).catch(X)});return p(J,K),J}function be(D){var K=this,$=new d(function(J,te){K.ready().then(function(){C(K._dbInfo,B,function(X,de){if(X)return te(X);try{var ye=de.objectStore(K._dbInfo.storeName),Se=ye.clear();de.oncomplete=function(){J()},de.onabort=de.onerror=function(){var _e=Se.error?Se.error:Se.transaction.error;te(_e)}}catch(_e){te(_e)}})}).catch(te)});return p($,D),$}function xe(D){var K=this,$=new d(function(J,te){K.ready().then(function(){C(K._dbInfo,F,function(X,de){if(X)return te(X);try{var ye=de.objectStore(K._dbInfo.storeName),Se=ye.count();Se.onsuccess=function(){J(Se.result)},Se.onerror=function(){te(Se.error)}}catch(_e){te(_e)}})}).catch(te)});return p($,D),$}function pe(D,K){var $=this,J=new d(function(te,X){if(D<0){te(null);return}$.ready().then(function(){C($._dbInfo,F,function(de,ye){if(de)return X(de);try{var Se=ye.objectStore($._dbInfo.storeName),_e=!1,Ee=Se.openKeyCursor();Ee.onsuccess=function(){var $e=Ee.result;if(!$e){te(null);return}D===0||_e?te($e.key):(_e=!0,$e.advance(D))},Ee.onerror=function(){X(Ee.error)}}catch($e){X($e)}})}).catch(X)});return p(J,K),J}function Le(D){var K=this,$=new d(function(J,te){K.ready().then(function(){C(K._dbInfo,F,function(X,de){if(X)return te(X);try{var ye=de.objectStore(K._dbInfo.storeName),Se=ye.openKeyCursor(),_e=[];Se.onsuccess=function(){var Ee=Se.result;if(!Ee){J(_e);return}_e.push(Ee.key),Ee.continue()},Se.onerror=function(){te(Se.error)}}catch(Ee){te(Ee)}})}).catch(te)});return p($,D),$}function Ae(D,K){K=b.apply(this,arguments);var $=this.config();D=typeof D!="function"&&D||{},D.name||(D.name=D.name||$.name,D.storeName=D.storeName||$.storeName);var J=this,te;if(!D.name)te=d.reject("Invalid arguments");else{var X=D.name===$.name&&J._dbInfo.db,de=X?d.resolve(J._dbInfo.db):L(D).then(function(ye){var Se=P[D.name],_e=Se.forages;Se.db=ye;for(var Ee=0;Ee<_e.length;Ee++)_e[Ee]._dbInfo.db=ye;return ye});D.storeName?te=de.then(function(ye){if(ye.objectStoreNames.contains(D.storeName)){var Se=ye.version+1;re(D);var _e=P[D.name],Ee=_e.forages;ye.close();for(var $e=0;$e<Ee.length;$e++){var bt=Ee[$e];bt._dbInfo.db=null,bt._dbInfo.version=Se}var $t=new d(function(qt,hr){var fr=c.open(D.name,Se);fr.onerror=function(on){var Ls=fr.result;Ls.close(),hr(on)},fr.onupgradeneeded=function(){var on=fr.result;on.deleteObjectStore(D.storeName)},fr.onsuccess=function(){var on=fr.result;on.close(),qt(on)}});return $t.then(function(qt){_e.db=qt;for(var hr=0;hr<Ee.length;hr++){var fr=Ee[hr];fr._dbInfo.db=qt,oe(fr._dbInfo)}}).catch(function(qt){throw(se(D,qt)||d.resolve()).catch(function(){}),qt})}}):te=de.then(function(ye){re(D);var Se=P[D.name],_e=Se.forages;ye.close();for(var Ee=0;Ee<_e.length;Ee++){var $e=_e[Ee];$e._dbInfo.db=null}var bt=new d(function($t,qt){var hr=c.deleteDatabase(D.name);hr.onerror=function(){var fr=hr.result;fr&&fr.close(),qt(hr.error)},hr.onblocked=function(){console.warn('dropInstance blocked for database "'+D.name+'" until all open connections are closed')},hr.onsuccess=function(){var fr=hr.result;fr&&fr.close(),$t(fr)}});return bt.then(function($t){Se.db=$t;for(var qt=0;qt<_e.length;qt++){var hr=_e[qt];oe(hr._dbInfo)}}).catch(function($t){throw(se(D,$t)||d.resolve()).catch(function(){}),$t})})}return p(te,K),te}var Je={_driver:"asyncStorage",_initStorage:v,_support:l(),iterate:Q,getItem:j,setItem:Z,removeItem:ce,clear:be,length:xe,key:pe,keys:Le,dropInstance:Ae};function ft(){return typeof openDatabase=="function"}var je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pt="~~local_forage_type~",we=/^~~local_forage_type~([^~]+)~/,he="__lfsc__:",Ce=he.length,Ve="arbf",ke="blob",Te="si08",Me="ui08",Ue="uic8",lt="si16",ut="si32",ze="ur16",kt="ui32",_t="fl32",Ke="fl64",Mt=Ce+Ve.length,Ut=Object.prototype.toString;function et(D){var K=D.length*.75,$=D.length,J,te=0,X,de,ye,Se;D[D.length-1]==="="&&(K--,D[D.length-2]==="="&&K--);var _e=new ArrayBuffer(K),Ee=new Uint8Array(_e);for(J=0;J<$;J+=4)X=je.indexOf(D[J]),de=je.indexOf(D[J+1]),ye=je.indexOf(D[J+2]),Se=je.indexOf(D[J+3]),Ee[te++]=X<<2|de>>4,Ee[te++]=(de&15)<<4|ye>>2,Ee[te++]=(ye&3)<<6|Se&63;return _e}function Et(D){var K=new Uint8Array(D),$="",J;for(J=0;J<K.length;J+=3)$+=je[K[J]>>2],$+=je[(K[J]&3)<<4|K[J+1]>>4],$+=je[(K[J+1]&15)<<2|K[J+2]>>6],$+=je[K[J+2]&63];return K.length%3===2?$=$.substring(0,$.length-1)+"=":K.length%3===1&&($=$.substring(0,$.length-2)+"=="),$}function It(D,K){var $="";if(D&&($=Ut.call(D)),D&&($==="[object ArrayBuffer]"||D.buffer&&Ut.call(D.buffer)==="[object ArrayBuffer]")){var J,te=he;D instanceof ArrayBuffer?(J=D,te+=Ve):(J=D.buffer,$==="[object Int8Array]"?te+=Te:$==="[object Uint8Array]"?te+=Me:$==="[object Uint8ClampedArray]"?te+=Ue:$==="[object Int16Array]"?te+=lt:$==="[object Uint16Array]"?te+=ze:$==="[object Int32Array]"?te+=ut:$==="[object Uint32Array]"?te+=kt:$==="[object Float32Array]"?te+=_t:$==="[object Float64Array]"?te+=Ke:K(new Error("Failed to get type for BinaryArray"))),K(te+Et(J))}else if($==="[object Blob]"){var X=new FileReader;X.onload=function(){var de=pt+D.type+"~"+Et(this.result);K(he+ke+de)},X.readAsArrayBuffer(D)}else try{K(JSON.stringify(D))}catch(de){console.error("Couldn't convert value into a JSON string: ",D),K(null,de)}}function nt(D){if(D.substring(0,Ce)!==he)return JSON.parse(D);var K=D.substring(Mt),$=D.substring(Ce,Mt),J;if($===ke&&we.test(K)){var te=K.match(we);J=te[1],K=K.substring(te[0].length)}var X=et(K);switch($){case Ve:return X;case ke:return u([X],{type:J});case Te:return new Int8Array(X);case Me:return new Uint8Array(X);case Ue:return new Uint8ClampedArray(X);case lt:return new Int16Array(X);case ze:return new Uint16Array(X);case ut:return new Int32Array(X);case kt:return new Uint32Array(X);case _t:return new Float32Array(X);case Ke:return new Float64Array(X);default:throw new Error("Unkown type: "+$)}}var jt={serialize:It,deserialize:nt,stringToBuffer:et,bufferToString:Et};function Pt(D,K,$,J){D.executeSql("CREATE TABLE IF NOT EXISTS "+K.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],$,J)}function tt(D){var K=this,$={db:null};if(D)for(var J in D)$[J]=typeof D[J]!="string"?D[J].toString():D[J];var te=new d(function(X,de){try{$.db=openDatabase($.name,String($.version),$.description,$.size)}catch(ye){return de(ye)}$.db.transaction(function(ye){Pt(ye,$,function(){K._dbInfo=$,X()},function(Se,_e){de(_e)})},de)});return $.serializer=jt,te}function wt(D,K,$,J,te,X){D.executeSql($,J,te,function(de,ye){ye.code===ye.SYNTAX_ERR?de.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[K.storeName],function(Se,_e){_e.rows.length?X(Se,ye):Pt(Se,K,function(){Se.executeSql($,J,te,X)},X)},X):X(de,ye)},X)}function Ct(D,K){var $=this;D=x(D);var J=new d(function(te,X){$.ready().then(function(){var de=$._dbInfo;de.db.transaction(function(ye){wt(ye,de,"SELECT * FROM "+de.storeName+" WHERE key = ? LIMIT 1",[D],function(Se,_e){var Ee=_e.rows.length?_e.rows.item(0).value:null;Ee&&(Ee=de.serializer.deserialize(Ee)),te(Ee)},function(Se,_e){X(_e)})})}).catch(X)});return p(J,K),J}function Ge(D,K){var $=this,J=new d(function(te,X){$.ready().then(function(){var de=$._dbInfo;de.db.transaction(function(ye){wt(ye,de,"SELECT * FROM "+de.storeName,[],function(Se,_e){for(var Ee=_e.rows,$e=Ee.length,bt=0;bt<$e;bt++){var $t=Ee.item(bt),qt=$t.value;if(qt&&(qt=de.serializer.deserialize(qt)),qt=D(qt,$t.key,bt+1),qt!==void 0){te(qt);return}}te()},function(Se,_e){X(_e)})})}).catch(X)});return p(J,K),J}function mt(D,K,$,J){var te=this;D=x(D);var X=new d(function(de,ye){te.ready().then(function(){K===void 0&&(K=null);var Se=K,_e=te._dbInfo;_e.serializer.serialize(K,function(Ee,$e){$e?ye($e):_e.db.transaction(function(bt){wt(bt,_e,"INSERT OR REPLACE INTO "+_e.storeName+" (key, value) VALUES (?, ?)",[D,Ee],function(){de(Se)},function($t,qt){ye(qt)})},function(bt){if(bt.code===bt.QUOTA_ERR){if(J>0){de(mt.apply(te,[D,Se,$,J-1]));return}ye(bt)}})})}).catch(ye)});return p(X,$),X}function Nt(D,K,$){return mt.apply(this,[D,K,$,1])}function it(D,K){var $=this;D=x(D);var J=new d(function(te,X){$.ready().then(function(){var de=$._dbInfo;de.db.transaction(function(ye){wt(ye,de,"DELETE FROM "+de.storeName+" WHERE key = ?",[D],function(){te()},function(Se,_e){X(_e)})})}).catch(X)});return p(J,K),J}function xt(D){var K=this,$=new d(function(J,te){K.ready().then(function(){var X=K._dbInfo;X.db.transaction(function(de){wt(de,X,"DELETE FROM "+X.storeName,[],function(){J()},function(ye,Se){te(Se)})})}).catch(te)});return p($,D),$}function zt(D){var K=this,$=new d(function(J,te){K.ready().then(function(){var X=K._dbInfo;X.db.transaction(function(de){wt(de,X,"SELECT COUNT(key) as c FROM "+X.storeName,[],function(ye,Se){var _e=Se.rows.item(0).c;J(_e)},function(ye,Se){te(Se)})})}).catch(te)});return p($,D),$}function N(D,K){var $=this,J=new d(function(te,X){$.ready().then(function(){var de=$._dbInfo;de.db.transaction(function(ye){wt(ye,de,"SELECT key FROM "+de.storeName+" WHERE id = ? LIMIT 1",[D+1],function(Se,_e){var Ee=_e.rows.length?_e.rows.item(0).key:null;te(Ee)},function(Se,_e){X(_e)})})}).catch(X)});return p(J,K),J}function _(D){var K=this,$=new d(function(J,te){K.ready().then(function(){var X=K._dbInfo;X.db.transaction(function(de){wt(de,X,"SELECT key FROM "+X.storeName,[],function(ye,Se){for(var _e=[],Ee=0;Ee<Se.rows.length;Ee++)_e.push(Se.rows.item(Ee).key);J(_e)},function(ye,Se){te(Se)})})}).catch(te)});return p($,D),$}function A(D){return new d(function(K,$){D.transaction(function(J){J.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(te,X){for(var de=[],ye=0;ye<X.rows.length;ye++)de.push(X.rows.item(ye).name);K({db:D,storeNames:de})},function(te,X){$(X)})},function(J){$(J)})})}function U(D,K){K=b.apply(this,arguments);var $=this.config();D=typeof D!="function"&&D||{},D.name||(D.name=D.name||$.name,D.storeName=D.storeName||$.storeName);var J=this,te;return D.name?te=new d(function(X){var de;D.name===$.name?de=J._dbInfo.db:de=openDatabase(D.name,"","",0),D.storeName?X({db:de,storeNames:[D.storeName]}):X(A(de))}).then(function(X){return new d(function(de,ye){X.db.transaction(function(Se){function _e($t){return new d(function(qt,hr){Se.executeSql("DROP TABLE IF EXISTS "+$t,[],function(){qt()},function(fr,on){hr(on)})})}for(var Ee=[],$e=0,bt=X.storeNames.length;$e<bt;$e++)Ee.push(_e(X.storeNames[$e]));d.all(Ee).then(function(){de()}).catch(function($t){ye($t)})},function(Se){ye(Se)})})}):te=d.reject("Invalid arguments"),p(te,K),te}var Y={_driver:"webSQLStorage",_initStorage:tt,_support:ft(),iterate:Ge,getItem:Ct,setItem:Nt,removeItem:it,clear:xt,length:zt,key:N,keys:_,dropInstance:U};function ee(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ne(D,K){var $=D.name+"/";return D.storeName!==K.storeName&&($+=D.storeName+"/"),$}function De(){var D="_localforage_support_test";try{return localStorage.setItem(D,!0),localStorage.removeItem(D),!1}catch{return!0}}function Ze(){return!De()||localStorage.length>0}function Ne(D){var K=this,$={};if(D)for(var J in D)$[J]=D[J];return $.keyPrefix=ne(D,K._defaultConfig),Ze()?(K._dbInfo=$,$.serializer=jt,d.resolve()):d.reject()}function V(D){var K=this,$=K.ready().then(function(){for(var J=K._dbInfo.keyPrefix,te=localStorage.length-1;te>=0;te--){var X=localStorage.key(te);X.indexOf(J)===0&&localStorage.removeItem(X)}});return p($,D),$}function ae(D,K){var $=this;D=x(D);var J=$.ready().then(function(){var te=$._dbInfo,X=localStorage.getItem(te.keyPrefix+D);return X&&(X=te.serializer.deserialize(X)),X});return p(J,K),J}function fe(D,K){var $=this,J=$.ready().then(function(){for(var te=$._dbInfo,X=te.keyPrefix,de=X.length,ye=localStorage.length,Se=1,_e=0;_e<ye;_e++){var Ee=localStorage.key(_e);if(Ee.indexOf(X)===0){var $e=localStorage.getItem(Ee);if($e&&($e=te.serializer.deserialize($e)),$e=D($e,Ee.substring(de),Se++),$e!==void 0)return $e}}});return p(J,K),J}function Oe(D,K){var $=this,J=$.ready().then(function(){var te=$._dbInfo,X;try{X=localStorage.key(D)}catch{X=null}return X&&(X=X.substring(te.keyPrefix.length)),X});return p(J,K),J}function qe(D){var K=this,$=K.ready().then(function(){for(var J=K._dbInfo,te=localStorage.length,X=[],de=0;de<te;de++){var ye=localStorage.key(de);ye.indexOf(J.keyPrefix)===0&&X.push(ye.substring(J.keyPrefix.length))}return X});return p($,D),$}function Pe(D){var K=this,$=K.keys().then(function(J){return J.length});return p($,D),$}function Fe(D,K){var $=this;D=x(D);var J=$.ready().then(function(){var te=$._dbInfo;localStorage.removeItem(te.keyPrefix+D)});return p(J,K),J}function ot(D,K,$){var J=this;D=x(D);var te=J.ready().then(function(){K===void 0&&(K=null);var X=K;return new d(function(de,ye){var Se=J._dbInfo;Se.serializer.serialize(K,function(_e,Ee){if(Ee)ye(Ee);else try{localStorage.setItem(Se.keyPrefix+D,_e),de(X)}catch($e){($e.name==="QuotaExceededError"||$e.name==="NS_ERROR_DOM_QUOTA_REACHED")&&ye($e),ye($e)}})})});return p(te,$),te}function Jt(D,K){if(K=b.apply(this,arguments),D=typeof D!="function"&&D||{},!D.name){var $=this.config();D.name=D.name||$.name,D.storeName=D.storeName||$.storeName}var J=this,te;return D.name?te=new d(function(X){D.storeName?X(ne(D,J._defaultConfig)):X(D.name+"/")}).then(function(X){for(var de=localStorage.length-1;de>=0;de--){var ye=localStorage.key(de);ye.indexOf(X)===0&&localStorage.removeItem(ye)}}):te=d.reject("Invalid arguments"),p(te,K),te}var Dt={_driver:"localStorageWrapper",_initStorage:Ne,_support:ee(),iterate:fe,getItem:ae,setItem:ot,removeItem:Fe,clear:V,length:Pe,key:Oe,keys:qe,dropInstance:Jt},Ft=function(K,$){return K===$||typeof K=="number"&&typeof $=="number"&&isNaN(K)&&isNaN($)},or=function(K,$){for(var J=K.length,te=0;te<J;){if(Ft(K[te],$))return!0;te++}return!1},_r=Array.isArray||function(D){return Object.prototype.toString.call(D)==="[object Array]"},ur={},Zt={},wr={INDEXEDDB:Je,WEBSQL:Y,LOCALSTORAGE:Dt},bn=[wr.INDEXEDDB._driver,wr.WEBSQL._driver,wr.LOCALSTORAGE._driver],$r=["dropInstance"],yn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat($r),ii={description:"",driver:bn.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function oi(D,K){D[K]=function(){var $=arguments;return D.ready().then(function(){return D[K].apply(D,$)})}}function wn(){for(var D=1;D<arguments.length;D++){var K=arguments[D];if(K)for(var $ in K)K.hasOwnProperty($)&&(_r(K[$])?arguments[0][$]=K[$].slice():arguments[0][$]=K[$])}return arguments[0]}var si=function(){function D(K){s(this,D);for(var $ in wr)if(wr.hasOwnProperty($)){var J=wr[$],te=J._driver;this[$]=te,ur[te]||this.defineDriver(J)}this._defaultConfig=wn({},ii),this._config=wn({},this._defaultConfig,K),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return D.prototype.config=function($){if((typeof $>"u"?"undefined":o($))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var J in $){if(J==="storeName"&&($[J]=$[J].replace(/\W/g,"_")),J==="version"&&typeof $[J]!="number")return new Error("Database version must be a number.");this._config[J]=$[J]}return"driver"in $&&$.driver?this.setDriver(this._config.driver):!0}else return typeof $=="string"?this._config[$]:this._config},D.prototype.defineDriver=function($,J,te){var X=new d(function(de,ye){try{var Se=$._driver,_e=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!$._driver){ye(_e);return}for(var Ee=yn.concat("_initStorage"),$e=0,bt=Ee.length;$e<bt;$e++){var $t=Ee[$e],qt=!or($r,$t);if((qt||$[$t])&&typeof $[$t]!="function"){ye(_e);return}}var hr=function(){for(var Ls=function(i6){return function(){var o6=new Error("Method "+i6+" is not implemented by the current driver"),th=d.reject(o6);return p(th,arguments[arguments.length-1]),th}},au=0,n6=$r.length;au<n6;au++){var cu=$r[au];$[cu]||($[cu]=Ls(cu))}};hr();var fr=function(Ls){ur[Se]&&console.info("Redefining LocalForage driver: "+Se),ur[Se]=$,Zt[Se]=Ls,de()};"_support"in $?$._support&&typeof $._support=="function"?$._support().then(fr,ye):fr(!!$._support):fr(!0)}catch(on){ye(on)}});return y(X,J,te),X},D.prototype.driver=function(){return this._driver||null},D.prototype.getDriver=function($,J,te){var X=ur[$]?d.resolve(ur[$]):d.reject(new Error("Driver not found."));return y(X,J,te),X},D.prototype.getSerializer=function($){var J=d.resolve(jt);return y(J,$),J},D.prototype.ready=function($){var J=this,te=J._driverSet.then(function(){return J._ready===null&&(J._ready=J._initDriver()),J._ready});return y(te,$,$),te},D.prototype.setDriver=function($,J,te){var X=this;_r($)||($=[$]);var de=this._getSupportedDrivers($);function ye(){X._config.driver=X.driver()}function Se($e){return X._extend($e),ye(),X._ready=X._initStorage(X._config),X._ready}function _e($e){return function(){var bt=0;function $t(){for(;bt<$e.length;){var qt=$e[bt];return bt++,X._dbInfo=null,X._ready=null,X.getDriver(qt).then(Se).catch($t)}ye();var hr=new Error("No available storage method found.");return X._driverSet=d.reject(hr),X._driverSet}return $t()}}var Ee=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=Ee.then(function(){var $e=de[0];return X._dbInfo=null,X._ready=null,X.getDriver($e).then(function(bt){X._driver=bt._driver,ye(),X._wrapLibraryMethodsWithReady(),X._initDriver=_e(de)})}).catch(function(){ye();var $e=new Error("No available storage method found.");return X._driverSet=d.reject($e),X._driverSet}),y(this._driverSet,J,te),this._driverSet},D.prototype.supports=function($){return!!Zt[$]},D.prototype._extend=function($){wn(this,$)},D.prototype._getSupportedDrivers=function($){for(var J=[],te=0,X=$.length;te<X;te++){var de=$[te];this.supports(de)&&J.push(de)}return J},D.prototype._wrapLibraryMethodsWithReady=function(){for(var $=0,J=yn.length;$<J;$++)oi(this,yn[$])},D.prototype.createInstance=function($){return new D($)},D}(),ai=new si;n.exports=ai},{3:3}]},{},[4])(4)})})(bb);var YE=bb.exports;const Zs=Ta(YE);Zs.config({name:"CetusSite",storeName:"tokens"});class Si{static async setItem(t,r){try{await Zs.setItem(t,r)}catch(n){console.error(`Failed to set item with key "${t}"`,n)}}static async getItem(t){try{return await Zs.getItem(t)}catch(r){return console.error(`Failed to get item with key "${t}"`,r),null}}static async removeItem(t){try{await Zs.removeItem(t)}catch(r){console.error(`Failed to remove item with key "${t}"`,r)}}static async clear(){try{await Zs.clear()}catch(t){console.error("Failed to clear storage",t)}}}const Pl=[{name:"SuiVision",link:"https://suivision.xyz",img:Ot("/images/logo_suivision@2x.png"),isCustom:!1},{name:"Suiscan",link:"https://suiscan.xyz/mainnet",img:Ot("/images/logo_suiscan@2x.png"),isCustom:!1}],Hc=[{name:"Sui Fullnode",link:"https://fullnode.mainnet.sui.io",isCustom:!1},{name:"Custom RPC URL",link:"",isCustom:!0}],XE=[{display:"0.1",value:"0.001"},{display:"0.5",value:"0.005"},{display:"1",value:"0.01"}],JE="mainnet",ZE={mainnet:{env:"mainnet",fullRpcUrl:"https://fullnode.mainnet.sui.io",simulationAccount:"0x326ce9894f08dcaa337fa232641cc34db957aec9ff6614c1186bc9a7508df0bb",api:"https://api-sui.cetus.zone",aggregatorUrl:"https://api-sui.cetus.zone/router_v2"}},ls=ZE[JE],QE="0x45f3c0814d7be4aa5fbd32d7e3c40f3c062a2b63eaf5ec4f8c1539b5987b11af",eC=Ot("/images/birdeye-logo.png"),tC=Ot("/images/img-logo@2x.png"),rC=Ot("/images/logo_CoinGecko@2x.png"),nC=Ot("/images/logo_pyth.png");var sa=(e=>(e.CETUS="CETUS",e.KRIYA="KRIYA",e.KRIYAV3="KRIYAV3",e.FLOWX="FLOWX",e.FLOWXV3="FLOWXV3",e.AFTERMATH="AFTERMATH",e.HAEDAL="HAEDAL",e.VOLO="VOLO",e.AFSUI="AFSUI",e.DEEPBOOKV3="DEEPBOOKV3",e.SCALLOP="SCALLOP",e.BLUEMOVE="BLUEMOVE",e.TURBOS="TURBOS",e.SPRINGSUI="SPRINGSUI",e.BLUEFIN="BLUEFIN",e.HAEDALPMM="HAEDALPMM",e.ALPHAFI="ALPHAFI",e.STEAMM="STEAMM",e.OBRIC="OBRIC",e.METASTABLE="METASTABLE",e))(sa||{});const yb={pyth:"Pyth Network",coingecko:"CoinGecko",birdeye:"Birdeye",Cetus:"Cetus"},iC={pyth:nC,coingecko:rC,birdeye:eC,Cetus:tC},sr={CETUS:Ot("/images/aggregator-source/cetus.png"),KRIYA:Ot("/images/aggregator-source/kriya.png"),FLOWX:Ot("/images/aggregator-source/flowx.png"),AFTERMATH:Ot("/images/aggregator-source/aftermath.png"),TURBOS:Ot("/images/aggregator-source/turbos.png"),HAEDAL:Ot("/images/aggregator-source/haedal.png"),VOLO:Ot("/images/aggregator-source/volo.png"),AFSUI:Ot("/images/aggregator-source/aftermath.png"),BLUEMOVE:Ot("/images/aggregator-source/bluemove.png"),KRIYAV3:Ot("/images/aggregator-source/kriya.png"),FLOWXV3:Ot("/images/aggregator-source/flowx.png"),DEEPBOOKV3:Ot("/images/aggregator-source/deepbook.png"),SCALLOP:Ot("/images/aggregator-source/scallop.png"),SPRINGSUI:Ot("/images/aggregator-source/suilend.png"),BLUEFIN:Ot("/images/aggregator-source/bluefin.png"),HAEDALPMM:Ot("/images/aggregator-source/haedal.png"),ALPHAFI:Ot("/images/aggregator-source/stSui.png"),STEAMM:Ot("/images/aggregator-source/steamm.png"),OBRIC:Ot("/images/aggregator-source/obric.png"),METASTABLE:Ot("/images/aggregator-source/metastable.png")},wb={CETUS:{name:"Cetus",id:"CETUS",logo:sr.CETUS,type:"dex",sort:100},DEEPBOOKV3:{name:"DeepBook V3",id:"DEEPBOOKV3",logo:sr.DEEPBOOKV3,type:"dex",sort:99},KRIYA:{name:"Kriya V2",id:"KRIYA",logo:sr.KRIYA,type:"dex",sort:98},KRIYAV3:{name:"Kriya V3",id:"KRIYAV3",logo:sr.KRIYA,type:"dex",sort:97},FLOWX:{name:"FlowX V2",id:"FLOWX",logo:sr.FLOWX,type:"dex",sort:96},FLOWXV3:{name:"FlowX V3",id:"FLOWXV3",logo:sr.FLOWX,type:"dex",sort:95},AFTERMATH:{name:"Aftermath",id:"AFTERMATH",logo:sr.AFTERMATH,type:"dex",sort:94},TURBOS:{name:"Turbos",id:"TURBOS",logo:sr.TURBOS,type:"dex",sort:93},HAEDAL:{name:"Haedal LSD",id:"HAEDAL",logo:sr.HAEDAL,type:"other",sort:92},HAEDALPMM:{name:"Haedal HMM",id:"HAEDALPMM",logo:sr.HAEDALPMM,type:"other",sort:92},VOLO:{name:"Volo",id:"VOLO",logo:sr.VOLO,type:"other",sort:91},AFSUI:{name:"Aftermath LSD",id:"AFSUI",logo:sr.AFTERMATH,type:"other",sort:90},BLUEMOVE:{name:"BlueMove",id:"BLUEMOVE",logo:sr.BLUEMOVE,type:"dex",sort:80},BLUEFIN:{name:"Bluefin",id:"BLUEFIN",logo:sr.BLUEFIN,sort:79,type:"dex"},SCALLOP:{name:"Scallop",id:"SCALLOP",logo:sr.SCALLOP,type:"other",sort:70},SPRINGSUI:{name:"SpringSui",id:"SPRINGSUI",logo:sr.SPRINGSUI,type:"other",sort:60},ALPHAFI:{name:"stSUI",id:"ALPHAFI",logo:sr.ALPHAFI,type:"other",sort:50},STEAMM:{name:"STEAMM",id:"STEAMM",logo:sr.STEAMM,sort:78,type:"dex"},METASTABLE:{name:"Metastable",id:"METASTABLE",logo:sr.METASTABLE,sort:77,type:"dex"},OBRIC:{name:"Obric",id:"OBRIC",logo:sr.OBRIC,sort:76,type:"dex"}},hp=e=>{let t;const r=new Set,n=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const p=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(y=>y(t,p))}},i=()=>t,a={setState:n,getState:i,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(n,i,a);return a},oC=e=>e?hp(e):hp,sC=e=>e;function aC(e,t=sC){const r=ie.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ie.useDebugValue(r),r}const pp=e=>{const t=oC(e),r=n=>aC(t,n);return Object.assign(r,t),r},Oi=e=>e?pp(e):pp;function cC(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var o;const s=c=>c===null?null:JSON.parse(c,t==null?void 0:t.reviver),a=(o=r.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>r.setItem(i,JSON.stringify(o,t==null?void 0:t.replacer)),removeItem:i=>r.removeItem(i)}}const Wf=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return Wf(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Wf(n)(r)}}}},lC=(e,t)=>(r,n,i)=>{let o={storage:cC(()=>localStorage),partialize:b=>b,version:0,merge:(b,M)=>({...M,...b}),...t},s=!1;const a=new Set,c=new Set;let l=o.storage;if(!l)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...b)},n,i);const u=()=>{const b=o.partialize({...n()});return l.setItem(o.name,{state:b,version:o.version})},d=i.setState;i.setState=(b,M)=>{d(b,M),u()};const p=e((...b)=>{r(...b),u()},n,i);i.getInitialState=()=>p;let y;const x=()=>{var b,M;if(!l)return;s=!1,a.forEach(P=>{var k;return P((k=n())!=null?k:p)});const R=((M=o.onRehydrateStorage)==null?void 0:M.call(o,(b=n())!=null?b:p))||void 0;return Wf(l.getItem.bind(l))(o.name).then(P=>{if(P)if(typeof P.version=="number"&&P.version!==o.version){if(o.migrate){const k=o.migrate(P.state,P.version);return k instanceof Promise?k.then(F=>[!0,F]):[!0,k]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,P.state];return[!1,void 0]}).then(P=>{var k;const[F,B]=P;if(y=o.merge(B,(k=n())!=null?k:p),r(y,!0),F)return u()}).then(()=>{R==null||R(y,void 0),y=n(),s=!0,c.forEach(P=>P(y))}).catch(P=>{R==null||R(void 0,P)})};return i.persist={setOptions:b=>{o={...o,...b},b.storage&&(l=b.storage)},clearStorage:()=>{l==null||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>x(),hasHydrated:()=>s,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(c.add(b),()=>{c.delete(b)})},o.skipHydration||x(),y||p},uC=lC,fC=(e,t)=>({ignoreWarnTokenMap:{},currentExplorer:Pl[0].link,setCurrentExplorer:r=>{e(()=>({currentExplorer:r}))},rpcList:Hc,setRpcList:r=>{e(()=>({rpcList:[...r]}))},currentRpc:Hc[0],customRpc:"",setCurrentRpc:r=>{e(()=>({currentRpc:r}))},setCustomRpc:r=>{e(()=>({customRpc:r}))},slippage:"0.5",setSlippage:r=>{e(()=>({slippage:r}))},isOpenSlippageDialog:!1,setIsOpenSlippageDialog:r=>{e(()=>({isOpenSlippageDialog:r}))},providers:Object.values(sa),setProviders:r=>{e(()=>({providers:r}))},poolApiMap:{},setPoolApiMap:(r,n)=>{const i=t().poolApiMap;i[r]=n,e(()=>({poolApiMap:{...i}}))},mevProtect:!0,setMevProtect:r=>{e(()=>({mevProtect:r}))},setIgnoreWarnToken:r=>{const n=t().ignoreWarnTokenMap;n[Ti(r)]=!0,e(()=>({ignoreWarnTokenMap:{...n}}))}}),Fr=Oi(uC(fC,{name:"useGlobalStore",partialize:e=>{const{currentExplorer:t,currentRpc:r,slippage:n,customRpc:i,providers:o,mevProtect:s,ignoreWarnTokenMap:a}=e;return{currentExplorer:t,currentRpc:r,slippage:n,customRpc:i,providers:o,mevProtect:s,ignoreWarnTokenMap:a}}}));function As(){const{currentExplorer:e}=Fr();return{getExplorerUrl:(r,n="account",i=e)=>{let o;return i.includes("suivision")?o=`${i}/${hC(n)}/${r}`:o=`${i}/${dC(n)}/${r}`,o}}}const dC=e=>{switch(e){case"account":return"address";case"token":return"object";case"tx":return"tx";case"poolAddress":return"object";case"nftAddress":return"object";case"coin":return"coin"}},hC=e=>{switch(e){case"account":return"account";case"token":return"object";case"tx":return"txblock";case"poolAddress":return"object";case"nftAddress":return"object";case"coin":return"coin"}};function xb(e){const{text:t,keywords:r,onKeywordClick:n,text_highlight_color:i="var(--cs-primary)",text_size:o="12px",text_color:s="var(--cs-btn-disabled-text)"}=e,a=new RegExp(`(${r.join("|")})`,"gi"),c=t.split(a);return w.jsx("span",{style:{display:"inline",whiteSpace:"normal",textAlign:"start"},children:c.map((l,u)=>{const d=r.includes(l);return w.jsx("span",{style:{lineHeight:"20px",fontSize:o,color:d?i:s,cursor:"pointer",whiteSpace:"inherit"},onClick:()=>n(l),children:l},u)})})}var Sb={exports:{}};/*!
|
|
45
|
+
*/(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,o){function s(l,u){if(!i[l]){if(!n[l]){var d=typeof Xa=="function"&&Xa;if(!u&&d)return d(l,!0);if(a)return a(l,!0);var p=new Error("Cannot find module '"+l+"'");throw p.code="MODULE_NOT_FOUND",p}var y=i[l]={exports:{}};n[l][0].call(y.exports,function(x){var b=n[l][1][x];return s(b||x)},y,y.exports,r,n,i,o)}return i[l].exports}for(var a=typeof Xa=="function"&&Xa,c=0;c<o.length;c++)s(o[c]);return s}({1:[function(r,n,i){(function(o){var s=o.MutationObserver||o.WebKitMutationObserver,a;if(s){var c=0,l=new s(x),u=o.document.createTextNode("");l.observe(u,{characterData:!0}),a=function(){u.data=c=++c%2}}else if(!o.setImmediate&&typeof o.MessageChannel<"u"){var d=new o.MessageChannel;d.port1.onmessage=x,a=function(){d.port2.postMessage(0)}}else"document"in o&&"onreadystatechange"in o.document.createElement("script")?a=function(){var M=o.document.createElement("script");M.onreadystatechange=function(){x(),M.onreadystatechange=null,M.parentNode.removeChild(M),M=null},o.document.documentElement.appendChild(M)}:a=function(){setTimeout(x,0)};var p,y=[];function x(){p=!0;for(var M,O,P=y.length;P;){for(O=y,y=[],M=-1;++M<P;)O[M]();P=y.length}p=!1}n.exports=b;function b(M){y.push(M)===1&&!p&&a()}}).call(this,typeof Ar<"u"?Ar:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,n,i){var o=r(1);function s(){}var a={},c=["REJECTED"],l=["FULFILLED"],u=["PENDING"];n.exports=d;function d(B){if(typeof B!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,B!==s&&b(this,B)}d.prototype.catch=function(B){return this.then(null,B)},d.prototype.then=function(B,W){if(typeof B!="function"&&this.state===l||typeof W!="function"&&this.state===c)return this;var z=new this.constructor(s);if(this.state!==u){var G=this.state===l?B:W;y(z,G,this.outcome)}else this.queue.push(new p(z,B,W));return z};function p(B,W,z){this.promise=B,typeof W=="function"&&(this.onFulfilled=W,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}p.prototype.callFulfilled=function(B){a.resolve(this.promise,B)},p.prototype.otherCallFulfilled=function(B){y(this.promise,this.onFulfilled,B)},p.prototype.callRejected=function(B){a.reject(this.promise,B)},p.prototype.otherCallRejected=function(B){y(this.promise,this.onRejected,B)};function y(B,W,z){o(function(){var G;try{G=W(z)}catch(re){return a.reject(B,re)}G===B?a.reject(B,new TypeError("Cannot resolve promise with itself")):a.resolve(B,G)})}a.resolve=function(B,W){var z=M(x,W);if(z.status==="error")return a.reject(B,z.value);var G=z.value;if(G)b(B,G);else{B.state=l,B.outcome=W;for(var re=-1,oe=B.queue.length;++re<oe;)B.queue[re].callFulfilled(W)}return B},a.reject=function(B,W){B.state=c,B.outcome=W;for(var z=-1,G=B.queue.length;++z<G;)B.queue[z].callRejected(W);return B};function x(B){var W=B&&B.then;if(B&&(typeof B=="object"||typeof B=="function")&&typeof W=="function")return function(){W.apply(B,arguments)}}function b(B,W){var z=!1;function G(q){z||(z=!0,a.reject(B,q))}function re(q){z||(z=!0,a.resolve(B,q))}function oe(){W(re,G)}var se=M(oe);se.status==="error"&&G(se.value)}function M(B,W){var z={};try{z.value=B(W),z.status="success"}catch(G){z.status="error",z.value=G}return z}d.resolve=O;function O(B){return B instanceof this?B:a.resolve(new this(s),B)}d.reject=P;function P(B){var W=new this(s);return a.reject(W,B)}d.all=k;function k(B){var W=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=B.length,G=!1;if(!z)return this.resolve([]);for(var re=new Array(z),oe=0,se=-1,q=new this(s);++se<z;)L(B[se],se);return q;function L(h,f){W.resolve(h).then(m,function(S){G||(G=!0,a.reject(q,S))});function m(S){re[f]=S,++oe===z&&!G&&(G=!0,a.resolve(q,re))}}}d.race=F;function F(B){var W=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=B.length,G=!1;if(!z)return this.resolve([]);for(var re=-1,oe=new this(s);++re<z;)se(B[re]);return oe;function se(q){W.resolve(q).then(function(L){G||(G=!0,a.resolve(oe,L))},function(L){G||(G=!0,a.reject(oe,L))})}}},{1:1}],3:[function(r,n,i){(function(o){typeof o.Promise!="function"&&(o.Promise=r(2))}).call(this,typeof Ar<"u"?Ar:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,n,i){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D};function s(D,K){if(!(D instanceof K))throw new TypeError("Cannot call a class as a function")}function a(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=a();function l(){try{if(!c||!c.open)return!1;var D=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),K=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!D||K)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function u(D,K){D=D||[],K=K||{};try{return new Blob(D,K)}catch(X){if(X.name!=="TypeError")throw X;for(var $=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,J=new $,te=0;te<D.length;te+=1)J.append(D[te]);return J.getBlob(K.type)}}typeof Promise>"u"&&r(3);var d=Promise;function p(D,K){K&&D.then(function($){K(null,$)},function($){K($)})}function y(D,K,$){typeof K=="function"&&D.then(K),typeof $=="function"&&D.catch($)}function x(D){return typeof D!="string"&&(console.warn(D+" used as a key, but it is not a string."),D=String(D)),D}function b(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var M="local-forage-detect-blob-support",O=void 0,P={},k=Object.prototype.toString,F="readonly",B="readwrite";function W(D){for(var K=D.length,$=new ArrayBuffer(K),J=new Uint8Array($),te=0;te<K;te++)J[te]=D.charCodeAt(te);return $}function z(D){return new d(function(K){var $=D.transaction(M,B),J=u([""]);$.objectStore(M).put(J,"key"),$.onabort=function(te){te.preventDefault(),te.stopPropagation(),K(!1)},$.oncomplete=function(){var te=navigator.userAgent.match(/Chrome\/(\d+)/),X=navigator.userAgent.match(/Edge\//);K(X||!te||parseInt(te[1],10)>=43)}}).catch(function(){return!1})}function G(D){return typeof O=="boolean"?d.resolve(O):z(D).then(function(K){return O=K,O})}function re(D){var K=P[D.name],$={};$.promise=new d(function(J,te){$.resolve=J,$.reject=te}),K.deferredOperations.push($),K.dbReady?K.dbReady=K.dbReady.then(function(){return $.promise}):K.dbReady=$.promise}function oe(D){var K=P[D.name],$=K.deferredOperations.pop();if($)return $.resolve(),$.promise}function se(D,K){var $=P[D.name],J=$.deferredOperations.pop();if(J)return J.reject(K),J.promise}function q(D,K){return new d(function($,J){if(P[D.name]=P[D.name]||g(),D.db)if(K)re(D),D.db.close();else return $(D.db);var te=[D.name];K&&te.push(D.version);var X=c.open.apply(c,te);K&&(X.onupgradeneeded=function(de){var ye=X.result;try{ye.createObjectStore(D.storeName),de.oldVersion<=1&&ye.createObjectStore(M)}catch(Se){if(Se.name==="ConstraintError")console.warn('The database "'+D.name+'" has been upgraded from version '+de.oldVersion+" to version "+de.newVersion+', but the storage "'+D.storeName+'" already exists.');else throw Se}}),X.onerror=function(de){de.preventDefault(),J(X.error)},X.onsuccess=function(){var de=X.result;de.onversionchange=function(ye){ye.target.close()},$(de),oe(D)}})}function L(D){return q(D,!1)}function h(D){return q(D,!0)}function f(D,K){if(!D.db)return!0;var $=!D.db.objectStoreNames.contains(D.storeName),J=D.version<D.db.version,te=D.version>D.db.version;if(J&&(D.version!==K&&console.warn('The database "'+D.name+`" can't be downgraded from version `+D.db.version+" to version "+D.version+"."),D.version=D.db.version),te||$){if($){var X=D.db.version+1;X>D.version&&(D.version=X)}return!0}return!1}function m(D){return new d(function(K,$){var J=new FileReader;J.onerror=$,J.onloadend=function(te){var X=btoa(te.target.result||"");K({__local_forage_encoded_blob:!0,data:X,type:D.type})},J.readAsBinaryString(D)})}function S(D){var K=W(atob(D.data));return u([K],{type:D.type})}function T(D){return D&&D.__local_forage_encoded_blob}function E(D){var K=this,$=K._initReady().then(function(){var J=P[K._dbInfo.name];if(J&&J.dbReady)return J.dbReady});return y($,D,D),$}function I(D){re(D);for(var K=P[D.name],$=K.forages,J=0;J<$.length;J++){var te=$[J];te._dbInfo.db&&(te._dbInfo.db.close(),te._dbInfo.db=null)}return D.db=null,L(D).then(function(X){return D.db=X,f(D)?h(D):X}).then(function(X){D.db=K.db=X;for(var de=0;de<$.length;de++)$[de]._dbInfo.db=X}).catch(function(X){throw se(D,X),X})}function C(D,K,$,J){J===void 0&&(J=1);try{var te=D.db.transaction(D.storeName,K);$(null,te)}catch(X){if(J>0&&(!D.db||X.name==="InvalidStateError"||X.name==="NotFoundError"))return d.resolve().then(function(){if(!D.db||X.name==="NotFoundError"&&!D.db.objectStoreNames.contains(D.storeName)&&D.version<=D.db.version)return D.db&&(D.version=D.db.version+1),h(D)}).then(function(){return I(D).then(function(){C(D,K,$,J-1)})}).catch($);$(X)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function v(D){var K=this,$={db:null};if(D)for(var J in D)$[J]=D[J];var te=P[$.name];te||(te=g(),P[$.name]=te),te.forages.push(K),K._initReady||(K._initReady=K.ready,K.ready=E);var X=[];function de(){return d.resolve()}for(var ye=0;ye<te.forages.length;ye++){var Se=te.forages[ye];Se!==K&&X.push(Se._initReady().catch(de))}var _e=te.forages.slice(0);return d.all(X).then(function(){return $.db=te.db,L($)}).then(function(Ee){return $.db=Ee,f($,K._defaultConfig.version)?h($):Ee}).then(function(Ee){$.db=te.db=Ee,K._dbInfo=$;for(var $e=0;$e<_e.length;$e++){var bt=_e[$e];bt!==K&&(bt._dbInfo.db=$.db,bt._dbInfo.version=$.version)}})}function j(D,K){var $=this;D=x(D);var J=new d(function(te,X){$.ready().then(function(){C($._dbInfo,F,function(de,ye){if(de)return X(de);try{var Se=ye.objectStore($._dbInfo.storeName),_e=Se.get(D);_e.onsuccess=function(){var Ee=_e.result;Ee===void 0&&(Ee=null),T(Ee)&&(Ee=S(Ee)),te(Ee)},_e.onerror=function(){X(_e.error)}}catch(Ee){X(Ee)}})}).catch(X)});return p(J,K),J}function Q(D,K){var $=this,J=new d(function(te,X){$.ready().then(function(){C($._dbInfo,F,function(de,ye){if(de)return X(de);try{var Se=ye.objectStore($._dbInfo.storeName),_e=Se.openCursor(),Ee=1;_e.onsuccess=function(){var $e=_e.result;if($e){var bt=$e.value;T(bt)&&(bt=S(bt));var $t=D(bt,$e.key,Ee++);$t!==void 0?te($t):$e.continue()}else te()},_e.onerror=function(){X(_e.error)}}catch($e){X($e)}})}).catch(X)});return p(J,K),J}function Z(D,K,$){var J=this;D=x(D);var te=new d(function(X,de){var ye;J.ready().then(function(){return ye=J._dbInfo,k.call(K)==="[object Blob]"?G(ye.db).then(function(Se){return Se?K:m(K)}):K}).then(function(Se){C(J._dbInfo,B,function(_e,Ee){if(_e)return de(_e);try{var $e=Ee.objectStore(J._dbInfo.storeName);Se===null&&(Se=void 0);var bt=$e.put(Se,D);Ee.oncomplete=function(){Se===void 0&&(Se=null),X(Se)},Ee.onabort=Ee.onerror=function(){var $t=bt.error?bt.error:bt.transaction.error;de($t)}}catch($t){de($t)}})}).catch(de)});return p(te,$),te}function ce(D,K){var $=this;D=x(D);var J=new d(function(te,X){$.ready().then(function(){C($._dbInfo,B,function(de,ye){if(de)return X(de);try{var Se=ye.objectStore($._dbInfo.storeName),_e=Se.delete(D);ye.oncomplete=function(){te()},ye.onerror=function(){X(_e.error)},ye.onabort=function(){var Ee=_e.error?_e.error:_e.transaction.error;X(Ee)}}catch(Ee){X(Ee)}})}).catch(X)});return p(J,K),J}function be(D){var K=this,$=new d(function(J,te){K.ready().then(function(){C(K._dbInfo,B,function(X,de){if(X)return te(X);try{var ye=de.objectStore(K._dbInfo.storeName),Se=ye.clear();de.oncomplete=function(){J()},de.onabort=de.onerror=function(){var _e=Se.error?Se.error:Se.transaction.error;te(_e)}}catch(_e){te(_e)}})}).catch(te)});return p($,D),$}function xe(D){var K=this,$=new d(function(J,te){K.ready().then(function(){C(K._dbInfo,F,function(X,de){if(X)return te(X);try{var ye=de.objectStore(K._dbInfo.storeName),Se=ye.count();Se.onsuccess=function(){J(Se.result)},Se.onerror=function(){te(Se.error)}}catch(_e){te(_e)}})}).catch(te)});return p($,D),$}function pe(D,K){var $=this,J=new d(function(te,X){if(D<0){te(null);return}$.ready().then(function(){C($._dbInfo,F,function(de,ye){if(de)return X(de);try{var Se=ye.objectStore($._dbInfo.storeName),_e=!1,Ee=Se.openKeyCursor();Ee.onsuccess=function(){var $e=Ee.result;if(!$e){te(null);return}D===0||_e?te($e.key):(_e=!0,$e.advance(D))},Ee.onerror=function(){X(Ee.error)}}catch($e){X($e)}})}).catch(X)});return p(J,K),J}function Le(D){var K=this,$=new d(function(J,te){K.ready().then(function(){C(K._dbInfo,F,function(X,de){if(X)return te(X);try{var ye=de.objectStore(K._dbInfo.storeName),Se=ye.openKeyCursor(),_e=[];Se.onsuccess=function(){var Ee=Se.result;if(!Ee){J(_e);return}_e.push(Ee.key),Ee.continue()},Se.onerror=function(){te(Se.error)}}catch(Ee){te(Ee)}})}).catch(te)});return p($,D),$}function Ae(D,K){K=b.apply(this,arguments);var $=this.config();D=typeof D!="function"&&D||{},D.name||(D.name=D.name||$.name,D.storeName=D.storeName||$.storeName);var J=this,te;if(!D.name)te=d.reject("Invalid arguments");else{var X=D.name===$.name&&J._dbInfo.db,de=X?d.resolve(J._dbInfo.db):L(D).then(function(ye){var Se=P[D.name],_e=Se.forages;Se.db=ye;for(var Ee=0;Ee<_e.length;Ee++)_e[Ee]._dbInfo.db=ye;return ye});D.storeName?te=de.then(function(ye){if(ye.objectStoreNames.contains(D.storeName)){var Se=ye.version+1;re(D);var _e=P[D.name],Ee=_e.forages;ye.close();for(var $e=0;$e<Ee.length;$e++){var bt=Ee[$e];bt._dbInfo.db=null,bt._dbInfo.version=Se}var $t=new d(function(qt,hr){var fr=c.open(D.name,Se);fr.onerror=function(on){var Ls=fr.result;Ls.close(),hr(on)},fr.onupgradeneeded=function(){var on=fr.result;on.deleteObjectStore(D.storeName)},fr.onsuccess=function(){var on=fr.result;on.close(),qt(on)}});return $t.then(function(qt){_e.db=qt;for(var hr=0;hr<Ee.length;hr++){var fr=Ee[hr];fr._dbInfo.db=qt,oe(fr._dbInfo)}}).catch(function(qt){throw(se(D,qt)||d.resolve()).catch(function(){}),qt})}}):te=de.then(function(ye){re(D);var Se=P[D.name],_e=Se.forages;ye.close();for(var Ee=0;Ee<_e.length;Ee++){var $e=_e[Ee];$e._dbInfo.db=null}var bt=new d(function($t,qt){var hr=c.deleteDatabase(D.name);hr.onerror=function(){var fr=hr.result;fr&&fr.close(),qt(hr.error)},hr.onblocked=function(){console.warn('dropInstance blocked for database "'+D.name+'" until all open connections are closed')},hr.onsuccess=function(){var fr=hr.result;fr&&fr.close(),$t(fr)}});return bt.then(function($t){Se.db=$t;for(var qt=0;qt<_e.length;qt++){var hr=_e[qt];oe(hr._dbInfo)}}).catch(function($t){throw(se(D,$t)||d.resolve()).catch(function(){}),$t})})}return p(te,K),te}var Je={_driver:"asyncStorage",_initStorage:v,_support:l(),iterate:Q,getItem:j,setItem:Z,removeItem:ce,clear:be,length:xe,key:pe,keys:Le,dropInstance:Ae};function dt(){return typeof openDatabase=="function"}var je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pt="~~local_forage_type~",we=/^~~local_forage_type~([^~]+)~/,he="__lfsc__:",Ce=he.length,Ve="arbf",ke="blob",Te="si08",Me="ui08",Ue="uic8",ut="si16",ft="si32",ze="ur16",kt="ui32",_t="fl32",Ke="fl64",It=Ce+Ve.length,Ut=Object.prototype.toString;function et(D){var K=D.length*.75,$=D.length,J,te=0,X,de,ye,Se;D[D.length-1]==="="&&(K--,D[D.length-2]==="="&&K--);var _e=new ArrayBuffer(K),Ee=new Uint8Array(_e);for(J=0;J<$;J+=4)X=je.indexOf(D[J]),de=je.indexOf(D[J+1]),ye=je.indexOf(D[J+2]),Se=je.indexOf(D[J+3]),Ee[te++]=X<<2|de>>4,Ee[te++]=(de&15)<<4|ye>>2,Ee[te++]=(ye&3)<<6|Se&63;return _e}function Et(D){var K=new Uint8Array(D),$="",J;for(J=0;J<K.length;J+=3)$+=je[K[J]>>2],$+=je[(K[J]&3)<<4|K[J+1]>>4],$+=je[(K[J+1]&15)<<2|K[J+2]>>6],$+=je[K[J+2]&63];return K.length%3===2?$=$.substring(0,$.length-1)+"=":K.length%3===1&&($=$.substring(0,$.length-2)+"=="),$}function Ot(D,K){var $="";if(D&&($=Ut.call(D)),D&&($==="[object ArrayBuffer]"||D.buffer&&Ut.call(D.buffer)==="[object ArrayBuffer]")){var J,te=he;D instanceof ArrayBuffer?(J=D,te+=Ve):(J=D.buffer,$==="[object Int8Array]"?te+=Te:$==="[object Uint8Array]"?te+=Me:$==="[object Uint8ClampedArray]"?te+=Ue:$==="[object Int16Array]"?te+=ut:$==="[object Uint16Array]"?te+=ze:$==="[object Int32Array]"?te+=ft:$==="[object Uint32Array]"?te+=kt:$==="[object Float32Array]"?te+=_t:$==="[object Float64Array]"?te+=Ke:K(new Error("Failed to get type for BinaryArray"))),K(te+Et(J))}else if($==="[object Blob]"){var X=new FileReader;X.onload=function(){var de=pt+D.type+"~"+Et(this.result);K(he+ke+de)},X.readAsArrayBuffer(D)}else try{K(JSON.stringify(D))}catch(de){console.error("Couldn't convert value into a JSON string: ",D),K(null,de)}}function nt(D){if(D.substring(0,Ce)!==he)return JSON.parse(D);var K=D.substring(It),$=D.substring(Ce,It),J;if($===ke&&we.test(K)){var te=K.match(we);J=te[1],K=K.substring(te[0].length)}var X=et(K);switch($){case Ve:return X;case ke:return u([X],{type:J});case Te:return new Int8Array(X);case Me:return new Uint8Array(X);case Ue:return new Uint8ClampedArray(X);case ut:return new Int16Array(X);case ze:return new Uint16Array(X);case ft:return new Int32Array(X);case kt:return new Uint32Array(X);case _t:return new Float32Array(X);case Ke:return new Float64Array(X);default:throw new Error("Unkown type: "+$)}}var jt={serialize:Ot,deserialize:nt,stringToBuffer:et,bufferToString:Et};function Pt(D,K,$,J){D.executeSql("CREATE TABLE IF NOT EXISTS "+K.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],$,J)}function tt(D){var K=this,$={db:null};if(D)for(var J in D)$[J]=typeof D[J]!="string"?D[J].toString():D[J];var te=new d(function(X,de){try{$.db=openDatabase($.name,String($.version),$.description,$.size)}catch(ye){return de(ye)}$.db.transaction(function(ye){Pt(ye,$,function(){K._dbInfo=$,X()},function(Se,_e){de(_e)})},de)});return $.serializer=jt,te}function wt(D,K,$,J,te,X){D.executeSql($,J,te,function(de,ye){ye.code===ye.SYNTAX_ERR?de.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[K.storeName],function(Se,_e){_e.rows.length?X(Se,ye):Pt(Se,K,function(){Se.executeSql($,J,te,X)},X)},X):X(de,ye)},X)}function Ct(D,K){var $=this;D=x(D);var J=new d(function(te,X){$.ready().then(function(){var de=$._dbInfo;de.db.transaction(function(ye){wt(ye,de,"SELECT * FROM "+de.storeName+" WHERE key = ? LIMIT 1",[D],function(Se,_e){var Ee=_e.rows.length?_e.rows.item(0).value:null;Ee&&(Ee=de.serializer.deserialize(Ee)),te(Ee)},function(Se,_e){X(_e)})})}).catch(X)});return p(J,K),J}function Ge(D,K){var $=this,J=new d(function(te,X){$.ready().then(function(){var de=$._dbInfo;de.db.transaction(function(ye){wt(ye,de,"SELECT * FROM "+de.storeName,[],function(Se,_e){for(var Ee=_e.rows,$e=Ee.length,bt=0;bt<$e;bt++){var $t=Ee.item(bt),qt=$t.value;if(qt&&(qt=de.serializer.deserialize(qt)),qt=D(qt,$t.key,bt+1),qt!==void 0){te(qt);return}}te()},function(Se,_e){X(_e)})})}).catch(X)});return p(J,K),J}function mt(D,K,$,J){var te=this;D=x(D);var X=new d(function(de,ye){te.ready().then(function(){K===void 0&&(K=null);var Se=K,_e=te._dbInfo;_e.serializer.serialize(K,function(Ee,$e){$e?ye($e):_e.db.transaction(function(bt){wt(bt,_e,"INSERT OR REPLACE INTO "+_e.storeName+" (key, value) VALUES (?, ?)",[D,Ee],function(){de(Se)},function($t,qt){ye(qt)})},function(bt){if(bt.code===bt.QUOTA_ERR){if(J>0){de(mt.apply(te,[D,Se,$,J-1]));return}ye(bt)}})})}).catch(ye)});return p(X,$),X}function Nt(D,K,$){return mt.apply(this,[D,K,$,1])}function it(D,K){var $=this;D=x(D);var J=new d(function(te,X){$.ready().then(function(){var de=$._dbInfo;de.db.transaction(function(ye){wt(ye,de,"DELETE FROM "+de.storeName+" WHERE key = ?",[D],function(){te()},function(Se,_e){X(_e)})})}).catch(X)});return p(J,K),J}function xt(D){var K=this,$=new d(function(J,te){K.ready().then(function(){var X=K._dbInfo;X.db.transaction(function(de){wt(de,X,"DELETE FROM "+X.storeName,[],function(){J()},function(ye,Se){te(Se)})})}).catch(te)});return p($,D),$}function zt(D){var K=this,$=new d(function(J,te){K.ready().then(function(){var X=K._dbInfo;X.db.transaction(function(de){wt(de,X,"SELECT COUNT(key) as c FROM "+X.storeName,[],function(ye,Se){var _e=Se.rows.item(0).c;J(_e)},function(ye,Se){te(Se)})})}).catch(te)});return p($,D),$}function N(D,K){var $=this,J=new d(function(te,X){$.ready().then(function(){var de=$._dbInfo;de.db.transaction(function(ye){wt(ye,de,"SELECT key FROM "+de.storeName+" WHERE id = ? LIMIT 1",[D+1],function(Se,_e){var Ee=_e.rows.length?_e.rows.item(0).key:null;te(Ee)},function(Se,_e){X(_e)})})}).catch(X)});return p(J,K),J}function _(D){var K=this,$=new d(function(J,te){K.ready().then(function(){var X=K._dbInfo;X.db.transaction(function(de){wt(de,X,"SELECT key FROM "+X.storeName,[],function(ye,Se){for(var _e=[],Ee=0;Ee<Se.rows.length;Ee++)_e.push(Se.rows.item(Ee).key);J(_e)},function(ye,Se){te(Se)})})}).catch(te)});return p($,D),$}function A(D){return new d(function(K,$){D.transaction(function(J){J.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(te,X){for(var de=[],ye=0;ye<X.rows.length;ye++)de.push(X.rows.item(ye).name);K({db:D,storeNames:de})},function(te,X){$(X)})},function(J){$(J)})})}function U(D,K){K=b.apply(this,arguments);var $=this.config();D=typeof D!="function"&&D||{},D.name||(D.name=D.name||$.name,D.storeName=D.storeName||$.storeName);var J=this,te;return D.name?te=new d(function(X){var de;D.name===$.name?de=J._dbInfo.db:de=openDatabase(D.name,"","",0),D.storeName?X({db:de,storeNames:[D.storeName]}):X(A(de))}).then(function(X){return new d(function(de,ye){X.db.transaction(function(Se){function _e($t){return new d(function(qt,hr){Se.executeSql("DROP TABLE IF EXISTS "+$t,[],function(){qt()},function(fr,on){hr(on)})})}for(var Ee=[],$e=0,bt=X.storeNames.length;$e<bt;$e++)Ee.push(_e(X.storeNames[$e]));d.all(Ee).then(function(){de()}).catch(function($t){ye($t)})},function(Se){ye(Se)})})}):te=d.reject("Invalid arguments"),p(te,K),te}var Y={_driver:"webSQLStorage",_initStorage:tt,_support:dt(),iterate:Ge,getItem:Ct,setItem:Nt,removeItem:it,clear:xt,length:zt,key:N,keys:_,dropInstance:U};function ee(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ne(D,K){var $=D.name+"/";return D.storeName!==K.storeName&&($+=D.storeName+"/"),$}function De(){var D="_localforage_support_test";try{return localStorage.setItem(D,!0),localStorage.removeItem(D),!1}catch{return!0}}function Ze(){return!De()||localStorage.length>0}function Ne(D){var K=this,$={};if(D)for(var J in D)$[J]=D[J];return $.keyPrefix=ne(D,K._defaultConfig),Ze()?(K._dbInfo=$,$.serializer=jt,d.resolve()):d.reject()}function V(D){var K=this,$=K.ready().then(function(){for(var J=K._dbInfo.keyPrefix,te=localStorage.length-1;te>=0;te--){var X=localStorage.key(te);X.indexOf(J)===0&&localStorage.removeItem(X)}});return p($,D),$}function ae(D,K){var $=this;D=x(D);var J=$.ready().then(function(){var te=$._dbInfo,X=localStorage.getItem(te.keyPrefix+D);return X&&(X=te.serializer.deserialize(X)),X});return p(J,K),J}function fe(D,K){var $=this,J=$.ready().then(function(){for(var te=$._dbInfo,X=te.keyPrefix,de=X.length,ye=localStorage.length,Se=1,_e=0;_e<ye;_e++){var Ee=localStorage.key(_e);if(Ee.indexOf(X)===0){var $e=localStorage.getItem(Ee);if($e&&($e=te.serializer.deserialize($e)),$e=D($e,Ee.substring(de),Se++),$e!==void 0)return $e}}});return p(J,K),J}function Re(D,K){var $=this,J=$.ready().then(function(){var te=$._dbInfo,X;try{X=localStorage.key(D)}catch{X=null}return X&&(X=X.substring(te.keyPrefix.length)),X});return p(J,K),J}function qe(D){var K=this,$=K.ready().then(function(){for(var J=K._dbInfo,te=localStorage.length,X=[],de=0;de<te;de++){var ye=localStorage.key(de);ye.indexOf(J.keyPrefix)===0&&X.push(ye.substring(J.keyPrefix.length))}return X});return p($,D),$}function Pe(D){var K=this,$=K.keys().then(function(J){return J.length});return p($,D),$}function Fe(D,K){var $=this;D=x(D);var J=$.ready().then(function(){var te=$._dbInfo;localStorage.removeItem(te.keyPrefix+D)});return p(J,K),J}function ot(D,K,$){var J=this;D=x(D);var te=J.ready().then(function(){K===void 0&&(K=null);var X=K;return new d(function(de,ye){var Se=J._dbInfo;Se.serializer.serialize(K,function(_e,Ee){if(Ee)ye(Ee);else try{localStorage.setItem(Se.keyPrefix+D,_e),de(X)}catch($e){($e.name==="QuotaExceededError"||$e.name==="NS_ERROR_DOM_QUOTA_REACHED")&&ye($e),ye($e)}})})});return p(te,$),te}function Jt(D,K){if(K=b.apply(this,arguments),D=typeof D!="function"&&D||{},!D.name){var $=this.config();D.name=D.name||$.name,D.storeName=D.storeName||$.storeName}var J=this,te;return D.name?te=new d(function(X){D.storeName?X(ne(D,J._defaultConfig)):X(D.name+"/")}).then(function(X){for(var de=localStorage.length-1;de>=0;de--){var ye=localStorage.key(de);ye.indexOf(X)===0&&localStorage.removeItem(ye)}}):te=d.reject("Invalid arguments"),p(te,K),te}var Dt={_driver:"localStorageWrapper",_initStorage:Ne,_support:ee(),iterate:fe,getItem:ae,setItem:ot,removeItem:Fe,clear:V,length:Pe,key:Re,keys:qe,dropInstance:Jt},Ft=function(K,$){return K===$||typeof K=="number"&&typeof $=="number"&&isNaN(K)&&isNaN($)},sr=function(K,$){for(var J=K.length,te=0;te<J;){if(Ft(K[te],$))return!0;te++}return!1},Er=Array.isArray||function(D){return Object.prototype.toString.call(D)==="[object Array]"},ur={},Zt={},wr={INDEXEDDB:Je,WEBSQL:Y,LOCALSTORAGE:Dt},vn=[wr.INDEXEDDB._driver,wr.WEBSQL._driver,wr.LOCALSTORAGE._driver],Vr=["dropInstance"],bn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Vr),ii={description:"",driver:vn.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function oi(D,K){D[K]=function(){var $=arguments;return D.ready().then(function(){return D[K].apply(D,$)})}}function yn(){for(var D=1;D<arguments.length;D++){var K=arguments[D];if(K)for(var $ in K)K.hasOwnProperty($)&&(Er(K[$])?arguments[0][$]=K[$].slice():arguments[0][$]=K[$])}return arguments[0]}var si=function(){function D(K){s(this,D);for(var $ in wr)if(wr.hasOwnProperty($)){var J=wr[$],te=J._driver;this[$]=te,ur[te]||this.defineDriver(J)}this._defaultConfig=yn({},ii),this._config=yn({},this._defaultConfig,K),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return D.prototype.config=function($){if((typeof $>"u"?"undefined":o($))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var J in $){if(J==="storeName"&&($[J]=$[J].replace(/\W/g,"_")),J==="version"&&typeof $[J]!="number")return new Error("Database version must be a number.");this._config[J]=$[J]}return"driver"in $&&$.driver?this.setDriver(this._config.driver):!0}else return typeof $=="string"?this._config[$]:this._config},D.prototype.defineDriver=function($,J,te){var X=new d(function(de,ye){try{var Se=$._driver,_e=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!$._driver){ye(_e);return}for(var Ee=bn.concat("_initStorage"),$e=0,bt=Ee.length;$e<bt;$e++){var $t=Ee[$e],qt=!sr(Vr,$t);if((qt||$[$t])&&typeof $[$t]!="function"){ye(_e);return}}var hr=function(){for(var Ls=function(s6){return function(){var a6=new Error("Method "+s6+" is not implemented by the current driver"),nh=d.reject(a6);return p(nh,arguments[arguments.length-1]),nh}},au=0,o6=Vr.length;au<o6;au++){var cu=Vr[au];$[cu]||($[cu]=Ls(cu))}};hr();var fr=function(Ls){ur[Se]&&console.info("Redefining LocalForage driver: "+Se),ur[Se]=$,Zt[Se]=Ls,de()};"_support"in $?$._support&&typeof $._support=="function"?$._support().then(fr,ye):fr(!!$._support):fr(!0)}catch(on){ye(on)}});return y(X,J,te),X},D.prototype.driver=function(){return this._driver||null},D.prototype.getDriver=function($,J,te){var X=ur[$]?d.resolve(ur[$]):d.reject(new Error("Driver not found."));return y(X,J,te),X},D.prototype.getSerializer=function($){var J=d.resolve(jt);return y(J,$),J},D.prototype.ready=function($){var J=this,te=J._driverSet.then(function(){return J._ready===null&&(J._ready=J._initDriver()),J._ready});return y(te,$,$),te},D.prototype.setDriver=function($,J,te){var X=this;Er($)||($=[$]);var de=this._getSupportedDrivers($);function ye(){X._config.driver=X.driver()}function Se($e){return X._extend($e),ye(),X._ready=X._initStorage(X._config),X._ready}function _e($e){return function(){var bt=0;function $t(){for(;bt<$e.length;){var qt=$e[bt];return bt++,X._dbInfo=null,X._ready=null,X.getDriver(qt).then(Se).catch($t)}ye();var hr=new Error("No available storage method found.");return X._driverSet=d.reject(hr),X._driverSet}return $t()}}var Ee=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=Ee.then(function(){var $e=de[0];return X._dbInfo=null,X._ready=null,X.getDriver($e).then(function(bt){X._driver=bt._driver,ye(),X._wrapLibraryMethodsWithReady(),X._initDriver=_e(de)})}).catch(function(){ye();var $e=new Error("No available storage method found.");return X._driverSet=d.reject($e),X._driverSet}),y(this._driverSet,J,te),this._driverSet},D.prototype.supports=function($){return!!Zt[$]},D.prototype._extend=function($){yn(this,$)},D.prototype._getSupportedDrivers=function($){for(var J=[],te=0,X=$.length;te<X;te++){var de=$[te];this.supports(de)&&J.push(de)}return J},D.prototype._wrapLibraryMethodsWithReady=function(){for(var $=0,J=bn.length;$<J;$++)oi(this,bn[$])},D.prototype.createInstance=function($){return new D($)},D}(),ai=new si;n.exports=ai},{3:3}]},{},[4])(4)})})(wb);var tC=wb.exports;const Zs=Ta(tC);Zs.config({name:"CetusSite",storeName:"tokens"});class Si{static async setItem(t,r){try{await Zs.setItem(t,r)}catch(n){console.error(`Failed to set item with key "${t}"`,n)}}static async getItem(t){try{return await Zs.getItem(t)}catch(r){return console.error(`Failed to get item with key "${t}"`,r),null}}static async removeItem(t){try{await Zs.removeItem(t)}catch(r){console.error(`Failed to remove item with key "${t}"`,r)}}static async clear(){try{await Zs.clear()}catch(t){console.error("Failed to clear storage",t)}}}const Pl=[{name:"SuiVision",link:"https://suivision.xyz",img:At("/images/logo_suivision@2x.png"),isCustom:!1},{name:"Suiscan",link:"https://suiscan.xyz/mainnet",img:At("/images/logo_suiscan@2x.png"),isCustom:!1}],Hc=[{name:"Sui Fullnode",link:"https://fullnode.mainnet.sui.io",isCustom:!1},{name:"Custom RPC URL",link:"",isCustom:!0}],rC=[{display:"0.1",value:"0.001"},{display:"0.5",value:"0.005"},{display:"1",value:"0.01"}],nC="mainnet",iC={mainnet:{env:"mainnet",fullRpcUrl:"https://fullnode.mainnet.sui.io",simulationAccount:"0x326ce9894f08dcaa337fa232641cc34db957aec9ff6614c1186bc9a7508df0bb",api:"https://api-sui.cetus.zone",aggregatorUrl:"https://api-sui.cetus.zone/router_v2"}},ls=iC[nC],oC="0x45f3c0814d7be4aa5fbd32d7e3c40f3c062a2b63eaf5ec4f8c1539b5987b11af",sC=At("/images/birdeye-logo.png"),aC=At("/images/img-logo@2x.png"),cC=At("/images/logo_CoinGecko@2x.png"),lC=At("/images/logo_pyth.png");var sa=(e=>(e.CETUS="CETUS",e.KRIYA="KRIYA",e.KRIYAV3="KRIYAV3",e.FLOWX="FLOWX",e.FLOWXV3="FLOWXV3",e.AFTERMATH="AFTERMATH",e.HAEDAL="HAEDAL",e.VOLO="VOLO",e.AFSUI="AFSUI",e.DEEPBOOKV3="DEEPBOOKV3",e.SCALLOP="SCALLOP",e.BLUEMOVE="BLUEMOVE",e.TURBOS="TURBOS",e.SPRINGSUI="SPRINGSUI",e.BLUEFIN="BLUEFIN",e.HAEDALPMM="HAEDALPMM",e.ALPHAFI="ALPHAFI",e.STEAMM="STEAMM",e.STEAMM_OMM="STEAMM_OMM",e.OBRIC="OBRIC",e.METASTABLE="METASTABLE",e.MOMENTUM="MOMENTUM",e))(sa||{});const xb={pyth:"Pyth Network",coingecko:"CoinGecko",birdeye:"Birdeye",Cetus:"Cetus"},uC={pyth:lC,coingecko:cC,birdeye:sC,Cetus:aC},tr={CETUS:At("/images/aggregator-source/cetus.png"),KRIYA:At("/images/aggregator-source/kriya.png"),FLOWX:At("/images/aggregator-source/flowx.png"),AFTERMATH:At("/images/aggregator-source/aftermath.png"),TURBOS:At("/images/aggregator-source/turbos.png"),HAEDAL:At("/images/aggregator-source/haedal.png"),VOLO:At("/images/aggregator-source/volo.png"),AFSUI:At("/images/aggregator-source/aftermath.png"),BLUEMOVE:At("/images/aggregator-source/bluemove.png"),KRIYAV3:At("/images/aggregator-source/kriya.png"),FLOWXV3:At("/images/aggregator-source/flowx.png"),DEEPBOOKV3:At("/images/aggregator-source/deepbook.png"),SCALLOP:At("/images/aggregator-source/scallop.png"),SPRINGSUI:At("/images/aggregator-source/suilend.png"),BLUEFIN:At("/images/aggregator-source/bluefin.png"),HAEDALPMM:At("/images/aggregator-source/haedal.png"),ALPHAFI:At("/images/aggregator-source/stSui.png"),STEAMM:At("/images/aggregator-source/steamm.png"),OBRIC:At("/images/aggregator-source/obric.png"),METASTABLE:At("/images/aggregator-source/metastable.png"),MOMENTUM:At("/images/aggregator-source/momentum.png"),STEAMM_OMM:At("/images/aggregator-source/steamm.png")},Sb={CETUS:{name:"Cetus",id:"CETUS",logo:tr.CETUS,type:"dex",sort:100},DEEPBOOKV3:{name:"DeepBook V3",id:"DEEPBOOKV3",logo:tr.DEEPBOOKV3,type:"dex",sort:99},KRIYA:{name:"Kriya V2",id:"KRIYA",logo:tr.KRIYA,type:"dex",sort:98},KRIYAV3:{name:"Kriya V3",id:"KRIYAV3",logo:tr.KRIYA,type:"dex",sort:97},FLOWX:{name:"FlowX V2",id:"FLOWX",logo:tr.FLOWX,type:"dex",sort:96},FLOWXV3:{name:"FlowX V3",id:"FLOWXV3",logo:tr.FLOWX,type:"dex",sort:95},AFTERMATH:{name:"Aftermath",id:"AFTERMATH",logo:tr.AFTERMATH,type:"dex",sort:94},TURBOS:{name:"Turbos",id:"TURBOS",logo:tr.TURBOS,type:"dex",sort:93},HAEDAL:{name:"Haedal LSD",id:"HAEDAL",logo:tr.HAEDAL,type:"other",sort:92},HAEDALPMM:{name:"Haedal HMM",id:"HAEDALPMM",logo:tr.HAEDALPMM,type:"other",sort:92},VOLO:{name:"Volo",id:"VOLO",logo:tr.VOLO,type:"other",sort:91},AFSUI:{name:"Aftermath LSD",id:"AFSUI",logo:tr.AFTERMATH,type:"other",sort:90},BLUEMOVE:{name:"BlueMove",id:"BLUEMOVE",logo:tr.BLUEMOVE,type:"dex",sort:80},BLUEFIN:{name:"Bluefin",id:"BLUEFIN",logo:tr.BLUEFIN,sort:79,type:"dex"},MOMENTUM:{name:"Momentum",id:"MOMENTUM",logo:tr.MOMENTUM,sort:68,type:"dex"},SCALLOP:{name:"Scallop",id:"SCALLOP",logo:tr.SCALLOP,type:"other",sort:70},SPRINGSUI:{name:"SpringSui",id:"SPRINGSUI",logo:tr.SPRINGSUI,type:"other",sort:60},ALPHAFI:{name:"stSUI",id:"ALPHAFI",logo:tr.ALPHAFI,type:"other",sort:50},STEAMM:{name:"STEAMM CPMM",id:"STEAMM",logo:tr.STEAMM,sort:76,type:"dex"},STEAMM_OMM:{name:"STEAMM OMM",id:"STEAMM_OMM",logo:tr.STEAMM_OMM,sort:75,type:"dex"},METASTABLE:{name:"Metastable",id:"METASTABLE",logo:tr.METASTABLE,sort:77,type:"dex"},OBRIC:{name:"Obric",id:"OBRIC",logo:tr.OBRIC,sort:76,type:"dex"}},mp=e=>{let t;const r=new Set,n=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const p=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),r.forEach(y=>y(t,p))}},i=()=>t,a={setState:n,getState:i,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=t=e(n,i,a);return a},fC=e=>e?mp(e):mp,dC=e=>e;function hC(e,t=dC){const r=ie.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ie.useDebugValue(r),r}const gp=e=>{const t=fC(e),r=n=>hC(t,n);return Object.assign(r,t),r},Ri=e=>e?gp(e):gp;function pC(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var o;const s=c=>c===null?null:JSON.parse(c,t==null?void 0:t.reviver),a=(o=r.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>r.setItem(i,JSON.stringify(o,t==null?void 0:t.replacer)),removeItem:i=>r.removeItem(i)}}const Wf=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return Wf(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Wf(n)(r)}}}},mC=(e,t)=>(r,n,i)=>{let o={storage:pC(()=>localStorage),partialize:b=>b,version:0,merge:(b,M)=>({...M,...b}),...t},s=!1;const a=new Set,c=new Set;let l=o.storage;if(!l)return e((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),r(...b)},n,i);const u=()=>{const b=o.partialize({...n()});return l.setItem(o.name,{state:b,version:o.version})},d=i.setState;i.setState=(b,M)=>{d(b,M),u()};const p=e((...b)=>{r(...b),u()},n,i);i.getInitialState=()=>p;let y;const x=()=>{var b,M;if(!l)return;s=!1,a.forEach(P=>{var k;return P((k=n())!=null?k:p)});const O=((M=o.onRehydrateStorage)==null?void 0:M.call(o,(b=n())!=null?b:p))||void 0;return Wf(l.getItem.bind(l))(o.name).then(P=>{if(P)if(typeof P.version=="number"&&P.version!==o.version){if(o.migrate){const k=o.migrate(P.state,P.version);return k instanceof Promise?k.then(F=>[!0,F]):[!0,k]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,P.state];return[!1,void 0]}).then(P=>{var k;const[F,B]=P;if(y=o.merge(B,(k=n())!=null?k:p),r(y,!0),F)return u()}).then(()=>{O==null||O(y,void 0),y=n(),s=!0,c.forEach(P=>P(y))}).catch(P=>{O==null||O(void 0,P)})};return i.persist={setOptions:b=>{o={...o,...b},b.storage&&(l=b.storage)},clearStorage:()=>{l==null||l.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>x(),hasHydrated:()=>s,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(c.add(b),()=>{c.delete(b)})},o.skipHydration||x(),y||p},gC=mC,vC=(e,t)=>({ignoreWarnTokenMap:{},currentExplorer:Pl[0].link,setCurrentExplorer:r=>{e(()=>({currentExplorer:r}))},rpcList:Hc,setRpcList:r=>{e(()=>({rpcList:[...r]}))},currentRpc:Hc[0],customRpc:"",setCurrentRpc:r=>{e(()=>({currentRpc:r}))},setCustomRpc:r=>{e(()=>({customRpc:r}))},slippage:"0.5",setSlippage:r=>{e(()=>({slippage:r}))},isOpenSlippageDialog:!1,setIsOpenSlippageDialog:r=>{e(()=>({isOpenSlippageDialog:r}))},providers:Object.values(sa),setProviders:r=>{e(()=>({providers:r}))},poolApiMap:{},setPoolApiMap:(r,n)=>{const i=t().poolApiMap;i[r]=n,e(()=>({poolApiMap:{...i}}))},mevProtect:!0,setMevProtect:r=>{e(()=>({mevProtect:r}))},setIgnoreWarnToken:r=>{const n=t().ignoreWarnTokenMap;n[Ti(r)]=!0,e(()=>({ignoreWarnTokenMap:{...n}}))}}),$r=Ri(gC(vC,{name:"useGlobalStore",partialize:e=>{const{currentExplorer:t,currentRpc:r,slippage:n,customRpc:i,providers:o,mevProtect:s,ignoreWarnTokenMap:a}=e;return{currentExplorer:t,currentRpc:r,slippage:n,customRpc:i,providers:o,mevProtect:s,ignoreWarnTokenMap:a}}}));function As(){const{currentExplorer:e}=$r();return{getExplorerUrl:(r,n="account",i=e)=>{let o;return i.includes("suivision")?o=`${i}/${yC(n)}/${r}`:o=`${i}/${bC(n)}/${r}`,o}}}const bC=e=>{switch(e){case"account":return"address";case"token":return"object";case"tx":return"tx";case"poolAddress":return"object";case"nftAddress":return"object";case"coin":return"coin"}},yC=e=>{switch(e){case"account":return"account";case"token":return"object";case"tx":return"txblock";case"poolAddress":return"object";case"nftAddress":return"object";case"coin":return"coin"}};function _b(e){const{text:t,keywords:r,onKeywordClick:n,text_highlight_color:i="var(--cs-primary)",text_size:o="12px",text_color:s="var(--cs-btn-disabled-text)"}=e,a=new RegExp(`(${r.join("|")})`,"gi"),c=t.split(a);return w.jsx("span",{style:{display:"inline",whiteSpace:"normal",textAlign:"start"},children:c.map((l,u)=>{const d=r.includes(l);return w.jsx("span",{style:{lineHeight:"20px",fontSize:o,color:d?i:s,cursor:"pointer",whiteSpace:"inherit"},onClick:()=>n(l),children:l},u)})})}var Eb={exports:{}};/*!
|
|
46
46
|
Copyright (c) 2018 Jed Watson.
|
|
47
47
|
Licensed under the MIT License (MIT), see
|
|
48
48
|
http://jedwatson.github.io/classnames
|
|
49
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,n(a)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)t.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Sb);var pC=Sb.exports;const er=Ta(pC);function Qe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function mp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nl(...e){return t=>{let r=!1;const n=e.map(i=>{const o=mp(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i<n.length;i++){const o=n[i];typeof o=="function"?o():mp(e[i],null)}}}}function nr(...e){return O.useCallback(Nl(...e),e)}function Pi(e,t=[]){let r=[];function n(o,s){const a=O.createContext(s),c=r.length;r=[...r,s];const l=d=>{var R;const{scope:p,children:y,...x}=d,b=((R=p==null?void 0:p[e])==null?void 0:R[c])||a,M=O.useMemo(()=>x,Object.values(x));return w.jsx(b.Provider,{value:M,children:y})};l.displayName=o+"Provider";function u(d,p){var b;const y=((b=p==null?void 0:p[e])==null?void 0:b[c])||a,x=O.useContext(y);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[l,u]}const i=()=>{const o=r.map(s=>O.createContext(s));return function(a){const c=(a==null?void 0:a[e])||o;return O.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return i.scopeName=e,[n,mC(i,...t)]}function mC(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=n.reduce((a,{useScope:c,scopeName:l})=>{const d=c(o)[`__scope${l}`];return{...a,...d}},{});return O.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Ai=O.forwardRef((e,t)=>{const{children:r,...n}=e,i=O.Children.toArray(r),o=i.find(gC);if(o){const s=o.props.children,a=i.map(c=>c===o?O.Children.count(s)>1?O.Children.only(null):O.isValidElement(s)?s.props.children:null:c);return w.jsx(Gf,{...n,ref:t,children:O.isValidElement(s)?O.cloneElement(s,void 0,a):null})}return w.jsx(Gf,{...n,ref:t,children:r})});Ai.displayName="Slot";var Gf=O.forwardRef((e,t)=>{const{children:r,...n}=e;if(O.isValidElement(r)){const i=bC(r),o=vC(n,r.props);return r.type!==O.Fragment&&(o.ref=t?Nl(t,i):i),O.cloneElement(r,o)}return O.Children.count(r)>1?O.Children.only(null):null});Gf.displayName="SlotClone";var Ms=({children:e})=>w.jsx(w.Fragment,{children:e});function gC(e){return O.isValidElement(e)&&e.type===Ms}function vC(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...a)=>{o(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function bC(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var yC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xt=yC.reduce((e,t)=>{const r=O.forwardRef((n,i)=>{const{asChild:o,...s}=n,a=o?Ai:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(a,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function _b(e,t){e&&Dm.flushSync(()=>e.dispatchEvent(t))}function br(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function wC(e,t=globalThis==null?void 0:globalThis.document){const r=br(e);O.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var xC="DismissableLayer",Kf="dismissableLayer.update",SC="dismissableLayer.pointerDownOutside",_C="dismissableLayer.focusOutside",gp,Eb=O.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),c0=O.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...c}=e,l=O.useContext(Eb),[u,d]=O.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=O.useState({}),x=nr(t,z=>d(z)),b=Array.from(l.layers),[M]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),R=b.indexOf(M),P=u?b.indexOf(u):-1,k=l.layersWithOutsidePointerEventsDisabled.size>0,F=P>=R,B=TC(z=>{const G=z.target,re=[...l.branches].some(oe=>oe.contains(G));!F||re||(i==null||i(z),s==null||s(z),z.defaultPrevented||a==null||a())},p),W=AC(z=>{const G=z.target;[...l.branches].some(oe=>oe.contains(G))||(o==null||o(z),s==null||s(z),z.defaultPrevented||a==null||a())},p);return wC(z=>{P===l.layers.size-1&&(n==null||n(z),!z.defaultPrevented&&a&&(z.preventDefault(),a()))},p),O.useEffect(()=>{if(u)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(gp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),vp(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=gp)}},[u,p,r,l]),O.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),vp())},[u,l]),O.useEffect(()=>{const z=()=>y({});return document.addEventListener(Kf,z),()=>document.removeEventListener(Kf,z)},[]),w.jsx(Xt.div,{...c,ref:x,style:{pointerEvents:k?F?"auto":"none":void 0,...e.style},onFocusCapture:Qe(e.onFocusCapture,W.onFocusCapture),onBlurCapture:Qe(e.onBlurCapture,W.onBlurCapture),onPointerDownCapture:Qe(e.onPointerDownCapture,B.onPointerDownCapture)})});c0.displayName=xC;var EC="DismissableLayerBranch",CC=O.forwardRef((e,t)=>{const r=O.useContext(Eb),n=O.useRef(null),i=nr(t,n);return O.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),w.jsx(Xt.div,{...e,ref:i})});CC.displayName=EC;function TC(e,t=globalThis==null?void 0:globalThis.document){const r=br(e),n=O.useRef(!1),i=O.useRef(()=>{});return O.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let c=function(){Cb(SC,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function AC(e,t=globalThis==null?void 0:globalThis.document){const r=br(e),n=O.useRef(!1);return O.useEffect(()=>{const i=o=>{o.target&&!n.current&&Cb(_C,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function vp(){const e=new CustomEvent(Kf);document.dispatchEvent(e)}function Cb(e,t,r,{discrete:n}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?_b(i,o):i.dispatchEvent(o)}var Zi=globalThis!=null&&globalThis.document?O.useLayoutEffect:()=>{},MC=O["useId".toString()]||(()=>{}),IC=0;function ma(e){const[t,r]=O.useState(MC());return Zi(()=>{e||r(n=>n??String(IC++))},[e]),e||(t?`radix-${t}`:"")}const RC=["top","right","bottom","left"],Qi=Math.min,Xr=Math.max,Wc=Math.round,Ja=Math.floor,Yn=e=>({x:e,y:e}),OC={left:"right",right:"left",bottom:"top",top:"bottom"},PC={start:"end",end:"start"};function Yf(e,t,r){return Xr(e,Qi(t,r))}function Mi(e,t){return typeof e=="function"?e(t):e}function Ii(e){return e.split("-")[0]}function Is(e){return e.split("-")[1]}function l0(e){return e==="x"?"y":"x"}function u0(e){return e==="y"?"height":"width"}function eo(e){return["top","bottom"].includes(Ii(e))?"y":"x"}function f0(e){return l0(eo(e))}function NC(e,t,r){r===void 0&&(r=!1);const n=Is(e),i=f0(e),o=u0(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Gc(s)),[s,Gc(s)]}function kC(e){const t=Gc(e);return[Xf(e),t,Xf(t)]}function Xf(e){return e.replace(/start|end/g,t=>PC[t])}function jC(e,t,r){const n=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:n:t?n:i;case"left":case"right":return t?o:s;default:return[]}}function DC(e,t,r,n){const i=Is(e);let o=jC(Ii(e),r==="start",n);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Xf)))),o}function Gc(e){return e.replace(/left|right|bottom|top/g,t=>OC[t])}function LC(e){return{top:0,right:0,bottom:0,left:0,...e}}function Tb(e){return typeof e!="number"?LC(e):{top:e,right:e,bottom:e,left:e}}function Kc(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function bp(e,t,r){let{reference:n,floating:i}=e;const o=eo(t),s=f0(t),a=u0(s),c=Ii(t),l=o==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,p=n[a]/2-i[a]/2;let y;switch(c){case"top":y={x:u,y:n.y-i.height};break;case"bottom":y={x:u,y:n.y+n.height};break;case"right":y={x:n.x+n.width,y:d};break;case"left":y={x:n.x-i.width,y:d};break;default:y={x:n.x,y:n.y}}switch(Is(t)){case"start":y[s]-=p*(r&&l?-1:1);break;case"end":y[s]+=p*(r&&l?-1:1);break}return y}const BC=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,a=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=bp(l,n,c),p=n,y={},x=0;for(let b=0;b<a.length;b++){const{name:M,fn:R}=a[b],{x:P,y:k,data:F,reset:B}=await R({x:u,y:d,initialPlacement:n,placement:p,strategy:i,middlewareData:y,rects:l,platform:s,elements:{reference:e,floating:t}});u=P??u,d=k??d,y={...y,[M]:{...y[M],...F}},B&&x<=50&&(x++,typeof B=="object"&&(B.placement&&(p=B.placement),B.rects&&(l=B.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):B.rects),{x:u,y:d}=bp(l,p,c)),b=-1)}return{x:u,y:d,placement:p,strategy:i,middlewareData:y}};async function ga(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:o,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:y=0}=Mi(t,e),x=Tb(y),M=a[p?d==="floating"?"reference":"floating":d],R=Kc(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(M)))==null||r?M:M.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),P=d==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),F=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},B=Kc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:P,offsetParent:k,strategy:c}):P);return{top:(R.top-B.top+x.top)/F.y,bottom:(B.bottom-R.bottom+x.bottom)/F.y,left:(R.left-B.left+x.left)/F.x,right:(B.right-R.right+x.right)/F.x}}const UC=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Mi(e,t)||{};if(l==null)return{};const d=Tb(u),p={x:r,y:n},y=f0(i),x=u0(y),b=await s.getDimensions(l),M=y==="y",R=M?"top":"left",P=M?"bottom":"right",k=M?"clientHeight":"clientWidth",F=o.reference[x]+o.reference[y]-p[y]-o.floating[x],B=p[y]-o.reference[y],W=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let z=W?W[k]:0;(!z||!await(s.isElement==null?void 0:s.isElement(W)))&&(z=a.floating[k]||o.floating[x]);const G=F/2-B/2,re=z/2-b[x]/2-1,oe=Qi(d[R],re),se=Qi(d[P],re),q=oe,L=z-b[x]-se,h=z/2-b[x]/2+G,f=Yf(q,h,L),m=!c.arrow&&Is(i)!=null&&h!==f&&o.reference[x]/2-(h<q?oe:se)-b[x]/2<0,S=m?h<q?h-q:h-L:0;return{[y]:p[y]+S,data:{[y]:f,centerOffset:h-f-S,...m&&{alignmentOffset:S}},reset:m}}}),FC=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...M}=Mi(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const R=Ii(i),P=eo(a),k=Ii(a)===a,F=await(c.isRTL==null?void 0:c.isRTL(l.floating)),B=p||(k||!b?[Gc(a)]:kC(a)),W=x!=="none";!p&&W&&B.push(...DC(a,b,x,F));const z=[a,...B],G=await ga(t,M),re=[];let oe=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&re.push(G[R]),d){const h=NC(i,s,F);re.push(G[h[0]],G[h[1]])}if(oe=[...oe,{placement:i,overflows:re}],!re.every(h=>h<=0)){var se,q;const h=(((se=o.flip)==null?void 0:se.index)||0)+1,f=z[h];if(f)return{data:{index:h,overflows:oe},reset:{placement:f}};let m=(q=oe.filter(S=>S.overflows[0]<=0).sort((S,T)=>S.overflows[1]-T.overflows[1])[0])==null?void 0:q.placement;if(!m)switch(y){case"bestFit":{var L;const S=(L=oe.filter(T=>{if(W){const E=eo(T.placement);return E===P||E==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(E=>E>0).reduce((E,I)=>E+I,0)]).sort((T,E)=>T[1]-E[1])[0])==null?void 0:L[0];S&&(m=S);break}case"initialPlacement":m=a;break}if(i!==m)return{reset:{placement:m}}}return{}}}};function yp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wp(e){return RC.some(t=>e[t]>=0)}const $C=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=Mi(e,t);switch(n){case"referenceHidden":{const o=await ga(t,{...i,elementContext:"reference"}),s=yp(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:wp(s)}}}case"escaped":{const o=await ga(t,{...i,altBoundary:!0}),s=yp(o,r.floating);return{data:{escapedOffsets:s,escaped:wp(s)}}}default:return{}}}}};async function VC(e,t){const{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=Ii(r),a=Is(r),c=eo(r)==="y",l=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,d=Mi(t,e);let{mainAxis:p,crossAxis:y,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof x=="number"&&(y=a==="end"?x*-1:x),c?{x:y*u,y:p*l}:{x:p*l,y:y*u}}const zC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:o,placement:s,middlewareData:a}=t,c=await VC(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},qC=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:M=>{let{x:R,y:P}=M;return{x:R,y:P}}},...c}=Mi(e,t),l={x:r,y:n},u=await ga(t,c),d=eo(Ii(i)),p=l0(d);let y=l[p],x=l[d];if(o){const M=p==="y"?"top":"left",R=p==="y"?"bottom":"right",P=y+u[M],k=y-u[R];y=Yf(P,y,k)}if(s){const M=d==="y"?"top":"left",R=d==="y"?"bottom":"right",P=x+u[M],k=x-u[R];x=Yf(P,x,k)}const b=a.fn({...t,[p]:y,[d]:x});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[p]:o,[d]:s}}}}}},HC=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Mi(e,t),u={x:r,y:n},d=eo(i),p=l0(d);let y=u[p],x=u[d];const b=Mi(a,t),M=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const k=p==="y"?"height":"width",F=o.reference[p]-o.floating[k]+M.mainAxis,B=o.reference[p]+o.reference[k]-M.mainAxis;y<F?y=F:y>B&&(y=B)}if(l){var R,P;const k=p==="y"?"width":"height",F=["top","left"].includes(Ii(i)),B=o.reference[d]-o.floating[k]+(F&&((R=s.offset)==null?void 0:R[d])||0)+(F?0:M.crossAxis),W=o.reference[d]+o.reference[k]+(F?0:((P=s.offset)==null?void 0:P[d])||0)-(F?M.crossAxis:0);x<B?x=B:x>W&&(x=W)}return{[p]:y,[d]:x}}}},WC=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:c=()=>{},...l}=Mi(e,t),u=await ga(t,l),d=Ii(i),p=Is(i),y=eo(i)==="y",{width:x,height:b}=o.floating;let M,R;d==="top"||d==="bottom"?(M=d,R=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(R=d,M=p==="end"?"top":"bottom");const P=b-u.top-u.bottom,k=x-u.left-u.right,F=Qi(b-u[M],P),B=Qi(x-u[R],k),W=!t.middlewareData.shift;let z=F,G=B;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(G=k),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(z=P),W&&!p){const oe=Xr(u.left,0),se=Xr(u.right,0),q=Xr(u.top,0),L=Xr(u.bottom,0);y?G=x-2*(oe!==0||se!==0?oe+se:Xr(u.left,u.right)):z=b-2*(q!==0||L!==0?q+L:Xr(u.top,u.bottom))}await c({...t,availableWidth:G,availableHeight:z});const re=await s.getDimensions(a.floating);return x!==re.width||b!==re.height?{reset:{rects:!0}}:{}}}};function kl(){return typeof window<"u"}function Rs(e){return Ab(e)?(e.nodeName||"").toLowerCase():"#document"}function en(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ti(e){var t;return(t=(Ab(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ab(e){return kl()?e instanceof Node||e instanceof en(e).Node:!1}function kn(e){return kl()?e instanceof Element||e instanceof en(e).Element:!1}function Qn(e){return kl()?e instanceof HTMLElement||e instanceof en(e).HTMLElement:!1}function xp(e){return!kl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof en(e).ShadowRoot}function ja(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=jn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function GC(e){return["table","td","th"].includes(Rs(e))}function jl(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function d0(e){const t=h0(),r=kn(e)?jn(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function KC(e){let t=to(e);for(;Qn(t)&&!ys(t);){if(d0(t))return t;if(jl(t))return null;t=to(t)}return null}function h0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ys(e){return["html","body","#document"].includes(Rs(e))}function jn(e){return en(e).getComputedStyle(e)}function Dl(e){return kn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function to(e){if(Rs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xp(e)&&e.host||ti(e);return xp(t)?t.host:t}function Mb(e){const t=to(e);return ys(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qn(t)&&ja(t)?t:Mb(t)}function va(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=Mb(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),s=en(i);if(o){const a=Jf(s);return t.concat(s,s.visualViewport||[],ja(i)?i:[],a&&r?va(a):[])}return t.concat(i,va(i,[],r))}function Jf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ib(e){const t=jn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Qn(e),o=i?e.offsetWidth:r,s=i?e.offsetHeight:n,a=Wc(r)!==o||Wc(n)!==s;return a&&(r=o,n=s),{width:r,height:n,$:a}}function p0(e){return kn(e)?e:e.contextElement}function us(e){const t=p0(e);if(!Qn(t))return Yn(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=Ib(t);let s=(o?Wc(r.width):r.width)/n,a=(o?Wc(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const YC=Yn(0);function Rb(e){const t=en(e);return!h0()||!t.visualViewport?YC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function XC(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==en(e)?!1:t}function No(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=p0(e);let s=Yn(1);t&&(n?kn(n)&&(s=us(n)):s=us(e));const a=XC(o,r,n)?Rb(o):Yn(0);let c=(i.left+a.x)/s.x,l=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const p=en(o),y=n&&kn(n)?en(n):n;let x=p,b=Jf(x);for(;b&&n&&y!==x;){const M=us(b),R=b.getBoundingClientRect(),P=jn(b),k=R.left+(b.clientLeft+parseFloat(P.paddingLeft))*M.x,F=R.top+(b.clientTop+parseFloat(P.paddingTop))*M.y;c*=M.x,l*=M.y,u*=M.x,d*=M.y,c+=k,l+=F,x=en(b),b=Jf(x)}}return Kc({width:u,height:d,x:c,y:l})}function m0(e,t){const r=Dl(e).scrollLeft;return t?t.left+r:No(ti(e)).left+r}function Ob(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-(r?0:m0(e,n)),o=n.top+t.scrollTop;return{x:i,y:o}}function JC(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o=i==="fixed",s=ti(n),a=t?jl(t.floating):!1;if(n===s||a&&o)return r;let c={scrollLeft:0,scrollTop:0},l=Yn(1);const u=Yn(0),d=Qn(n);if((d||!d&&!o)&&((Rs(n)!=="body"||ja(s))&&(c=Dl(n)),Qn(n))){const y=No(n);l=us(n),u.x=y.x+n.clientLeft,u.y=y.y+n.clientTop}const p=s&&!d&&!o?Ob(s,c,!0):Yn(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:r.y*l.y-c.scrollTop*l.y+u.y+p.y}}function ZC(e){return Array.from(e.getClientRects())}function QC(e){const t=ti(e),r=Dl(e),n=e.ownerDocument.body,i=Xr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Xr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+m0(e);const a=-r.scrollTop;return jn(n).direction==="rtl"&&(s+=Xr(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:s,y:a}}function eT(e,t){const r=en(e),n=ti(e),i=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;const l=h0();(!l||l&&t==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a,y:c}}function tT(e,t){const r=No(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=Qn(e)?us(e):Yn(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,c=i*o.x,l=n*o.y;return{width:s,height:a,x:c,y:l}}function Sp(e,t,r){let n;if(t==="viewport")n=eT(e,r);else if(t==="document")n=QC(ti(e));else if(kn(t))n=tT(t,r);else{const i=Rb(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Kc(n)}function Pb(e,t){const r=to(e);return r===t||!kn(r)||ys(r)?!1:jn(r).position==="fixed"||Pb(r,t)}function rT(e,t){const r=t.get(e);if(r)return r;let n=va(e,[],!1).filter(a=>kn(a)&&Rs(a)!=="body"),i=null;const o=jn(e).position==="fixed";let s=o?to(e):e;for(;kn(s)&&!ys(s);){const a=jn(s),c=d0(s);!c&&a.position==="fixed"&&(i=null),(o?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ja(s)&&!c&&Pb(e,s))?n=n.filter(u=>u!==s):i=a,s=to(s)}return t.set(e,n),n}function nT(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const s=[...r==="clippingAncestors"?jl(t)?[]:rT(t,this._c):[].concat(r),n],a=s[0],c=s.reduce((l,u)=>{const d=Sp(t,u,i);return l.top=Xr(d.top,l.top),l.right=Qi(d.right,l.right),l.bottom=Qi(d.bottom,l.bottom),l.left=Xr(d.left,l.left),l},Sp(t,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function iT(e){const{width:t,height:r}=Ib(e);return{width:t,height:r}}function oT(e,t,r){const n=Qn(t),i=ti(t),o=r==="fixed",s=No(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=Yn(0);if(n||!n&&!o)if((Rs(t)!=="body"||ja(i))&&(a=Dl(t)),n){const p=No(t,!0,o,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else i&&(c.x=m0(i));const l=i&&!n&&!o?Ob(i,a):Yn(0),u=s.left+a.scrollLeft-c.x-l.x,d=s.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:s.width,height:s.height}}function $u(e){return jn(e).position==="static"}function _p(e,t){if(!Qn(e)||jn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ti(e)===r&&(r=r.ownerDocument.body),r}function Nb(e,t){const r=en(e);if(jl(e))return r;if(!Qn(e)){let i=to(e);for(;i&&!ys(i);){if(kn(i)&&!$u(i))return i;i=to(i)}return r}let n=_p(e,t);for(;n&&GC(n)&&$u(n);)n=_p(n,t);return n&&ys(n)&&$u(n)&&!d0(n)?r:n||KC(e)||r}const sT=async function(e){const t=this.getOffsetParent||Nb,r=this.getDimensions,n=await r(e.floating);return{reference:oT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function aT(e){return jn(e).direction==="rtl"}const cT={convertOffsetParentRelativeRectToViewportRelativeRect:JC,getDocumentElement:ti,getClippingRect:nT,getOffsetParent:Nb,getElementRects:sT,getClientRects:ZC,getDimensions:iT,getScale:us,isElement:kn,isRTL:aT};function kb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lT(e,t){let r=null,n;const i=ti(e);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const l=e.getBoundingClientRect(),{left:u,top:d,width:p,height:y}=l;if(a||t(),!p||!y)return;const x=Ja(d),b=Ja(i.clientWidth-(u+p)),M=Ja(i.clientHeight-(d+y)),R=Ja(u),k={rootMargin:-x+"px "+-b+"px "+-M+"px "+-R+"px",threshold:Xr(0,Qi(1,c))||1};let F=!0;function B(W){const z=W[0].intersectionRatio;if(z!==c){if(!F)return s();z?s(!1,z):n=setTimeout(()=>{s(!1,1e-7)},1e3)}z===1&&!kb(l,e.getBoundingClientRect())&&s(),F=!1}try{r=new IntersectionObserver(B,{...k,root:i.ownerDocument})}catch{r=new IntersectionObserver(B,k)}r.observe(e)}return s(!0),o}function uT(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=p0(e),u=i||o?[...l?va(l):[],...va(t)]:[];u.forEach(R=>{i&&R.addEventListener("scroll",r,{passive:!0}),o&&R.addEventListener("resize",r)});const d=l&&a?lT(l,r):null;let p=-1,y=null;s&&(y=new ResizeObserver(R=>{let[P]=R;P&&P.target===l&&y&&(y.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=y)==null||k.observe(t)})),r()}),l&&!c&&y.observe(l),y.observe(t));let x,b=c?No(e):null;c&&M();function M(){const R=No(e);b&&!kb(b,R)&&r(),b=R,x=requestAnimationFrame(M)}return r(),()=>{var R;u.forEach(P=>{i&&P.removeEventListener("scroll",r),o&&P.removeEventListener("resize",r)}),d==null||d(),(R=y)==null||R.disconnect(),y=null,c&&cancelAnimationFrame(x)}}const fT=zC,dT=qC,hT=FC,pT=WC,mT=$C,Ep=UC,gT=HC,vT=(e,t,r)=>{const n=new Map,i={platform:cT,...r},o={...i.platform,_c:n};return BC(e,t,{...i,platform:o})};var yc=typeof document<"u"?ie.useLayoutEffect:ie.useEffect;function Yc(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 r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Yc(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!Yc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function jb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cp(e,t){const r=jb(e);return Math.round(t*r)/r}function Vu(e){const t=O.useRef(e);return yc(()=>{t.current=e}),t}function bT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=O.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,y]=O.useState(n);Yc(p,n)||y(n);const[x,b]=O.useState(null),[M,R]=O.useState(null),P=O.useCallback(T=>{T!==W.current&&(W.current=T,b(T))},[]),k=O.useCallback(T=>{T!==z.current&&(z.current=T,R(T))},[]),F=o||x,B=s||M,W=O.useRef(null),z=O.useRef(null),G=O.useRef(u),re=c!=null,oe=Vu(c),se=Vu(i),q=Vu(l),L=O.useCallback(()=>{if(!W.current||!z.current)return;const T={placement:t,strategy:r,middleware:p};se.current&&(T.platform=se.current),vT(W.current,z.current,T).then(E=>{const I={...E,isPositioned:q.current!==!1};h.current&&!Yc(G.current,I)&&(G.current=I,Dm.flushSync(()=>{d(I)}))})},[p,t,r,se,q]);yc(()=>{l===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[l]);const h=O.useRef(!1);yc(()=>(h.current=!0,()=>{h.current=!1}),[]),yc(()=>{if(F&&(W.current=F),B&&(z.current=B),F&&B){if(oe.current)return oe.current(F,B,L);L()}},[F,B,L,oe,re]);const f=O.useMemo(()=>({reference:W,floating:z,setReference:P,setFloating:k}),[P,k]),m=O.useMemo(()=>({reference:F,floating:B}),[F,B]),S=O.useMemo(()=>{const T={position:r,left:0,top:0};if(!m.floating)return T;const E=Cp(m.floating,u.x),I=Cp(m.floating,u.y);return a?{...T,transform:"translate("+E+"px, "+I+"px)",...jb(m.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:E,top:I}},[r,a,m.floating,u.x,u.y]);return O.useMemo(()=>({...u,update:L,refs:f,elements:m,floatingStyles:S}),[u,L,f,m,S])}const yT=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Ep({element:n.current,padding:i}).fn(r):{}:n?Ep({element:n,padding:i}).fn(r):{}}}},wT=(e,t)=>({...fT(e),options:[e,t]}),xT=(e,t)=>({...dT(e),options:[e,t]}),ST=(e,t)=>({...gT(e),options:[e,t]}),_T=(e,t)=>({...hT(e),options:[e,t]}),ET=(e,t)=>({...pT(e),options:[e,t]}),CT=(e,t)=>({...mT(e),options:[e,t]}),TT=(e,t)=>({...yT(e),options:[e,t]});var AT="Arrow",Db=O.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...o}=e;return w.jsx(Xt.svg,{...o,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});Db.displayName=AT;var MT=Db;function g0(e){const[t,r]=O.useState(void 0);return Zi(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const c=o.borderBoxSize,l=Array.isArray(c)?c[0]:c;s=l.inlineSize,a=l.blockSize}else s=e.offsetWidth,a=e.offsetHeight;r({width:s,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var v0="Popper",[Lb,Ll]=Pi(v0),[IT,Bb]=Lb(v0),Ub=e=>{const{__scopePopper:t,children:r}=e,[n,i]=O.useState(null);return w.jsx(IT,{scope:t,anchor:n,onAnchorChange:i,children:r})};Ub.displayName=v0;var Fb="PopperAnchor",$b=O.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=Bb(Fb,r),s=O.useRef(null),a=nr(t,s);return O.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||s.current)}),n?null:w.jsx(Xt.div,{...i,ref:a})});$b.displayName=Fb;var b0="PopperContent",[RT,OT]=Lb(b0),Vb=O.forwardRef((e,t)=>{var ce,be,xe,pe,Le,Ae;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:y="optimized",onPlaced:x,...b}=e,M=Bb(b0,r),[R,P]=O.useState(null),k=nr(t,Je=>P(Je)),[F,B]=O.useState(null),W=g0(F),z=(W==null?void 0:W.width)??0,G=(W==null?void 0:W.height)??0,re=n+(o!=="center"?"-"+o:""),oe=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},se=Array.isArray(l)?l:[l],q=se.length>0,L={padding:oe,boundary:se.filter(NT),altBoundary:q},{refs:h,floatingStyles:f,placement:m,isPositioned:S,middlewareData:T}=bT({strategy:"fixed",placement:re,whileElementsMounted:(...Je)=>uT(...Je,{animationFrame:y==="always"}),elements:{reference:M.anchor},middleware:[wT({mainAxis:i+G,alignmentAxis:s}),c&&xT({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?ST():void 0,...L}),c&&_T({...L}),ET({...L,apply:({elements:Je,rects:ft,availableWidth:je,availableHeight:pt})=>{const{width:we,height:he}=ft.reference,Ce=Je.floating.style;Ce.setProperty("--radix-popper-available-width",`${je}px`),Ce.setProperty("--radix-popper-available-height",`${pt}px`),Ce.setProperty("--radix-popper-anchor-width",`${we}px`),Ce.setProperty("--radix-popper-anchor-height",`${he}px`)}}),F&&TT({element:F,padding:a}),kT({arrowWidth:z,arrowHeight:G}),p&&CT({strategy:"referenceHidden",...L})]}),[E,I]=Hb(m),C=br(x);Zi(()=>{S&&(C==null||C())},[S,C]);const g=(ce=T.arrow)==null?void 0:ce.x,v=(be=T.arrow)==null?void 0:be.y,j=((xe=T.arrow)==null?void 0:xe.centerOffset)!==0,[Q,Z]=O.useState();return Zi(()=>{R&&Z(window.getComputedStyle(R).zIndex)},[R]),w.jsx("div",{ref:h.setFloating,"data-radix-popper-content-wrapper":"",style:{...f,transform:S?f.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(pe=T.transformOrigin)==null?void 0:pe.x,(Le=T.transformOrigin)==null?void 0:Le.y].join(" "),...((Ae=T.hide)==null?void 0:Ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(RT,{scope:r,placedSide:E,onArrowChange:B,arrowX:g,arrowY:v,shouldHideArrow:j,children:w.jsx(Xt.div,{"data-side":E,"data-align":I,...b,ref:k,style:{...b.style,animation:S?void 0:"none"}})})})});Vb.displayName=b0;var zb="PopperArrow",PT={top:"bottom",right:"left",bottom:"top",left:"right"},qb=O.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,o=OT(zb,n),s=PT[o.placedSide];return w.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:w.jsx(MT,{...i,ref:r,style:{...i.style,display:"block"}})})});qb.displayName=zb;function NT(e){return e!==null}var kT=e=>({name:"transformOrigin",options:e,fn(t){var M,R,P;const{placement:r,rects:n,middlewareData:i}=t,s=((M=i.arrow)==null?void 0:M.centerOffset)!==0,a=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[l,u]=Hb(r),d={start:"0%",center:"50%",end:"100%"}[u],p=(((R=i.arrow)==null?void 0:R.x)??0)+a/2,y=(((P=i.arrow)==null?void 0:P.y)??0)+c/2;let x="",b="";return l==="bottom"?(x=s?d:`${p}px`,b=`${-c}px`):l==="top"?(x=s?d:`${p}px`,b=`${n.floating.height+c}px`):l==="right"?(x=`${-c}px`,b=s?d:`${y}px`):l==="left"&&(x=`${n.floating.width+c}px`,b=s?d:`${y}px`),{data:{x,y:b}}}});function Hb(e){const[t,r="center"]=e.split("-");return[t,r]}var Wb=Ub,Gb=$b,Kb=Vb,Yb=qb,jT="Portal",Xb=O.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[i,o]=O.useState(!1);Zi(()=>o(!0),[]);const s=r||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?ol.createPortal(w.jsx(Xt.div,{...n,ref:t}),s):null});Xb.displayName=jT;function DT(e,t){return O.useReducer((r,n)=>t[r][n]??r,e)}var Ln=e=>{const{present:t,children:r}=e,n=LT(t),i=typeof r=="function"?r({present:n.isPresent}):O.Children.only(r),o=nr(n.ref,BT(i));return typeof r=="function"||n.isPresent?O.cloneElement(i,{ref:o}):null};Ln.displayName="Presence";function LT(e){const[t,r]=O.useState(),n=O.useRef({}),i=O.useRef(e),o=O.useRef("none"),s=e?"mounted":"unmounted",[a,c]=DT(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return O.useEffect(()=>{const l=Za(n.current);o.current=a==="mounted"?l:"none"},[a]),Zi(()=>{const l=n.current,u=i.current;if(u!==e){const p=o.current,y=Za(l);e?c("MOUNT"):y==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&p!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Zi(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=y=>{const b=Za(n.current).includes(y.animationName);if(y.target===t&&b&&(c("ANIMATION_END"),!i.current)){const M=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=M)})}},p=y=>{y.target===t&&(o.current=Za(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:O.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function Za(e){return(e==null?void 0:e.animationName)||"none"}function BT(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Da({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,i]=UT({defaultProp:t,onChange:r}),o=e!==void 0,s=o?e:n,a=br(r),c=O.useCallback(l=>{if(o){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else i(l)},[o,e,i,a]);return[s,c]}function UT({defaultProp:e,onChange:t}){const r=O.useState(e),[n]=r,i=O.useRef(n),o=br(t);return O.useEffect(()=>{i.current!==n&&(o(n),i.current=n)},[n,i,o]),r}var FT="VisuallyHidden",Jb=O.forwardRef((e,t)=>w.jsx(Xt.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Jb.displayName=FT;var $T=Jb,[Bl,HB]=Pi("Tooltip",[Ll]),y0=Ll(),Zb="TooltipProvider",VT=700,Tp="tooltip.open",[zT,Qb]=Bl(Zb),ey=e=>{const{__scopeTooltip:t,delayDuration:r=VT,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=O.useState(!0),c=O.useRef(!1),l=O.useRef(0);return O.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),w.jsx(zT,{scope:t,isOpenDelayed:s,delayDuration:r,onOpen:O.useCallback(()=>{window.clearTimeout(l.current),a(!1)},[]),onClose:O.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:O.useCallback(u=>{c.current=u},[]),disableHoverableContent:i,children:o})};ey.displayName=Zb;var ty="Tooltip",[WB,Ul]=Bl(ty),Zf="TooltipTrigger",qT=O.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=Ul(Zf,r),o=Qb(Zf,r),s=y0(r),a=O.useRef(null),c=nr(t,a,i.onTriggerChange),l=O.useRef(!1),u=O.useRef(!1),d=O.useCallback(()=>l.current=!1,[]);return O.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),w.jsx(Gb,{asChild:!0,...s,children:w.jsx(Xt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:Qe(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Qe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Qe(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Qe(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:Qe(e.onBlur,i.onClose),onClick:Qe(e.onClick,i.onClose)})})});qT.displayName=Zf;var HT="TooltipPortal",[GB,WT]=Bl(HT,{forceMount:void 0}),ws="TooltipContent",GT=O.forwardRef((e,t)=>{const r=WT(ws,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...o}=e,s=Ul(ws,e.__scopeTooltip);return w.jsx(Ln,{present:n||s.open,children:s.disableHoverableContent?w.jsx(ry,{side:i,...o,ref:t}):w.jsx(KT,{side:i,...o,ref:t})})}),KT=O.forwardRef((e,t)=>{const r=Ul(ws,e.__scopeTooltip),n=Qb(ws,e.__scopeTooltip),i=O.useRef(null),o=nr(t,i),[s,a]=O.useState(null),{trigger:c,onClose:l}=r,u=i.current,{onPointerInTransitChange:d}=n,p=O.useCallback(()=>{a(null),d(!1)},[d]),y=O.useCallback((x,b)=>{const M=x.currentTarget,R={x:x.clientX,y:x.clientY},P=ZT(R,M.getBoundingClientRect()),k=QT(R,P),F=eA(b.getBoundingClientRect()),B=rA([...k,...F]);a(B),d(!0)},[d]);return O.useEffect(()=>()=>p(),[p]),O.useEffect(()=>{if(c&&u){const x=M=>y(M,u),b=M=>y(M,c);return c.addEventListener("pointerleave",x),u.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",b)}}},[c,u,y,p]),O.useEffect(()=>{if(s){const x=b=>{const M=b.target,R={x:b.clientX,y:b.clientY},P=(c==null?void 0:c.contains(M))||(u==null?void 0:u.contains(M)),k=!tA(R,s);P?p():k&&(p(),l())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,u,s,l,p]),w.jsx(ry,{...e,ref:o})}),[YT,XT]=Bl(ty,{isInside:!1}),ry=O.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,c=Ul(ws,r),l=y0(r),{onClose:u}=c;return O.useEffect(()=>(document.addEventListener(Tp,u),()=>document.removeEventListener(Tp,u)),[u]),O.useEffect(()=>{if(c.trigger){const d=p=>{const y=p.target;y!=null&&y.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),w.jsx(c0,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:w.jsxs(Kb,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[w.jsx(Ms,{children:n}),w.jsx(YT,{scope:r,isInside:!0,children:w.jsx($T,{id:c.contentId,role:"tooltip",children:i||n})})]})})});GT.displayName=ws;var ny="TooltipArrow",JT=O.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=y0(r);return XT(ny,r).isInside?null:w.jsx(Yb,{...i,...n,ref:t})});JT.displayName=ny;function ZT(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,i,o)){case o:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function QT(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function eA(e){const{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}function tA(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,c=t[o].y,l=t[s].x,u=t[s].y;c>n!=u>n&&r<(l-a)*(n-c)/(u-c)+a&&(i=!i)}return i}function rA(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),nA(t)}function nA(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const i=e[n];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const i=e[n];for(;r.length>=2;){const o=r[r.length-1],s=r[r.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var iA=ey,iy=O.createContext(void 0),oA=e=>{const{dir:t,children:r}=e;return w.jsx(iy.Provider,{value:t,children:r})};function w0(e){const t=O.useContext(iy);return e||t||"ltr"}const sA=["tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","brown","orange"],aA=["sky","mint","lime","yellow","amber"],cA=["gold","bronze"],lA=[...sA,...aA,...cA],uA="gray",fA=["mauve","slate","sage","olive","sand"],dA=[uA,...fA];function hA(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand"}}const pA=["inherit","light","dark"],mA=[...lA,"gray"],gA=[...dA,"auto"],vA=["solid","translucent"],bA=["none","small","medium","large","full"],yA=["90%","95%","100%","105%","110%"],Br={hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:pA,default:"inherit"},accentColor:{type:"enum",values:mA,default:"indigo"},grayColor:{type:"enum",values:gA,default:"auto"},panelBackground:{type:"enum",values:vA,default:"translucent"},radius:{type:"enum",values:bA,default:"medium"},scaling:{type:"enum",values:yA,default:"100%"}};function oy(e){return e==="gray"?"gray":hA(e)}const Go=()=>{},Xc=O.createContext(void 0);function wA(){const e=O.useContext(Xc);if(e===void 0)throw new Error("`useThemeContext` must be used within a `Theme`");return e}const Fl=O.forwardRef((e,t)=>O.useContext(Xc)===void 0?O.createElement(iA,null,O.createElement(oA,{dir:"ltr"},O.createElement(sy,{...e,ref:t}))):O.createElement(x0,{...e,ref:t}));Fl.displayName="Theme";const sy=O.forwardRef((e,t)=>{const{appearance:r=Br.appearance.default,accentColor:n=Br.accentColor.default,grayColor:i=Br.grayColor.default,panelBackground:o=Br.panelBackground.default,radius:s=Br.radius.default,scaling:a=Br.scaling.default,hasBackground:c=Br.hasBackground.default,...l}=e,[u,d]=O.useState(r);O.useEffect(()=>d(r),[r]);const[p,y]=O.useState(n);O.useEffect(()=>y(n),[n]);const[x,b]=O.useState(i);O.useEffect(()=>b(i),[i]);const[M,R]=O.useState(o);O.useEffect(()=>R(o),[o]);const[P,k]=O.useState(s);O.useEffect(()=>k(s),[s]);const[F,B]=O.useState(a);O.useEffect(()=>B(a),[a]);const W=O.memo(({appearance:G})=>O.createElement("script",{dangerouslySetInnerHTML:{__html:`!(function(){try{var d=document.documentElement,c=d.classList;c.remove('light','dark');d.style.colorScheme='${G}';c.add('${G}');}catch(e){}})();`}}),()=>!0);W.displayName="ExplicitRootAppearanceScript",O.useEffect(()=>xA(r),[r]);const z=x==="auto"?oy(p):x;return O.createElement(O.Fragment,null,u!=="inherit"&&O.createElement(W,{appearance:u}),c&&O.createElement("style",{dangerouslySetInnerHTML:{__html:`
|
|
49
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,n(a)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)t.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Eb);var wC=Eb.exports;const er=Ta(wC);function Qe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function vp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nl(...e){return t=>{let r=!1;const n=e.map(i=>{const o=vp(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i<n.length;i++){const o=n[i];typeof o=="function"?o():vp(e[i],null)}}}}function ir(...e){return R.useCallback(Nl(...e),e)}function Pi(e,t=[]){let r=[];function n(o,s){const a=R.createContext(s),c=r.length;r=[...r,s];const l=d=>{var O;const{scope:p,children:y,...x}=d,b=((O=p==null?void 0:p[e])==null?void 0:O[c])||a,M=R.useMemo(()=>x,Object.values(x));return w.jsx(b.Provider,{value:M,children:y})};l.displayName=o+"Provider";function u(d,p){var b;const y=((b=p==null?void 0:p[e])==null?void 0:b[c])||a,x=R.useContext(y);if(x)return x;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[l,u]}const i=()=>{const o=r.map(s=>R.createContext(s));return function(a){const c=(a==null?void 0:a[e])||o;return R.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return i.scopeName=e,[n,xC(i,...t)]}function xC(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=n.reduce((a,{useScope:c,scopeName:l})=>{const d=c(o)[`__scope${l}`];return{...a,...d}},{});return R.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Ai=R.forwardRef((e,t)=>{const{children:r,...n}=e,i=R.Children.toArray(r),o=i.find(SC);if(o){const s=o.props.children,a=i.map(c=>c===o?R.Children.count(s)>1?R.Children.only(null):R.isValidElement(s)?s.props.children:null:c);return w.jsx(Gf,{...n,ref:t,children:R.isValidElement(s)?R.cloneElement(s,void 0,a):null})}return w.jsx(Gf,{...n,ref:t,children:r})});Ai.displayName="Slot";var Gf=R.forwardRef((e,t)=>{const{children:r,...n}=e;if(R.isValidElement(r)){const i=EC(r),o=_C(n,r.props);return r.type!==R.Fragment&&(o.ref=t?Nl(t,i):i),R.cloneElement(r,o)}return R.Children.count(r)>1?R.Children.only(null):null});Gf.displayName="SlotClone";var Ms=({children:e})=>w.jsx(w.Fragment,{children:e});function SC(e){return R.isValidElement(e)&&e.type===Ms}function _C(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...a)=>{o(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function EC(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var CC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Xt=CC.reduce((e,t)=>{const r=R.forwardRef((n,i)=>{const{asChild:o,...s}=n,a=o?Ai:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(a,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Cb(e,t){e&&Bm.flushSync(()=>e.dispatchEvent(t))}function br(e){const t=R.useRef(e);return R.useEffect(()=>{t.current=e}),R.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function TC(e,t=globalThis==null?void 0:globalThis.document){const r=br(e);R.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var AC="DismissableLayer",Kf="dismissableLayer.update",MC="dismissableLayer.pointerDownOutside",IC="dismissableLayer.focusOutside",bp,Tb=R.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),u0=R.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...c}=e,l=R.useContext(Tb),[u,d]=R.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=R.useState({}),x=ir(t,z=>d(z)),b=Array.from(l.layers),[M]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),O=b.indexOf(M),P=u?b.indexOf(u):-1,k=l.layersWithOutsidePointerEventsDisabled.size>0,F=P>=O,B=PC(z=>{const G=z.target,re=[...l.branches].some(oe=>oe.contains(G));!F||re||(i==null||i(z),s==null||s(z),z.defaultPrevented||a==null||a())},p),W=NC(z=>{const G=z.target;[...l.branches].some(oe=>oe.contains(G))||(o==null||o(z),s==null||s(z),z.defaultPrevented||a==null||a())},p);return TC(z=>{P===l.layers.size-1&&(n==null||n(z),!z.defaultPrevented&&a&&(z.preventDefault(),a()))},p),R.useEffect(()=>{if(u)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(bp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),yp(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=bp)}},[u,p,r,l]),R.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),yp())},[u,l]),R.useEffect(()=>{const z=()=>y({});return document.addEventListener(Kf,z),()=>document.removeEventListener(Kf,z)},[]),w.jsx(Xt.div,{...c,ref:x,style:{pointerEvents:k?F?"auto":"none":void 0,...e.style},onFocusCapture:Qe(e.onFocusCapture,W.onFocusCapture),onBlurCapture:Qe(e.onBlurCapture,W.onBlurCapture),onPointerDownCapture:Qe(e.onPointerDownCapture,B.onPointerDownCapture)})});u0.displayName=AC;var OC="DismissableLayerBranch",RC=R.forwardRef((e,t)=>{const r=R.useContext(Tb),n=R.useRef(null),i=ir(t,n);return R.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),w.jsx(Xt.div,{...e,ref:i})});RC.displayName=OC;function PC(e,t=globalThis==null?void 0:globalThis.document){const r=br(e),n=R.useRef(!1),i=R.useRef(()=>{});return R.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let c=function(){Ab(MC,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function NC(e,t=globalThis==null?void 0:globalThis.document){const r=br(e),n=R.useRef(!1);return R.useEffect(()=>{const i=o=>{o.target&&!n.current&&Ab(IC,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function yp(){const e=new CustomEvent(Kf);document.dispatchEvent(e)}function Ab(e,t,r,{discrete:n}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?Cb(i,o):i.dispatchEvent(o)}var Zi=globalThis!=null&&globalThis.document?R.useLayoutEffect:()=>{},kC=R["useId".toString()]||(()=>{}),jC=0;function ma(e){const[t,r]=R.useState(kC());return Zi(()=>{e||r(n=>n??String(jC++))},[e]),e||(t?`radix-${t}`:"")}const DC=["top","right","bottom","left"],Qi=Math.min,Xr=Math.max,Wc=Math.round,Ja=Math.floor,Yn=e=>({x:e,y:e}),LC={left:"right",right:"left",bottom:"top",top:"bottom"},BC={start:"end",end:"start"};function Yf(e,t,r){return Xr(e,Qi(t,r))}function Mi(e,t){return typeof e=="function"?e(t):e}function Ii(e){return e.split("-")[0]}function Is(e){return e.split("-")[1]}function f0(e){return e==="x"?"y":"x"}function d0(e){return e==="y"?"height":"width"}function eo(e){return["top","bottom"].includes(Ii(e))?"y":"x"}function h0(e){return f0(eo(e))}function UC(e,t,r){r===void 0&&(r=!1);const n=Is(e),i=h0(e),o=d0(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Gc(s)),[s,Gc(s)]}function FC(e){const t=Gc(e);return[Xf(e),t,Xf(t)]}function Xf(e){return e.replace(/start|end/g,t=>BC[t])}function $C(e,t,r){const n=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:n:t?n:i;case"left":case"right":return t?o:s;default:return[]}}function VC(e,t,r,n){const i=Is(e);let o=$C(Ii(e),r==="start",n);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(Xf)))),o}function Gc(e){return e.replace(/left|right|bottom|top/g,t=>LC[t])}function zC(e){return{top:0,right:0,bottom:0,left:0,...e}}function Mb(e){return typeof e!="number"?zC(e):{top:e,right:e,bottom:e,left:e}}function Kc(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function wp(e,t,r){let{reference:n,floating:i}=e;const o=eo(t),s=h0(t),a=d0(s),c=Ii(t),l=o==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,p=n[a]/2-i[a]/2;let y;switch(c){case"top":y={x:u,y:n.y-i.height};break;case"bottom":y={x:u,y:n.y+n.height};break;case"right":y={x:n.x+n.width,y:d};break;case"left":y={x:n.x-i.width,y:d};break;default:y={x:n.x,y:n.y}}switch(Is(t)){case"start":y[s]-=p*(r&&l?-1:1);break;case"end":y[s]+=p*(r&&l?-1:1);break}return y}const qC=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,a=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=wp(l,n,c),p=n,y={},x=0;for(let b=0;b<a.length;b++){const{name:M,fn:O}=a[b],{x:P,y:k,data:F,reset:B}=await O({x:u,y:d,initialPlacement:n,placement:p,strategy:i,middlewareData:y,rects:l,platform:s,elements:{reference:e,floating:t}});u=P??u,d=k??d,y={...y,[M]:{...y[M],...F}},B&&x<=50&&(x++,typeof B=="object"&&(B.placement&&(p=B.placement),B.rects&&(l=B.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):B.rects),{x:u,y:d}=wp(l,p,c)),b=-1)}return{x:u,y:d,placement:p,strategy:i,middlewareData:y}};async function ga(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:o,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:y=0}=Mi(t,e),x=Mb(y),M=a[p?d==="floating"?"reference":"floating":d],O=Kc(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(M)))==null||r?M:M.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),P=d==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),F=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},B=Kc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:P,offsetParent:k,strategy:c}):P);return{top:(O.top-B.top+x.top)/F.y,bottom:(B.bottom-O.bottom+x.bottom)/F.y,left:(O.left-B.left+x.left)/F.x,right:(B.right-O.right+x.right)/F.x}}const HC=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:s,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Mi(e,t)||{};if(l==null)return{};const d=Mb(u),p={x:r,y:n},y=h0(i),x=d0(y),b=await s.getDimensions(l),M=y==="y",O=M?"top":"left",P=M?"bottom":"right",k=M?"clientHeight":"clientWidth",F=o.reference[x]+o.reference[y]-p[y]-o.floating[x],B=p[y]-o.reference[y],W=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let z=W?W[k]:0;(!z||!await(s.isElement==null?void 0:s.isElement(W)))&&(z=a.floating[k]||o.floating[x]);const G=F/2-B/2,re=z/2-b[x]/2-1,oe=Qi(d[O],re),se=Qi(d[P],re),q=oe,L=z-b[x]-se,h=z/2-b[x]/2+G,f=Yf(q,h,L),m=!c.arrow&&Is(i)!=null&&h!==f&&o.reference[x]/2-(h<q?oe:se)-b[x]/2<0,S=m?h<q?h-q:h-L:0;return{[y]:p[y]+S,data:{[y]:f,centerOffset:h-f-S,...m&&{alignmentOffset:S}},reset:m}}}),WC=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...M}=Mi(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const O=Ii(i),P=eo(a),k=Ii(a)===a,F=await(c.isRTL==null?void 0:c.isRTL(l.floating)),B=p||(k||!b?[Gc(a)]:FC(a)),W=x!=="none";!p&&W&&B.push(...VC(a,b,x,F));const z=[a,...B],G=await ga(t,M),re=[];let oe=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&re.push(G[O]),d){const h=UC(i,s,F);re.push(G[h[0]],G[h[1]])}if(oe=[...oe,{placement:i,overflows:re}],!re.every(h=>h<=0)){var se,q;const h=(((se=o.flip)==null?void 0:se.index)||0)+1,f=z[h];if(f)return{data:{index:h,overflows:oe},reset:{placement:f}};let m=(q=oe.filter(S=>S.overflows[0]<=0).sort((S,T)=>S.overflows[1]-T.overflows[1])[0])==null?void 0:q.placement;if(!m)switch(y){case"bestFit":{var L;const S=(L=oe.filter(T=>{if(W){const E=eo(T.placement);return E===P||E==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(E=>E>0).reduce((E,I)=>E+I,0)]).sort((T,E)=>T[1]-E[1])[0])==null?void 0:L[0];S&&(m=S);break}case"initialPlacement":m=a;break}if(i!==m)return{reset:{placement:m}}}return{}}}};function xp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Sp(e){return DC.some(t=>e[t]>=0)}const GC=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=Mi(e,t);switch(n){case"referenceHidden":{const o=await ga(t,{...i,elementContext:"reference"}),s=xp(o,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Sp(s)}}}case"escaped":{const o=await ga(t,{...i,altBoundary:!0}),s=xp(o,r.floating);return{data:{escapedOffsets:s,escaped:Sp(s)}}}default:return{}}}}};async function KC(e,t){const{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=Ii(r),a=Is(r),c=eo(r)==="y",l=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,d=Mi(t,e);let{mainAxis:p,crossAxis:y,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof x=="number"&&(y=a==="end"?x*-1:x),c?{x:y*u,y:p*l}:{x:p*l,y:y*u}}const YC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:o,placement:s,middlewareData:a}=t,c=await KC(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},XC=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:M=>{let{x:O,y:P}=M;return{x:O,y:P}}},...c}=Mi(e,t),l={x:r,y:n},u=await ga(t,c),d=eo(Ii(i)),p=f0(d);let y=l[p],x=l[d];if(o){const M=p==="y"?"top":"left",O=p==="y"?"bottom":"right",P=y+u[M],k=y-u[O];y=Yf(P,y,k)}if(s){const M=d==="y"?"top":"left",O=d==="y"?"bottom":"right",P=x+u[M],k=x-u[O];x=Yf(P,x,k)}const b=a.fn({...t,[p]:y,[d]:x});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[p]:o,[d]:s}}}}}},JC=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Mi(e,t),u={x:r,y:n},d=eo(i),p=f0(d);let y=u[p],x=u[d];const b=Mi(a,t),M=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(c){const k=p==="y"?"height":"width",F=o.reference[p]-o.floating[k]+M.mainAxis,B=o.reference[p]+o.reference[k]-M.mainAxis;y<F?y=F:y>B&&(y=B)}if(l){var O,P;const k=p==="y"?"width":"height",F=["top","left"].includes(Ii(i)),B=o.reference[d]-o.floating[k]+(F&&((O=s.offset)==null?void 0:O[d])||0)+(F?0:M.crossAxis),W=o.reference[d]+o.reference[k]+(F?0:((P=s.offset)==null?void 0:P[d])||0)-(F?M.crossAxis:0);x<B?x=B:x>W&&(x=W)}return{[p]:y,[d]:x}}}},ZC=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:c=()=>{},...l}=Mi(e,t),u=await ga(t,l),d=Ii(i),p=Is(i),y=eo(i)==="y",{width:x,height:b}=o.floating;let M,O;d==="top"||d==="bottom"?(M=d,O=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(O=d,M=p==="end"?"top":"bottom");const P=b-u.top-u.bottom,k=x-u.left-u.right,F=Qi(b-u[M],P),B=Qi(x-u[O],k),W=!t.middlewareData.shift;let z=F,G=B;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(G=k),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(z=P),W&&!p){const oe=Xr(u.left,0),se=Xr(u.right,0),q=Xr(u.top,0),L=Xr(u.bottom,0);y?G=x-2*(oe!==0||se!==0?oe+se:Xr(u.left,u.right)):z=b-2*(q!==0||L!==0?q+L:Xr(u.top,u.bottom))}await c({...t,availableWidth:G,availableHeight:z});const re=await s.getDimensions(a.floating);return x!==re.width||b!==re.height?{reset:{rects:!0}}:{}}}};function kl(){return typeof window<"u"}function Os(e){return Ib(e)?(e.nodeName||"").toLowerCase():"#document"}function en(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ti(e){var t;return(t=(Ib(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ib(e){return kl()?e instanceof Node||e instanceof en(e).Node:!1}function kn(e){return kl()?e instanceof Element||e instanceof en(e).Element:!1}function Qn(e){return kl()?e instanceof HTMLElement||e instanceof en(e).HTMLElement:!1}function _p(e){return!kl()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof en(e).ShadowRoot}function ja(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=jn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function QC(e){return["table","td","th"].includes(Os(e))}function jl(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function p0(e){const t=m0(),r=kn(e)?jn(e):e;return["transform","translate","scale","rotate","perspective"].some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function eT(e){let t=to(e);for(;Qn(t)&&!ys(t);){if(p0(t))return t;if(jl(t))return null;t=to(t)}return null}function m0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ys(e){return["html","body","#document"].includes(Os(e))}function jn(e){return en(e).getComputedStyle(e)}function Dl(e){return kn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function to(e){if(Os(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_p(e)&&e.host||ti(e);return _p(t)?t.host:t}function Ob(e){const t=to(e);return ys(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qn(t)&&ja(t)?t:Ob(t)}function va(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=Ob(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),s=en(i);if(o){const a=Jf(s);return t.concat(s,s.visualViewport||[],ja(i)?i:[],a&&r?va(a):[])}return t.concat(i,va(i,[],r))}function Jf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rb(e){const t=jn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Qn(e),o=i?e.offsetWidth:r,s=i?e.offsetHeight:n,a=Wc(r)!==o||Wc(n)!==s;return a&&(r=o,n=s),{width:r,height:n,$:a}}function g0(e){return kn(e)?e:e.contextElement}function us(e){const t=g0(e);if(!Qn(t))return Yn(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=Rb(t);let s=(o?Wc(r.width):r.width)/n,a=(o?Wc(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const tT=Yn(0);function Pb(e){const t=en(e);return!m0()||!t.visualViewport?tT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rT(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==en(e)?!1:t}function No(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=g0(e);let s=Yn(1);t&&(n?kn(n)&&(s=us(n)):s=us(e));const a=rT(o,r,n)?Pb(o):Yn(0);let c=(i.left+a.x)/s.x,l=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const p=en(o),y=n&&kn(n)?en(n):n;let x=p,b=Jf(x);for(;b&&n&&y!==x;){const M=us(b),O=b.getBoundingClientRect(),P=jn(b),k=O.left+(b.clientLeft+parseFloat(P.paddingLeft))*M.x,F=O.top+(b.clientTop+parseFloat(P.paddingTop))*M.y;c*=M.x,l*=M.y,u*=M.x,d*=M.y,c+=k,l+=F,x=en(b),b=Jf(x)}}return Kc({width:u,height:d,x:c,y:l})}function v0(e,t){const r=Dl(e).scrollLeft;return t?t.left+r:No(ti(e)).left+r}function Nb(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-(r?0:v0(e,n)),o=n.top+t.scrollTop;return{x:i,y:o}}function nT(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o=i==="fixed",s=ti(n),a=t?jl(t.floating):!1;if(n===s||a&&o)return r;let c={scrollLeft:0,scrollTop:0},l=Yn(1);const u=Yn(0),d=Qn(n);if((d||!d&&!o)&&((Os(n)!=="body"||ja(s))&&(c=Dl(n)),Qn(n))){const y=No(n);l=us(n),u.x=y.x+n.clientLeft,u.y=y.y+n.clientTop}const p=s&&!d&&!o?Nb(s,c,!0):Yn(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:r.y*l.y-c.scrollTop*l.y+u.y+p.y}}function iT(e){return Array.from(e.getClientRects())}function oT(e){const t=ti(e),r=Dl(e),n=e.ownerDocument.body,i=Xr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Xr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+v0(e);const a=-r.scrollTop;return jn(n).direction==="rtl"&&(s+=Xr(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:s,y:a}}function sT(e,t){const r=en(e),n=ti(e),i=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,a=0,c=0;if(i){o=i.width,s=i.height;const l=m0();(!l||l&&t==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:a,y:c}}function aT(e,t){const r=No(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=Qn(e)?us(e):Yn(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,c=i*o.x,l=n*o.y;return{width:s,height:a,x:c,y:l}}function Ep(e,t,r){let n;if(t==="viewport")n=sT(e,r);else if(t==="document")n=oT(ti(e));else if(kn(t))n=aT(t,r);else{const i=Pb(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Kc(n)}function kb(e,t){const r=to(e);return r===t||!kn(r)||ys(r)?!1:jn(r).position==="fixed"||kb(r,t)}function cT(e,t){const r=t.get(e);if(r)return r;let n=va(e,[],!1).filter(a=>kn(a)&&Os(a)!=="body"),i=null;const o=jn(e).position==="fixed";let s=o?to(e):e;for(;kn(s)&&!ys(s);){const a=jn(s),c=p0(s);!c&&a.position==="fixed"&&(i=null),(o?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ja(s)&&!c&&kb(e,s))?n=n.filter(u=>u!==s):i=a,s=to(s)}return t.set(e,n),n}function lT(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const s=[...r==="clippingAncestors"?jl(t)?[]:cT(t,this._c):[].concat(r),n],a=s[0],c=s.reduce((l,u)=>{const d=Ep(t,u,i);return l.top=Xr(d.top,l.top),l.right=Qi(d.right,l.right),l.bottom=Qi(d.bottom,l.bottom),l.left=Xr(d.left,l.left),l},Ep(t,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function uT(e){const{width:t,height:r}=Rb(e);return{width:t,height:r}}function fT(e,t,r){const n=Qn(t),i=ti(t),o=r==="fixed",s=No(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=Yn(0);if(n||!n&&!o)if((Os(t)!=="body"||ja(i))&&(a=Dl(t)),n){const p=No(t,!0,o,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else i&&(c.x=v0(i));const l=i&&!n&&!o?Nb(i,a):Yn(0),u=s.left+a.scrollLeft-c.x-l.x,d=s.top+a.scrollTop-c.y-l.y;return{x:u,y:d,width:s.width,height:s.height}}function $u(e){return jn(e).position==="static"}function Cp(e,t){if(!Qn(e)||jn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ti(e)===r&&(r=r.ownerDocument.body),r}function jb(e,t){const r=en(e);if(jl(e))return r;if(!Qn(e)){let i=to(e);for(;i&&!ys(i);){if(kn(i)&&!$u(i))return i;i=to(i)}return r}let n=Cp(e,t);for(;n&&QC(n)&&$u(n);)n=Cp(n,t);return n&&ys(n)&&$u(n)&&!p0(n)?r:n||eT(e)||r}const dT=async function(e){const t=this.getOffsetParent||jb,r=this.getDimensions,n=await r(e.floating);return{reference:fT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function hT(e){return jn(e).direction==="rtl"}const pT={convertOffsetParentRelativeRectToViewportRelativeRect:nT,getDocumentElement:ti,getClippingRect:lT,getOffsetParent:jb,getElementRects:dT,getClientRects:iT,getDimensions:uT,getScale:us,isElement:kn,isRTL:hT};function Db(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mT(e,t){let r=null,n;const i=ti(e);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),o();const l=e.getBoundingClientRect(),{left:u,top:d,width:p,height:y}=l;if(a||t(),!p||!y)return;const x=Ja(d),b=Ja(i.clientWidth-(u+p)),M=Ja(i.clientHeight-(d+y)),O=Ja(u),k={rootMargin:-x+"px "+-b+"px "+-M+"px "+-O+"px",threshold:Xr(0,Qi(1,c))||1};let F=!0;function B(W){const z=W[0].intersectionRatio;if(z!==c){if(!F)return s();z?s(!1,z):n=setTimeout(()=>{s(!1,1e-7)},1e3)}z===1&&!Db(l,e.getBoundingClientRect())&&s(),F=!1}try{r=new IntersectionObserver(B,{...k,root:i.ownerDocument})}catch{r=new IntersectionObserver(B,k)}r.observe(e)}return s(!0),o}function gT(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=g0(e),u=i||o?[...l?va(l):[],...va(t)]:[];u.forEach(O=>{i&&O.addEventListener("scroll",r,{passive:!0}),o&&O.addEventListener("resize",r)});const d=l&&a?mT(l,r):null;let p=-1,y=null;s&&(y=new ResizeObserver(O=>{let[P]=O;P&&P.target===l&&y&&(y.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=y)==null||k.observe(t)})),r()}),l&&!c&&y.observe(l),y.observe(t));let x,b=c?No(e):null;c&&M();function M(){const O=No(e);b&&!Db(b,O)&&r(),b=O,x=requestAnimationFrame(M)}return r(),()=>{var O;u.forEach(P=>{i&&P.removeEventListener("scroll",r),o&&P.removeEventListener("resize",r)}),d==null||d(),(O=y)==null||O.disconnect(),y=null,c&&cancelAnimationFrame(x)}}const vT=YC,bT=XC,yT=WC,wT=ZC,xT=GC,Tp=HC,ST=JC,_T=(e,t,r)=>{const n=new Map,i={platform:pT,...r},o={...i.platform,_c:n};return qC(e,t,{...i,platform:o})};var yc=typeof document<"u"?ie.useLayoutEffect:ie.useEffect;function Yc(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 r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Yc(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!Yc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Lb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ap(e,t){const r=Lb(e);return Math.round(t*r)/r}function Vu(e){const t=R.useRef(e);return yc(()=>{t.current=e}),t}function ET(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=R.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,y]=R.useState(n);Yc(p,n)||y(n);const[x,b]=R.useState(null),[M,O]=R.useState(null),P=R.useCallback(T=>{T!==W.current&&(W.current=T,b(T))},[]),k=R.useCallback(T=>{T!==z.current&&(z.current=T,O(T))},[]),F=o||x,B=s||M,W=R.useRef(null),z=R.useRef(null),G=R.useRef(u),re=c!=null,oe=Vu(c),se=Vu(i),q=Vu(l),L=R.useCallback(()=>{if(!W.current||!z.current)return;const T={placement:t,strategy:r,middleware:p};se.current&&(T.platform=se.current),_T(W.current,z.current,T).then(E=>{const I={...E,isPositioned:q.current!==!1};h.current&&!Yc(G.current,I)&&(G.current=I,Bm.flushSync(()=>{d(I)}))})},[p,t,r,se,q]);yc(()=>{l===!1&&G.current.isPositioned&&(G.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[l]);const h=R.useRef(!1);yc(()=>(h.current=!0,()=>{h.current=!1}),[]),yc(()=>{if(F&&(W.current=F),B&&(z.current=B),F&&B){if(oe.current)return oe.current(F,B,L);L()}},[F,B,L,oe,re]);const f=R.useMemo(()=>({reference:W,floating:z,setReference:P,setFloating:k}),[P,k]),m=R.useMemo(()=>({reference:F,floating:B}),[F,B]),S=R.useMemo(()=>{const T={position:r,left:0,top:0};if(!m.floating)return T;const E=Ap(m.floating,u.x),I=Ap(m.floating,u.y);return a?{...T,transform:"translate("+E+"px, "+I+"px)",...Lb(m.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:E,top:I}},[r,a,m.floating,u.x,u.y]);return R.useMemo(()=>({...u,update:L,refs:f,elements:m,floatingStyles:S}),[u,L,f,m,S])}const CT=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Tp({element:n.current,padding:i}).fn(r):{}:n?Tp({element:n,padding:i}).fn(r):{}}}},TT=(e,t)=>({...vT(e),options:[e,t]}),AT=(e,t)=>({...bT(e),options:[e,t]}),MT=(e,t)=>({...ST(e),options:[e,t]}),IT=(e,t)=>({...yT(e),options:[e,t]}),OT=(e,t)=>({...wT(e),options:[e,t]}),RT=(e,t)=>({...xT(e),options:[e,t]}),PT=(e,t)=>({...CT(e),options:[e,t]});var NT="Arrow",Bb=R.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...o}=e;return w.jsx(Xt.svg,{...o,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});Bb.displayName=NT;var kT=Bb;function b0(e){const[t,r]=R.useState(void 0);return Zi(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const c=o.borderBoxSize,l=Array.isArray(c)?c[0]:c;s=l.inlineSize,a=l.blockSize}else s=e.offsetWidth,a=e.offsetHeight;r({width:s,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var y0="Popper",[Ub,Ll]=Pi(y0),[jT,Fb]=Ub(y0),$b=e=>{const{__scopePopper:t,children:r}=e,[n,i]=R.useState(null);return w.jsx(jT,{scope:t,anchor:n,onAnchorChange:i,children:r})};$b.displayName=y0;var Vb="PopperAnchor",zb=R.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=Fb(Vb,r),s=R.useRef(null),a=ir(t,s);return R.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||s.current)}),n?null:w.jsx(Xt.div,{...i,ref:a})});zb.displayName=Vb;var w0="PopperContent",[DT,LT]=Ub(w0),qb=R.forwardRef((e,t)=>{var ce,be,xe,pe,Le,Ae;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:y="optimized",onPlaced:x,...b}=e,M=Fb(w0,r),[O,P]=R.useState(null),k=ir(t,Je=>P(Je)),[F,B]=R.useState(null),W=b0(F),z=(W==null?void 0:W.width)??0,G=(W==null?void 0:W.height)??0,re=n+(o!=="center"?"-"+o:""),oe=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},se=Array.isArray(l)?l:[l],q=se.length>0,L={padding:oe,boundary:se.filter(UT),altBoundary:q},{refs:h,floatingStyles:f,placement:m,isPositioned:S,middlewareData:T}=ET({strategy:"fixed",placement:re,whileElementsMounted:(...Je)=>gT(...Je,{animationFrame:y==="always"}),elements:{reference:M.anchor},middleware:[TT({mainAxis:i+G,alignmentAxis:s}),c&&AT({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?MT():void 0,...L}),c&&IT({...L}),OT({...L,apply:({elements:Je,rects:dt,availableWidth:je,availableHeight:pt})=>{const{width:we,height:he}=dt.reference,Ce=Je.floating.style;Ce.setProperty("--radix-popper-available-width",`${je}px`),Ce.setProperty("--radix-popper-available-height",`${pt}px`),Ce.setProperty("--radix-popper-anchor-width",`${we}px`),Ce.setProperty("--radix-popper-anchor-height",`${he}px`)}}),F&&PT({element:F,padding:a}),FT({arrowWidth:z,arrowHeight:G}),p&&RT({strategy:"referenceHidden",...L})]}),[E,I]=Gb(m),C=br(x);Zi(()=>{S&&(C==null||C())},[S,C]);const g=(ce=T.arrow)==null?void 0:ce.x,v=(be=T.arrow)==null?void 0:be.y,j=((xe=T.arrow)==null?void 0:xe.centerOffset)!==0,[Q,Z]=R.useState();return Zi(()=>{O&&Z(window.getComputedStyle(O).zIndex)},[O]),w.jsx("div",{ref:h.setFloating,"data-radix-popper-content-wrapper":"",style:{...f,transform:S?f.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[(pe=T.transformOrigin)==null?void 0:pe.x,(Le=T.transformOrigin)==null?void 0:Le.y].join(" "),...((Ae=T.hide)==null?void 0:Ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(DT,{scope:r,placedSide:E,onArrowChange:B,arrowX:g,arrowY:v,shouldHideArrow:j,children:w.jsx(Xt.div,{"data-side":E,"data-align":I,...b,ref:k,style:{...b.style,animation:S?void 0:"none"}})})})});qb.displayName=w0;var Hb="PopperArrow",BT={top:"bottom",right:"left",bottom:"top",left:"right"},Wb=R.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,o=LT(Hb,n),s=BT[o.placedSide];return w.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:w.jsx(kT,{...i,ref:r,style:{...i.style,display:"block"}})})});Wb.displayName=Hb;function UT(e){return e!==null}var FT=e=>({name:"transformOrigin",options:e,fn(t){var M,O,P;const{placement:r,rects:n,middlewareData:i}=t,s=((M=i.arrow)==null?void 0:M.centerOffset)!==0,a=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[l,u]=Gb(r),d={start:"0%",center:"50%",end:"100%"}[u],p=(((O=i.arrow)==null?void 0:O.x)??0)+a/2,y=(((P=i.arrow)==null?void 0:P.y)??0)+c/2;let x="",b="";return l==="bottom"?(x=s?d:`${p}px`,b=`${-c}px`):l==="top"?(x=s?d:`${p}px`,b=`${n.floating.height+c}px`):l==="right"?(x=`${-c}px`,b=s?d:`${y}px`):l==="left"&&(x=`${n.floating.width+c}px`,b=s?d:`${y}px`),{data:{x,y:b}}}});function Gb(e){const[t,r="center"]=e.split("-");return[t,r]}var Kb=$b,Yb=zb,Xb=qb,Jb=Wb,$T="Portal",Zb=R.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[i,o]=R.useState(!1);Zi(()=>o(!0),[]);const s=r||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?ol.createPortal(w.jsx(Xt.div,{...n,ref:t}),s):null});Zb.displayName=$T;function VT(e,t){return R.useReducer((r,n)=>t[r][n]??r,e)}var Ln=e=>{const{present:t,children:r}=e,n=zT(t),i=typeof r=="function"?r({present:n.isPresent}):R.Children.only(r),o=ir(n.ref,qT(i));return typeof r=="function"||n.isPresent?R.cloneElement(i,{ref:o}):null};Ln.displayName="Presence";function zT(e){const[t,r]=R.useState(),n=R.useRef({}),i=R.useRef(e),o=R.useRef("none"),s=e?"mounted":"unmounted",[a,c]=VT(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return R.useEffect(()=>{const l=Za(n.current);o.current=a==="mounted"?l:"none"},[a]),Zi(()=>{const l=n.current,u=i.current;if(u!==e){const p=o.current,y=Za(l);e?c("MOUNT"):y==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&p!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Zi(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=y=>{const b=Za(n.current).includes(y.animationName);if(y.target===t&&b&&(c("ANIMATION_END"),!i.current)){const M=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=M)})}},p=y=>{y.target===t&&(o.current=Za(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:R.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function Za(e){return(e==null?void 0:e.animationName)||"none"}function qT(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Da({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,i]=HT({defaultProp:t,onChange:r}),o=e!==void 0,s=o?e:n,a=br(r),c=R.useCallback(l=>{if(o){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else i(l)},[o,e,i,a]);return[s,c]}function HT({defaultProp:e,onChange:t}){const r=R.useState(e),[n]=r,i=R.useRef(n),o=br(t);return R.useEffect(()=>{i.current!==n&&(o(n),i.current=n)},[n,i,o]),r}var WT="VisuallyHidden",Qb=R.forwardRef((e,t)=>w.jsx(Xt.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Qb.displayName=WT;var GT=Qb,[Bl,JB]=Pi("Tooltip",[Ll]),x0=Ll(),ey="TooltipProvider",KT=700,Mp="tooltip.open",[YT,ty]=Bl(ey),ry=e=>{const{__scopeTooltip:t,delayDuration:r=KT,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:o}=e,[s,a]=R.useState(!0),c=R.useRef(!1),l=R.useRef(0);return R.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),w.jsx(YT,{scope:t,isOpenDelayed:s,delayDuration:r,onOpen:R.useCallback(()=>{window.clearTimeout(l.current),a(!1)},[]),onClose:R.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:c,onPointerInTransitChange:R.useCallback(u=>{c.current=u},[]),disableHoverableContent:i,children:o})};ry.displayName=ey;var ny="Tooltip",[ZB,Ul]=Bl(ny),Zf="TooltipTrigger",XT=R.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=Ul(Zf,r),o=ty(Zf,r),s=x0(r),a=R.useRef(null),c=ir(t,a,i.onTriggerChange),l=R.useRef(!1),u=R.useRef(!1),d=R.useCallback(()=>l.current=!1,[]);return R.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),w.jsx(Yb,{asChild:!0,...s,children:w.jsx(Xt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:Qe(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Qe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Qe(e.onPointerDown,()=>{l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Qe(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:Qe(e.onBlur,i.onClose),onClick:Qe(e.onClick,i.onClose)})})});XT.displayName=Zf;var JT="TooltipPortal",[QB,ZT]=Bl(JT,{forceMount:void 0}),ws="TooltipContent",QT=R.forwardRef((e,t)=>{const r=ZT(ws,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...o}=e,s=Ul(ws,e.__scopeTooltip);return w.jsx(Ln,{present:n||s.open,children:s.disableHoverableContent?w.jsx(iy,{side:i,...o,ref:t}):w.jsx(eA,{side:i,...o,ref:t})})}),eA=R.forwardRef((e,t)=>{const r=Ul(ws,e.__scopeTooltip),n=ty(ws,e.__scopeTooltip),i=R.useRef(null),o=ir(t,i),[s,a]=R.useState(null),{trigger:c,onClose:l}=r,u=i.current,{onPointerInTransitChange:d}=n,p=R.useCallback(()=>{a(null),d(!1)},[d]),y=R.useCallback((x,b)=>{const M=x.currentTarget,O={x:x.clientX,y:x.clientY},P=iA(O,M.getBoundingClientRect()),k=oA(O,P),F=sA(b.getBoundingClientRect()),B=cA([...k,...F]);a(B),d(!0)},[d]);return R.useEffect(()=>()=>p(),[p]),R.useEffect(()=>{if(c&&u){const x=M=>y(M,u),b=M=>y(M,c);return c.addEventListener("pointerleave",x),u.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",b)}}},[c,u,y,p]),R.useEffect(()=>{if(s){const x=b=>{const M=b.target,O={x:b.clientX,y:b.clientY},P=(c==null?void 0:c.contains(M))||(u==null?void 0:u.contains(M)),k=!aA(O,s);P?p():k&&(p(),l())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,u,s,l,p]),w.jsx(iy,{...e,ref:o})}),[tA,rA]=Bl(ny,{isInside:!1}),iy=R.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...a}=e,c=Ul(ws,r),l=x0(r),{onClose:u}=c;return R.useEffect(()=>(document.addEventListener(Mp,u),()=>document.removeEventListener(Mp,u)),[u]),R.useEffect(()=>{if(c.trigger){const d=p=>{const y=p.target;y!=null&&y.contains(c.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[c.trigger,u]),w.jsx(u0,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:w.jsxs(Xb,{"data-state":c.stateAttribute,...l,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[w.jsx(Ms,{children:n}),w.jsx(tA,{scope:r,isInside:!0,children:w.jsx(GT,{id:c.contentId,role:"tooltip",children:i||n})})]})})});QT.displayName=ws;var oy="TooltipArrow",nA=R.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=x0(r);return rA(oy,r).isInside?null:w.jsx(Jb,{...i,...n,ref:t})});nA.displayName=oy;function iA(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,i,o)){case o:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function oA(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function sA(e){const{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}function aA(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,c=t[o].y,l=t[s].x,u=t[s].y;c>n!=u>n&&r<(l-a)*(n-c)/(u-c)+a&&(i=!i)}return i}function cA(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),lA(t)}function lA(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const i=e[n];for(;t.length>=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const i=e[n];for(;r.length>=2;){const o=r[r.length-1],s=r[r.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var uA=ry,sy=R.createContext(void 0),fA=e=>{const{dir:t,children:r}=e;return w.jsx(sy.Provider,{value:t,children:r})};function S0(e){const t=R.useContext(sy);return e||t||"ltr"}const dA=["tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","brown","orange"],hA=["sky","mint","lime","yellow","amber"],pA=["gold","bronze"],mA=[...dA,...hA,...pA],gA="gray",vA=["mauve","slate","sage","olive","sand"],bA=[gA,...vA];function yA(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand"}}const wA=["inherit","light","dark"],xA=[...mA,"gray"],SA=[...bA,"auto"],_A=["solid","translucent"],EA=["none","small","medium","large","full"],CA=["90%","95%","100%","105%","110%"],Ur={hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:wA,default:"inherit"},accentColor:{type:"enum",values:xA,default:"indigo"},grayColor:{type:"enum",values:SA,default:"auto"},panelBackground:{type:"enum",values:_A,default:"translucent"},radius:{type:"enum",values:EA,default:"medium"},scaling:{type:"enum",values:CA,default:"100%"}};function ay(e){return e==="gray"?"gray":yA(e)}const Go=()=>{},Xc=R.createContext(void 0);function TA(){const e=R.useContext(Xc);if(e===void 0)throw new Error("`useThemeContext` must be used within a `Theme`");return e}const Fl=R.forwardRef((e,t)=>R.useContext(Xc)===void 0?R.createElement(uA,null,R.createElement(fA,{dir:"ltr"},R.createElement(cy,{...e,ref:t}))):R.createElement(_0,{...e,ref:t}));Fl.displayName="Theme";const cy=R.forwardRef((e,t)=>{const{appearance:r=Ur.appearance.default,accentColor:n=Ur.accentColor.default,grayColor:i=Ur.grayColor.default,panelBackground:o=Ur.panelBackground.default,radius:s=Ur.radius.default,scaling:a=Ur.scaling.default,hasBackground:c=Ur.hasBackground.default,...l}=e,[u,d]=R.useState(r);R.useEffect(()=>d(r),[r]);const[p,y]=R.useState(n);R.useEffect(()=>y(n),[n]);const[x,b]=R.useState(i);R.useEffect(()=>b(i),[i]);const[M,O]=R.useState(o);R.useEffect(()=>O(o),[o]);const[P,k]=R.useState(s);R.useEffect(()=>k(s),[s]);const[F,B]=R.useState(a);R.useEffect(()=>B(a),[a]);const W=R.memo(({appearance:G})=>R.createElement("script",{dangerouslySetInnerHTML:{__html:`!(function(){try{var d=document.documentElement,c=d.classList;c.remove('light','dark');d.style.colorScheme='${G}';c.add('${G}');}catch(e){}})();`}}),()=>!0);W.displayName="ExplicitRootAppearanceScript",R.useEffect(()=>AA(r),[r]);const z=x==="auto"?ay(p):x;return R.createElement(R.Fragment,null,u!=="inherit"&&R.createElement(W,{appearance:u}),c&&R.createElement("style",{dangerouslySetInnerHTML:{__html:`
|
|
50
50
|
:root, .light, .light-theme { --color-page-background: white; }
|
|
51
51
|
.dark, .dark-theme { --color-page-background: var(--${z}-1); }
|
|
52
52
|
body { background-color: var(--color-page-background); }
|
|
53
|
-
`}}),O.createElement(x0,{...l,ref:t,isRoot:!0,hasBackground:c,appearance:u,accentColor:p,grayColor:x,panelBackground:M,radius:P,scaling:F,onAppearanceChange:d,onAccentColorChange:y,onGrayColorChange:b,onPanelBackgroundChange:R,onRadiusChange:k,onScalingChange:B}))});sy.displayName="ThemeRoot";const x0=O.forwardRef((e,t)=>{var r,n,i,o,s,a;const c=O.useContext(Xc),{asChild:l,isRoot:u,hasBackground:d,appearance:p=(r=c==null?void 0:c.appearance)!==null&&r!==void 0?r:Br.appearance.default,accentColor:y=(n=c==null?void 0:c.accentColor)!==null&&n!==void 0?n:Br.accentColor.default,grayColor:x=(i=c==null?void 0:c.resolvedGrayColor)!==null&&i!==void 0?i:Br.grayColor.default,panelBackground:b=(o=c==null?void 0:c.panelBackground)!==null&&o!==void 0?o:Br.panelBackground.default,radius:M=(s=c==null?void 0:c.radius)!==null&&s!==void 0?s:Br.radius.default,scaling:R=(a=c==null?void 0:c.scaling)!==null&&a!==void 0?a:Br.scaling.default,onAppearanceChange:P=Go,onAccentColorChange:k=Go,onGrayColorChange:F=Go,onPanelBackgroundChange:B=Go,onRadiusChange:W=Go,onScalingChange:z=Go,...G}=e,re=l?Ai:"div",oe=x==="auto"?oy(y):x,se=e.appearance!==void 0&&e.appearance!=="inherit",q=e.grayColor!==void 0,L=!u&&(d===!0||d!==!1&&(se||q));return O.createElement(Xc.Provider,{value:O.useMemo(()=>({appearance:p,accentColor:y,grayColor:x,resolvedGrayColor:oe,panelBackground:b,radius:M,scaling:R,onAppearanceChange:P,onAccentColorChange:k,onGrayColorChange:F,onPanelBackgroundChange:B,onRadiusChange:W,onScalingChange:z}),[p,y,x,oe,b,M,R,P,k,F,B,W,z])},O.createElement(re,{"data-is-root-theme":u?"true":"false","data-accent-color":y,"data-gray-color":oe,"data-has-background":L?"true":"false","data-panel-background":b,"data-radius":M,"data-scaling":R,ref:t,...G,className:er("radix-themes",{light:!u&&p==="light",dark:!u&&p==="dark"},G.className)}))});x0.displayName="ThemeImpl";function xA(e){if(e==="inherit")return;const t=document.documentElement;(t.classList.contains("light-theme")||t.classList.contains("dark-theme"))&&(t.classList.remove("light-theme","dark-theme"),t.style.colorScheme=e,t.classList.add(`${e}-theme`)),(t.classList.contains("light")||t.classList.contains("dark"))&&(t.classList.remove("light","dark"),t.style.colorScheme=e,t.classList.add(e))}const La={type:"enum",values:Br.accentColor.values,default:void 0},$l={type:"boolean",default:void 0};function St(e,t="",r){var n,i,o,s;const a=[];if(typeof e=="object"){for(const c of Object.keys(e))if(c in e){const l=(n=e[c])===null||n===void 0?void 0:n.toString(),u=l==null?void 0:l.startsWith("-"),d=t===""?"":"-",p=u?`-${t}`:t,y=u?l==null?void 0:l.substring(1):l;if(y===void 0)continue;const x=(i=r==null?void 0:r[y])!==null&&i!==void 0?i:y,b=c==="initial"?`${p}${d}${x}`:`${c}:${p}${d}${x}`;a.push(b)}}if(typeof e=="string"){const c=e.startsWith("-"),l=t===""?"":"-",u=c?`-${t}`:t,d=c?e.substring(1):e,p=(o=r==null?void 0:r[d])!==null&&o!==void 0?o:d;a.push(`${u}${l}${p}`)}if(typeof e=="boolean"){const c=t===""?"":"-",l=e.toString(),u=(s=r==null?void 0:r[l])!==null&&s!==void 0?s:l;a.push(`${t}${c}${u}`)}return a.join(" ")}const po=["0","1","2","3","4","5","6","7","8","9"],SA={p:{type:"enum",values:po,default:void 0,responsive:!0},px:{type:"enum",values:po,default:void 0,responsive:!0},py:{type:"enum",values:po,default:void 0,responsive:!0},pt:{type:"enum",values:po,default:void 0,responsive:!0},pr:{type:"enum",values:po,default:void 0,responsive:!0},pb:{type:"enum",values:po,default:void 0,responsive:!0},pl:{type:"enum",values:po,default:void 0,responsive:!0}};function _A(e){const{p:t=Cr.p.default,px:r=Cr.px.default,py:n=Cr.py.default,pt:i=Cr.pt.default,pr:o=Cr.pr.default,pb:s=Cr.pb.default,pl:a=Cr.pl.default,...c}=e;return{p:t,px:r,py:n,pt:i,pr:o,pb:s,pl:a,rest:c}}function EA(e){return[St(e.p,"rt-r-p"),St(e.px,"rt-r-px"),St(e.py,"rt-r-py"),St(e.pt,"rt-r-pt"),St(e.pr,"rt-r-pr"),St(e.pb,"rt-r-pb"),St(e.pl,"rt-r-pl")].filter(Boolean).join(" ")}const CA=["static","relative","absolute","fixed","sticky"],qs=["auto","0","50%","100%"],Ap=["auto","min-content","max-content","100%","0","1","2","3","4","5","6","7","8","9"],TA=["0","1"],AA=["0","1"],Cr={...SA,position:{type:"enum",values:CA,default:void 0,responsive:!0},inset:{type:"enum",values:qs,default:void 0,responsive:!0},top:{type:"enum",values:qs,default:void 0,responsive:!0},right:{type:"enum",values:qs,default:void 0,responsive:!0},bottom:{type:"enum",values:qs,default:void 0,responsive:!0},left:{type:"enum",values:qs,default:void 0,responsive:!0},width:{type:"enum",values:Ap,default:void 0,responsive:!0},height:{type:"enum",values:Ap,default:void 0,responsive:!0},shrink:{type:"enum",values:TA,default:void 0,responsive:!0},grow:{type:"enum",values:AA,default:void 0,responsive:!0}};function MA(e){const{rest:t,...r}=_A(e),{position:n=Cr.position.default,width:i=Cr.width.default,height:o=Cr.height.default,inset:s=Cr.inset.default,top:a=Cr.top.default,bottom:c=Cr.bottom.default,left:l=Cr.left.default,right:u=Cr.right.default,shrink:d=Cr.shrink.default,grow:p=Cr.grow.default,...y}=t;return{...r,position:n,width:i,height:o,inset:s,top:a,bottom:c,left:l,right:u,shrink:d,grow:p,rest:y}}function IA(e){return[EA(e),St(e.position,"rt-r-position"),St(e.shrink,"rt-r-fs"),St(e.grow,"rt-r-fg"),St(e.width,"rt-r-w"),St(e.height,"rt-r-h"),St(e.inset,"rt-r-inset"),St(e.top,"rt-r-top"),St(e.bottom,"rt-r-bottom"),St(e.left,"rt-r-left"),St(e.right,"rt-r-right")].filter(Boolean).join(" ")}const mo=["auto","0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],go={m:{type:"enum",values:mo,default:void 0,responsive:!0},mx:{type:"enum",values:mo,default:void 0,responsive:!0},my:{type:"enum",values:mo,default:void 0,responsive:!0},mt:{type:"enum",values:mo,default:void 0,responsive:!0},mr:{type:"enum",values:mo,default:void 0,responsive:!0},mb:{type:"enum",values:mo,default:void 0,responsive:!0},ml:{type:"enum",values:mo,default:void 0,responsive:!0}};function Os(e){const{m:t=go.m.default,mx:r=go.mx.default,my:n=go.my.default,mt:i=go.mt.default,mr:o=go.mr.default,mb:s=go.mb.default,ml:a=go.ml.default,...c}=e;return{m:t,mx:r,my:n,mt:i,mr:o,mb:s,ml:a,rest:c}}function Ps(e){return[St(e.m,"rt-r-m"),St(e.mx,"rt-r-mx"),St(e.my,"rt-r-my"),St(e.mt,"rt-r-mt"),St(e.mr,"rt-r-mr"),St(e.mb,"rt-r-mb"),St(e.ml,"rt-r-ml")].filter(Boolean).join(" ")}const S0={type:"enum",values:Br.radius.values,default:void 0},RA=["none","inline-flex","flex"],OA=["row","column","row-reverse","column-reverse"],PA=["start","center","end","baseline","stretch"],NA=["start","center","end","between"],kA=["nowrap","wrap","wrap-reverse"],jA=["0","1","2","3","4","5","6","7","8","9"],Ko={display:{type:"enum",values:RA,default:"flex",responsive:!0},direction:{type:"enum",values:OA,default:void 0,responsive:!0},align:{type:"enum",values:PA,default:void 0,responsive:!0},justify:{type:"enum",values:NA,default:"start",responsive:!0},wrap:{type:"enum",values:kA,default:void 0,responsive:!0},gap:{type:"enum",values:jA,default:void 0,responsive:!0}},ay=O.forwardRef((e,t)=>{const{rest:r,...n}=Os(e),{rest:i,...o}=MA(r),{className:s,asChild:a,display:c=Ko.display.default,direction:l=Ko.direction.default,align:u=Ko.align.default,justify:d=Ko.justify.default,wrap:p=Ko.wrap.default,gap:y=Ko.gap.default,...x}=i,b=a?Ai:"div";return O.createElement(b,{...x,ref:t,className:er("rt-Flex",s,St(c,"rt-r-display"),St(l,"rt-r-fd"),St(u,"rt-r-ai"),St(d,"rt-r-jc",{between:"space-between"}),St(p,"rt-r-fw"),St(y,"rt-r-gap"),IA(o),Ps(n))})});ay.displayName="Flex";function cy(e){const t=O.useRef({value:e,previous:e});return O.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var _0="Checkbox",[DA,KB]=Pi(_0),[LA,BA]=DA(_0),ly=O.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:o,required:s,disabled:a,value:c="on",onCheckedChange:l,form:u,...d}=e,[p,y]=O.useState(null),x=nr(t,F=>y(F)),b=O.useRef(!1),M=p?u||!!p.closest("form"):!0,[R=!1,P]=Da({prop:i,defaultProp:o,onChange:l}),k=O.useRef(R);return O.useEffect(()=>{const F=p==null?void 0:p.form;if(F){const B=()=>P(k.current);return F.addEventListener("reset",B),()=>F.removeEventListener("reset",B)}},[p,P]),w.jsxs(LA,{scope:r,state:R,disabled:a,children:[w.jsx(Xt.button,{type:"button",role:"checkbox","aria-checked":Gi(R)?"mixed":R,"aria-required":s,"data-state":dy(R),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:x,onKeyDown:Qe(e.onKeyDown,F=>{F.key==="Enter"&&F.preventDefault()}),onClick:Qe(e.onClick,F=>{P(B=>Gi(B)?!0:!B),M&&(b.current=F.isPropagationStopped(),b.current||F.stopPropagation())})}),M&&w.jsx(UA,{control:p,bubbles:!b.current,name:n,value:c,checked:R,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Gi(o)?!1:o})]})});ly.displayName=_0;var uy="CheckboxIndicator",fy=O.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...i}=e,o=BA(uy,r);return w.jsx(Ln,{present:n||Gi(o.state)||o.state===!0,children:w.jsx(Xt.span,{"data-state":dy(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});fy.displayName=uy;var UA=e=>{const{control:t,checked:r,bubbles:n=!0,defaultChecked:i,...o}=e,s=O.useRef(null),a=cy(r),c=g0(t);O.useEffect(()=>{const u=s.current,d=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==r&&y){const x=new Event("click",{bubbles:n});u.indeterminate=Gi(r),y.call(u,Gi(r)?!1:r),u.dispatchEvent(x)}},[a,r,n]);const l=O.useRef(Gi(r)?!1:r);return w.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??l.current,...o,tabIndex:-1,ref:s,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Gi(e){return e==="indeterminate"}function dy(e){return Gi(e)?"indeterminate":e?"checked":"unchecked"}var FA=ly,$A=fy;const VA=["1","2","3"],zA=["classic","surface","soft"],Qa={size:{type:"enum",values:VA,default:"2",responsive:!0},variant:{type:"enum",values:zA,default:"surface"},color:La,highContrast:$l},Vl=O.forwardRef(({color:e="currentColor",...t},r)=>O.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},O.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));Vl.displayName="ThickCheckIcon";const qA=O.forwardRef(({color:e="currentColor",...t},r)=>O.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},O.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));qA.displayName="ChevronDownIcon";const hy=O.forwardRef(({color:e="currentColor",...t},r)=>O.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},O.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));hy.displayName="ThickChevronRightIcon";const HA=O.forwardRef(({color:e="currentColor",...t},r)=>O.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,ref:r},O.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:e,fillRule:"evenodd",clipRule:"evenodd"})));HA.displayName="InfoCircledIcon";const zl=O.forwardRef((e,t)=>{const{rest:r,...n}=Os(e),{className:i,style:o,size:s=Qa.size.default,variant:a=Qa.variant.default,color:c=Qa.color.default,highContrast:l=Qa.highContrast.default,...u}=r;return O.createElement("span",{className:er("rt-CheckboxRoot",i,St(s,"rt-r-size"),Ps(n)),style:o},O.createElement(FA,{"data-accent-color":c,...u,ref:t,className:er("rt-reset","rt-CheckboxButton",`rt-variant-${a}`,{"rt-high-contrast":l})},O.createElement($A,{className:"rt-CheckboxIndicator"},O.createElement(Vl,{className:"rt-CheckboxIndicatorIcon"}))))});zl.displayName="Checkbox";function py(e){const t=e+"CollectionProvider",[r,n]=Pi(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:x,children:b}=y,M=ie.useRef(null),R=ie.useRef(new Map).current;return w.jsx(i,{scope:x,itemMap:R,collectionRef:M,children:b})};s.displayName=t;const a=e+"CollectionSlot",c=ie.forwardRef((y,x)=>{const{scope:b,children:M}=y,R=o(a,b),P=nr(x,R.collectionRef);return w.jsx(Ai,{ref:P,children:M})});c.displayName=a;const l=e+"CollectionItemSlot",u="data-radix-collection-item",d=ie.forwardRef((y,x)=>{const{scope:b,children:M,...R}=y,P=ie.useRef(null),k=nr(x,P),F=o(l,b);return ie.useEffect(()=>(F.itemMap.set(P,{ref:P,...R}),()=>void F.itemMap.delete(P))),w.jsx(Ai,{[u]:"",ref:k,children:M})});d.displayName=l;function p(y){const x=o(e+"CollectionConsumer",y);return ie.useCallback(()=>{const M=x.collectionRef.current;if(!M)return[];const R=Array.from(M.querySelectorAll(`[${u}]`));return Array.from(x.itemMap.values()).sort((F,B)=>R.indexOf(F.ref.current)-R.indexOf(B.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:c,ItemSlot:d},p,n]}var zu="rovingFocusGroup.onEntryFocus",WA={bubbles:!1,cancelable:!0},ql="RovingFocusGroup",[Qf,my,GA]=py(ql),[KA,gy]=Pi(ql,[GA]),[YA,XA]=KA(ql),vy=O.forwardRef((e,t)=>w.jsx(Qf.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Qf.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(JA,{...e,ref:t})})}));vy.displayName=ql;var JA=O.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,p=O.useRef(null),y=nr(t,p),x=w0(o),[b=null,M]=Da({prop:s,defaultProp:a,onChange:c}),[R,P]=O.useState(!1),k=br(l),F=my(r),B=O.useRef(!1),[W,z]=O.useState(0);return O.useEffect(()=>{const G=p.current;if(G)return G.addEventListener(zu,k),()=>G.removeEventListener(zu,k)},[k]),w.jsx(YA,{scope:r,orientation:n,dir:x,loop:i,currentTabStopId:b,onItemFocus:O.useCallback(G=>M(G),[M]),onItemShiftTab:O.useCallback(()=>P(!0),[]),onFocusableItemAdd:O.useCallback(()=>z(G=>G+1),[]),onFocusableItemRemove:O.useCallback(()=>z(G=>G-1),[]),children:w.jsx(Xt.div,{tabIndex:R||W===0?-1:0,"data-orientation":n,...d,ref:y,style:{outline:"none",...e.style},onMouseDown:Qe(e.onMouseDown,()=>{B.current=!0}),onFocus:Qe(e.onFocus,G=>{const re=!B.current;if(G.target===G.currentTarget&&re&&!R){const oe=new CustomEvent(zu,WA);if(G.currentTarget.dispatchEvent(oe),!oe.defaultPrevented){const se=F().filter(m=>m.focusable),q=se.find(m=>m.active),L=se.find(m=>m.id===b),f=[q,L,...se].filter(Boolean).map(m=>m.ref.current);wy(f,u)}}B.current=!1}),onBlur:Qe(e.onBlur,()=>P(!1))})})}),by="RovingFocusGroupItem",yy=O.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,...s}=e,a=ma(),c=o||a,l=XA(by,r),u=l.currentTabStopId===c,d=my(r),{onFocusableItemAdd:p,onFocusableItemRemove:y}=l;return O.useEffect(()=>{if(n)return p(),()=>y()},[n,p,y]),w.jsx(Qf.ItemSlot,{scope:r,id:c,focusable:n,active:i,children:w.jsx(Xt.span,{tabIndex:u?0:-1,"data-orientation":l.orientation,...s,ref:t,onMouseDown:Qe(e.onMouseDown,x=>{n?l.onItemFocus(c):x.preventDefault()}),onFocus:Qe(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:Qe(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){l.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const b=eM(x,l.orientation,l.dir);if(b!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let R=d().filter(P=>P.focusable).map(P=>P.ref.current);if(b==="last")R.reverse();else if(b==="prev"||b==="next"){b==="prev"&&R.reverse();const P=R.indexOf(x.currentTarget);R=l.loop?tM(R,P+1):R.slice(P+1)}setTimeout(()=>wy(R))}})})})});yy.displayName=by;var ZA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function QA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function eM(e,t,r){const n=QA(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return ZA[n]}function wy(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function tM(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var rM=vy,nM=yy;function iM(e,[t,r]){return Math.min(r,Math.max(t,e))}var qu=0;function oM(){O.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Mp()),document.body.insertAdjacentElement("beforeend",e[1]??Mp()),qu++,()=>{qu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qu--}},[])}function Mp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Hu="focusScope.autoFocusOnMount",Wu="focusScope.autoFocusOnUnmount",Ip={bubbles:!1,cancelable:!0},sM="FocusScope",xy=O.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,c]=O.useState(null),l=br(i),u=br(o),d=O.useRef(null),p=nr(t,b=>c(b)),y=O.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;O.useEffect(()=>{if(n){let b=function(k){if(y.paused||!a)return;const F=k.target;a.contains(F)?d.current=F:Ui(d.current,{select:!0})},M=function(k){if(y.paused||!a)return;const F=k.relatedTarget;F!==null&&(a.contains(F)||Ui(d.current,{select:!0}))},R=function(k){if(document.activeElement===document.body)for(const B of k)B.removedNodes.length>0&&Ui(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",M);const P=new MutationObserver(R);return a&&P.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",M),P.disconnect()}}},[n,a,y.paused]),O.useEffect(()=>{if(a){Op.add(y);const b=document.activeElement;if(!a.contains(b)){const R=new CustomEvent(Hu,Ip);a.addEventListener(Hu,l),a.dispatchEvent(R),R.defaultPrevented||(aM(dM(Sy(a)),{select:!0}),document.activeElement===b&&Ui(a))}return()=>{a.removeEventListener(Hu,l),setTimeout(()=>{const R=new CustomEvent(Wu,Ip);a.addEventListener(Wu,u),a.dispatchEvent(R),R.defaultPrevented||Ui(b??document.body,{select:!0}),a.removeEventListener(Wu,u),Op.remove(y)},0)}}},[a,l,u,y]);const x=O.useCallback(b=>{if(!r&&!n||y.paused)return;const M=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,R=document.activeElement;if(M&&R){const P=b.currentTarget,[k,F]=cM(P);k&&F?!b.shiftKey&&R===F?(b.preventDefault(),r&&Ui(k,{select:!0})):b.shiftKey&&R===k&&(b.preventDefault(),r&&Ui(F,{select:!0})):R===P&&b.preventDefault()}},[r,n,y.paused]);return w.jsx(Xt.div,{tabIndex:-1,...s,ref:p,onKeyDown:x})});xy.displayName=sM;function aM(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ui(n,{select:t}),document.activeElement!==r)return}function cM(e){const t=Sy(e),r=Rp(t,e),n=Rp(t.reverse(),e);return[r,n]}function Sy(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Rp(e,t){for(const r of e)if(!lM(r,{upTo:t}))return r}function lM(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function uM(e){return e instanceof HTMLInputElement&&"select"in e}function Ui(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&uM(e)&&t&&e.select()}}var Op=fM();function fM(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Pp(e,t),e.unshift(t)},remove(t){var r;e=Pp(e,t),(r=e[0])==null||r.resume()}}}function Pp(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function dM(e){return e.filter(t=>t.tagName!=="A")}var hM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Yo=new WeakMap,ec=new WeakMap,tc={},Gu=0,_y=function(e){return e&&(e.host||_y(e.parentNode))},pM=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=_y(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},mM=function(e,t,r,n){var i=pM(t,Array.isArray(e)?e:[e]);tc[r]||(tc[r]=new WeakMap);var o=tc[r],s=[],a=new Set,c=new Set(i),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};i.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))u(p);else try{var y=p.getAttribute(n),x=y!==null&&y!=="false",b=(Yo.get(p)||0)+1,M=(o.get(p)||0)+1;Yo.set(p,b),o.set(p,M),s.push(p),b===1&&x&&ec.set(p,!0),M===1&&p.setAttribute(r,"true"),x||p.setAttribute(n,"true")}catch(R){console.error("aria-hidden: cannot operate on ",p,R)}})};return u(t),a.clear(),Gu++,function(){s.forEach(function(d){var p=Yo.get(d)-1,y=o.get(d)-1;Yo.set(d,p),o.set(d,y),p||(ec.has(d)||d.removeAttribute(n),ec.delete(d)),y||d.removeAttribute(r)}),Gu--,Gu||(Yo=new WeakMap,Yo=new WeakMap,ec=new WeakMap,tc={})}},gM=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=t||hM(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),mM(n,i,r,"aria-hidden")):function(){return null}},Gn=function(){return Gn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Gn.apply(this,arguments)};function Ey(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function vM(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var wc="right-scroll-bar-position",xc="width-before-scroll-bar",bM="with-scroll-bars-hidden",yM="--removed-body-scroll-bar-size";function Ku(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function wM(e,t){var r=ie.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=t,r.facade}var xM=typeof window<"u"?O.useLayoutEffect:O.useEffect,Np=new WeakMap;function SM(e,t){var r=wM(t||null,function(n){return e.forEach(function(i){return Ku(i,n)})});return xM(function(){var n=Np.get(r);if(n){var i=new Set(n),o=new Set(e),s=r.current;i.forEach(function(a){o.has(a)||Ku(a,null)}),o.forEach(function(a){i.has(a)||Ku(a,s)})}Np.set(r,e)},[e]),r}function _M(e){return e}function EM(e,t){t===void 0&&(t=_M);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var s=t(o,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(n=!0;r.length;){var s=r;r=[],s.forEach(o)}r={push:function(a){return o(a)},filter:function(){return r}}},assignMedium:function(o){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(o),s=r}var c=function(){var u=s;s=[],u.forEach(o)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){s.push(u),l()},filter:function(u){return s=s.filter(u),r}}}};return i}function CM(e){e===void 0&&(e={});var t=EM(null);return t.options=Gn({async:!0,ssr:!1},e),t}var Cy=function(e){var t=e.sideCar,r=Ey(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return O.createElement(n,Gn({},r))};Cy.isSideCarExport=!0;function TM(e,t){return e.useMedium(t),Cy}var Ty=CM(),Yu=function(){},Hl=O.forwardRef(function(e,t){var r=O.useRef(null),n=O.useState({onScrollCapture:Yu,onWheelCapture:Yu,onTouchMoveCapture:Yu}),i=n[0],o=n[1],s=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,y=e.noIsolation,x=e.inert,b=e.allowPinchZoom,M=e.as,R=M===void 0?"div":M,P=e.gapMode,k=Ey(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),F=p,B=SM([r,t]),W=Gn(Gn({},k),i);return O.createElement(O.Fragment,null,u&&O.createElement(F,{sideCar:Ty,removeScrollBar:l,shards:d,noIsolation:y,inert:x,setCallbacks:o,allowPinchZoom:!!b,lockRef:r,gapMode:P}),s?O.cloneElement(O.Children.only(a),Gn(Gn({},W),{ref:B})):O.createElement(R,Gn({},W,{className:c,ref:B}),a))});Hl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hl.classNames={fullWidth:xc,zeroRight:wc};var kp,AM=function(){if(kp)return kp;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function MM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=AM();return t&&e.setAttribute("nonce",t),e}function IM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function RM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var OM=function(){var e=0,t=null;return{add:function(r){e==0&&(t=MM())&&(IM(t,r),RM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},PM=function(){var e=OM();return function(t,r){O.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Ay=function(){var e=PM(),t=function(r){var n=r.styles,i=r.dynamic;return e(n,i),null};return t},NM={left:0,top:0,right:0,gap:0},Xu=function(e){return parseInt(e||"",10)||0},kM=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Xu(r),Xu(n),Xu(i)]},jM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return NM;var t=kM(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},DM=Ay(),fs="data-scroll-locked",LM=function(e,t,r,n){var i=e.left,o=e.top,s=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
54
|
-
.`.concat(
|
|
53
|
+
`}}),R.createElement(_0,{...l,ref:t,isRoot:!0,hasBackground:c,appearance:u,accentColor:p,grayColor:x,panelBackground:M,radius:P,scaling:F,onAppearanceChange:d,onAccentColorChange:y,onGrayColorChange:b,onPanelBackgroundChange:O,onRadiusChange:k,onScalingChange:B}))});cy.displayName="ThemeRoot";const _0=R.forwardRef((e,t)=>{var r,n,i,o,s,a;const c=R.useContext(Xc),{asChild:l,isRoot:u,hasBackground:d,appearance:p=(r=c==null?void 0:c.appearance)!==null&&r!==void 0?r:Ur.appearance.default,accentColor:y=(n=c==null?void 0:c.accentColor)!==null&&n!==void 0?n:Ur.accentColor.default,grayColor:x=(i=c==null?void 0:c.resolvedGrayColor)!==null&&i!==void 0?i:Ur.grayColor.default,panelBackground:b=(o=c==null?void 0:c.panelBackground)!==null&&o!==void 0?o:Ur.panelBackground.default,radius:M=(s=c==null?void 0:c.radius)!==null&&s!==void 0?s:Ur.radius.default,scaling:O=(a=c==null?void 0:c.scaling)!==null&&a!==void 0?a:Ur.scaling.default,onAppearanceChange:P=Go,onAccentColorChange:k=Go,onGrayColorChange:F=Go,onPanelBackgroundChange:B=Go,onRadiusChange:W=Go,onScalingChange:z=Go,...G}=e,re=l?Ai:"div",oe=x==="auto"?ay(y):x,se=e.appearance!==void 0&&e.appearance!=="inherit",q=e.grayColor!==void 0,L=!u&&(d===!0||d!==!1&&(se||q));return R.createElement(Xc.Provider,{value:R.useMemo(()=>({appearance:p,accentColor:y,grayColor:x,resolvedGrayColor:oe,panelBackground:b,radius:M,scaling:O,onAppearanceChange:P,onAccentColorChange:k,onGrayColorChange:F,onPanelBackgroundChange:B,onRadiusChange:W,onScalingChange:z}),[p,y,x,oe,b,M,O,P,k,F,B,W,z])},R.createElement(re,{"data-is-root-theme":u?"true":"false","data-accent-color":y,"data-gray-color":oe,"data-has-background":L?"true":"false","data-panel-background":b,"data-radius":M,"data-scaling":O,ref:t,...G,className:er("radix-themes",{light:!u&&p==="light",dark:!u&&p==="dark"},G.className)}))});_0.displayName="ThemeImpl";function AA(e){if(e==="inherit")return;const t=document.documentElement;(t.classList.contains("light-theme")||t.classList.contains("dark-theme"))&&(t.classList.remove("light-theme","dark-theme"),t.style.colorScheme=e,t.classList.add(`${e}-theme`)),(t.classList.contains("light")||t.classList.contains("dark"))&&(t.classList.remove("light","dark"),t.style.colorScheme=e,t.classList.add(e))}const La={type:"enum",values:Ur.accentColor.values,default:void 0},$l={type:"boolean",default:void 0};function St(e,t="",r){var n,i,o,s;const a=[];if(typeof e=="object"){for(const c of Object.keys(e))if(c in e){const l=(n=e[c])===null||n===void 0?void 0:n.toString(),u=l==null?void 0:l.startsWith("-"),d=t===""?"":"-",p=u?`-${t}`:t,y=u?l==null?void 0:l.substring(1):l;if(y===void 0)continue;const x=(i=r==null?void 0:r[y])!==null&&i!==void 0?i:y,b=c==="initial"?`${p}${d}${x}`:`${c}:${p}${d}${x}`;a.push(b)}}if(typeof e=="string"){const c=e.startsWith("-"),l=t===""?"":"-",u=c?`-${t}`:t,d=c?e.substring(1):e,p=(o=r==null?void 0:r[d])!==null&&o!==void 0?o:d;a.push(`${u}${l}${p}`)}if(typeof e=="boolean"){const c=t===""?"":"-",l=e.toString(),u=(s=r==null?void 0:r[l])!==null&&s!==void 0?s:l;a.push(`${t}${c}${u}`)}return a.join(" ")}const po=["0","1","2","3","4","5","6","7","8","9"],MA={p:{type:"enum",values:po,default:void 0,responsive:!0},px:{type:"enum",values:po,default:void 0,responsive:!0},py:{type:"enum",values:po,default:void 0,responsive:!0},pt:{type:"enum",values:po,default:void 0,responsive:!0},pr:{type:"enum",values:po,default:void 0,responsive:!0},pb:{type:"enum",values:po,default:void 0,responsive:!0},pl:{type:"enum",values:po,default:void 0,responsive:!0}};function IA(e){const{p:t=Tr.p.default,px:r=Tr.px.default,py:n=Tr.py.default,pt:i=Tr.pt.default,pr:o=Tr.pr.default,pb:s=Tr.pb.default,pl:a=Tr.pl.default,...c}=e;return{p:t,px:r,py:n,pt:i,pr:o,pb:s,pl:a,rest:c}}function OA(e){return[St(e.p,"rt-r-p"),St(e.px,"rt-r-px"),St(e.py,"rt-r-py"),St(e.pt,"rt-r-pt"),St(e.pr,"rt-r-pr"),St(e.pb,"rt-r-pb"),St(e.pl,"rt-r-pl")].filter(Boolean).join(" ")}const RA=["static","relative","absolute","fixed","sticky"],qs=["auto","0","50%","100%"],Ip=["auto","min-content","max-content","100%","0","1","2","3","4","5","6","7","8","9"],PA=["0","1"],NA=["0","1"],Tr={...MA,position:{type:"enum",values:RA,default:void 0,responsive:!0},inset:{type:"enum",values:qs,default:void 0,responsive:!0},top:{type:"enum",values:qs,default:void 0,responsive:!0},right:{type:"enum",values:qs,default:void 0,responsive:!0},bottom:{type:"enum",values:qs,default:void 0,responsive:!0},left:{type:"enum",values:qs,default:void 0,responsive:!0},width:{type:"enum",values:Ip,default:void 0,responsive:!0},height:{type:"enum",values:Ip,default:void 0,responsive:!0},shrink:{type:"enum",values:PA,default:void 0,responsive:!0},grow:{type:"enum",values:NA,default:void 0,responsive:!0}};function kA(e){const{rest:t,...r}=IA(e),{position:n=Tr.position.default,width:i=Tr.width.default,height:o=Tr.height.default,inset:s=Tr.inset.default,top:a=Tr.top.default,bottom:c=Tr.bottom.default,left:l=Tr.left.default,right:u=Tr.right.default,shrink:d=Tr.shrink.default,grow:p=Tr.grow.default,...y}=t;return{...r,position:n,width:i,height:o,inset:s,top:a,bottom:c,left:l,right:u,shrink:d,grow:p,rest:y}}function jA(e){return[OA(e),St(e.position,"rt-r-position"),St(e.shrink,"rt-r-fs"),St(e.grow,"rt-r-fg"),St(e.width,"rt-r-w"),St(e.height,"rt-r-h"),St(e.inset,"rt-r-inset"),St(e.top,"rt-r-top"),St(e.bottom,"rt-r-bottom"),St(e.left,"rt-r-left"),St(e.right,"rt-r-right")].filter(Boolean).join(" ")}const mo=["auto","0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],go={m:{type:"enum",values:mo,default:void 0,responsive:!0},mx:{type:"enum",values:mo,default:void 0,responsive:!0},my:{type:"enum",values:mo,default:void 0,responsive:!0},mt:{type:"enum",values:mo,default:void 0,responsive:!0},mr:{type:"enum",values:mo,default:void 0,responsive:!0},mb:{type:"enum",values:mo,default:void 0,responsive:!0},ml:{type:"enum",values:mo,default:void 0,responsive:!0}};function Rs(e){const{m:t=go.m.default,mx:r=go.mx.default,my:n=go.my.default,mt:i=go.mt.default,mr:o=go.mr.default,mb:s=go.mb.default,ml:a=go.ml.default,...c}=e;return{m:t,mx:r,my:n,mt:i,mr:o,mb:s,ml:a,rest:c}}function Ps(e){return[St(e.m,"rt-r-m"),St(e.mx,"rt-r-mx"),St(e.my,"rt-r-my"),St(e.mt,"rt-r-mt"),St(e.mr,"rt-r-mr"),St(e.mb,"rt-r-mb"),St(e.ml,"rt-r-ml")].filter(Boolean).join(" ")}const E0={type:"enum",values:Ur.radius.values,default:void 0},DA=["none","inline-flex","flex"],LA=["row","column","row-reverse","column-reverse"],BA=["start","center","end","baseline","stretch"],UA=["start","center","end","between"],FA=["nowrap","wrap","wrap-reverse"],$A=["0","1","2","3","4","5","6","7","8","9"],Ko={display:{type:"enum",values:DA,default:"flex",responsive:!0},direction:{type:"enum",values:LA,default:void 0,responsive:!0},align:{type:"enum",values:BA,default:void 0,responsive:!0},justify:{type:"enum",values:UA,default:"start",responsive:!0},wrap:{type:"enum",values:FA,default:void 0,responsive:!0},gap:{type:"enum",values:$A,default:void 0,responsive:!0}},ly=R.forwardRef((e,t)=>{const{rest:r,...n}=Rs(e),{rest:i,...o}=kA(r),{className:s,asChild:a,display:c=Ko.display.default,direction:l=Ko.direction.default,align:u=Ko.align.default,justify:d=Ko.justify.default,wrap:p=Ko.wrap.default,gap:y=Ko.gap.default,...x}=i,b=a?Ai:"div";return R.createElement(b,{...x,ref:t,className:er("rt-Flex",s,St(c,"rt-r-display"),St(l,"rt-r-fd"),St(u,"rt-r-ai"),St(d,"rt-r-jc",{between:"space-between"}),St(p,"rt-r-fw"),St(y,"rt-r-gap"),jA(o),Ps(n))})});ly.displayName="Flex";function uy(e){const t=R.useRef({value:e,previous:e});return R.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var C0="Checkbox",[VA,eU]=Pi(C0),[zA,qA]=VA(C0),fy=R.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:o,required:s,disabled:a,value:c="on",onCheckedChange:l,form:u,...d}=e,[p,y]=R.useState(null),x=ir(t,F=>y(F)),b=R.useRef(!1),M=p?u||!!p.closest("form"):!0,[O=!1,P]=Da({prop:i,defaultProp:o,onChange:l}),k=R.useRef(O);return R.useEffect(()=>{const F=p==null?void 0:p.form;if(F){const B=()=>P(k.current);return F.addEventListener("reset",B),()=>F.removeEventListener("reset",B)}},[p,P]),w.jsxs(zA,{scope:r,state:O,disabled:a,children:[w.jsx(Xt.button,{type:"button",role:"checkbox","aria-checked":Gi(O)?"mixed":O,"aria-required":s,"data-state":py(O),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:x,onKeyDown:Qe(e.onKeyDown,F=>{F.key==="Enter"&&F.preventDefault()}),onClick:Qe(e.onClick,F=>{P(B=>Gi(B)?!0:!B),M&&(b.current=F.isPropagationStopped(),b.current||F.stopPropagation())})}),M&&w.jsx(HA,{control:p,bubbles:!b.current,name:n,value:c,checked:O,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Gi(o)?!1:o})]})});fy.displayName=C0;var dy="CheckboxIndicator",hy=R.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...i}=e,o=qA(dy,r);return w.jsx(Ln,{present:n||Gi(o.state)||o.state===!0,children:w.jsx(Xt.span,{"data-state":py(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});hy.displayName=dy;var HA=e=>{const{control:t,checked:r,bubbles:n=!0,defaultChecked:i,...o}=e,s=R.useRef(null),a=uy(r),c=b0(t);R.useEffect(()=>{const u=s.current,d=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==r&&y){const x=new Event("click",{bubbles:n});u.indeterminate=Gi(r),y.call(u,Gi(r)?!1:r),u.dispatchEvent(x)}},[a,r,n]);const l=R.useRef(Gi(r)?!1:r);return w.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??l.current,...o,tabIndex:-1,ref:s,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Gi(e){return e==="indeterminate"}function py(e){return Gi(e)?"indeterminate":e?"checked":"unchecked"}var WA=fy,GA=hy;const KA=["1","2","3"],YA=["classic","surface","soft"],Qa={size:{type:"enum",values:KA,default:"2",responsive:!0},variant:{type:"enum",values:YA,default:"surface"},color:La,highContrast:$l},Vl=R.forwardRef(({color:e="currentColor",...t},r)=>R.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));Vl.displayName="ThickCheckIcon";const XA=R.forwardRef(({color:e="currentColor",...t},r)=>R.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},R.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));XA.displayName="ChevronDownIcon";const my=R.forwardRef(({color:e="currentColor",...t},r)=>R.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},R.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));my.displayName="ThickChevronRightIcon";const JA=R.forwardRef(({color:e="currentColor",...t},r)=>R.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,ref:r},R.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:e,fillRule:"evenodd",clipRule:"evenodd"})));JA.displayName="InfoCircledIcon";const zl=R.forwardRef((e,t)=>{const{rest:r,...n}=Rs(e),{className:i,style:o,size:s=Qa.size.default,variant:a=Qa.variant.default,color:c=Qa.color.default,highContrast:l=Qa.highContrast.default,...u}=r;return R.createElement("span",{className:er("rt-CheckboxRoot",i,St(s,"rt-r-size"),Ps(n)),style:o},R.createElement(WA,{"data-accent-color":c,...u,ref:t,className:er("rt-reset","rt-CheckboxButton",`rt-variant-${a}`,{"rt-high-contrast":l})},R.createElement(GA,{className:"rt-CheckboxIndicator"},R.createElement(Vl,{className:"rt-CheckboxIndicatorIcon"}))))});zl.displayName="Checkbox";function gy(e){const t=e+"CollectionProvider",[r,n]=Pi(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:x,children:b}=y,M=ie.useRef(null),O=ie.useRef(new Map).current;return w.jsx(i,{scope:x,itemMap:O,collectionRef:M,children:b})};s.displayName=t;const a=e+"CollectionSlot",c=ie.forwardRef((y,x)=>{const{scope:b,children:M}=y,O=o(a,b),P=ir(x,O.collectionRef);return w.jsx(Ai,{ref:P,children:M})});c.displayName=a;const l=e+"CollectionItemSlot",u="data-radix-collection-item",d=ie.forwardRef((y,x)=>{const{scope:b,children:M,...O}=y,P=ie.useRef(null),k=ir(x,P),F=o(l,b);return ie.useEffect(()=>(F.itemMap.set(P,{ref:P,...O}),()=>void F.itemMap.delete(P))),w.jsx(Ai,{[u]:"",ref:k,children:M})});d.displayName=l;function p(y){const x=o(e+"CollectionConsumer",y);return ie.useCallback(()=>{const M=x.collectionRef.current;if(!M)return[];const O=Array.from(M.querySelectorAll(`[${u}]`));return Array.from(x.itemMap.values()).sort((F,B)=>O.indexOf(F.ref.current)-O.indexOf(B.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:c,ItemSlot:d},p,n]}var zu="rovingFocusGroup.onEntryFocus",ZA={bubbles:!1,cancelable:!0},ql="RovingFocusGroup",[Qf,vy,QA]=gy(ql),[eM,by]=Pi(ql,[QA]),[tM,rM]=eM(ql),yy=R.forwardRef((e,t)=>w.jsx(Qf.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Qf.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(nM,{...e,ref:t})})}));yy.displayName=ql;var nM=R.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,p=R.useRef(null),y=ir(t,p),x=S0(o),[b=null,M]=Da({prop:s,defaultProp:a,onChange:c}),[O,P]=R.useState(!1),k=br(l),F=vy(r),B=R.useRef(!1),[W,z]=R.useState(0);return R.useEffect(()=>{const G=p.current;if(G)return G.addEventListener(zu,k),()=>G.removeEventListener(zu,k)},[k]),w.jsx(tM,{scope:r,orientation:n,dir:x,loop:i,currentTabStopId:b,onItemFocus:R.useCallback(G=>M(G),[M]),onItemShiftTab:R.useCallback(()=>P(!0),[]),onFocusableItemAdd:R.useCallback(()=>z(G=>G+1),[]),onFocusableItemRemove:R.useCallback(()=>z(G=>G-1),[]),children:w.jsx(Xt.div,{tabIndex:O||W===0?-1:0,"data-orientation":n,...d,ref:y,style:{outline:"none",...e.style},onMouseDown:Qe(e.onMouseDown,()=>{B.current=!0}),onFocus:Qe(e.onFocus,G=>{const re=!B.current;if(G.target===G.currentTarget&&re&&!O){const oe=new CustomEvent(zu,ZA);if(G.currentTarget.dispatchEvent(oe),!oe.defaultPrevented){const se=F().filter(m=>m.focusable),q=se.find(m=>m.active),L=se.find(m=>m.id===b),f=[q,L,...se].filter(Boolean).map(m=>m.ref.current);Sy(f,u)}}B.current=!1}),onBlur:Qe(e.onBlur,()=>P(!1))})})}),wy="RovingFocusGroupItem",xy=R.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,...s}=e,a=ma(),c=o||a,l=rM(wy,r),u=l.currentTabStopId===c,d=vy(r),{onFocusableItemAdd:p,onFocusableItemRemove:y}=l;return R.useEffect(()=>{if(n)return p(),()=>y()},[n,p,y]),w.jsx(Qf.ItemSlot,{scope:r,id:c,focusable:n,active:i,children:w.jsx(Xt.span,{tabIndex:u?0:-1,"data-orientation":l.orientation,...s,ref:t,onMouseDown:Qe(e.onMouseDown,x=>{n?l.onItemFocus(c):x.preventDefault()}),onFocus:Qe(e.onFocus,()=>l.onItemFocus(c)),onKeyDown:Qe(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){l.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const b=sM(x,l.orientation,l.dir);if(b!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let O=d().filter(P=>P.focusable).map(P=>P.ref.current);if(b==="last")O.reverse();else if(b==="prev"||b==="next"){b==="prev"&&O.reverse();const P=O.indexOf(x.currentTarget);O=l.loop?aM(O,P+1):O.slice(P+1)}setTimeout(()=>Sy(O))}})})})});xy.displayName=wy;var iM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function oM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function sM(e,t,r){const n=oM(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return iM[n]}function Sy(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function aM(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var cM=yy,lM=xy;function uM(e,[t,r]){return Math.min(r,Math.max(t,e))}var qu=0;function fM(){R.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Op()),document.body.insertAdjacentElement("beforeend",e[1]??Op()),qu++,()=>{qu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),qu--}},[])}function Op(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Hu="focusScope.autoFocusOnMount",Wu="focusScope.autoFocusOnUnmount",Rp={bubbles:!1,cancelable:!0},dM="FocusScope",_y=R.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,c]=R.useState(null),l=br(i),u=br(o),d=R.useRef(null),p=ir(t,b=>c(b)),y=R.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;R.useEffect(()=>{if(n){let b=function(k){if(y.paused||!a)return;const F=k.target;a.contains(F)?d.current=F:Ui(d.current,{select:!0})},M=function(k){if(y.paused||!a)return;const F=k.relatedTarget;F!==null&&(a.contains(F)||Ui(d.current,{select:!0}))},O=function(k){if(document.activeElement===document.body)for(const B of k)B.removedNodes.length>0&&Ui(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",M);const P=new MutationObserver(O);return a&&P.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",M),P.disconnect()}}},[n,a,y.paused]),R.useEffect(()=>{if(a){Np.add(y);const b=document.activeElement;if(!a.contains(b)){const O=new CustomEvent(Hu,Rp);a.addEventListener(Hu,l),a.dispatchEvent(O),O.defaultPrevented||(hM(bM(Ey(a)),{select:!0}),document.activeElement===b&&Ui(a))}return()=>{a.removeEventListener(Hu,l),setTimeout(()=>{const O=new CustomEvent(Wu,Rp);a.addEventListener(Wu,u),a.dispatchEvent(O),O.defaultPrevented||Ui(b??document.body,{select:!0}),a.removeEventListener(Wu,u),Np.remove(y)},0)}}},[a,l,u,y]);const x=R.useCallback(b=>{if(!r&&!n||y.paused)return;const M=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,O=document.activeElement;if(M&&O){const P=b.currentTarget,[k,F]=pM(P);k&&F?!b.shiftKey&&O===F?(b.preventDefault(),r&&Ui(k,{select:!0})):b.shiftKey&&O===k&&(b.preventDefault(),r&&Ui(F,{select:!0})):O===P&&b.preventDefault()}},[r,n,y.paused]);return w.jsx(Xt.div,{tabIndex:-1,...s,ref:p,onKeyDown:x})});_y.displayName=dM;function hM(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ui(n,{select:t}),document.activeElement!==r)return}function pM(e){const t=Ey(e),r=Pp(t,e),n=Pp(t.reverse(),e);return[r,n]}function Ey(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Pp(e,t){for(const r of e)if(!mM(r,{upTo:t}))return r}function mM(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gM(e){return e instanceof HTMLInputElement&&"select"in e}function Ui(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&gM(e)&&t&&e.select()}}var Np=vM();function vM(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=kp(e,t),e.unshift(t)},remove(t){var r;e=kp(e,t),(r=e[0])==null||r.resume()}}}function kp(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function bM(e){return e.filter(t=>t.tagName!=="A")}var yM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Yo=new WeakMap,ec=new WeakMap,tc={},Gu=0,Cy=function(e){return e&&(e.host||Cy(e.parentNode))},wM=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Cy(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},xM=function(e,t,r,n){var i=wM(t,Array.isArray(e)?e:[e]);tc[r]||(tc[r]=new WeakMap);var o=tc[r],s=[],a=new Set,c=new Set(i),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};i.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))u(p);else try{var y=p.getAttribute(n),x=y!==null&&y!=="false",b=(Yo.get(p)||0)+1,M=(o.get(p)||0)+1;Yo.set(p,b),o.set(p,M),s.push(p),b===1&&x&&ec.set(p,!0),M===1&&p.setAttribute(r,"true"),x||p.setAttribute(n,"true")}catch(O){console.error("aria-hidden: cannot operate on ",p,O)}})};return u(t),a.clear(),Gu++,function(){s.forEach(function(d){var p=Yo.get(d)-1,y=o.get(d)-1;Yo.set(d,p),o.set(d,y),p||(ec.has(d)||d.removeAttribute(n),ec.delete(d)),y||d.removeAttribute(r)}),Gu--,Gu||(Yo=new WeakMap,Yo=new WeakMap,ec=new WeakMap,tc={})}},SM=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=t||yM(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),xM(n,i,r,"aria-hidden")):function(){return null}},Gn=function(){return Gn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Gn.apply(this,arguments)};function Ty(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function _M(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var wc="right-scroll-bar-position",xc="width-before-scroll-bar",EM="with-scroll-bars-hidden",CM="--removed-body-scroll-bar-size";function Ku(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function TM(e,t){var r=ie.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=t,r.facade}var AM=typeof window<"u"?R.useLayoutEffect:R.useEffect,jp=new WeakMap;function MM(e,t){var r=TM(t||null,function(n){return e.forEach(function(i){return Ku(i,n)})});return AM(function(){var n=jp.get(r);if(n){var i=new Set(n),o=new Set(e),s=r.current;i.forEach(function(a){o.has(a)||Ku(a,null)}),o.forEach(function(a){i.has(a)||Ku(a,s)})}jp.set(r,e)},[e]),r}function IM(e){return e}function OM(e,t){t===void 0&&(t=IM);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var s=t(o,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(n=!0;r.length;){var s=r;r=[],s.forEach(o)}r={push:function(a){return o(a)},filter:function(){return r}}},assignMedium:function(o){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(o),s=r}var c=function(){var u=s;s=[],u.forEach(o)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){s.push(u),l()},filter:function(u){return s=s.filter(u),r}}}};return i}function RM(e){e===void 0&&(e={});var t=OM(null);return t.options=Gn({async:!0,ssr:!1},e),t}var Ay=function(e){var t=e.sideCar,r=Ty(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return R.createElement(n,Gn({},r))};Ay.isSideCarExport=!0;function PM(e,t){return e.useMedium(t),Ay}var My=RM(),Yu=function(){},Hl=R.forwardRef(function(e,t){var r=R.useRef(null),n=R.useState({onScrollCapture:Yu,onWheelCapture:Yu,onTouchMoveCapture:Yu}),i=n[0],o=n[1],s=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,y=e.noIsolation,x=e.inert,b=e.allowPinchZoom,M=e.as,O=M===void 0?"div":M,P=e.gapMode,k=Ty(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),F=p,B=MM([r,t]),W=Gn(Gn({},k),i);return R.createElement(R.Fragment,null,u&&R.createElement(F,{sideCar:My,removeScrollBar:l,shards:d,noIsolation:y,inert:x,setCallbacks:o,allowPinchZoom:!!b,lockRef:r,gapMode:P}),s?R.cloneElement(R.Children.only(a),Gn(Gn({},W),{ref:B})):R.createElement(O,Gn({},W,{className:c,ref:B}),a))});Hl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hl.classNames={fullWidth:xc,zeroRight:wc};var Dp,NM=function(){if(Dp)return Dp;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function kM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=NM();return t&&e.setAttribute("nonce",t),e}function jM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function DM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var LM=function(){var e=0,t=null;return{add:function(r){e==0&&(t=kM())&&(jM(t,r),DM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},BM=function(){var e=LM();return function(t,r){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Iy=function(){var e=BM(),t=function(r){var n=r.styles,i=r.dynamic;return e(n,i),null};return t},UM={left:0,top:0,right:0,gap:0},Xu=function(e){return parseInt(e||"",10)||0},FM=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Xu(r),Xu(n),Xu(i)]},$M=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return UM;var t=FM(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},VM=Iy(),fs="data-scroll-locked",zM=function(e,t,r,n){var i=e.left,o=e.top,s=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
54
|
+
.`.concat(EM,` {
|
|
55
55
|
overflow: hidden `).concat(n,`;
|
|
56
56
|
padding-right: `).concat(a,"px ").concat(n,`;
|
|
57
57
|
}
|
|
@@ -85,12 +85,12 @@ body { background-color: var(--color-page-background); }
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
body[`).concat(fs,`] {
|
|
88
|
-
`).concat(
|
|
88
|
+
`).concat(CM,": ").concat(a,`px;
|
|
89
89
|
}
|
|
90
|
-
`)},
|
|
90
|
+
`)},Lp=function(){var e=parseInt(document.body.getAttribute(fs)||"0",10);return isFinite(e)?e:0},qM=function(){R.useEffect(function(){return document.body.setAttribute(fs,(Lp()+1).toString()),function(){var e=Lp()-1;e<=0?document.body.removeAttribute(fs):document.body.setAttribute(fs,e.toString())}},[])},HM=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;qM();var o=R.useMemo(function(){return $M(i)},[i]);return R.createElement(VM,{styles:zM(o,!t,i,r?"":"!important")})},ed=!1;if(typeof window<"u")try{var rc=Object.defineProperty({},"passive",{get:function(){return ed=!0,!0}});window.addEventListener("test",rc,rc),window.removeEventListener("test",rc,rc)}catch{ed=!1}var Xo=ed?{passive:!1}:!1,WM=function(e){return e.tagName==="TEXTAREA"},Oy=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!WM(e)&&r[t]==="visible")},GM=function(e){return Oy(e,"overflowY")},KM=function(e){return Oy(e,"overflowX")},Bp=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=Ry(e,n);if(i){var o=Py(e,n),s=o[1],a=o[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},YM=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},XM=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Ry=function(e,t){return e==="v"?GM(t):KM(t)},Py=function(e,t){return e==="v"?YM(t):XM(t)},JM=function(e,t){return e==="h"&&t==="rtl"?-1:1},ZM=function(e,t,r,n,i){var o=JM(e,window.getComputedStyle(t).direction),s=o*n,a=r.target,c=t.contains(a),l=!1,u=s>0,d=0,p=0;do{var y=Py(e,a),x=y[0],b=y[1],M=y[2],O=b-M-o*x;(x||O)&&Ry(e,a)&&(d+=O,p+=x),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&(i&&Math.abs(d)<1||!i&&s>d)||!u&&(i&&Math.abs(p)<1||!i&&-s>p))&&(l=!0),l},nc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Up=function(e){return[e.deltaX,e.deltaY]},Fp=function(e){return e&&"current"in e?e.current:e},QM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},eI=function(e){return`
|
|
91
91
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
92
92
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
93
|
-
`)},YM=0,Jo=[];function XM(e){var t=O.useRef([]),r=O.useRef([0,0]),n=O.useRef(),i=O.useState(YM++)[0],o=O.useState(Ay)[0],s=O.useRef(e);O.useEffect(function(){s.current=e},[e]),O.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=vM([e.lockRef.current],(e.shards||[]).map(Bp),!0).filter(Boolean);return b.forEach(function(M){return M.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(M){return M.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=O.useCallback(function(b,M){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var R=nc(b),P=r.current,k="deltaX"in b?b.deltaX:P[0]-R[0],F="deltaY"in b?b.deltaY:P[1]-R[1],B,W=b.target,z=Math.abs(k)>Math.abs(F)?"h":"v";if("touches"in b&&z==="h"&&W.type==="range")return!1;var G=Dp(z,W);if(!G)return!0;if(G?B=z:(B=z==="v"?"h":"v",G=Dp(z,W)),!G)return!1;if(!n.current&&"changedTouches"in b&&(k||F)&&(n.current=B),!B)return!0;var re=n.current||B;return WM(re,M,b,re==="h"?k:F,!0)},[]),c=O.useCallback(function(b){var M=b;if(!(!Jo.length||Jo[Jo.length-1]!==o)){var R="deltaY"in M?Lp(M):nc(M),P=t.current.filter(function(B){return B.name===M.type&&(B.target===M.target||M.target===B.shadowParent)&&GM(B.delta,R)})[0];if(P&&P.should){M.cancelable&&M.preventDefault();return}if(!P){var k=(s.current.shards||[]).map(Bp).filter(Boolean).filter(function(B){return B.contains(M.target)}),F=k.length>0?a(M,k[0]):!s.current.noIsolation;F&&M.cancelable&&M.preventDefault()}}},[]),l=O.useCallback(function(b,M,R,P){var k={name:b,delta:M,target:R,should:P,shadowParent:JM(R)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(F){return F!==k})},1)},[]),u=O.useCallback(function(b){r.current=nc(b),n.current=void 0},[]),d=O.useCallback(function(b){l(b.type,Lp(b),b.target,a(b,e.lockRef.current))},[]),p=O.useCallback(function(b){l(b.type,nc(b),b.target,a(b,e.lockRef.current))},[]);O.useEffect(function(){return Jo.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Xo),document.addEventListener("touchmove",c,Xo),document.addEventListener("touchstart",u,Xo),function(){Jo=Jo.filter(function(b){return b!==o}),document.removeEventListener("wheel",c,Xo),document.removeEventListener("touchmove",c,Xo),document.removeEventListener("touchstart",u,Xo)}},[]);var y=e.removeScrollBar,x=e.inert;return O.createElement(O.Fragment,null,x?O.createElement(o,{styles:KM(i)}):null,y?O.createElement(UM,{gapMode:e.gapMode}):null)}function JM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ZM=TM(Ty,XM);var Oy=O.forwardRef(function(e,t){return O.createElement(Hl,Gn({},e,{ref:t,sideCar:ZM}))});Oy.classNames=Hl.classNames;const QM=Oy;function eI(e,t){return O.useReducer((r,n)=>t[r][n]??r,e)}var E0="ScrollArea",[Py,YB]=Pi(E0),[tI,vn]=Py(E0),Ny=O.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,c]=O.useState(null),[l,u]=O.useState(null),[d,p]=O.useState(null),[y,x]=O.useState(null),[b,M]=O.useState(null),[R,P]=O.useState(0),[k,F]=O.useState(0),[B,W]=O.useState(!1),[z,G]=O.useState(!1),re=nr(t,se=>c(se)),oe=w0(i);return w.jsx(tI,{scope:r,type:n,dir:oe,scrollHideDelay:o,scrollArea:a,viewport:l,onViewportChange:u,content:d,onContentChange:p,scrollbarX:y,onScrollbarXChange:x,scrollbarXEnabled:B,onScrollbarXEnabledChange:W,scrollbarY:b,onScrollbarYChange:M,scrollbarYEnabled:z,onScrollbarYEnabledChange:G,onCornerWidthChange:P,onCornerHeightChange:F,children:w.jsx(Xt.div,{dir:oe,...s,ref:re,style:{position:"relative","--radix-scroll-area-corner-width":R+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});Ny.displayName=E0;var ky="ScrollAreaViewport",jy=O.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:i,...o}=e,s=vn(ky,r),a=O.useRef(null),c=nr(t,a,s.onViewportChange);return w.jsxs(w.Fragment,{children:[w.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),w.jsx(Xt.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:w.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});jy.displayName=ky;var ri="ScrollAreaScrollbar",Dy=O.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=vn(ri,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return O.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?w.jsx(rI,{...n,ref:t,forceMount:r}):i.type==="scroll"?w.jsx(nI,{...n,ref:t,forceMount:r}):i.type==="auto"?w.jsx(Ly,{...n,ref:t,forceMount:r}):i.type==="always"?w.jsx(C0,{...n,ref:t}):null});Dy.displayName=ri;var rI=O.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=vn(ri,e.__scopeScrollArea),[o,s]=O.useState(!1);return O.useEffect(()=>{const a=i.scrollArea;let c=0;if(a){const l=()=>{window.clearTimeout(c),s(!0)},u=()=>{c=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",l),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",l),a.removeEventListener("pointerleave",u)}}},[i.scrollArea,i.scrollHideDelay]),w.jsx(Ln,{present:r||o,children:w.jsx(Ly,{"data-state":o?"visible":"hidden",...n,ref:t})})}),nI=O.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=vn(ri,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Gl(()=>c("SCROLL_END"),100),[a,c]=eI("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return O.useEffect(()=>{if(a==="idle"){const l=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[a,i.scrollHideDelay,c]),O.useEffect(()=>{const l=i.viewport,u=o?"scrollLeft":"scrollTop";if(l){let d=l[u];const p=()=>{const y=l[u];d!==y&&(c("SCROLL"),s()),d=y};return l.addEventListener("scroll",p),()=>l.removeEventListener("scroll",p)}},[i.viewport,o,c,s]),w.jsx(Ln,{present:r||a!=="hidden",children:w.jsx(C0,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Qe(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Qe(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Ly=O.forwardRef((e,t)=>{const r=vn(ri,e.__scopeScrollArea),{forceMount:n,...i}=e,[o,s]=O.useState(!1),a=e.orientation==="horizontal",c=Gl(()=>{if(r.viewport){const l=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;s(a?l:u)}},10);return xs(r.viewport,c),xs(r.content,c),w.jsx(Ln,{present:n||o,children:w.jsx(C0,{"data-state":o?"visible":"hidden",...i,ref:t})})}),C0=O.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,i=vn(ri,e.__scopeScrollArea),o=O.useRef(null),s=O.useRef(0),[a,c]=O.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Vy(a.viewport,a.content),u={...n,sizes:a,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function d(p,y){return lI(p,s.current,a,y)}return r==="horizontal"?w.jsx(iI,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollLeft,y=Up(p,a,i.dir);o.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=d(p,i.dir))}}):r==="vertical"?w.jsx(oI,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollTop,y=Up(p,a);o.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=d(p))}}):null}),iI=O.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,o=vn(ri,e.__scopeScrollArea),[s,a]=O.useState(),c=O.useRef(null),l=nr(t,c,o.onScrollbarXChange);return O.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.jsx(Uy,{"data-orientation":"horizontal",...i,ref:l,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Wl(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(o.viewport){const p=o.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),qy(p,d)&&u.preventDefault()}},onResize:()=>{c.current&&o.viewport&&s&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Zc(s.paddingLeft),paddingEnd:Zc(s.paddingRight)}})}})}),oI=O.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,o=vn(ri,e.__scopeScrollArea),[s,a]=O.useState(),c=O.useRef(null),l=nr(t,c,o.onScrollbarYChange);return O.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.jsx(Uy,{"data-orientation":"vertical",...i,ref:l,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Wl(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(o.viewport){const p=o.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),qy(p,d)&&u.preventDefault()}},onResize:()=>{c.current&&o.viewport&&s&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Zc(s.paddingTop),paddingEnd:Zc(s.paddingBottom)}})}})}),[sI,By]=Py(ri),Uy=O.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...p}=e,y=vn(ri,r),[x,b]=O.useState(null),M=nr(t,re=>b(re)),R=O.useRef(null),P=O.useRef(""),k=y.viewport,F=n.content-n.viewport,B=br(u),W=br(c),z=Gl(d,10);function G(re){if(R.current){const oe=re.clientX-R.current.left,se=re.clientY-R.current.top;l({x:oe,y:se})}}return O.useEffect(()=>{const re=oe=>{const se=oe.target;(x==null?void 0:x.contains(se))&&B(oe,F)};return document.addEventListener("wheel",re,{passive:!1}),()=>document.removeEventListener("wheel",re,{passive:!1})},[k,x,F,B]),O.useEffect(W,[n,W]),xs(x,z),xs(y.content,z),w.jsx(sI,{scope:r,scrollbar:x,hasThumb:i,onThumbChange:br(o),onThumbPointerUp:br(s),onThumbPositionChange:W,onThumbPointerDown:br(a),children:w.jsx(Xt.div,{...p,ref:M,style:{position:"absolute",...p.style},onPointerDown:Qe(e.onPointerDown,re=>{re.button===0&&(re.target.setPointerCapture(re.pointerId),R.current=x.getBoundingClientRect(),P.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),G(re))}),onPointerMove:Qe(e.onPointerMove,G),onPointerUp:Qe(e.onPointerUp,re=>{const oe=re.target;oe.hasPointerCapture(re.pointerId)&&oe.releasePointerCapture(re.pointerId),document.body.style.webkitUserSelect=P.current,y.viewport&&(y.viewport.style.scrollBehavior=""),R.current=null})})})}),Jc="ScrollAreaThumb",Fy=O.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=By(Jc,e.__scopeScrollArea);return w.jsx(Ln,{present:r||i.hasThumb,children:w.jsx(aI,{ref:t,...n})})}),aI=O.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...i}=e,o=vn(Jc,r),s=By(Jc,r),{onThumbPositionChange:a}=s,c=nr(t,d=>s.onThumbChange(d)),l=O.useRef(void 0),u=Gl(()=>{l.current&&(l.current(),l.current=void 0)},100);return O.useEffect(()=>{const d=o.viewport;if(d){const p=()=>{if(u(),!l.current){const y=uI(d,a);l.current=y,a()}};return a(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[o.viewport,u,a]),w.jsx(Xt.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Qe(e.onPointerDownCapture,d=>{const y=d.target.getBoundingClientRect(),x=d.clientX-y.left,b=d.clientY-y.top;s.onThumbPointerDown({x,y:b})}),onPointerUp:Qe(e.onPointerUp,s.onThumbPointerUp)})});Fy.displayName=Jc;var T0="ScrollAreaCorner",$y=O.forwardRef((e,t)=>{const r=vn(T0,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?w.jsx(cI,{...e,ref:t}):null});$y.displayName=T0;var cI=O.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,i=vn(T0,r),[o,s]=O.useState(0),[a,c]=O.useState(0),l=!!(o&&a);return xs(i.scrollbarX,()=>{var d;const u=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(u),c(u)}),xs(i.scrollbarY,()=>{var d;const u=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(u),s(u)}),l?w.jsx(Xt.div,{...n,ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Zc(e){return e?parseInt(e,10):0}function Vy(e,t){const r=e/t;return isNaN(r)?0:r}function Wl(e){const t=Vy(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function lI(e,t,r,n="ltr"){const i=Wl(r),o=i/2,s=t||o,a=i-s,c=r.scrollbar.paddingStart+s,l=r.scrollbar.size-r.scrollbar.paddingEnd-a,u=r.content-r.viewport,d=n==="ltr"?[0,u]:[u*-1,0];return zy([c,l],d)(e)}function Up(e,t,r="ltr"){const n=Wl(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-n,c=r==="ltr"?[0,s]:[s*-1,0],l=iM(e,c);return zy([0,s],[0,a])(l)}function zy(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function qy(e,t){return e>0&&e<t}var uI=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=r.left!==o.left,a=r.top!==o.top;(s||a)&&t(),r=o,n=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(n)};function Gl(e,t){const r=br(e),n=O.useRef(0);return O.useEffect(()=>()=>window.clearTimeout(n.current),[]),O.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function xs(e,t){const r=br(t);Zi(()=>{let n=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return i.observe(e),()=>{window.cancelAnimationFrame(n),i.unobserve(e)}}},[e,r])}var fI=Ny,dI=jy,Fp=Dy,$p=Fy,hI=$y,A0="Switch",[pI,XB]=Pi(A0),[mI,gI]=pI(A0),Hy=O.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:o,required:s,disabled:a,value:c="on",onCheckedChange:l,form:u,...d}=e,[p,y]=O.useState(null),x=nr(t,k=>y(k)),b=O.useRef(!1),M=p?u||!!p.closest("form"):!0,[R=!1,P]=Da({prop:i,defaultProp:o,onChange:l});return w.jsxs(mI,{scope:r,checked:R,disabled:a,children:[w.jsx(Xt.button,{type:"button",role:"switch","aria-checked":R,"aria-required":s,"data-state":Ky(R),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:x,onClick:Qe(e.onClick,k=>{P(F=>!F),M&&(b.current=k.isPropagationStopped(),b.current||k.stopPropagation())})}),M&&w.jsx(vI,{control:p,bubbles:!b.current,name:n,value:c,checked:R,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});Hy.displayName=A0;var Wy="SwitchThumb",Gy=O.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,i=gI(Wy,r);return w.jsx(Xt.span,{"data-state":Ky(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:t})});Gy.displayName=Wy;var vI=e=>{const{control:t,checked:r,bubbles:n=!0,...i}=e,o=O.useRef(null),s=cy(r),a=g0(t);return O.useEffect(()=>{const c=o.current,l=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(l,"checked").set;if(s!==r&&d){const p=new Event("click",{bubbles:n});d.call(c,r),c.dispatchEvent(p)}},[s,r,n]),w.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Ky(e){return e?"checked":"unchecked"}var bI=Hy,yI=Gy;const wI=["1","2","3"],xI=["classic","surface","soft"],Hs={size:{type:"enum",values:wI,default:"2",responsive:!0},variant:{type:"enum",values:xI,default:"surface"},color:La,highContrast:$l,radius:S0},Yy=O.forwardRef((e,t)=>{const{rest:r,...n}=Os(e),{className:i,style:o,size:s=Hs.size.default,variant:a=Hs.variant.default,color:c=Hs.color.default,highContrast:l=Hs.highContrast.default,radius:u=Hs.radius.default,...d}=r;return O.createElement("span",{"data-radius":u,className:er("rt-SwitchRoot",i,St(s,"rt-r-size"),`rt-variant-${a}`,{"rt-high-contrast":l},Ps(n)),style:o},O.createElement(bI,{"data-accent-color":c,...d,ref:t,className:er("rt-reset","rt-SwitchButton",{"rt-high-contrast":l})},O.createElement(yI,{className:er("rt-SwitchThumb",{"rt-high-contrast":l})})))});Yy.displayName="Switch";var td=["Enter"," "],SI=["ArrowDown","PageUp","Home"],Xy=["ArrowUp","PageDown","End"],_I=[...SI,...Xy],EI={ltr:[...td,"ArrowRight"],rtl:[...td,"ArrowLeft"]},CI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ba="Menu",[ba,TI,AI]=py(Ba),[$o,Jy]=Pi(Ba,[AI,Ll,gy]),Ua=Ll(),Zy=gy(),[Qy,oo]=$o(Ba),[MI,Fa]=$o(Ba),e2=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:o,modal:s=!0}=e,a=Ua(t),[c,l]=O.useState(null),u=O.useRef(!1),d=br(o),p=w0(i);return O.useEffect(()=>{const y=()=>{u.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>u.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),w.jsx(Wb,{...a,children:w.jsx(Qy,{scope:t,open:r,onOpenChange:d,content:c,onContentChange:l,children:w.jsx(MI,{scope:t,onClose:O.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:s,children:n})})})};e2.displayName=Ba;var II="MenuAnchor",M0=O.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=Ua(r);return w.jsx(Gb,{...i,...n,ref:t})});M0.displayName=II;var I0="MenuPortal",[RI,t2]=$o(I0,{forceMount:void 0}),r2=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,o=oo(I0,t);return w.jsx(RI,{scope:t,forceMount:r,children:w.jsx(Ln,{present:r||o.open,children:w.jsx(Xb,{asChild:!0,container:i,children:n})})})};r2.displayName=I0;var pn="MenuContent",[OI,R0]=$o(pn),n2=O.forwardRef((e,t)=>{const r=t2(pn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=oo(pn,e.__scopeMenu),s=Fa(pn,e.__scopeMenu);return w.jsx(ba.Provider,{scope:e.__scopeMenu,children:w.jsx(Ln,{present:n||o.open,children:w.jsx(ba.Slot,{scope:e.__scopeMenu,children:s.modal?w.jsx(PI,{...i,ref:t}):w.jsx(NI,{...i,ref:t})})})})}),PI=O.forwardRef((e,t)=>{const r=oo(pn,e.__scopeMenu),n=O.useRef(null),i=nr(t,n);return O.useEffect(()=>{const o=n.current;if(o)return gM(o)},[]),w.jsx(O0,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Qe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),NI=O.forwardRef((e,t)=>{const r=oo(pn,e.__scopeMenu);return w.jsx(O0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),O0=O.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:y,disableOutsideScroll:x,...b}=e,M=oo(pn,r),R=Fa(pn,r),P=Ua(r),k=Zy(r),F=TI(r),[B,W]=O.useState(null),z=O.useRef(null),G=nr(t,z,M.onContentChange),re=O.useRef(0),oe=O.useRef(""),se=O.useRef(0),q=O.useRef(null),L=O.useRef("right"),h=O.useRef(0),f=x?QM:O.Fragment,m=x?{as:Ai,allowPinchZoom:!0}:void 0,S=E=>{var ce,be;const I=oe.current+E,C=F().filter(xe=>!xe.disabled),g=document.activeElement,v=(ce=C.find(xe=>xe.ref.current===g))==null?void 0:ce.textValue,j=C.map(xe=>xe.textValue),Q=HI(j,I,v),Z=(be=C.find(xe=>xe.textValue===Q))==null?void 0:be.ref.current;(function xe(pe){oe.current=pe,window.clearTimeout(re.current),pe!==""&&(re.current=window.setTimeout(()=>xe(""),1e3))})(I),Z&&setTimeout(()=>Z.focus())};O.useEffect(()=>()=>window.clearTimeout(re.current),[]),oM();const T=O.useCallback(E=>{var C,g;return L.current===((C=q.current)==null?void 0:C.side)&&GI(E,(g=q.current)==null?void 0:g.area)},[]);return w.jsx(OI,{scope:r,searchRef:oe,onItemEnter:O.useCallback(E=>{T(E)&&E.preventDefault()},[T]),onItemLeave:O.useCallback(E=>{var I;T(E)||((I=z.current)==null||I.focus(),W(null))},[T]),onTriggerLeave:O.useCallback(E=>{T(E)&&E.preventDefault()},[T]),pointerGraceTimerRef:se,onPointerGraceIntentChange:O.useCallback(E=>{q.current=E},[]),children:w.jsx(f,{...m,children:w.jsx(xy,{asChild:!0,trapped:i,onMountAutoFocus:Qe(o,E=>{var I;E.preventDefault(),(I=z.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:w.jsx(c0,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:y,children:w.jsx(rM,{asChild:!0,...k,dir:R.dir,orientation:"vertical",loop:n,currentTabStopId:B,onCurrentTabStopIdChange:W,onEntryFocus:Qe(c,E=>{R.isUsingKeyboardRef.current||E.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(Kb,{role:"menu","aria-orientation":"vertical","data-state":w2(M.open),"data-radix-menu-content":"",dir:R.dir,...P,...b,ref:G,style:{outline:"none",...b.style},onKeyDown:Qe(b.onKeyDown,E=>{const C=E.target.closest("[data-radix-menu-content]")===E.currentTarget,g=E.ctrlKey||E.altKey||E.metaKey,v=E.key.length===1;C&&(E.key==="Tab"&&E.preventDefault(),!g&&v&&S(E.key));const j=z.current;if(E.target!==j||!_I.includes(E.key))return;E.preventDefault();const Z=F().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);Xy.includes(E.key)&&Z.reverse(),zI(Z)}),onBlur:Qe(e.onBlur,E=>{E.currentTarget.contains(E.target)||(window.clearTimeout(re.current),oe.current="")}),onPointerMove:Qe(e.onPointerMove,ya(E=>{const I=E.target,C=h.current!==E.clientX;if(E.currentTarget.contains(I)&&C){const g=E.clientX>h.current?"right":"left";L.current=g,h.current=E.clientX}}))})})})})})})});n2.displayName=pn;var kI="MenuGroup",P0=O.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Xt.div,{role:"group",...n,ref:t})});P0.displayName=kI;var jI="MenuLabel",i2=O.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Xt.div,{...n,ref:t})});i2.displayName=jI;var Qc="MenuItem",Vp="menu.itemSelect",Kl=O.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,o=O.useRef(null),s=Fa(Qc,e.__scopeMenu),a=R0(Qc,e.__scopeMenu),c=nr(t,o),l=O.useRef(!1),u=()=>{const d=o.current;if(!r&&d){const p=new CustomEvent(Vp,{bubbles:!0,cancelable:!0});d.addEventListener(Vp,y=>n==null?void 0:n(y),{once:!0}),_b(d,p),p.defaultPrevented?l.current=!1:s.onClose()}};return w.jsx(o2,{...i,ref:c,disabled:r,onClick:Qe(e.onClick,u),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),l.current=!0},onPointerUp:Qe(e.onPointerUp,d=>{var p;l.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:Qe(e.onKeyDown,d=>{const p=a.searchRef.current!=="";r||p&&d.key===" "||td.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Kl.displayName=Qc;var o2=O.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=e,s=R0(Qc,r),a=Zy(r),c=O.useRef(null),l=nr(t,c),[u,d]=O.useState(!1),[p,y]=O.useState("");return O.useEffect(()=>{const x=c.current;x&&y((x.textContent??"").trim())},[o.children]),w.jsx(ba.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:w.jsx(nM,{asChild:!0,...a,focusable:!n,children:w.jsx(Xt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:l,onPointerMove:Qe(e.onPointerMove,ya(x=>{n?s.onItemLeave(x):(s.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Qe(e.onPointerLeave,ya(x=>s.onItemLeave(x))),onFocus:Qe(e.onFocus,()=>d(!0)),onBlur:Qe(e.onBlur,()=>d(!1))})})})}),DI="MenuCheckboxItem",s2=O.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...i}=e;return w.jsx(f2,{scope:e.__scopeMenu,checked:r,children:w.jsx(Kl,{role:"menuitemcheckbox","aria-checked":el(r)?"mixed":r,...i,ref:t,"data-state":j0(r),onSelect:Qe(i.onSelect,()=>n==null?void 0:n(el(r)?!0:!r),{checkForDefaultPrevented:!1})})})});s2.displayName=DI;var a2="MenuRadioGroup",[LI,BI]=$o(a2,{value:void 0,onValueChange:()=>{}}),c2=O.forwardRef((e,t)=>{const{value:r,onValueChange:n,...i}=e,o=br(n);return w.jsx(LI,{scope:e.__scopeMenu,value:r,onValueChange:o,children:w.jsx(P0,{...i,ref:t})})});c2.displayName=a2;var l2="MenuRadioItem",u2=O.forwardRef((e,t)=>{const{value:r,...n}=e,i=BI(l2,e.__scopeMenu),o=r===i.value;return w.jsx(f2,{scope:e.__scopeMenu,checked:o,children:w.jsx(Kl,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":j0(o),onSelect:Qe(n.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,r)},{checkForDefaultPrevented:!1})})})});u2.displayName=l2;var N0="MenuItemIndicator",[f2,UI]=$o(N0,{checked:!1}),d2=O.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...i}=e,o=UI(N0,r);return w.jsx(Ln,{present:n||el(o.checked)||o.checked===!0,children:w.jsx(Xt.span,{...i,ref:t,"data-state":j0(o.checked)})})});d2.displayName=N0;var FI="MenuSeparator",h2=O.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Xt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});h2.displayName=FI;var $I="MenuArrow",p2=O.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=Ua(r);return w.jsx(Yb,{...i,...n,ref:t})});p2.displayName=$I;var k0="MenuSub",[VI,m2]=$o(k0),g2=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:i}=e,o=oo(k0,t),s=Ua(t),[a,c]=O.useState(null),[l,u]=O.useState(null),d=br(i);return O.useEffect(()=>(o.open===!1&&d(!1),()=>d(!1)),[o.open,d]),w.jsx(Wb,{...s,children:w.jsx(Qy,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:w.jsx(VI,{scope:t,contentId:ma(),triggerId:ma(),trigger:a,onTriggerChange:c,children:r})})})};g2.displayName=k0;var Qs="MenuSubTrigger",v2=O.forwardRef((e,t)=>{const r=oo(Qs,e.__scopeMenu),n=Fa(Qs,e.__scopeMenu),i=m2(Qs,e.__scopeMenu),o=R0(Qs,e.__scopeMenu),s=O.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=o,l={__scopeMenu:e.__scopeMenu},u=O.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return O.useEffect(()=>u,[u]),O.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),w.jsx(M0,{asChild:!0,...l,children:w.jsx(o2,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":w2(r.open),...e,ref:Nl(t,i.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Qe(e.onPointerMove,ya(d=>{o.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:Qe(e.onPointerLeave,ya(d=>{var y,x;u();const p=(y=r.content)==null?void 0:y.getBoundingClientRect();if(p){const b=(x=r.content)==null?void 0:x.dataset.side,M=b==="right",R=M?-5:5,P=p[M?"left":"right"],k=p[M?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+R,y:d.clientY},{x:P,y:p.top},{x:k,y:p.top},{x:k,y:p.bottom},{x:P,y:p.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Qe(e.onKeyDown,d=>{var y;const p=o.searchRef.current!=="";e.disabled||p&&d.key===" "||EI[n.dir].includes(d.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),d.preventDefault())})})})});v2.displayName=Qs;var b2="MenuSubContent",y2=O.forwardRef((e,t)=>{const r=t2(pn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=oo(pn,e.__scopeMenu),s=Fa(pn,e.__scopeMenu),a=m2(b2,e.__scopeMenu),c=O.useRef(null),l=nr(t,c);return w.jsx(ba.Provider,{scope:e.__scopeMenu,children:w.jsx(Ln,{present:n||o.open,children:w.jsx(ba.Slot,{scope:e.__scopeMenu,children:w.jsx(O0,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Qe(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Qe(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Qe(e.onKeyDown,u=>{var y;const d=u.currentTarget.contains(u.target),p=CI[s.dir].includes(u.key);d&&p&&(o.onOpenChange(!1),(y=a.trigger)==null||y.focus(),u.preventDefault())})})})})})});y2.displayName=b2;function w2(e){return e?"open":"closed"}function el(e){return e==="indeterminate"}function j0(e){return el(e)?"indeterminate":e?"checked":"unchecked"}function zI(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function qI(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function HI(e,t,r){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let s=qI(e,Math.max(o,0));i.length===1&&(s=s.filter(l=>l!==r));const c=s.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function WI(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,c=t[o].y,l=t[s].x,u=t[s].y;c>n!=u>n&&r<(l-a)*(n-c)/(u-c)+a&&(i=!i)}return i}function GI(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return WI(r,t)}function ya(e){return t=>t.pointerType==="mouse"?e(t):void 0}var KI=e2,YI=M0,XI=r2,JI=n2,ZI=P0,QI=i2,eR=Kl,tR=s2,rR=c2,nR=u2,iR=d2,oR=h2,sR=p2,aR=g2,cR=v2,lR=y2,D0="DropdownMenu",[uR,JB]=Pi(D0,[Jy]),Dr=Jy(),[fR,x2]=uR(D0),S2=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,c=Dr(t),l=O.useRef(null),[u=!1,d]=Da({prop:i,defaultProp:o,onChange:s});return w.jsx(fR,{scope:t,triggerId:ma(),triggerRef:l,contentId:ma(),open:u,onOpenChange:d,onOpenToggle:O.useCallback(()=>d(p=>!p),[d]),modal:a,children:w.jsx(KI,{...c,open:u,onOpenChange:d,dir:n,modal:a,children:r})})};S2.displayName=D0;var _2="DropdownMenuTrigger",E2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,o=x2(_2,r),s=Dr(r);return w.jsx(YI,{asChild:!0,...s,children:w.jsx(Xt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:Nl(t,o.triggerRef),onPointerDown:Qe(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Qe(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});E2.displayName=_2;var dR="DropdownMenuPortal",C2=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Dr(t);return w.jsx(XI,{...n,...r})};C2.displayName=dR;var T2="DropdownMenuContent",A2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=x2(T2,r),o=Dr(r),s=O.useRef(!1);return w.jsx(JI,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...n,ref:t,onCloseAutoFocus:Qe(e.onCloseAutoFocus,a=>{var c;s.current||(c=i.triggerRef.current)==null||c.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Qe(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!i.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});A2.displayName=T2;var hR="DropdownMenuGroup",M2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Dr(r);return w.jsx(ZI,{...i,...n,ref:t})});M2.displayName=hR;var pR="DropdownMenuLabel",I2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Dr(r);return w.jsx(QI,{...i,...n,ref:t})});I2.displayName=pR;var mR="DropdownMenuItem",R2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Dr(r);return w.jsx(eR,{...i,...n,ref:t})});R2.displayName=mR;var gR="DropdownMenuCheckboxItem",O2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Dr(r);return w.jsx(tR,{...i,...n,ref:t})});O2.displayName=gR;var vR="DropdownMenuRadioGroup",P2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Dr(r);return w.jsx(rR,{...i,...n,ref:t})});P2.displayName=vR;var bR="DropdownMenuRadioItem",N2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Dr(r);return w.jsx(nR,{...i,...n,ref:t})});N2.displayName=bR;var yR="DropdownMenuItemIndicator",k2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Dr(r);return w.jsx(iR,{...i,...n,ref:t})});k2.displayName=yR;var wR="DropdownMenuSeparator",j2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Dr(r);return w.jsx(oR,{...i,...n,ref:t})});j2.displayName=wR;var xR="DropdownMenuArrow",SR=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Dr(r);return w.jsx(sR,{...i,...n,ref:t})});SR.displayName=xR;var _R=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:i,defaultOpen:o}=e,s=Dr(t),[a=!1,c]=Da({prop:n,defaultProp:o,onChange:i});return w.jsx(aR,{...s,open:a,onOpenChange:c,children:r})},ER="DropdownMenuSubTrigger",D2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Dr(r);return w.jsx(cR,{...i,...n,ref:t})});D2.displayName=ER;var CR="DropdownMenuSubContent",L2=O.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Dr(r);return w.jsx(lR,{...i,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});L2.displayName=CR;var TR=S2,AR=E2,B2=C2,MR=A2,IR=M2,RR=I2,OR=R2,PR=O2,NR=P2,kR=N2,U2=k2,jR=j2,DR=_R,LR=D2,BR=L2;const UR=["1","2","3"],FR=["vertical","horizontal","both"],Ju={size:{type:"enum",values:UR,default:"1",responsive:!0},radius:S0,scrollbars:{type:"enum",values:FR,default:"both"}},L0=O.forwardRef((e,t)=>{const{rest:r,...n}=Os(e),{className:i,style:o,type:s,scrollHideDelay:a=s!=="scroll"?0:void 0,dir:c,size:l=Ju.size.default,radius:u=Ju.radius.default,scrollbars:d=Ju.scrollbars.default,...p}=r;return O.createElement(fI,{type:s,scrollHideDelay:a,className:er("rt-ScrollAreaRoot",i,Ps(n)),style:o},O.createElement(dI,{...p,ref:t,className:"rt-ScrollAreaViewport"}),O.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),d!=="vertical"?O.createElement(Fp,{"data-radius":u,orientation:"horizontal",className:er("rt-ScrollAreaScrollbar",St(l,"rt-r-size"))},O.createElement($p,{className:"rt-ScrollAreaThumb"})):null,d!=="horizontal"?O.createElement(Fp,{"data-radius":u,orientation:"vertical",className:er("rt-ScrollAreaScrollbar",St(l,"rt-r-size"))},O.createElement($p,{className:"rt-ScrollAreaThumb"})):null,d==="both"?O.createElement(hI,{className:"rt-ScrollAreaCorner"}):null)});L0.displayName="ScrollArea";const $R=["1","2"],VR=["solid","soft"],Zu={size:{type:"enum",values:$R,default:"2",responsive:!0},variant:{type:"enum",values:VR,default:"solid"},color:La,highContrast:$l},F2={color:La,shortcut:{type:"string",default:void 0}},$2=e=>O.createElement(TR,{...e});$2.displayName="DropdownMenuRoot";const V2=O.forwardRef((e,t)=>O.createElement(AR,{...e,ref:t,asChild:!0}));V2.displayName="DropdownMenuTrigger";const z2=O.createContext({}),q2=O.forwardRef((e,t)=>{const r=wA(),{className:n,children:i,size:o=Zu.size.default,variant:s=Zu.variant.default,highContrast:a=Zu.highContrast.default,color:c=F2.color.default,container:l,forceMount:u,...d}=e,p=c??r.accentColor;return O.createElement(B2,{container:l,forceMount:u},O.createElement(Fl,{asChild:!0},O.createElement(MR,{"data-accent-color":p,align:"start",sideOffset:4,collisionPadding:10,...d,ref:t,className:er("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",n,St(o,"rt-r-size"),`rt-variant-${s}`,{"rt-high-contrast":a})},O.createElement(L0,{type:"auto"},O.createElement("div",{className:er("rt-BaseMenuViewport","rt-DropdownMenuViewport")},O.createElement(z2.Provider,{value:O.useMemo(()=>({size:o,variant:s,color:p,highContrast:a}),[o,s,p,a])},i))))))});q2.displayName="DropdownMenuContent";const H2=O.forwardRef((e,t)=>O.createElement(RR,{...e,ref:t,className:er("rt-BaseMenuLabel","rt-DropdownMenuLabel",e.className)}));H2.displayName="DropdownMenuLabel";const W2=O.forwardRef((e,t)=>{const{className:r,children:n,color:i=F2.color.default,shortcut:o,...s}=e;return O.createElement(OR,{"data-accent-color":i,...s,ref:t,className:er("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",r)},O.createElement(Ms,null,n),o&&O.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},o))});W2.displayName="DropdownMenuItem";const G2=O.forwardRef((e,t)=>O.createElement(IR,{...e,ref:t,className:er("rt-BaseMenuGroup","rt-DropdownMenuGroup",e.className)}));G2.displayName="DropdownMenuGroup";const K2=O.forwardRef((e,t)=>O.createElement(NR,{...e,ref:t,className:er("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",e.className)}));K2.displayName="DropdownMenuRadioGroup";const Y2=O.forwardRef((e,t)=>{const{children:r,className:n,...i}=e;return O.createElement(kR,{...i,ref:t,className:er("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",n)},O.createElement(Ms,null,r),O.createElement(U2,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},O.createElement(Vl,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})))});Y2.displayName="DropdownMenuRadioItem";const X2=O.forwardRef((e,t)=>{const{children:r,className:n,shortcut:i,...o}=e;return O.createElement(PR,{...o,ref:t,className:er("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",n)},O.createElement(Ms,null,r),O.createElement(U2,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},O.createElement(Vl,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),i&&O.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},i))});X2.displayName="DropdownMenuCheckboxItem";const J2=e=>O.createElement(DR,{...e});J2.displayName="DropdownMenuSub";const Z2=O.forwardRef((e,t)=>{const{className:r,children:n,...i}=e;return O.createElement(LR,{...i,ref:t,className:er("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",r)},O.createElement(Ms,null,n),O.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},O.createElement(hy,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"})))});Z2.displayName="DropdownMenuSubTrigger";const Q2=O.forwardRef((e,t)=>{const{className:r,children:n,container:i,forceMount:o,...s}=e,{size:a,variant:c,color:l,highContrast:u}=O.useContext(z2);return O.createElement(B2,{container:i,forceMount:o},O.createElement(Fl,{asChild:!0},O.createElement(BR,{"data-accent-color":l,alignOffset:-Number(a)*4,sideOffset:1,collisionPadding:10,...s,ref:t,className:er("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",r,St(a,"rt-r-size"),`rt-variant-${c}`,{"rt-high-contrast":u})},O.createElement(L0,{type:"auto"},O.createElement("div",{className:er("rt-BaseMenuViewport","rt-DropdownMenuViewport")},n)))))});Q2.displayName="DropdownMenuSubContent";const ew=O.forwardRef((e,t)=>O.createElement(jR,{...e,ref:t,className:er("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",e.className)}));ew.displayName="DropdownMenuSeparator";const mn=Object.assign({},{Root:$2,Trigger:V2,Content:q2,Label:H2,Item:W2,Group:G2,RadioGroup:K2,RadioItem:Y2,CheckboxItem:X2,Sub:J2,SubTrigger:Z2,SubContent:Q2,Separator:ew}),zR=["1","2","3","4"],qR=["classic","solid","soft","surface","outline","ghost"],Ws={size:{type:"enum",values:zR,default:"2",responsive:!0},variant:{type:"enum",values:qR,default:"solid"},color:La,highContrast:$l,radius:S0},tw=O.forwardRef((e,t)=>{const{rest:r,...n}=Os(e),{className:i,asChild:o=!1,size:s=Ws.size.default,variant:a=Ws.variant.default,color:c=Ws.color.default,highContrast:l=Ws.highContrast.default,radius:u=Ws.radius.default,...d}=r,p=o?Ai:"button";return O.createElement(p,{"data-disabled":d.disabled||void 0,"data-accent-color":c,"data-radius":u,...d,ref:t,className:er("rt-reset","rt-BaseButton",i,St(s,"rt-r-size"),`rt-variant-${a}`,{"rt-high-contrast":l},Ps(n))})});tw.displayName="BaseButton";const rw=O.forwardRef((e,t)=>O.createElement(tw,{...e,ref:t,className:er("rt-Button",e.className)}));rw.displayName="Button";const HR={loading:{type:"boolean",default:!0}},Ns=O.forwardRef((e,t)=>{const{rest:r,...n}=Os(e),{className:i,children:o,loading:s=HR.loading.default,...a}=r;if(!s)return O.createElement(O.Fragment,null,o);const c=O.isValidElement(o)?Ai:"span";return O.createElement(c,{ref:t,"aria-hidden":!0,className:er("rt-Skeleton",i,Ps(n)),"data-inline-skeleton":O.isValidElement(o)?void 0:!0,tabIndex:-1,inert:"",...a},o)});Ns.displayName="Skeleton";const WR=Ot("/images/ghost_loading.png"),GR=Ot("/images/primary_loading.png"),KR={primary:GR,ghost:WR};function YR({size:e="24px",variant:t="primary",wrapStyle:r={}}){return w.jsx(ay,{align:"center",justify:"center",style:{width:"100%",height:"100%",...r},children:w.jsx("img",{src:KR[t],alt:"Loading",style:{width:e,height:e,animation:"spin 1s linear infinite"}})})}const XR="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAPKADAAQAAAABAAAAPAAAAACL3+lcAAAJW0lEQVRoBd1be1BU1xk/LstLdtlVUYKoKKA8fJBKJDVxovYxTadC0zY1/2jaKWM0GRsnTTOpEQNGqc34mGicNpqxGkirMYk4QFONqTG01WioFXzwFhRfUJTl/dple37XnmUf93Hu3Uuknpmdc/ec7/vO97vn9Z3vfHcUGaa0a+2PxlnN9hVWU+Aia5gxLsIaHGk1GUNCAgMCRocaRqHZ7p5BZ++Aw2HrtPe22PqabF32Olun46Stw/Du6s0Fd4ZDNaFhvQS/k/P95ChryKb4iaO/NX1yWHhgwD1gauUPOAadNY1d7bU3u0/csvVmrcr562W1MqTodQGcvzlj9cwppqw5ceYJFKMuMpnCFLuzvK6j+dK1zk3L1xbuYuVac7+Uy8tNf2legiU7cYrJolUBNXyV1zrbSqvas5evK9yhhs+dVhPgd9YvSUmJCzvyzeQxU92FfV3PX15ubSir63pq1cbiMrVtBqhlyM/9wfqli6MOxkaFjVHLqxf9pPGh1sSY0SuT46MGC07UlKiRq6qHC3c8Vbhk/kNLKJMqPjUKqaF1EuIsPn27OGPNkQxePi7F976ZYU6ICDn3+Oyx8byCv066f164W1vV0js389XCDqV2FYf07pz0xAWJlsq5MyxRSsLuV/2UyNCxoQGjVs9JjikoPlndIqeHbA+jZx+LC79BV2GznBDeuu4+B9l+qI4Un2oSWNIfe4j86plYEhqk+N65mqCreMepuvZouZ42yknCMNYLbL/dSX7xu/Pk3zVtribzjjWSC1faSd66b5Ago8FVrvUBut5p6z9H+adLyZB8tVigvpM6fr4Uo9ry7YeukE++vNez7ry37/aRvv5BsmD2WPdizc8Y3qmzJqUeOFp5QEyIKGBsPU8vjF6p12pMhxpZu6eCOOmyKpbKaS9/O3U8ibAEiVWrLpsx2TQjfmqk6JblAxhGBfbZYKM2O9hbO2D85VsXyM2WXu8q13+8iCr6Un6yaKIu+x06KjY6bFHMpIlHikuqPYaVz8SBBWUKMcouZi5NOR4+/Pymx7yVYsHc/ujkTalq1eXAACzejB6A83Mz1uhpLrZ2DJBtdFXmTVs/qCPg0SsBCzC5y/MA/EhC+Ab3Sn+ftxysJTYVAEAL0Homb0wuwHmb0l/U89Rzjg7Rj7+4pVp3DGvw6pWACdiYPBfgWdPMr7FCf3O7w0ly9lVxizGFGsn8WUPbEnjpOZibX4nQHZsAGJ4KHN6VGHnrYVBg1eVJgXR9/MPLc0hb59DcBe97Rxt52LlogA0YQSwAhltGL09FU2sfeftwPZci8I1sfWEmocOOVFz1tPt3FTQQyNIjARswQpYAGD4oPQRDRm5+DenudXCJy3p2BnkybQIprbL5GCVdPXZBFpcgDiKG0QDvIhxuHDyKJH8vv0uOnW1WpAPBqh9OJcu+O0mgPVthE+WBLMjUIwEjsBrgStXqXXRXpG9gkGzYz7dQ/fiJKPLST2Nd7GcrWl3P3g9vvFdFcPDwNwEjsBrgN/ZXGPh3F14ljc09iqIWPjyObMxMdNF10KF7ucFz/roq6cO1ph4qu8G9SPMzsBrgJNcs4X+MDbe7yZ6iBkUxKfHhZMeLs4gxYMhyLa1s85m/3oIA+CoF7m8CVgNuBPwVtGF/NRlQGHbTokaT3S+n+Bz2z1Qoz1HI5p0ucliAlQ5pY4gckVIdzrinLsorPWFMMNn76sNkjDnQR9xXtId5EvVbiZ6neXgZDbAacdfDCtTmnXT+bf5TrSwbrKh3X0kh0RG+7xXG1NzpFpISFy7IYOflkvI75LrIeoC2nkgZRyBTSwJWI7vY0iJg58f1pFnGOGBWFAwLsYQT97rlnt6Yo3QrOvC362LkQlto87VlnjyixCKFwCoYHiJ1ikXwYuR/Kq4YmJkVlZZoVZTFCM7Q7enXv78ku4ihTbStNRlxZWkxqfNuYFd8/Y+VZFDGwI8eH0rOXLYJP3a9RrdCspb2jlhrAPHC9guKix/azKaHi4PZqaq9I8BqxP2shahzGcKLUVbbLvuSMQf//JnnCJg5zSwK9gZ1/6zYUkawJvCk8/T4CB2WLp7IQ+6iAVYDLqNdJRwPdzv6NR/S05J8hzc8HJlvnpddC8TUgicFuqhJwGrAzbsapi0H6jyOcmp405I87996+h1k5bYyUn+rW40YgVbwjhxU5x0BVgPCDHhb+1e1jRwuUe/FgHzM43luCxicBGt2XlScGnK6waMCnXgTsNIh7TjJw3DPi1HNQypKkxRjJma3/XP93kryxXn/wzhy9lUT6MaTgNWAABLEVCgx5B27TqobtW8HjyYPDWfcL2kdKd56QifoppSAEVgNiJZBAIkcwz0vxhU5EsU6tmC9f/y6cLJSZFBB8PbhK6TZJu8dAUZgFQwPRMvIyccb5PViiMnB/H0kwUpgRW3K0z4txGSjDLrt+0TeB8YwCoCb2u3rES0jJfDTr/i8GFL8MC1hWChZUVL8POXHS/8jSQZsCH8CgQD4udeLLiE0SIrDX2ea1RxEnt9WrmhFSbXPUy43pIGNxXq5bGnqdciVEhxLz7L+pNP0+MhrRWltJz46TJIVMV6scsj1QEsqPlpmg6eeVbIcjrTntpbJ2s6M9n7kAdSDgiPo427OfKYHnUptSU+/7zLxPM7Cj6bE9NGz6fcYMctjIkPJQnoObe+2E1vXAOmlF9jSM55xDX8eYQ0SQG5emUTm0UVRLB092/KbghNVZ1idRw+j8PT+Z+r1vEFkDd2PHAFs83/+wTT3tl1zmBUiwq2zV8FBxYhHcA4MwOKtoseQRiVuzBHhNjvOsoh2v88I8BYwEv/T/dX54ec3sjOz/3LIWz8fwCBAOB8CQxImmxK8Gf4f/iM6b+krRc+L6Srbg//Yu7RmpEbfiYFBGaLyFmQeknR6+cxhd0EI56PLuvS1gDvxCHiGrtBZThXRIc0YCj+r6kc4X1iw4Wc0pCiYlY/EHGBLLralrcgqko2MkR3SDNiDFFzKBZgBfxDCh2WHNAPKcoTzIcINQV80NlLVy2Iy9Mqxz2LrkVqNpdpRBRhCsGUhws3ucDyJyHQpwcNZDgvqeGnrYrF9Vqldv3oJQV+IgxI7cCg1rKUeB4H78pGHt7KIg0Jo0HB+xnOxvuO3z2YV7fRuW+1/v3rYu7E9b6TPjAw3bnzgP9TyBo7/2j/FG6Cf4hmH7VO8/wJSjxTWAm8L8gAAAABJRU5ErkJggg==",Qu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAABGUUKwAAAQcklEQVR4Ac07C3BUVZb33vfp7nQSgiEhYYYgESEj40oZjERH/MxAnFEGQQYUZILRGix1y3V3q3bZqd2trZpZqram1rJ2tMZZiUGFAURQ4romiALjmlkFB2eGEVyMEAQSEiSQ9O+9fvfuOfe923Q66aQ7dDS3q/vcd9+553fPOffzXlMyxqX4hc1Vls9p4Iao5nm8Mp5HSoSfmsIUGjcJRfbMIoJa1CFRbhlh2k3CrJ3F6EG/rTWee3DlkbEUUQqQawYTX3ppVTxInoxN4rPjVxAfAf0kDwG/WEM4RKGUEiEEQYgF0ITxJY2ZPfSwHiJPnV+9etMQ3S6rKWcGmPTcq+XWxOhzVhlfGJ8oQGkoSlnFJcUAAlSk8EHoort1bPMaXGN5lzoao5O1muf9a3vW3nvGRbq8XyXaqKlMebG5IpTXtzF6JZ/PfYINSyjFADDUoCA0eiN+SVvXINIuKKF3qQzKLMr9x9n+YLig/vSPF3UMy3OEm6M2ALgqLd6y5fnwVXyNCJChFZcKU2GcoyGtlx6FuD7MYuQDjemHhNC7mLggR5HTCeWUxic7JD6HG6QGDDmbTxSzrCtEELRPKyOLEB74jDWdu+++hyFslJlGUHng7bTEB6INvPrGC6/O65tmt1iTeKGKWxfDGy7OhL+Tduq9ZLMZ9j19uuGekwMpZHY1pfG1qVZe7Il4EV8ZLSNlYGZgIK3qEXDrZje5GOgw67oevPd3mVG+hJW1AUpf3vpI+GrxjAOj7qmrIpZQhwr/CdbG+sz67tWLj11ic/m1kpden8ELrI2RabyWaIO9QkNv+D/9sbMPLPtVNtyyMsDkra809s8iawjjXj9lAhjxk+TTYLdY1bFm+cFsBMgWt6JpW3WomG6KVpCZhCg5XCqUMBE8Qpq6VvyoIVO6GRmg+oAwvji9sy00zalWKrsMBPF1sW69kzzU9eNlzZkyzQXelM2vLbImORtik3mJoqeCw39CO1gxZUntwbnUVvfSwRENgMp39OzoiJWJsgFZG5JO8BjdfWbpkrp0xL+K9sk7drZEruILYDZxZ0/PCj7IQRXFSytGMsLQ2TtJ8tOnX2+zy2kZo5CBgAdCZjNR8Alb/3Urj2J2wQAUHNHWs7gGczBmSfxlxC6jZadA9iRVhqwOa4CpW3c1RqeRalRcKg+E9X5m5x81lp1acc9Ph6T4NTSiLPlH2TI9BEMDJlDyxipI9dStzY3DiZQ2BK78TfMjfVXiWYHUvKKHme1v1+Z0PPCDP6u28QQrXn7zmmilcyieB6sJKFJwUAA85NHj99815OwwpAfM2PLmvHCleAbmeHR86VK6o4n8z/X7xqvyqDDKhjKirDIc0HOhhKc7z6BOiJNaBhkAV3jhUtEiTMZcV5ImEAXt+vr2Vd/fkUpgvF2jjCgrGEAagaED+xiTOmGiTCmDGiq3v7khdBVpkHjeOj3vBG39/J7v5yTbz9y2pyZO4/cIH68RGisV1PEJjerUZr3MEqepTd+JGUUvnlp647kUWbO6nL7rv1vC3+QLZRzgzAAl2E4b25f94CH3yv0dYICq37Rd2VfZ+5ljgNdjQeP10O4TC+4sddFH94tTae/J1v+0J4il9kRRgHbFkroXSuyLOBG+bnbcd8H4+6Mr7tjmYmf/O233W2djk0SJUpLGCJ/YUTD98PLvdChqA0IgHux/QRiUuRMJ/moi0E0HWEx1zBRevW33yp7w7guRaaTeLiIFFBwTJ2z5wRjFD0L4qqkWJKDWZDK972p7y1Vv7P4thmWm/JLxUHYIBJnHZS6HsI75IxuTcRKEv/Xq/vL+qdEvhA7B42H4z7Kjn935varkDtnUZ2/f+9cXKuxfEH1oBbw1S2K3m0obhUOcwBn6x2N3LfiL1PuZXF/91ttHwiV8lsJlccLzv/B/85N755/BtoQHCM1+juhgepnzYfS5JvIuslWqY7Zw1ta9t/dNc35BNfR0dy7BnS3W5Q4XR9yrJzzOa8PEJZOXB2EneO23tu/5WbYyIL4fdGACZgVcwCE/g8El6OqVhAGsK8hC5YoI8zq1tj8uv2NUGxt0WV4qXgd+lKEFgB5+UQAFk+uJ+x4u9pFf7IF1+MRK2d8oobOBqAPqInl44WaDroqGNMC1r7y3igeZLyEc7OeDjlmvkLKF1726/x/sQoz3S/GtaCPUYESCZ/S2CZ/7/nLSZ+bcwuPaT/292peEo0uC4wNMrmMbDwr/ddvfW56tLIjvt7QHkSfSQWM6Qeq79pV90rt1RIDT2ielc4KzYsz5e1nnR4tvGvV+PjaBPCGVl2kes72XaoA4A+MWHGf1Hy+/5SXk7RX0tH+dtWffWasIsrbKTIAv6ygUFJg6lwDIelb4eOktn1a17uu0ilm5O9OAQfPok0Brk/SAeFDMxpjDDI3QF9ZfRoajKTVv/2+xU0QnSWvLpQjGM9JF21OS36ntTFE+wSZw3vgXxFOeI3uAPAjx42gkkcwSnTKs+EJsM+YepIPQBp2xK6vefqDKKdB8ig06qBHW/yNDuoPQ7Ivxh3HIL9FT4sOkaml81qKb07qxYeu70BM176PqCGVd6P2DGGbYYEZ9T+O0rsKAg86oOxOG1QCjLnMk+r+vn4U+vL/mZIZ0B6E5wfxfFp7QH8w/pW0PnGPHjQizlQK+C/TYKxQegKQpIo/f7I4QIKD7w0gpKHMHZ6fSdB2xGXUy+2kIB0Z6GAdgOA260Fk1k5GPvAQxI9rREakNg/CHuutCcLvJ+0rM2uYDVZbD7xe287FsSPNj+cXPpHAw3ljQj2BGkRCMKLSY9m9pumbUjLo5QQ6nWi59WPNU67DyqyTczTJyrozTP2VELQuktkVz8fHWPw/XZe6uD/89VMwrKYehUVkQvQCFBeg/T08eWHbD74ejMdI9nWuHIQNUKzyui0omfLRERSlaH7aSHyqErwreuPPAP0ZK+V8BfxmK0k1lunIj1rA1J9hv/PBy5dFs9gHqqkKSmFqJDkskHzapAiIcUvWvAtb810cbw6V8NSjtPtrA0XcdUoYkCCzyusnj7y29ftjwyURWqZsAD1PIBjV1ouHy1ysQb36f2aUuxxLiarHmrY/ejxTzeaiwikulPPLW4owHv6SPv7/4+iFPc7KVD3ULEczBrsaCMU2nGuiPqwNsBuubNC43CbJhDH/mtfz+gFVMr8cHWirmVcJDqEdppKBPq9t393W/zZUYqFtykoVzCKpj4kOGsiiYK45p6Nz8xh/+KTTRcZXH0fDYq4QX6NU+KY36bty1uKovDYlRN8NaAAzudsddtq7B4yzHSwIogBXVy+H2qJfBmUhm5Yu/w5GQkqDRPYnAE/D8YdP/3HXt6kzoZIuDulEShwnV7QkPuCAK4hT0dz/SPQxtcraEs8G/tfmTRTzA8uQuD4yQgFDP+5K1jJXyKCMF3dwlPww18NMc5jDmUAsb5VeGA5+TjUJZ4zJxp4x7GAU5JXnQtDWrvG723VnTy6KDcPgceeokp0IIhjixdCPOuh2Bz+HBQvDljN6QBc2sUSHpTlErT+yssr8ZoYeGWyZnzWiIDtSgNW4SdG/qFu1msPBp12Dk8St3gxr99hB9c9hE8y+FnAo95K3hEnpMC+yEZrte5+qqC61d17h2kApxB3LG0eAmHfWWMxPpNc4+CPSTShcXfQ4zEmRjTrN+uSETfsk43NRmUbkQcqcBqfvC5s+r+kvif5ZPVyU2FfkX6bTWuhmj3hEmMx0v9YUtx6b2F/ATcpTdmUfk9xjXsNZF04+YMRZTbgnOAZMRe2K8CJ4rOVAn1E3paVoshrrLIzHDZocdgyd2SY5JVgLjv80Vc0Xn7uaeb0Ty+xJr+ksB4GIELO3h5rqK1xR+LiHqJDdZEHH4cp5hk8NIH3aHcAji6E956UhOTXaAlv3w3ZMz8F4uC2fRYNwniuM+Ir+2V0eIXzgLxUVYzgvqYvnhHQdQ3D0Wg2M/x3wKGUkDvFE3dZNhURkGOE3gCVGc8425lqQACMqZBgRBYSQvD8qFiStOrtkSC3RJuD8EAaw5YqgzMpIGwIrfYq3JAsX8tPaultOJsECcyy4+d/GT7sEIYdpls0glgDrYAVarpj+EvhhtVXgJA5j+wFo4O4fXrnBssBmSoc6llRRyLiCuAlUiSoW5oJ9KQ+qAp2rg2cgbpmFu8sBahZcwwI75JWf8UbbftZTrnpaPzry35dQihXz50Jd40qP4KIgCqofSl8/HpYCyW342UxkaBxZ13HFnSWLLnzAAdvH7J9aDD3DVAb0garINuRII0q2Me3c0UBzwNsw53ifXISBlT4w+GJhrHHVM1sddEiW1LNl9dkPY7zRgEwSBPCvIg/yw87uT65LQRl39kRBpAz2Xe4Ele7paIj6ReAaIAgcirHHngtKHkoUfZAA8qlq8r7vX1gS8BwyzBsQNPOEUeRG2fvv3Jo2bN8OSlUitL3u75+chP193aXULD4UdevH1W0uKcJmXjD8gBPAGIgRsrQ4e6cN7GuieYAU4R4yYfN2Kd3qWJncej3WUMWqKdTiVQyaTwQWvFnPUKVV5lH+QAbBx64Li3wUd/TGNum9byVgFN4jpbMuqt/uuQZzxWFA2lBFHEZWXD9YpE/mO+RjqNJTMQxoAEbfcfsWvIPabXC9w05QD/2CJmM6h8egJK945vzRsxA/BatJQSRZlRx223F6U9lR5UA5ItdLydy8ciGnePgGxMSdAbsxztPWbbyscFzlh5d6LPw8zZx2Kliw//IHl4LZbJ8xNbkutp/UAhVh0W2Gtj7NOdClpWeQB8RXWxLqVe/taFN7XBVEGlAWHRYYqyIfQz7XOovmFtSPJNcBi6ZB/IoTRv7+/LUrEwKUxuILBRXfAMR9q+q6/OV3/sWhfs+fioohGNsCj5xJFHyMfj/gDVDsYvCWv9tc0B6/LK+IIH9jb3xhjdA3HA3VZcEYBzwC+JiefGpyu2nhHcFTvFbn0Rv6tfydU7TC6KcbETJyyB/TA0OS06cXbgg0D2oe5GEhgGER1a827oUcijDwjX+fBcPCOtLz7wk9oW4Hhr3/2JprTZwuPvi9m9NmRjVFCwK09xV37SxEglnlAkMeabg+mTXhKh2SYtQGw88PvWfMijtNiC1KYbADwBLlwwreMDSE6dUI3BwK+p5+toaM6Xnv0AzE1EoE/TRGyEly9LHXE0d3R7eFU52JA0+qe/4455FSXrHBqfVQGQCIoTMN+6/kYERASQ68nJDNYWIEhQhoRR+H57580h3zo9xuHoE9XXpDITUk4RMpjlEymUXsOvAd0A4TYtx1CZ8UJHNenunmSBvBUk8PuoqlxvvnV/m0uSQbyxGFR0X8uvjFGyHzO4eB5mKJGDKEsKRGEM436N+lQZJTHg4fhHwL2Fxbr9U/Pph1D4WbaNmoPSGXwk/2inAvnOYuLhfAA2of3lcCeuoMzhooZhLIDYKo2t2XArw7vSxqEtsLjtLW/nk+l9wxAGMVFzgyQzPvRNrHKtvmTNiezwZV96dx4JAPBcgPCR8R0Sg6bJnvq2Vqa+wOaZMHHov74+6LKiZMGSGTVEPeV4P0lkMNNgBrMJHIAIG7gRRV4c0EQS6OkG1rbIbEd1HTS+Mub6JGxkEvR/H/1GixGG+ou8QAAAABJRU5ErkJggg==";function Gr({src:e,alt:t,className:r,style:n,showWarn:i,...o}){const[s,a]=ie.useState(Qu),c=l=>{a(Qu)};return ie.useEffect(()=>{a(e||Qu)},[e]),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[w.jsx("img",{src:s,alt:t||"",className:r,loading:"lazy",decoding:"async",style:{borderRadius:"100%",...n},onError:c,...o}),i&&w.jsx("img",{style:{position:"absolute",right:-2,bottom:-2,width:"16px",height:"16px"},src:XR})]})}function JR({toastData:e,onClose:t}){const{status:r,buildShowInfo:n,tx:i,id:o}=e,{getExplorerUrl:s}=As(),a=ie.useMemo(()=>{if(n&&r)return n(r)},[r]),c=ie.useMemo(()=>{if(r){if(r==="rejected")return"#ff5073";if(r==="success")return"#68ffd8"}return"#909ca4"},[r]);return w.jsxs("div",{className:"cs-toast",children:[w.jsxs("div",{style:{gap:"0px",display:"flex",flexDirection:"column"},children:[w.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[r==="submitted"&&w.jsx("div",{children:w.jsx(YR,{})}),w.jsxs("svg",{className:"cs-icon",style:{width:"16px",height:"16px",fill:c},children:[r==="rejected"&&w.jsx("use",{xlinkHref:"#icon-close"}),r==="success"&&w.jsx("use",{xlinkHref:"#icon-sel"})]}),r==="submitted"&&w.jsxs("span",{style:{marginLeft:"-28px"},children:[" ","Transaction in progress"," "]}),r==="rejected"&&w.jsx("span",{className:"red",children:(a==null?void 0:a.toastTitleText)||"Transaction failed"}),r==="success"&&w.jsx("span",{className:"green",children:(a==null?void 0:a.toastTitleText)||"Transaction Successful"})]}),r==="submitted"&&w.jsxs("div",{children:[a!=null&&a.toastDescriptionContent&&typeof a.toastDescriptionContent=="function"?a.toastDescriptionContent():w.jsx("span",{children:a==null?void 0:a.toastDescriptionContent}),!(a!=null&&a.toastDescriptionContent)&&i&&w.jsx(xb,{text:"Confirmation is in progress. Check your transaction on here",keywords:["here"],text_highlight_color:"#72c1f7",onKeywordClick:()=>{window.open(s(i,"tx"),"_blank")}})]}),r==="rejected"&&w.jsxs(w.Fragment,{children:[a!=null&&a.toastDescriptionContent&&typeof a.toastDescriptionContent=="function"?a.toastDescriptionContent():w.jsx("span",{children:a==null?void 0:a.toastDescriptionContent}),!(a!=null&&a.toastDescriptionContent)&&w.jsx("span",{children:"Something went wrong"})]}),r==="success"&&w.jsx(w.Fragment,{children:a!=null&&a.toastDescriptionContent&&typeof a.toastDescriptionContent=="function"?a.toastDescriptionContent():w.jsx("span",{children:a==null?void 0:a.toastDescriptionContent})}),r==="success"&&i&&w.jsxs("div",{className:"view-transaction",children:[w.jsx("span",{children:"View Transaction"}),Pl.map(l=>w.jsx("a",{href:s(i,"tx",l.link),target:"_blank",children:w.jsx(Gr,{src:l.img})},l.link))]})]}),w.jsx("svg",{className:"cs-icon close","aria-hidden":"true",onClick:()=>t(o),children:w.jsx("use",{xlinkHref:"#icon-close"})})]})}const ZR=Oi((e,t)=>({toasts:[],setToasts:r=>{e(n=>({toasts:[...n.toasts,r]})),setTimeout(()=>{e(n=>({toasts:n.toasts.filter(i=>i.id!==r.id)}))},3e3)},removeToast:r=>{e(n=>({toasts:n.toasts.filter(i=>i.id!==r)}))}})),ks=(e="cs-swap-widget")=>{const{toasts:t,setToasts:r,removeToast:n}=ZR(),i=(a,c="success")=>{const u={id:Date.now(),status:c,buildShowInfo:()=>({toastTitleText:a})};r(u)},o=a=>{const c=Date.now();return a.id=c,r(a),c},s=ie.useCallback(()=>{let a=document.getElementById(e);return a||(a=document.createElement("div"),a.id=e,document.body.appendChild(a)),ol.createPortal(w.jsx("div",{className:"cs-toast-wrapper",children:t&&t.map(c=>w.jsx(JR,{toastData:c,onClose:()=>{n(c.id)}},c.id))}),a)},[t]);return{addCommonToast:i,addTxToast:o,ToastContainer:s,removeToast:n}};function QR(){const{mevProtect:e,setMevProtect:t}=Fr();return w.jsxs(mn.Root,{children:[w.jsx(mn.Trigger,{children:w.jsx("div",{className:"cs-settings-btn",children:w.jsx("svg",{"aria-hidden":"true",cursor:"pointer",fill:e?"var(--cs-primary)":"var(--cs-icon-fill)",children:w.jsx("use",{xlinkHref:"#icon-mev"})})})}),w.jsx(mn.Content,{variant:"soft",className:"cs-dropdown-content",side:"bottom",align:"end",style:{maxWidth:"328px"},children:w.jsxs("div",{className:"mev-settings-box",children:[w.jsxs("div",{className:"mev-setting-title",children:[w.jsxs("div",{className:"name",children:[w.jsx("img",{src:Ot("/images/icon_mev@2x.png")}),w.jsx("span",{children:"MEV Protect"})]}),w.jsx(Yy,{checked:e,className:"cs-switch",onClick:()=>{t(!e)}})]}),w.jsx("p",{className:"mev-tips",children:"By enabling this, your txn will be submitted via 3rd party MEV service provider. MEV value retained will be redistributed to all users who successfully execute their trades with Shio through its point campaign."})]})})]})}function eO({onClick:e}){const[t,r]=ie.useState(!1),n=()=>{r(!0),setTimeout(()=>{r(!1)},1e3),e()};return w.jsx("div",{className:"refresh-button",children:w.jsx("svg",{className:t?"rotate cs-icon-hover":"cs-icon-hover","aria-hidden":"true",onClick:n,children:w.jsx("use",{xlinkHref:"#icon-refresh"})})})}function B0(e){const{text:t,onClick:r,className:n,btnIsDisabled:i=!1}=e,o=()=>{r&&r()};return w.jsx(rw,{disabled:i,className:n?`cs-button ${n}`:"cs-button",onClick:o,children:t})}function tO(){const{setIsOpenSlippageDialog:e,isOpenSlippageDialog:t,slippage:r}=Fr();return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"slippage-button",onClick:()=>e(!0),children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-verticalslider"})}),w.jsxs("span",{children:[r,"%"]})]}),t&&w.jsx(rO,{onClose:()=>e(!1)})]})}function rO({onClose:e}){const{slippage:t,setSlippage:r}=Fr(),[n,i]=ie.useState(t),o=l=>{i(l.display)},s=l=>{const u=new RegExp("[^\\d-]*(\\d*(?:\\.\\d{0,2})?).*$");l.target.value=l.target.value.replace(u,"$1"),i(l.target.value)},a=()=>{n&&r(n),e()},c=ie.useMemo(()=>+n?Number(n)>50||Number(n)<.01:!0,[t,n]);return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"dialog-mask",style:{zIndex:"100"}}),w.jsx("div",{className:"slippage-settings-dialog",style:{zIndex:"100"},children:w.jsxs("div",{className:"slippage-settings",children:[w.jsxs("div",{className:"slippage-settings-header",children:[w.jsx("div",{className:"title",children:"Slippage Settings"}),w.jsx("svg",{className:"cs-icon","aria-hidden":"true",onClick:e,children:w.jsx("use",{xlinkHref:"#icon-close"})})]}),w.jsxs("div",{className:"title",children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-verticalslider"})}),w.jsx("span",{children:"Slippage Tolerance"})]}),w.jsxs("div",{className:"form-box",children:[w.jsx("div",{className:"slippage-tab-list",children:XE.map(l=>w.jsxs("span",{className:l.display===n?"active":"",onClick:()=>o(l),children:[l.display," %"]}))}),w.jsxs("div",{className:"input-box",children:[w.jsx("span",{children:"Custom"}),w.jsx("input",{className:"cs-input",placeholder:"0.0",value:n,onChange:s}),w.jsx("div",{style:{fontSize:"14px",color:"#fff"},children:"%"})]})]}),Number(n)<=.05&&w.jsx("div",{className:"tips warning",children:"Slippage is low. Your transaction may fail."}),Number(n)<=50&&Number(n)>1&&w.jsx("div",{className:"tips warning",children:"Your transaction may frontrun"}),Number(n)>50&&w.jsx("div",{className:"tips error",children:" Enter a valid slippage percentage"}),w.jsx(B0,{text:"Save",btnIsDisabled:c,className:"slippage-save-btn",onClick:a})]})})]})}function nO({handleRefresh:e}){return w.jsx(w.Fragment,{children:w.jsxs("div",{className:"swap-header",children:[w.jsx("h3",{className:"swap-title",children:"Swap"}),w.jsxs("div",{className:"right",children:[w.jsx(tO,{}),w.jsx(QR,{}),w.jsx(eO,{onClick:e})]})]})})}function iO(){const[e,t]=ie.useState(!1);return w.jsxs(mn.Root,{open:e,onOpenChange:t,children:[w.jsx(mn.Trigger,{children:w.jsx("div",{className:"cs-settings-btn",children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-settings"})})})}),w.jsx(mn.Content,{variant:"soft",className:"cs-dropdown-content",style:{backgroundColor:"#2B3643"},side:"bottom",align:"end",children:w.jsxs("div",{className:"cs-settings-box",children:[w.jsx("h3",{children:"Settings"}),w.jsx(oO,{}),w.jsx(aO,{onClose:()=>{t(!1)}})]})})]})}function oO(){const{currentExplorer:e,setCurrentExplorer:t,currentRpc:r,setCurrentRpc:n}=Fr(),i=o=>{t(o)};return w.jsxs("div",{className:"settings-card",style:{marginTop:"12px"},children:[w.jsxs("h3",{className:"card-title",children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-plorer"})}),w.jsx("span",{children:"Preferred Explorer"})]}),w.jsx("div",{className:"explorer-checkbox-group",children:Pl.map(o=>w.jsxs("div",{className:"group-item",style:{justifyContent:"center"},onClick:()=>i(o.link),children:[w.jsx(zl,{color:"indigo",checked:o.link===e,variant:"soft",className:"cs-checkbox"}),w.jsx("img",{src:o.img}),w.jsx("span",{children:o.name})]}))})]})}const sO=e=>!/^(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/.test(e);function aO({onClose:e}){const{addTxToast:t}=ks(),{currentRpc:r,setCurrentRpc:n,customRpc:i,setCustomRpc:o,rpcList:s}=Fr(),[a,c]=ie.useState(i),[l,u]=ie.useState(r),d=b=>{t({id:0,status:"success",buildShowInfo:()=>({toastTitleText:"RPC update",toastDescriptionContent:`RPC is currently set to ${b}`})})},p=b=>{u(b),b.isCustom||(n(b),d(b.link),e())},y=b=>{c(b.target.value)},x=()=>{if(a){const b={name:"Custom RPC URL",link:a,isCustom:!0};o(a),n(b),d(a),e()}};return w.jsxs("div",{className:"settings-card rpc-settings-card",children:[w.jsxs("h3",{className:"card-title",children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-settings"})}),w.jsx("span",{children:"RPC Node"})]}),w.jsxs("div",{className:"rpc-checkbox-group",children:[s.map(b=>w.jsxs("div",{className:"rpc-item",onClick:()=>p(b),children:[w.jsx(zl,{color:"indigo",checked:l.name===b.name,variant:"soft",className:"cs-checkbox"}),w.jsx("span",{children:b.name})]})),l.isCustom&&w.jsxs("div",{className:"custom-rpc-input-box",children:[w.jsx("input",{className:"cs-input",placeholder:"Custom RPC URL",onChange:y,value:a}),w.jsx(B0,{btnIsDisabled:sO(a),text:"Save",onClick:x})]})]})]})}const Yr=Oi((e,t)=>({accounts:[],currentAccount:void 0,isOpenWalletModal:!1,saveCurrentAccount:r=>{e({currentAccount:r})},saveAccounts:r=>{e({accounts:r})},onWalletModal:r=>{e({isOpenWalletModal:r})},isOpenAccountList:!1,setIsOpenAccountList:r=>{e(()=>({isOpenAccountList:r}))},tokenBalanceObj:{},setTokenBalanceObj:r=>{e(()=>({tokenBalanceObj:r}))},accountServiceNameObj:{},setAccountServiceNameObj:r=>{const n=t().accountServiceNameObj;e({accountServiceNameObj:{...n,...r}})}})),so=Oi((e,t)=>({suiClient:new ps({url:ls.fullRpcUrl}),setSuiClient:r=>{e(()=>({suiClient:r}))},aggregatorSDK:new Jv({signer:ls.simulationAccount,client:new ps({url:ls.fullRpcUrl}),env:o0.Mainnet}),setAggregatorSDK:r=>{e(()=>({aggregatorSDK:r}))}}));function nw(){const{suiClient:e}=so(),{setAccountServiceNameObj:t,accountServiceNameObj:r}=Yr(),n=async o=>{if(!((o==null?void 0:o.length)<1))try{const s=o.map(async l=>{var d;const u=await e.resolveNameServiceNames({address:l});return{address:l,name:((d=u==null?void 0:u.data)==null?void 0:d[0])||""}}),a=await Promise.all(s),c=Object.fromEntries(a==null?void 0:a.map(l=>[l.address,l.name]));t(c)}catch{}};return{fetchServiceNames:n,getServiceNames:async o=>{const s=[];o==null||o.forEach(a=>{const c=a==null?void 0:a.address;r!=null&&r[c]||s.push(c)}),(s==null?void 0:s.length)>0&&n(s)}}}var cO=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));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||r.forEach(function(i){e.addRange(i)}),t&&t.focus()}},lO=cO,zp={"text/plain":"Text","text/html":"Url",default:"Text"},uO="Copy to clipboard: #{key}, Enter";function fO(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function dO(e,t){var r,n,i,o,s,a,c=!1;t||(t={}),r=t.debug||!1;try{i=lO(),o=document.createRange(),s=document.getSelection(),a=document.createElement("span"),a.textContent=e,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(u){if(u.stopPropagation(),t.format)if(u.preventDefault(),typeof u.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var d=zp[t.format]||zp.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(a),o.selectNodeContents(a),s.addRange(o);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){r&&console.error("unable to copy using execCommand: ",u),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(d){r&&console.error("unable to copy using clipboardData: ",d),r&&console.error("falling back to prompt"),n=fO("message"in t?t.message:uO),window.prompt(n,e)}}finally{s&&(typeof s.removeRange=="function"?s.removeRange(o):s.removeAllRanges()),a&&document.body.removeChild(a),i()}return c}var hO=dO;const iw=Ta(hO);function pO({currentAccount:e}){const{mutate:t}=Vr.useSwitchAccount(),r=Vr.useAccounts(),{isOpenAccountList:n,setIsOpenAccountList:i,accountServiceNameObj:o}=Yr(),{getServiceNames:s}=nw(),a=ie.useCallback(()=>{n||s(r),i(!n)},[n,r]);ie.useEffect(()=>()=>{i(!1)},[]);const c=ie.useMemo(()=>r.filter(u=>u.address!==e),[r,e]);ie.useEffect(()=>{},[c]);const l=u=>{t({account:u},{onSuccess:()=>{}})};return w.jsxs("div",{className:"cs-account-switch",children:[w.jsxs("div",{className:"account",onClick:a,children:[w.jsx("span",{children:(o==null?void 0:o[e])||Po(e)}),(c==null?void 0:c.length)>0&&w.jsx("svg",{className:`cs-icon ${n?"open":"close"}`,"aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-unfold"})})]}),w.jsx("div",{className:`account-list ${n?"open":"close"}`,children:c.map(u=>w.jsxs("div",{className:"account-item",children:[w.jsxs("div",{className:"left",children:[w.jsx("div",{className:"label",children:u==null?void 0:u.label}),w.jsx("div",{className:"address",children:(o==null?void 0:o[u==null?void 0:u.address])||Po(u==null?void 0:u.address)})]}),w.jsx("button",{className:"cs-outline-btn",onClick:()=>l(u),children:"Switch"})]}))})]})}const mO=ie.forwardRef(({connect:e})=>{const t=Vr.useCurrentAccount();return w.jsx("div",{children:t?w.jsx(gO,{}):w.jsx(B0,{text:"Connect",className:"cs-connect-button",onClick:()=>e(!0)})})});function gO(){const{mutate:e}=Vr.useDisconnectWallet(),t=Vr.useCurrentAccount(),{currentWallet:r}=Vr.useCurrentWallet(),{addCommonToast:n}=ks(),{getExplorerUrl:i}=As(),{accountServiceNameObj:o}=Yr(),s=()=>{t&&(iw(t.address||"",{debug:!1,message:"message"}),n("Copied"))},a=()=>{t&&window.open(i(t.address,"account"),"_blank")};return ie.useEffect(()=>{},[r]),w.jsxs(mn.Root,{children:[w.jsx(mn.Trigger,{children:w.jsxs("div",{className:"cs-connected-button",children:[w.jsx("img",{src:r==null?void 0:r.icon,style:{width:"20px",height:"20px"}}),w.jsx("span",{children:(o==null?void 0:o[t==null?void 0:t.address])||Po(t==null?void 0:t.address)})]})}),w.jsx(mn.Content,{variant:"soft",className:"cs-dropdown-content",style:{backgroundColor:"#2B3643"},side:"bottom",align:"end",children:w.jsxs("div",{className:"account-op-box",children:[w.jsx("span",{style:{fontSize:"14px",color:"#909CA4",marginBottom:"6px"},children:t==null?void 0:t.label}),w.jsx(pO,{currentAccount:t==null?void 0:t.address}),w.jsxs("div",{className:"account-op-item",onClick:s,style:{marginTop:"12px"},children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-copy"})}),w.jsx("span",{children:"Copy address"})]}),w.jsxs("div",{className:"account-op-item",onClick:a,children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-link"})}),w.jsx("span",{children:"Open explorer"})]}),w.jsxs("div",{className:"account-op-item",onClick:()=>e(),children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-disconnect"})}),w.jsx("span",{children:"Disconnect"})]})]})})]})}function vO(){const{fetchServiceNames:e}=nw(),t=Vr.useCurrentAccount();Vr.useCurrentWallet();const{isOpenWalletModal:r,onWalletModal:n,saveCurrentAccount:i}=Yr();return Vr.useWallets(),ie.useEffect(()=>{t!=null&&t.address&&e([t==null?void 0:t.address])},[t==null?void 0:t.address]),w.jsx(w.Fragment,{children:w.jsx(Vr.ConnectModal,{trigger:w.jsx(mO,{connect:n}),open:r,onOpenChange:o=>n(o)})})}function bO({independentWallet:e,customWallet:t}){return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"widget-header",children:[w.jsx("img",{src:Ot("/images/logo@2x.png"),className:"cetus-logo"}),w.jsxs("div",{className:"right",children:[e&&w.jsx(vO,{}),w.jsx(iO,{})]})]}),w.jsx("div",{style:{marginTop:"20px"}})]})}const ow=()=>{const e=ie.useRef(null);ie.useEffect(()=>{if(e.current){const n=e.current.style;n.setProperty("--size-loader","50px"),n.setProperty("--size-orbe","10px")}},[]);const t=n=>({position:"absolute",width:"100%",height:"100%",animation:`webLoading ease-in-out 1.5s calc(${n} * 0.1s) infinite`,opacity:`calc(1 - calc(0.2 * ${n}))`}),r={position:"absolute",content:"''",top:0,left:0,width:"var(--size-orbe)",height:"var(--size-orbe)",backgroundColor:"#75C8FF",boxShadow:"0px 0px 20px 2px #75C8FF",borderRadius:"50%"};return w.jsx("div",{style:{width:"100%",height:"100%",position:"absolute",zIndex:100},children:w.jsx("div",{ref:e,style:{width:"var(--size-loader)",height:"var(--size-loader)",position:"absolute",top:"50%",left:"50%",marginTop:"-25px",marginLeft:"-25px",transform:"rotate(45deg)"},children:[...Array(5)].map((n,i)=>w.jsx("div",{style:t(i),children:w.jsx("div",{style:r})},i))})})};function yO({onClose:e,transactionData:t}){const{status:r,buildShowInfo:n,tx:i}=t,o=ie.useMemo(()=>{if(n&&r)return n(r)},[r]);return w.jsxs("div",{className:"ts-status-dialog",children:[(r==="confirmation"||r==="submitted")&&w.jsx(wO,{info:o,status:r}),(r==="success"||r==="rejected")&&w.jsx(xO,{info:o,status:r,tx:i,onClose:e})]})}function wO({info:e,status:t}){return w.jsxs("div",{className:"progress-dialog",children:[w.jsx("div",{className:"title",children:t==="confirmation"?"Waiting for Confirmation":"Transaction in progress"}),w.jsx("div",{className:"loading-box",children:w.jsx(ow,{})}),w.jsxs("div",{className:"ts-content",children:[e==null?void 0:e.modalDescriptionText," "]}),w.jsxs("p",{className:"ts-desc",children:[" ",t==="confirmation"?"Confirm this transaction in your wallet.":"Confirmation is in progress."]})]})}function xO({info:e,status:t,tx:r,onClose:n}){const{getExplorerUrl:i}=As();return w.jsxs("div",{className:"finally-status-dialog",children:[w.jsxs("div",{className:"center-content",children:[w.jsxs("div",{className:t==="success"?"status-box is-success":"status-box is-error",children:[w.jsx("div",{className:"status-icon-box",children:w.jsx("div",{className:"status-icon",children:w.jsx("svg",{className:"icon","aria-hidden":"true",children:t==="success"?w.jsx("use",{xlinkHref:"#icon-sel"}):w.jsx("use",{xlinkHref:"#icon-caution"})})})}),t==="success"?w.jsx("span",{children:"Swap Success"}):w.jsx("span",{children:"Swap failed"})]}),w.jsx("div",{className:"ts-content",children:e==null?void 0:e.modalDescriptionText}),r&&w.jsxs("div",{className:"view-transaction",children:[w.jsx("span",{children:"View Transaction"}),Pl.map(o=>w.jsx("a",{href:i(r,"tx",o.link),target:"_blank",children:w.jsx("img",{src:o.img})},o.link))]})]}),w.jsx("button",{className:"cs-solid-btn swap-more-btn",onClick:n,children:t==="success"?"Swap More":"Retry"})]})}function Yl(){return{fetchByApi:async(t,r,n,i)=>{try{return r==="GET"?await GE(`${i||ls.api}${t}`,n):await KE(`${i||ls.api}${t}`,n)}catch(o){throw o}}}}function SO(){const{fetchByApi:e}=Yl(),{setProviders:t}=Fr();return{fetchRouterConfig:async()=>{try{const n=await e("/router_v2/status","GET"),{providers:i}=n;i&&t(i)}catch{}}}}function _O({interval:e,callback:t}){const r=ie.useRef(),n=ie.useRef(null);ie.useEffect(()=>{r.current=t},[t]);const i=ie.useCallback(()=>{n.current&&clearInterval(n.current),e>0&&(n.current=setInterval(()=>{r.current&&r.current(Date.now())},e))},[e]),o=ie.useCallback(()=>{n.current&&(clearInterval(n.current),n.current=null)},[]);return ie.useEffect(()=>(i(),()=>o()),[]),{startTimer:i,stopTimer:o}}const EO=(e,t)=>({coinPriceObj:{},setPriceObj:r=>{const n=t().coinPriceObj;e({coinPriceObj:{...n,...r}})},clearPriceObj:r=>{const n=t().coinPriceObj;r.forEach(i=>{delete n[Nr(i).full_address]}),e({coinPriceObj:{...n}})}}),sw=Oi(EO);function CO(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function $a(){const{fetchByApi:e}=Yl(),{coinPriceObj:t,setPriceObj:r,clearPriceObj:n}=sw(),i=async a=>{const l=CO(a,10);try{const d=(await Promise.all(l.map(p=>e("/v2/sui/market_price","GET",{base_symbol_address_pair:p.map(y=>Ti(y,!1))})))).map(p=>p.prices).flat();if(d){const p={};d.forEach(y=>{p[Nr(y.base_symbol).full_address]=y}),r(p)}return d}catch{return n(a),null}},o=ie.useCallback(a=>{if(!a)return;const c=t[Nr(a).full_address];if(c)return c},[t]),s=ie.useCallback((a,c,l)=>{const u=Number(c)==0||!l?"0":l;if(c&&a&&+c){const d=o(a);if(d)return Be(c).mul(d.price).toString()}return u},[t]);return{fetchTokenPrices:i,getTokenPrice:o,getTokenAmountValue:s}}const TO=(e,t)=>({isOpenTokensDialog:!1,defaultFromCoinType:void 0,defaultToCoinCoinType:void 0,isOpenSecondary:!1,byAmountIn:!0,findRouterLoading:!1,fromAmount:"",toAmount:"",fromCoin:void 0,toCoin:void 0,routerData:void 0,setDefaultCoin:(r,n)=>{e(()=>({defaultFromCoinType:r,defaultToCoinCoinType:n}))},setFromCoin:r=>{e(()=>({fromCoin:r}))},setToCoin:r=>{e(()=>({toCoin:r}))},setFromAmount:r=>{e(()=>({fromAmount:r}))},setToAmount:r=>{e(()=>({toAmount:r}))},setRouterData:r=>{e(()=>({routerData:r}))},setFindRouterLoading:r=>{e(()=>({findRouterLoading:r}))},setByAmountIn:r=>{e(()=>({byAmountIn:r}))},setIsOpenSecondary:r=>{e(()=>({isOpenSecondary:r}))},setIsOpenTokensDialog:r=>{e(()=>({isOpenTokensDialog:r}))}}),nn=Oi(TO);function AO(){const{tokenBalanceObj:e}=Yr(),{fetchTokenPrices:t}=$a(),{isOpenTokensDialog:r}=nn(),n=ie.useCallback(()=>{if(WE(e)){const i=Object.keys(e);t(i)}},[e]);return ie.useEffect(()=>{r&&n()},[r]),{getMyAssetsPrice:n}}const MO=(e,t)=>({tokenMapIsInit:!1,requestTokenList:[],addRequestTokenList:r=>{e(()=>({requestTokenList:[...t().requestTokenList,r]}))},setToken:r=>{const{tokenMap:n,requestTokenList:i}=t(),o=Nr(r.coin_type).full_address;if(!n.has(o)){const s=new Map(n);s.set(o,r);const a=i.filter(c=>c!==r.coin_type);e(()=>({tokenMap:s,requestTokenList:[...a]})),Si.setItem(Hf,s)}},tokenMap:new Map,setTokenMap:(r,n=!1)=>{r.size>0?e(()=>({tokenMap:r,tokenMapIsInit:!0})):e(()=>({tokenMap:r})),n||Si.setItem(Hf,r)},trustedTokenList:[],setTrustedTokenList:(r,n=!1)=>{e(()=>({trustedTokenList:r})),n||Si.setItem(mb,r)}}),Va=Oi(MO);Si.getItem(Hf).then(e=>{e!==null&&Va.getState().setTokenMap(e,!0)});Si.getItem(mb).then(e=>{e!==null&&Va.getState().setTrustedTokenList(e,!0)});const IO=[{name:"Sudo LP Token",symbol:"SLP",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/slp.png",coinType:"0xc44d97a4bc4e5a33ca847b72b123172c88a6328196b71414f32c3070233604b2::slp::SLP",isVerified:!0,extensionFields:{birdeyeid:"0xc44d97a4bc4e5a33ca847b72b123172c88a6328196b71414f32c3070233604b2::slp::SLP",coin_priority:720,coingecko_id:"slp"}},{name:"❄️ WAL",symbol:"wWAL",decimals:9,logoURL:"https://interestprotocol.infura-ipfs.io/ipfs/QmPLCVWv7citJSc813NbcbZnRSXAEJ4BWVKq4zK8pPVEWq",coinType:"0xb1b0650a8862e30e3f604fd6c5838bc25464b8d3d827fbd58af7cb9685b832bf::wwal::WWAL",isVerified:!0},{name:"Wrapped GLMR (Portal from Moonbeam)",symbol:"WGLMR",decimals:8,logoURL:"https://zuwfvhekgt5rgxaa5e5yraqnxeivprtu2siky5qtffa2ysvcvh6q.arweave.net/zSxanIo0-xNcAOk7iIINuRFXxnTUkKx2EylBrEqiqf0",coinType:"0x66f87084e49c38f76502d17f87d17f943f183bb94117561eb573e075fdc5ff75::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x66f87084e49c38f76502d17f87d17f943f183bb94117561eb573e075fdc5ff75::coin::COIN",labels:["Wormhole"]}},{name:"Spring SUI",symbol:"sSUI",decimals:8,logoURL:"https://gateway.irys.xyz/5iJkTTWnZnTF5vpZA31F5vZZSqGPHuTMNCQSBTqkYGMV",coinType:"0x83556891f4a0f233ce7b05cfe7f957d4020492a34f5405b2cb9377d060bef4bf::spring_sui::SPRING_SUI",isVerified:!0,extensionFields:{coin_priority:908,rank:840,suggested_priority:909}},{name:"Volo Staked SUI",symbol:"vSUI",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/vsui.png",coinType:"0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT",isVerified:!0,extensionFields:{birdeyeid:"0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT",coin_priority:910,coingecko_id:"volo-staked-sui",pyth_id:"57ff7100a282e4af0c91154679c5dae2e5dcacb93fd467ea9cb7e58afdcfde27",rank:860,suggested_priority:910}},{name:"AXOLcoin",symbol:"AXOL",decimals:9,logoURL:"https://api.interestlabs.io/files/99e91dc540e4d32971972eed8ecae0958f0cb3e84018dd1b.png",coinType:"0xf00eb7ab086967a33c04a853ad960e5c6b0955ef5a47d50b376d83856dc1215e::axol::AXOL",isVerified:!0},{name:"SEND",symbol:"SEND",decimals:6,logoURL:"https://suilend-assets.s3.us-east-2.amazonaws.com/SEND/SEND.svg",coinType:"0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7::send::SEND",isVerified:!0},{name:"TIMES",symbol:"TIMES",decimals:5,logoURL:"https://assets.playdarktimes.com/images/icons/darktimes_logo.png",coinType:"0x46fbe54691b27d7abd2c9e5a01088913531f241b98f3c2351f8215e45cc17a4c::times::TIMES",isVerified:!0,extensionFields:{coingecko_id:"times"}},{name:"Aptos Coin (Portal from Aptos)",symbol:"APT",decimals:8,logoURL:"https://hvyfngb6s6wsyytjzbvqjunzqvwlzjjhfmk4z44yacx7sq7fidxa.arweave.net/PXBWmD6XrSxiachrBNG5hWy8pScrFczzmACv-UPlQO4",coinType:"0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN",coin_priority:590,labels:["Wormhole"],pyth_id:"03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5"}},{name:"Haedal staked SUI",symbol:"haSUI",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/hasui.png",coinType:"0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI",isVerified:!0,extensionFields:{birdeyeid:"0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI",coin_priority:960,coingecko_id:"haedal-staked-sui",pyth_id:"6120ffcf96395c70aa77e72dcb900bf9d40dccab228efca59a17b90ce423d5e8",rank:870,suggested_priority:960}},{name:"sNS",symbol:"sNS",decimals:6,logoURL:"https://3vhaecwgpni3lhtpvmwylermast5evx5e7x46x3hw534olzdqq7q.arweave.net/3U4CCsZ7UbWeb6sthZIsBKfSVv0n789fZ7d3xy8jhD8",coinType:"0x6511052d2f1404934e0d877709949bcda7c1d451d1218a4b2643ca2f3fa93991::scallop_ns::SCALLOP_NS",isVerified:!0},{name:"sSCA",symbol:"sSCA",decimals:9,logoURL:"https://gateway.irys.xyz/6HrUJbgHzoHMq952F1PG36L94BQkuyjnqAjfPLo3hJ3D",coinType:"0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA",isVerified:!0,extensionFields:{rank:820}},{name:"CAP",symbol:"CAP",decimals:9,logoURL:"https://owhanwxsgozv6rpjuntz4a32lqhb2tl4kurcmyltpd6ipysudv2a.arweave.net/dY4G2vIzs19F6aNnngN6XA4dTXxVIiZhc3j8h-JUHXQ",coinType:"0x893aa3f358b70e7dbcf957c64a1f016633630af42fb6097f25c33ef9fa738dd2::cap::CAP",isVerified:!0},{name:"mUSD",symbol:"mUSD",decimals:9,logoURL:"https://mstable.io/coins/musd.svg",coinType:"0xe44df51c0b21a27ab915fa1fe2ca610cd3eaa6d9666fe5e62b988bf7f0bd8722::musd::MUSD",isVerified:!0},{name:"sSBUSDT",symbol:"sSBUSDT",decimals:6,logoURL:"https://zu6izvoktna456r6pbxg3knacc4bysfalutz25xo6zfkx6x3wvda.arweave.net/zTyM1cqbQc76PnhubamgELgcSKBdJ5127vZKq_r7tUY",coinType:"0xb1d7df34829d1513b73ba17cb7ad90c88d1e104bb65ab8f62f13e0cc103783d3::scallop_sb_usdt::SCALLOP_SB_USDT",isVerified:!0},{name:"Wrapped AVAX (Portal from Avalanche)",symbol:"WAVAX",decimals:8,logoURL:"https://dvv5kcjybfklcqlql7dj7mfrfzj4bgunkcdgz6uh3re4usboi5ba.arweave.net/HWvVCTgJVLFBcF_Gn7CxLlPAmo1Qhmz6h9xJykguR0I",coinType:"0x1e8b532cca6569cab9f9b9ebc73f8c13885012ade714729aa3b450e0339ac766::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x1e8b532cca6569cab9f9b9ebc73f8c13885012ade714729aa3b450e0339ac766::coin::COIN",coingecko_id:"avalanche-wormhole",labels:["Wormhole"],pyth_id:"93da3352f9f1d105fdfe4971cfa80e9dd777bfc5d0f683ebb6e1294b92137bb7"}},{name:"suibeaver",symbol:"DAM",decimals:9,logoURL:"https://gateway.irys.xyz/8yU5QsDMFoLAoXFfSDrE5m3ZMMAzCzewtwfAy6qHvpju",coinType:"0xaf3aae4940a248739ce4964857381fc3f3149a6d05375bfbb2118592907e3bbb::dam::DAM",isVerified:!0},{name:"svSUI",symbol:"svSUI",decimals:9,logoURL:"https://gateway.irys.xyz/8ot3tVqpC3hhGQhf2sNyGC27Z877ZtcEb79RY1W4fzrB",coinType:"0xe1a1cc6bcf0001a015eab84bcc6713393ce20535f55b8b6f35c142e057a25fbe::scallop_v_sui::SCALLOP_V_SUI",isVerified:!0},{name:"USD Coin (Portal from Eth)",symbol:"wUSDC",decimals:6,logoURL:"https://klrhtty4kphjcsrez2eaeh6r27tbaayw3odjadigbrek544f3i2a.arweave.net/UuJ5zxxTzpFKJM6IAh_R1-YQAxbbhpANBgxIrvOF2jQ",coinType:"0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",coin_priority:990,coingecko_id:"usd-coin-wormhole-from-ethereum",labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:990}},{name:"Wrapped Ether (Portal from Eth)",symbol:"WETH",decimals:8,logoURL:"https://t4gq524jdiihjr6ihouhzsemfczi3eq2cnjyhbfms5utl3hueu6q.arweave.net/nw0O64kaEHTHyDuofMiMKLKNkhoTU4OErJdpNez0JT0",coinType:"0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",coin_priority:940,coingecko_id:"ethereum-wormhole",labels:["Wormhole"],pyth_id:"ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",rank:800}},{name:"Mirai Staked SUI",symbol:"mSUI",decimals:9,logoURL:"https://gateway.irys.xyz/3pwmCNEzHcDWVdobJJa2275EVQupXGzffjahSCPiw9G4",coinType:"0x922d15d7f55c13fd790f6e54397470ec592caa2b508df292a2e8553f3d3b274f::msui::MSUI",isVerified:!0},{name:"ZO Perpetuals LP Token",symbol:"ZLP",decimals:6,logoURL:"https://img.zofinance.io/zlp.png",coinType:"0xf7fade57462e56e2eff1d7adef32e4fd285b21fd81f983f407bb7110ca766cda::zlp::ZLP",isVerified:!0},{name:"Wrapped Fantom (Portal from Fantom)",symbol:"WFTM",decimals:8,logoURL:"https://tqhb43iz7vqrys2frjp73jn2o3uzehbmybq2sv2me2fpo4rocbja.arweave.net/nA4ebRn9YRxLRYpf_aW6dumSHCzAYalXTCaK93IuEFI",coinType:"0x6081300950a4f1e2081580e919c210436a1bed49080502834950d31ee55a2396::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x6081300950a4f1e2081580e919c210436a1bed49080502834950d31ee55a2396::coin::COIN",labels:["Wormhole"],pyth_id:"5c6c0d2386e3352356c3ab84434fafb5ea067ac2678a38a338c4a69ddc4bdb0c"}},{name:"swUSDT",symbol:"swUSDT",decimals:6,logoURL:"https://gateway.irys.xyz/GNNHRxZcwE3QnxL39LZQksEHB1JARX2bhBHGbcZCvfWg",coinType:"0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT",isVerified:!0},{name:"sUSDY",symbol:"sUSDY",decimals:6,logoURL:"https://v4kpvw5rr2kprz4echmm33xktmu4lu7kh3qncwrw7xvzdipatkya.arweave.net/rxT627GOlPjnhBHYze7qmynF0-o-4NFaNv3rkaHgmrA",coinType:"0xd285cbbf54c87fd93cd15227547467bb3e405da8bbf2ab99f83f323f88ac9a65::scallop_usdy::SCALLOP_USDY",isVerified:!0},{name:"$DRF",symbol:"DRF",decimals:6,logoURL:"https://gateway.irys.xyz/4tJCmQbwABnc8z1e8Wyy89j8kCinLdN915LucsZusH2r",coinType:"0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF",isVerified:!0},{name:"swSOL",symbol:"swSOL",decimals:8,logoURL:"https://gateway.irys.xyz/38CYobsZ6resAMb939doWgMwcKrVJm7mDXzXNjKHxTfX",coinType:"0x1392650f2eca9e3f6ffae3ff89e42a3590d7102b80e2b430f674730bc30d3259::scallop_wormhole_sol::SCALLOP_WORMHOLE_SOL",isVerified:!0},{name:"Scallop",symbol:"SCA",decimals:9,logoURL:"https://vrr7y7aent4hea3r444jrrsvgvgwsz6zi2r2vv2odhgfrgvvs6iq.arweave.net/rGP8fARs-HIDcec4mMZVNU1pZ9lGo6rXThnMWJq1l5E",coinType:"0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA",isVerified:!0,extensionFields:{birdeyeid:"0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA",coin_priority:900,coingecko_id:"scallop-2",pyth_id:"7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc",rank:830}},{name:"Daossui Token",symbol:"DAOS",decimals:6,logoURL:"https://public.daossui.io/dao-sui/assets/daossui-token.png",projectURL:"https://daossui.io/",coinType:"0xd40cec91f6dca0673b25451fb0d654e62ad13bf6546a32a21ef0c59eba42e71c::daos::DAOS",isVerified:!0},{name:"SPT",symbol:"SPT",decimals:9,logoURL:"https://seapad.s3.ap-southeast-1.amazonaws.com/uploads/PROD/public/media/images/logo_1685439392353.png",coinType:"0xb779486cfd6c19e9218cc7dc17c453014d2d9ba12d2ee4dbb0ec4e1e02ae1cca::spt::SPT",isVerified:!0},{name:"Suiba Inu",symbol:"SUIB",decimals:9,logoURL:"https://fvies4qayyhittfc6gxdfldafsmynmk5o5yitbrtnujlpbktv77a.arweave.net/LVBJcgDGDonMovGuMqxgLJmGsV13cImGM20St4VTr_4",coinType:"0xed4504e791e1dad7bf93b41e089b4733c27f35fde505693e18186c2ba8e2e14b::suib::SUIB",isVerified:!0},{name:"USD Coin (Celer)",symbol:"cUSDC",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/usdc_celer.png",coinType:"0x94e7a8e71830d2b34b3edaa195dc24c45d142584f06fa257b73af753d766e690::celer_usdc_coin::CELER_USDC_COIN",isVerified:!0,extensionFields:{birdeyeid:"0x94e7a8e71830d2b34b3edaa195dc24c45d142584f06fa257b73af753d766e690::celer_usdc_coin::CELER_USDC_COIN",coin_priority:830,labels:["Celer"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:930}},{name:"FOMO",symbol:"FOMO",decimals:2,logoURL:"https://7ms6dw2zbrlaaeadpyyz7cy5pwdlz64atqh6gdkpuws3uxpesxeq.arweave.net/-yXh21kMVgAQA34xn4sdfYa8-4CcD-MNT6Wlul3klck",coinType:"0xa340e3db1332c21f20f5c08bef0fa459e733575f9a7e2f5faca64f72cd5a54f2::fomo::FOMO",isVerified:!0},{name:"MOVE",symbol:"MOVE",decimals:9,logoURL:"https://gk4id6fee24ru5cdipjxyz6cl42yjtzl3xfuizlpqjub42hx5rvq.arweave.net/MriB-KQmuRp0Q0PTfGfCXzWEzyvdy0Rlb4JoHmj37Gs",coinType:"0x648f9eab1434c056d509ad857fb657ac170528798d771f7eb1edc35639e3e75c::movecoin::MOVECOIN",isVerified:!0,extensionFields:{birdeyeid:"0x648f9eab1434c056d509ad857fb657ac170528798d771f7eb1edc35639e3e75c::movecoin::MOVECOIN",coin_priority:690}},{name:"KOI",symbol:"KOI",decimals:6,logoURL:"https://ubxwf7ujw5ktuqvndqeqogfoiu343qxl2a3h3i5l5zkzj66fp6xa.arweave.net/oG9i_om3VTpCrRwJBxiuRTfNwuvQNn2jq-5VlPvFf64",coinType:"0x01d430425a8a681ef26315e78a082fe744f8d0bbdbd1ab76b9fd78ada09bedca::Koi::KOI",isVerified:!0},{name:"Bucket Token",symbol:"BUT",decimals:9,logoURL:"https://aqua-natural-grasshopper-705.mypinata.cloud/ipfs/QmUKAX4PME9Wb9VU6CMJPisNysaVKZNKpiB3gtMVVZTfjt",coinType:"0xbc858cb910b9914bee64fff0f9b38855355a040c49155a17b265d9086d256545::but::BUT",isVerified:!0},{name:"USD Coin (Portal from BSC)",symbol:"USDCbnb",decimals:8,logoURL:"https://co3xbx3vz2ww7tcs2tp4p36hdnkz677tuvqt6wgyfyoeefj6or6a.arweave.net/E7dw33XOrW_MUtTfx-_HG1Wff_OlYT9Y2C4cQhU-dHw",coinType:"0x909cba62ce96d54de25bec9502de5ca7b4f28901747bbf96b76c2e63ec5f1cba::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x909cba62ce96d54de25bec9502de5ca7b4f28901747bbf96b76c2e63ec5f1cba::coin::COIN",coin_priority:860,coingecko_id:"usd-coin-wormhole-bnb",labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:970}},{name:"haWAL",symbol:"haWAL",decimals:9,logoURL:"https://assets.haedal.xyz/logos/hawal.svg",coinType:"0x8b4d553839b219c3fd47608a0cc3d5fcc572cb25d41b7df3833208586a8d2470::hawal::HAWAL",isVerified:!0},{name:"USD Coin (Portal from Solana)",symbol:"USDCsol",decimals:6,logoURL:"https://gateway.irys.xyz/2q5BcNXs91mPPSaYLCbLRS8Pyha8N76dafj51HdMmrh6",coinType:"0xb231fcda8bbddb31f2ef02e6161444aec64a514e2c89279584ac9806ce9cf037::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xb231fcda8bbddb31f2ef02e6161444aec64a514e2c89279584ac9806ce9cf037::coin::COIN",coin_priority:870,labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:980}},{name:"SPAM",symbol:"SPAM",decimals:4,logoURL:"https://3fc4a4tjkjryoqps44rgwhydihn5htqyfjmrrmlouf6rt5qyxjbq.arweave.net/2UXAcmlSY4dB8uciax8DQdvTzhgqWRixbqF9GfYYukM",coinType:"0x30a644c3485ee9b604f52165668895092191fcaf5489a846afa7fc11cdb9b24a::spam::SPAM",isVerified:!0,extensionFields:{birdeyeid:"0x30a644c3485ee9b604f52165668895092191fcaf5489a846afa7fc11cdb9b24a::spam::SPAM"}},{name:"sKART",symbol:"sKARTCOIN",decimals:9,logoURL:"https://osp3bhhpqkgtrtuww3cn6cqpcy36lxhu2j4djhbr5fu4fzusrt2a.arweave.net/dJ-wnO-CjTjOlrbE3woPFjfl3PTSeDScMelpwuaSjPQ",coinType:"0xfd48ffd0e62ed5cb839400b7e0bee870cd752f9d01c657a665be2afff16995eb::skart::SKART",isVerified:!0,extensionFields:{birdeyeid:"0xfd48ffd0e62ed5cb839400b7e0bee870cd752f9d01c657a665be2afff16995eb::skart::SKART",coin_priority:770}},{name:"FUD Staked SUI",symbol:"fudSUI",decimals:9,logoURL:"https://gateway.irys.xyz/8qhJwoDEavz5KdkJEK9FaiHp9rYEqbWhF7HrqsJpUG4F",coinType:"0x02358129a7d66f943786a10b518fdc79145f1fc8d23420d9948c4aeea190f603::fud_sui::FUD_SUI",isVerified:!0},{name:"suitard",symbol:"STD",decimals:9,logoURL:"https://hawbf2zd3vl47ileyqlznfwluvtyis7bnbfkadg7vpsvxbpe5h4a.arweave.net/OCwS6yPdV8-hZMQXlpbLpWeES-FoSqAM36vlW4Xk6fg",coinType:"0x2cddfc6d4fc855917e990e71cd122b1ee8098aa890186ee15a84524ed17cd8c9::suitard::SUITARD",isVerified:!0,extensionFields:{birdeyeid:"0x2cddfc6d4fc855917e990e71cd122b1ee8098aa890186ee15a84524ed17cd8c9::suitard::SUITARD",coingecko_id:"suitard"}},{name:"NAVX Token",symbol:"NAVX",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/navx.png",coinType:"0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX",isVerified:!0,extensionFields:{birdeyeid:"0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX",coin_priority:950,coingecko_id:"navi",pyth_id:"88250f854c019ef4f88a5c073d52a18bb1c6ac437033f5932cd017d24917ab46",rank:770}},{name:"Wrapped SOL (Portal from Solana)",symbol:"WSOL",decimals:8,logoURL:"https://gateway.irys.xyz/Ek2PhfPT6AgsJ7TYXx4NQJ1WPtNSxPkCo5bVmGRr1aUo",coinType:"0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",coin_priority:790,labels:["Wormhole"],pyth_id:"ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d"}},{name:"Suilama",symbol:"SUILAMA",decimals:6,logoURL:"https://api.movepump.com/uploads/1000030596_8a14750351.jpg",coinType:"0x5a4f64079daed04d923c93f3ac4ee04b637e5b3ea2db87d591981c1049508a27::suilama::SUILAMA",isVerified:!0},{name:"MEMEFI",symbol:"MEMEFI",decimals:9,logoURL:"https://gateway.irys.xyz/AymYAvpqK3rnQE9AqtXwzHzPMQeiqdmm9yamxryDsZCT",coinType:"0x506a6fc25f1c7d52ceb06ea44a3114c9380f8e2029b4356019822f248b49e411::memefi::MEMEFI",isVerified:!0},{name:"SCUBA DOG",symbol:"SCUBA",decimals:6,logoURL:"https://j3i5gtlp36ptsx6lyygrujd2cx7vgzaxbqyeiyqded67ihlbehva.arweave.net/TtHTTW_fnzlfy8YNGiR6Ff9TZBcMMERiAyD99B1hIeo",coinType:"0x9e6d6124287360cc110044d1f1d7d04a0954eb317c76cf7927244bef0706b113::SCUBA::SCUBA",isVerified:!0},{name:"Suiman",symbol:"Suiman",decimals:6,logoURL:"https://cwwuyv2vk4qwk4vdtkub2hlhwy7vy7wqm5ar6hmxdikusgzcxi4a.arweave.net/Fa1MV1VXIWVyo5qoHR1ntj9cftBnQR8dlxoVSRsiujg",coinType:"0xa8b69040684d576828475115b30cc4ce7c7743eab9c7d669535ee31caccef4f5::suiman::SUIMAN",isVerified:!0},{name:"ALPHA Token",symbol:"ALPHA",decimals:9,logoURL:"https://7taj6jfau6n3dri7agspzfnva7qbj5sizz5xc3lb56nmxpsyoiba.arweave.net/_MCfJKCnm7HFHwGk_JW1B-AU9kjOe3FtYe-ay75YcgI",coinType:"0xfe3afec26c59e874f3c1d60b8203cb3852d2bb2aa415df9548b8d688e6683f93::alpha::ALPHA",isVerified:!0,extensionFields:{birdeyeid:"0xfe3afec26c59e874f3c1d60b8203cb3852d2bb2aa415df9548b8d688e6683f93::alpha::ALPHA",coingecko_id:"alpha-fi"}},{name:"sSBWBTC",symbol:"sSBWBTC",decimals:8,logoURL:"https://ferq2danvxy5xrhvml37sv3nlwaraso6iwfjtdops7rscscy7zba.arweave.net/KSMNDA2t8dvE9WL3-VdtXYEQSd5FipmNz5fjIUhY_kI",coinType:"0x08c0fe357d3a138f4552bee393ce3a28a45bebcca43373d6a90bc44ab76f82e2::scallop_sb_wbtc::SCALLOP_SB_WBTC",isVerified:!0},{name:"DeepBook Token",symbol:"DEEP",decimals:6,logoURL:"https://gateway.irys.xyz/5LqWyWG5EU9wPknvW5rY6qSQPtnNAfP27X1PnAiesyFG",coinType:"0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",isVerified:!0,extensionFields:{coingecko_id:"deep",suggested_priority:908}},{name:"sDEEP",symbol:"sDEEP",decimals:6,logoURL:"https://lkjkjfqta7322ikfbcklyovddpnjqrba3hlhhq4u4ilhcfbbjecq.arweave.net/WpKklhMH960hRQiUvDqjG9qYRCDZ1nPDlOIWcRQhSQU",coinType:"0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP",isVerified:!0},{name:"SUIME",symbol:"SUIME",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/suime.png",coinType:"0x934692a74595c4f5a0c026130eb2143eea6fc313742f5d7dd9e45fd6ddbb00f1::suime::SUIME",isVerified:!0,extensionFields:{birdeyeid:"0x934692a74595c4f5a0c026130eb2143eea6fc313742f5d7dd9e45fd6ddbb00f1::suime::SUIME",coin_priority:610}},{name:"dak",symbol:"dak",decimals:6,logoURL:"https://gateway.irys.xyz/JAgm2ztSdQGU5CncYUtNSp4Ce6qtv29nttZKAeQn441S",coinType:"0x41636c138167952207c88f5a75e433c9e880bc7bd5e4e46047d82be266d36712::dak::DAK",isVerified:!0},{name:"Tocen Token",symbol:"TOCE",decimals:9,logoURL:"https://ipfs.tocen.co/tocen/toce.png",coinType:"0xd2013e206f7983f06132d5b61f7c577638ff63171221f4f600a98863febdfb47::toce::TOCE",isVerified:!0,extensionFields:{birdeyeid:"0xd2013e206f7983f06132d5b61f7c577638ff63171221f4f600a98863febdfb47::toce::TOCE",coin_priority:650}},{name:"sWAL",symbol:"sWAL",decimals:9,logoURL:"https://demac7qmvo7cyr42swwzpki63in27j35g4b6rropmrwsmiszjbsq.arweave.net/GRgBfgyrvixHmpWtl6ke2huvp303A-jFz2RtJiJZSGU",coinType:"0x622345b3f80ea5947567760eec7b9639d0582adcfd6ab9fccb85437aeda7c0d0::scallop_wal::SCALLOP_WAL",isVerified:!0},{name:"safSUI",symbol:"safSUI",decimals:9,logoURL:"https://gateway.irys.xyz/3XoP2XumjxAAYDBWRJHhBLSHsLzH4jNnxWF6DB4rfWhN",coinType:"0x00671b1fa2a124f5be8bdae8b91ee711462c5d9e31bda232e70fd9607b523c88::scallop_af_sui::SCALLOP_AF_SUI",isVerified:!0},{name:"Agent S",symbol:"S",decimals:9,logoURL:"https://gateway.irys.xyz/B1xigsnVycuq7LkED5LybeZ6HhLyU14ZMDffDL4q577D",coinType:"0xea65bb5a79ff34ca83e2995f9ff6edd0887b08da9b45bf2e31f930d3efb82866::s::S",isVerified:!0},{name:"OceansGallerie",symbol:"OCEANS",decimals:9,logoURL:"https://gateway.irys.xyz/8a67JLSE8m56kK8bMFFt9HUhpSa1XeGFzSxqdrRcKtjB",coinType:"0xe90c71d308d8e6fed933d20f8b94d811e1dac649dac7815762520e90f84392f7::oceans::OCEANS",isVerified:!0},{name:"SuiBoxer",symbol:"SBOX",decimals:1,logoURL:"https://archive.cetus.zone/assets/image/sui/sbox.png",coinType:"0xbff8dc60d3f714f678cd4490ff08cabbea95d308c6de47a150c79cc875e0c7c6::sbox::SBOX",isVerified:!0,extensionFields:{birdeyeid:"0xbff8dc60d3f714f678cd4490ff08cabbea95d308c6de47a150c79cc875e0c7c6::sbox::SBOX",coin_priority:630,coingecko_id:"suiboxer"}},{name:"Fud The Pug",symbol:"FUD",decimals:5,logoURL:"https://archive.cetus.zone/assets/image/sui/fud.png",coinType:"0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",isVerified:!0,extensionFields:{birdeyeid:"0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",coin_priority:820,pyth_id:"6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75"}},{name:"sBLUB",symbol:"sBLUB",decimals:2,logoURL:"https://gutxmo5scqefen42iu6ysi5unhdsdenwtcqe2z5hxszz3ssdhzsa.arweave.net/NSd2O7IUCFI3mkU9iSO0acchkbaYoE1np7yzncpDPmQ",coinType:"0xe72f65446eabfad2103037af2d49d24599106fb44bf4c046c1e7e9acf6844dd0::scallop_blub::SCALLOP_BLUB",isVerified:!0},{name:"Typus",symbol:"TYPUS",decimals:9,logoURL:"https://gateway.irys.xyz/CQCvjKXMzASaCMXWx1SyUMa6syFJqtwAaAsAhbzsHGXi",coinType:"0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385::typus::TYPUS",isVerified:!0},{name:"sFUD",symbol:"sFUD",decimals:5,logoURL:"https://enx3zetzw42z2gpckvye66ljal2vfu63rb2qc5arvq7wof3xdbhq.arweave.net/I2-8knm3NZ0Z4lVwT3lpAvVS09uIdQF0Eaw_Zxd3GE8",coinType:"0xe56d5167f427cbe597da9e8150ef5c337839aaf46891d62468dcf80bdd8e10d1::scallop_fud::SCALLOP_FUD",isVerified:!0},{name:"shaSUI",symbol:"shaSUI",decimals:9,logoURL:"https://gateway.irys.xyz/8raXDMcjv2y9sV6pXSJkiyw6PXa7B44GRXNzuBBstfQL",coinType:"0x9a2376943f7d22f88087c259c5889925f332ca4347e669dc37d54c2bf651af3c::scallop_ha_sui::SCALLOP_HA_SUI",isVerified:!0,extensionFields:{birdeyeid:"0x9a2376943f7d22f88087c259c5889925f332ca4347e669dc37d54c2bf651af3c::scallop_ha_sui::SCALLOP_HA_SUI"}},{name:"Lorenzo stBTC",symbol:"stBTC",decimals:8,logoURL:"https://node1.irys.xyz/qg69O3RwWkFt8QG2_GeTh-xGOQEkLbaiPjuU-yDsHqM",coinType:"0x5f496ed5d9d045c5b788dc1bb85f54100f2ede11e46f6a232c29daada4c5bdb6::coin::COIN",isVerified:!0,extensionFields:{coingecko_id:"lorenzo-stbtc"}},{name:"Suia Token",symbol:"SUIA",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/suia.png",coinType:"0x1d58e26e85fbf9ee8596872686da75544342487f95b1773be3c9a49ab1061b19::suia_token::SUIA_TOKEN",isVerified:!0,extensionFields:{birdeyeid:"0x1d58e26e85fbf9ee8596872686da75544342487f95b1773be3c9a49ab1061b19::suia_token::SUIA_TOKEN",coin_priority:800,coingecko_id:"suia"}},{name:"Wrapped Matic (Portal from Polygon)",symbol:"WMATIC",decimals:8,logoURL:"https://fe3wnx45vysrtzfr7kwg4aowt7aqb2tku4szytg2ayfwdyp3jk6q.arweave.net/KTdm352uJRnksfqsbgHWn8EA6mqnJZxM2gYLYeH7Sr0",coinType:"0xdbe380b13a6d0f5cdedd58de8f04625263f113b3f9db32b3e1983f49e2841676::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xdbe380b13a6d0f5cdedd58de8f04625263f113b3f9db32b3e1983f49e2841676::coin::COIN",coin_priority:710,coingecko_id:"matic-wormhole",labels:["Wormhole"],pyth_id:"5de33a9112c2b700b8d30b8a3402c103578ccfa2765696471cc672bd5cf6ac52"}},{name:"Bucket USD",symbol:"BUCK",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/buck.png",coinType:"0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK",isVerified:!0,extensionFields:{birdeyeid:"0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK",coin_priority:920,coingecko_id:"bucket-protocol-buck-stablecoin",pyth_id:"fdf28a46570252b25fd31cb257973f865afc5ca2f320439e45d95e0394bc7382",rank:900,suggested_priority:900}},{name:"CETUS Token",symbol:"CETUS",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/cetus.png",coinType:"0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS",isVerified:!0,extensionFields:{birdeyeid:"0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS",coin_priority:970,coingecko_id:"cetus-protocol",pyth_id:"e5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef",rank:810,suggested_priority:980}},{name:"Ondo US Dollar Yield",symbol:"USDY",decimals:6,logoURL:"https://66wosxwjgpz7qbv4psulb555d35nxqn6h6jtgu2cxzw4awrbtw3q.arweave.net/96zpXskz8_gGvHyosPe9Hvrbwb4_kzNTQr5twFohnbc",coinType:"0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb::usdy::USDY",isVerified:!0,extensionFields:{birdeyeid:"0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb::usdy::USDY",coin_priority:880,coingecko_id:"ondo-us-dollar-yield",pyth_id:"e393449f6aff8a4b6d3e1165a7c9ebec103685f3b41e60db4277b5b6d10e7326",rank:890}},{name:"Bluefin",symbol:"BLUE",decimals:9,logoURL:"https://gateway.irys.xyz/CppTxB1NXfoDaJL4cjB6RyzFFwzySRF8zD8t2pBaMy8s",coinType:"0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca::blue::BLUE",isVerified:!0},{name:"swBTC",symbol:"swBTC",decimals:8,logoURL:"https://gateway.irys.xyz/82YqjZLgZo2wjsbktvPnKgAaSrUbkfJuL3zq4GBASjnP",coinType:"0x2cf76a9cf5d3337961d1154283234f94da2dcff18544dfe5cbdef65f319591b5::scallop_wormhole_btc::SCALLOP_WORMHOLE_BTC",isVerified:!0},{name:"Tether (Celer)",symbol:"cUSDT",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/usdt_celer.png",coinType:"0x94e7a8e71830d2b34b3edaa195dc24c45d142584f06fa257b73af753d766e690::celer_usdt_coin::CELER_USDT_COIN",isVerified:!0,extensionFields:{birdeyeid:"0x94e7a8e71830d2b34b3edaa195dc24c45d142584f06fa257b73af753d766e690::celer_usdt_coin::CELER_USDT_COIN",labels:["Celer"],pyth_id:"2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b"}},{name:"WEWE",symbol:"WEWE",decimals:9,logoURL:"https://file-walletapp.waveonsui.com/logos/wewe.png",coinType:"0xb5b603827d1bfb2859200fd332d5e139ccac2598f0625de153a87cf78954e0c4::wewe::WEWE",isVerified:!0},{name:"sSUI",symbol:"sSUI",decimals:9,logoURL:"https://gateway.irys.xyz/GYmShkpMcYFgSsEcpCEZUPiChhBaFeXMQnFrxxjqZdhE",coinType:"0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI",isVerified:!0,extensionFields:{birdeyeid:"0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI"}},{name:"USD Coin (Portal from Arbitrum, New)",symbol:"USDCarb",decimals:6,logoURL:"https://boqgq74qfqr7gfo4x7tpesefwkzawnbe4e3anop54gwsh3ctfdoa.arweave.net/C6Bof5AsI_MV3L_m8kiFsrILNCThNga5_eGtI-xTKNw",coinType:"0xc3f8927de33d3deb52c282a836082a413bc73c6ee0bd4d7ec7e3b6b4c28e9abf::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xc3f8927de33d3deb52c282a836082a413bc73c6ee0bd4d7ec7e3b6b4c28e9abf::coin::COIN",coin_priority:841,labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:950}},{name:"Meadow",symbol:"MED",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/meadow.png",coinType:"0x9a7ca7b6de5b6e9a4dadec42fada7cd84068aebd7adbd1faeb713622c4628ca9::meadow::MEADOW",isVerified:!0,extensionFields:{birdeyeid:"0x9a7ca7b6de5b6e9a4dadec42fada7cd84068aebd7adbd1faeb713622c4628ca9::meadow::MEADOW",coin_priority:670,coingecko_id:"meadow"}},{name:"Tether by Sui Bridge",symbol:"suiUSDT",decimals:6,logoURL:"https://gateway.irys.xyz/H6RiSi7PDvKaKCzgsLybW1Pdaq4pvakBHnTvghWD5Kad",coinType:"0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT",isVerified:!0,extensionFields:{coin_priority:831,rank:931,suggested_priority:990}},{name:"BLUB",symbol:"BLUB",decimals:2,logoURL:"https://453ilwcfza3uzupxtaell2f2acwezft7jynjduuc3skuehtu76pq.arweave.net/53aF2EXIN0zR95gItei6AKxMln9OGpHSgtyVQh50_58",coinType:"0xfa7ac3951fdca92c5200d468d31a365eb03b2be9936fde615e69f0c1274ad3a0::BLUB::BLUB",isVerified:!0,extensionFields:{birdeyeid:"0xfa7ac3951fdca92c5200d468d31a365eb03b2be9936fde615e69f0c1274ad3a0::BLUB::BLUB",coin_priority:821,coingecko_id:"blub"}},{name:"Pum Pup",symbol:"PUP",decimals:9,logoURL:"https://res.cetus.zone/coin-metadata/mainnet/icon/pup.png",coinType:"0x980ec1e7d5a3d11c95039cab901f02a044df2d82bc79d99b60455c02524fad83::pup::PUP",isVerified:!0,extensionFields:{birdeyeid:"0x980ec1e7d5a3d11c95039cab901f02a044df2d82bc79d99b60455c02524fad83::pup::PUP"}},{name:"sSBETH",symbol:"sSBETH",decimals:8,logoURL:"https://gateway.irys.xyz/4Zaceo2mJ9SQFKFdoqib1WMjdW1oYkNmTqV8MEsHjCCP",coinType:"0xb14f82d8506d139eacef109688d1b71e7236bcce9b2c0ad526abcd6aa5be7de0::scallop_sb_eth::SCALLOP_SB_ETH",isVerified:!0},{name:"USD Coin (Portal from Arbitrum, Old)",symbol:"USDCarb",decimals:6,logoURL:"https://zesrehijzslvuwaf7vplw5qsnhjdz4cpsighhn65watc4fwl22gq.arweave.net/ySUSHQnMl1pYBf1eu3YSadI88E-SDHO33bAmLhbL1o0",coinType:"0xe32d3ebafa42e6011b87ef1087bbc6053b499bf6f095807b9013aff5a6ecd7bb::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xe32d3ebafa42e6011b87ef1087bbc6053b499bf6f095807b9013aff5a6ecd7bb::coin::COIN",coin_priority:840,coingecko_id:"usd-coin-wormhole-arb",labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:940}},{name:"aaa cat",symbol:"AAA",decimals:6,logoURL:"https://45hgkrkliypqc7rpknvnhhqvsdpk23m2sfphh3vcmqrukddd74la.arweave.net/505lRUtGHwF-L1Nq054VkN6tbZqRXnPuomQjRQxj_xY",coinType:"0xd976fda9a9786cda1a36dee360013d775a5e5f206f8e20f84fad3385e99eeb2d::aaa::AAA",isVerified:!0},{name:"mETH",symbol:"mETH",decimals:8,logoURL:"https://gateway.irys.xyz/83AAjCZKyL3VKpxDZG71f4qNWuuqg4uHp4BHVLA3G14e",coinType:"0xccd628c2334c5ed33e6c47d6c21bb664f8b6307b2ac32c2462a61f69a31ebcee::meth::METH",isVerified:!0},{name:"WAVE",symbol:"WAV",decimals:9,logoURL:"https://files.waveonsui.com/logos/wav.png",coinType:"0x82616322719cb327186d5b83a6d7783ce5cef4c5dbd4c6d1b5f3d6e5d288e2be::wav::WAV",isVerified:!0},{name:"PIGU",symbol:"PIGU",decimals:5,logoURL:"https://idcawqx5x4ziq6wq7xck7wlleckqbzv5jbhqpgbbeynww2kd4pda.arweave.net/QMQLQv2_Moh60P3Er9lrIJUA5r1ITweYISYba2lD48Y",coinType:"0xfc71274a94f5d9cd1ae6928ecfc9fa910d03eb28258fddeb9842ac3c7b4f3ae6::pigu::PIGU",isVerified:!0},{name:"Tether (Portal from Eth)",symbol:"wUSDT",decimals:6,logoURL:"https://gateway.irys.xyz/DJs8CsKRW4sP5dgi8zfZRWiFXpzNsN3EnUYkQknu4dyd",coinType:"0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",coin_priority:980,coingecko_id:"tether-usd-wormhole-from-ethereum",labels:["Wormhole"],pyth_id:"2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b",rank:920}},{name:"sMOVE",symbol:"sMOVECOIN",logoURL:"https://4g7mzcwybmcqsnwiygg4eotqtqkays7y6qyyuycm7tetewing4da.arweave.net/4b7MitgLBQk2yMGNwjpwnBQMS_j0MYpgTPzJMlkNNwY",coinType:"0xf925a9e67cbe498c7e5cd87a17fc09692c455b940f065f4b462f885ea196a89d::smove::SMOVE",isVerified:!0,extensionFields:{birdeyeid:"0xf925a9e67cbe498c7e5cd87a17fc09692c455b940f065f4b462f885ea196a89d::smove::SMOVE",coin_priority:760}},{name:"SuiAI",symbol:"SUAI",decimals:6,logoURL:"https://api.suiai.fun/uploads/suai_logo.png",coinType:"0xbc732bc5f1e9a9f4bdf4c0672ee538dbf56c161afe04ff1de2176efabdf41f92::suai::SUAI",isVerified:!0},{name:"SuiPad",symbol:"SUIP",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/suip.png",coinType:"0xe4239cd951f6c53d9c41e25270d80d31f925ad1655e5ba5b543843d4a66975ee::SUIP::SUIP",isVerified:!0,extensionFields:{birdeyeid:"0xe4239cd951f6c53d9c41e25270d80d31f925ad1655e5ba5b543843d4a66975ee::SUIP::SUIP",coin_priority:780,coingecko_id:"suipad"}},{name:"BULLA",symbol:"BULLA",decimals:8,logoURL:"https://i.imgur.com/YPFKKZw.jpeg",coinType:"0xeec46a9527885ade0b62b984315f2f45d4cd40d9a8c19a553e553e722ab33239::bulla::BULLA",isVerified:!0},{name:"Dungeon Gold",symbol:"DGG",decimals:6,logoURL:"https://h6bzmql5j4nlpj3hiiizzqdmygd7xfbkzcn2gtfy4chmjsmmpdsq.arweave.net/P4OWQX1PGrenZ0IRnMBswYf7lCrIm6NMuOCOxMmMeOU",coinType:"0x625d518a3cc78899742d76cf785609cd707e15228d4284aa4fee5ca53caa9849::dgg_token::DGG_TOKEN",isVerified:!0,extensionFields:{birdeyeid:"0x625d518a3cc78899742d76cf785609cd707e15228d4284aa4fee5ca53caa9849::dgg_token::DGG_TOKEN"}},{name:"sFDUSD",symbol:"sFDUSD",decimals:6,logoURL:"https://am6vo2vn4mg2lm7vmajonsipgkat56z75mxe55babpztrbssmb4a.arweave.net/Az1Xaq3jDaWz9WAS5skPMoE--z_rLk70IAvzOIZSYHg",coinType:"0x6711551c1e7652a270d9fbf0eee25d99594c157cde3cb5fbb49035eb59b1b001::scallop_fdusd::SCALLOP_FDUSD",isVerified:!0},{name:"KDX",symbol:"KDX",decimals:6,logoURL:"https://i.ibb.co/Wsbch2z/kriya.png",coinType:"0x3b68324b392cee9cd28eba82df39860b6b220dc89bdd9b21f675d23d6b7416f1::kdx::KDX",isVerified:!0},{name:"LuckyStar",symbol:"LUCK",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/luck.png",coinType:"0x202591744d54ee4f4af736ef3b8508f3d46d982c36747d9587032bd549122179::luck::LUCK",isVerified:!0,extensionFields:{birdeyeid:"0x202591744d54ee4f4af736ef3b8508f3d46d982c36747d9587032bd549122179::luck::LUCK",coin_priority:640}},{name:"OTTER",symbol:"OTTER",decimals:9,logoURL:"https://i52dwsbjw2rvuagb4yknsxruq2vwqprdhga6p53ik3co6kzdiwea.arweave.net/R3Q7SCm2o1oAweYU2V40hqtoPiM5gef3aFbE7ysjRYg",coinType:"0x297b7f887a47fdcdf82364b5b175c2f00c2ece012c06ec7dc58ee7bc0c63aa07::otter::OTTER",isVerified:!0,extensionFields:{birdeyeid:"0x297b7f887a47fdcdf82364b5b175c2f00c2ece012c06ec7dc58ee7bc0c63aa07::otter::OTTER",coin_priority:660}},{name:"Suiswap",symbol:"SSWP",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/sswp.png",coinType:"0x361dd589b98e8fcda9a7ee53b85efabef3569d00416640d2faa516e3801d7ffc::TOKEN::TOKEN",isVerified:!0,extensionFields:{birdeyeid:"0x361dd589b98e8fcda9a7ee53b85efabef3569d00416640d2faa516e3801d7ffc::TOKEN::TOKEN",coin_priority:740}},{name:"First Digital USD",symbol:"FDUSD",decimals:6,logoURL:"https://cdn.1stdigital.com/icon/fdusd.svg",coinType:"0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD",isVerified:!0,extensionFields:{coin_priority:971,pyth_id:"ccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979"}},{name:"Dripward",symbol:"DRIP",decimals:9,logoURL:"https://gh63r3fltrhlf22hh6722j667hyk546aycyevlmody46swnzh5da.arweave.net/Mf247KucTrLrRz-_rSfe-fCu88DAsEqtjh456Vm5P0Y",coinType:"0x9eed28fc98688a799fe51aa6ed39b851bd09d950fc785b2d7c9f543796254631::drip::DRIP",isVerified:!0,extensionFields:{birdeyeid:"0x9eed28fc98688a799fe51aa6ed39b851bd09d950fc785b2d7c9f543796254631::drip::DRIP"}},{name:"superSUI",symbol:"superSUI",decimals:9,logoURL:"https://gateway.irys.xyz/TAKkVW5fTxDGTTgM22eFNEQX2V6JbLuN2ckBtFybrix",coinType:"0x790f258062909e3a0ffc78b3c53ac2f62d7084c3bab95644bdeb05add7250001::super_sui::SUPER_SUI",isVerified:!0,extensionFields:{birdeyeid:"0x790f258062909e3a0ffc78b3c53ac2f62d7084c3bab95644bdeb05add7250001::super_sui::SUPER_SUI"}},{name:"SuiNS Token",symbol:"NS",decimals:6,logoURL:"https://gateway.irys.xyz/FRs7eLL3B5eABDW3hG5xwtaATaU4x8fEZm9V5z8GdFYr",coinType:"0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS",isVerified:!0},{name:"ARTFI",symbol:"ARTFI",decimals:9,logoURL:"https://rao3tdm6qnrnk3z6tga4jsnn5ufuapmlqoffpatiqligyjb2vnga.arweave.net/iB25jZ6DYtVvPpmBxMmt7QtAPYuDileCaILQbCQ6q0w",coinType:"0x706fa7723231e13e8d37dad56da55c027f3163094aa31c867ca254ba0e0dc79f::artfi::ARTFI",isVerified:!0,extensionFields:{birdeyeid:"0x706fa7723231e13e8d37dad56da55c027f3163094aa31c867ca254ba0e0dc79f::artfi::ARTFI",coingecko_id:"artfi"}},{name:"sCETUS",symbol:"sCETUS",decimals:9,logoURL:"https://gateway.irys.xyz/FfmvsmthhRiAaBwY8nZjx8uavV2ySs7USgn5xamsxFf5",coinType:"0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS",isVerified:!0,extensionFields:{birdeyeid:"0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS"}},{name:"Sacabam",symbol:"SCB",decimals:5,logoURL:"https://archive.cetus.zone/assets/image/sui/scb.png",coinType:"0x9a5502414b5d51d01c8b5641db7436d789fa15a245694b24aa37c25c2a6ce001::scb::SCB",isVerified:!0,extensionFields:{birdeyeid:"0x9a5502414b5d51d01c8b5641db7436d789fa15a245694b24aa37c25c2a6ce001::scb::SCB",coin_priority:730,coingecko_id:"sacabam"}},{name:"Pearl",symbol:"PRL",decimals:12,logoURL:"https://archive.cetus.zone/assets/image/sui/pearl.png",coinType:"0x4e56b39acd75721999cf833062dfb77b1d51e749b02d90f049a5688e21919a64::prl::PRL",isVerified:!0,extensionFields:{birdeyeid:"0x4e56b39acd75721999cf833062dfb77b1d51e749b02d90f049a5688e21919a64::prl::PRL"}},{name:"Pyth Network",symbol:"PYTH",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/pyth.png",coinType:"0x9c6d76eb273e6b5ba2ec8d708b7fa336a5531f6be59f326b5be8d4d8b12348a4::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x9c6d76eb273e6b5ba2ec8d708b7fa336a5531f6be59f326b5be8d4d8b12348a4::coin::COIN",coin_priority:810,pyth_id:"0bbf28e9a841a1cc788f6a361b17ca072d0ea3098a1e5df1c3922d06719579ff"}},{name:"LOOPY",symbol:"LOOPY",decimals:6,logoURL:"https://lk47si3fdmkhszxbmzuksrg5gcbum5rbnudnjd7cnzxor7g2cd7a.arweave.net/Wrn5I2UbFHlm4WZoqUTdMINGdiFtBtSP4m5u6PzaEP4",coinType:"0x9b9c0e26a8ace7edb8fce14acd81507c507c677a400cfb9cc9a0ca4a8432a97a::loopy_sui::LOOPY_SUI",isVerified:!0},{name:"JWLSCA",symbol:"JWLSCA",decimals:9,logoURL:"https://ocknifrosvx5vmpte2zavnpv7fpkauqsqu5tij43iy5shxdle6ha.arweave.net/cJTUFi6Vb9qx8yayCrX1-V6gUhKFOzQnm0Y7I9xrJ44",coinType:"0x0e25582daef54ee41052390c4db5e70a82ec1baed97942db0eb6094267624b5d::jwlsca::JWLSCA",isVerified:!0},{name:"JWLSUI",symbol:"JWLSUI",decimals:9,logoURL:"https://bwxyokyoypcv4zjesyqn6gnjfopzohnrcv2lqwdvcccgahccintq.arweave.net/Da-HKw7DxV5lJJYg3xmpK5-XHbEVdLhYdRCEYBxCQ2c",coinType:"0x2921ca2fe6ee99698b095f046bc9759ce7a764d2e91ab0ad182c143649c3df79::jwlsui::JWLSUI",isVerified:!0},{name:"SLOVE",symbol:"SLOVE",decimals:6,logoURL:"https://ipfs.io/ipfs/bafkreigt2pvpzokflugamigupuwo3xfw3agg3xcfuiduqpv3j6hfooh65a",coinType:"0x6dd439dee053557b3dd340287a4b81099b3e729cb48fbdae726dd2dff82736c3::slove::SLOVE",isVerified:!0},{name:"FroggnRatt",symbol:"FRATT",decimals:2,logoURL:"https://xatontgesaqf7cfeboedtsik7xnnz2wespeifbf3igqzifiqi6fa.arweave.net/uCbmzMSQIF-IpAuIOckK_drc6sSTyIKEu0GhlBUQR4o",coinType:"0x31348f17429e6b37ed269cc667cc83947ff8c54593dcbd1a56cae06a895a38be::fratt::FRATT",isVerified:!0},{name:"Aftermath Staked SUI",symbol:"afSUI",decimals:9,logoURL:"https://aftermath.finance/coins/afsui.svg",coinType:"0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI",isVerified:!0,extensionFields:{birdeyeid:"0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI",coin_priority:909,pyth_id:"17cd845b16e874485b2684f8b8d1517d744105dbb904eec30222717f4bc9ee0d",rank:850}},{name:"JWLCETUS",symbol:"JWLCETUS",decimals:9,logoURL:"https://t3d7i5s4u6ntxge7nqkwjnfnyswrk22ymd4utk4qmaxlh7zofgyq.arweave.net/nsf0dlynmzuYn2wVZLStxK0Va1hg-UmrkGAus_8uKbE",coinType:"0x0e25582daef54ee41052390c4db5e70a82ec1baed97942db0eb6094267624b5d::jwlcetus::JWLCETUS",isVerified:!0,extensionFields:{birdeyeid:"0x0e25582daef54ee41052390c4db5e70a82ec1baed97942db0eb6094267624b5d::jwlcetus::JWLCETUS"}},{name:"SUI Token",symbol:"SUI",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/sui.png",coinType:"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",isVerified:!0,extensionFields:{birdeyeid:"0x2::sui::SUI",coin_priority:1e3,coingecko_id:"sui",pyth_id:"23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",rank:880,suggested_priority:1e3}},{name:"LOFI",symbol:"LOFI",decimals:9,logoURL:"https://gateway.irys.xyz/GqFLYxhLNuKYbSYCVJrjqnARisqogKhggngtYg9sZ9uw",coinType:"0xf22da9a24ad027cccb5f2d496cbe91de953d363513db08a3a734d361c7c17503::LOFI::LOFI",isVerified:!0},{name:"Sonic Snipe Bot",symbol:"Sonic",decimals:9,logoURL:"https://gateway.irys.xyz/E82DQkogizAv1CYi8nbgWydVx49DHy42qSRzksMx4iwx",coinType:"0x555f3aa7c9c60ca67f906557777fab78fd70a302da7d66a23fcb4f8808d15010::sonic::SONIC",isVerified:!0},{name:"Sui Plop",symbol:"PLOP",decimals:6,logoURL:"https://fj74jg6iknyhnkkajybduxndrgvp3r7lklyjnlj7w2cvflsc574a.arweave.net/Kn_Em8hTcHapQE4COl2jiar9x-tS8JatP7aFUq5C7_g",coinType:"0x1c6cd615ed4c42a34977212a3407a28eec21acc572c8dbe7d0382bf0289a2590::plop::PLOP",isVerified:!0},{name:"WAL Token",symbol:"WAL",decimals:9,logoURL:"https://gateway.irys.xyz/7dgjqChkGXxmhFvqR5AWP4vWUs8hNiJpe9Cw7K4x7GP2",coinType:"0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL",isVerified:!0,extensionFields:{suggested_priority:904}},{name:"Native USDC",symbol:"USDC",decimals:6,logoURL:"https://gateway.irys.xyz/EGpc2cG886CrWwLMneF2RyVpZ7D33a6znz6XE8n8nU7h",coinType:"0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",isVerified:!0,extensionFields:{coin_priority:991,coingecko_id:"usd-coin",pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:1e3,suggested_priority:991}},{name:"STASH",symbol:"STASH",decimals:9,logoURL:"https://7kyn2qaielikddp6kpi7dtriubzemb2pthesca33bxsxskusunhq.arweave.net/-rDdQAgi0KGN_lPR8c4ooHJGB0-ZySEDew3leSqSo08",coinType:"0x2cff601fe16f622fd6203f8f64bef4e68d687f51f4d06f13c2bbba17cb84c87e::stash::STASH",isVerified:!0,extensionFields:{birdeyeid:"0x2cff601fe16f622fd6203f8f64bef4e68d687f51f4d06f13c2bbba17cb84c87e::stash::STASH"}},{name:"swETH",symbol:"swETH",decimals:8,logoURL:"https://gateway.irys.xyz/J1Ni98whDmtXgtGYDmk7Hy6qfoHas9MJYwMnixgDSdNo",coinType:"0x67540ceb850d418679e69f1fb6b2093d6df78a2a699ffc733f7646096d552e9b::scallop_wormhole_eth::SCALLOP_WORMHOLE_ETH",isVerified:!0},{name:"meow",symbol:"meow",decimals:6,logoURL:"https://g2eop2adggvbnllpabicghum55pai3bt23c5yvo3c5gohtix6fma.arweave.net/Nojn6AMxqhatbwBQIx6M714EbDPWxdxV2xdM480X8Vg",coinType:"0x06b145d0322e389d6225f336ab57bba4c67e4e701bd6c6bc959d90675900a17e::meow::MEOW",isVerified:!0,extensionFields:{birdeyeid:"0x06b145d0322e389d6225f336ab57bba4c67e4e701bd6c6bc959d90675900a17e::meow::MEOW"}},{name:"SUI TRUMP",symbol:"SUITRUMP",decimals:6,logoURL:"https://gateway.irys.xyz/9Q89LeyqhQSDGun24w1PYZC6zZ4KTGhCPDC2rJpQieY1",coinType:"0xdeb831e796f16f8257681c0d5d4108fa94333060300b2459133a96631bf470b8::suitrump::SUITRUMP",isVerified:!0},{name:"Wrapped BTC (Portal from Eth)",symbol:"WBTC",decimals:8,logoURL:"https://gateway.irys.xyz/dNcUM18WoBxiGE55MrQVgt9kZ7yho9WbyJWa8NbSxDH",coinType:"0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",coin_priority:890,coingecko_id:"wrapped-btc-wormhole",labels:["Wormhole"],pyth_id:"e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",rank:790}},{name:"Releap",symbol:"REAP",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/reap.png",coinType:"0xde2d3e02ba60b806f81ee9220be2a34932a513fe8d7f553167649e95de21c066::reap_token::REAP_TOKEN",isVerified:!0,extensionFields:{birdeyeid:"0xde2d3e02ba60b806f81ee9220be2a34932a513fe8d7f553167649e95de21c066::reap_token::REAP_TOKEN",coin_priority:750}},{name:"ETH by Sui Bridge",symbol:"ETH",decimals:8,logoURL:"https://gateway.irys.xyz/435auUGaKQ3FAT7CZnegmvNNJnbuRc7aSkwTTDJ5JmNw",coinType:"0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH",isVerified:!0,extensionFields:{coin_priority:941,coingecko_id:"ethereum",pyth_id:"ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",rank:780,suggested_priority:890}},{name:"BonkCoin (Portal from Solana)",symbol:"BONK",decimals:5,logoURL:"https://3dgyzd2llawd2e6monsrlnrj4ijs3n3zkno37khmqcfbfjquvknq.arweave.net/2M2Mj0tYLD0TzHNlFbYp4hMtt3lTXb-o7ICKEqYUqps",coinType:"0x6907963ca849faff0957b9a8269a7a07065e3def2eef49cc33b50ab946ea5a9f::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x6907963ca849faff0957b9a8269a7a07065e3def2eef49cc33b50ab946ea5a9f::coin::COIN",coin_priority:680,labels:["Wormhole"],pyth_id:"72b021217ca3fe68922a19aaf990109cb9d84e9ad004b4d2025ad6f529314419"}},{name:"SroomAI DAO",symbol:"SHR0",decimals:9,logoURL:"https://suidaos.com/logo/shro.png",coinType:"0x16ab6a14d76a90328a6b04f06b0a0ce952847017023624e0c37bf8aa314c39ba::shr::SHR",isVerified:!0},{name:"USD Coin (Portal from Polygon)",symbol:"USDCpol",decimals:6,logoURL:"https://otjatct2scltanet7e7untvl3lx4kccddwx5pusxqr6a2pd3qe5a.arweave.net/dNIJinqQlzA0k_k_Rs6r2u_FCEMdr9fSV4R8DTx7gTo",coinType:"0xcf72ec52c0f8ddead746252481fb44ff6e8485a39b803825bde6b00d77cdb0bb::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xcf72ec52c0f8ddead746252481fb44ff6e8485a39b803825bde6b00d77cdb0bb::coin::COIN",coin_priority:850,labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:960}},{name:"AlphaFi Staked SUI",symbol:"stSUI",decimals:9,logoURL:"https://images.alphafi.xyz/stSUI.png",coinType:"0xd1b72982e40348d069bb1ff701e634c117bb5f741f44dff91e472d3b01461e55::stsui::STSUI",isVerified:!0},{name:"FLAMINGO GRINGO",symbol:"FLAMINGO",decimals:6,logoURL:"https://oggdkiqjw4niipp2w7r2ooeujubnhynevxkdwlqlqzqnrb7lufwa.arweave.net/cYw1Igm3GoQ9-rfjpziUTQLT4aSt1DsuC4Zg2IfroWw",coinType:"0x17c334979cd0698ccf9450a3ec2ae0ce1e4c6b0935353fe5facbf69fa77a72af::flamingo::FLAMINGO",isVerified:!0},{name:"AUSD",symbol:"AUSD",decimals:6,logoURL:"https://qele7wvrqjkzonp2egfsagymxbgrewy7adtywuxng4tmpdaycfxa.arweave.net/gRZP2rGCVZc1-iGLIBsMuE0SWx8A54tS7Tcmx4wYEW4",coinType:"0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD",isVerified:!0,extensionFields:{birdeyeid:"0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD",coin_priority:822,coingecko_id:"agora-dollar",rank:910}},{name:"Chirp Token",symbol:"CHIRP",decimals:10,logoURL:"https://download.chirpwireless.io/images/CHIRP_White_OBG.svg",coinType:"0x1ef4c0b20340b8c6a59438204467ca71e1e7cbe918526f9c2c6c5444517cd5ca::chirp::CHIRP",isVerified:!0},{name:"pSTAKE Finance",symbol:"PSTAKE",decimals:8,logoURL:"https://gateway.irys.xyz/3iYkJnAE2Kt14r6DoRvbbntbdVRjBt9LAURH4DTKmmrb",coinType:"0x61017ce4bd0b75b266af53edd60bbe391ba1a9fbe9a7d8553657c94ef73ee2ab::coin::COIN",isVerified:!0},{name:"xAIFRENS",symbol:"xAIFRENS",logoURL:"https://archive.cetus.zone/assets/image/sui/xAIFRENS.png",coinType:"0x9fe1780ac27ec50c9c441fb31822f5c148f841f09ee455c6a0daf7c634a30a27::aifrens::AIFRENS",isVerified:!0,extensionFields:{birdeyeid:"0x9fe1780ac27ec50c9c441fb31822f5c148f841f09ee455c6a0daf7c634a30a27::aifrens::AIFRENS",coin_priority:620}},{name:"Tardi",symbol:"TARDI",decimals:9,logoURL:"https://bafybeieycjagqv7xtenzxss5xkcxgeru7wql6izhzokr4ay4xdbrul4ef4.ipfs.w3s.link",coinType:"0x4cf08813756dfa7519cb480a1a1a3472b5b4ec067592a8bee0f826808d218158::tardi::TARDI",isVerified:!0},{name:"Turbos",symbol:"TURBOS",decimals:9,logoURL:"https://gateway.irys.xyz/4ov3eH2cE4B4DzTsSLmAQNnnmo8zc5MRSFR6wcN4XyLU",coinType:"0x5d1f47ea69bb0de31c313d7acf89b890dbb8991ea8e03c6c355171f84bb1ba4a::turbos::TURBOS",isVerified:!0},{name:"sudeng",symbol:"HIPPO",decimals:9,logoURL:"https://i.imgur.com/j2EuFh5.png",coinType:"0x8993129d72e733985f7f1a00396cbd055bad6f817fee36576ce483c8bbb8b87b::sudeng::SUDENG",isVerified:!0},{name:"Liquor",symbol:"LIQ",decimals:6,logoURL:"https://cehaawdywth4eyp6isj3vmv3ie2g5s3x4w36u3yrl6ytjeqcnulq.arweave.net/EQ4AWHi0z8Jh_kSTurK7QTRuy3flt-pvEV-xNJICbRc",coinType:"0x9c86d1926a0a39e906f20674d6a35f337be8625ebcb6b799ee8ff011f328bee2::liq::LIQ",isVerified:!0,extensionFields:{birdeyeid:"0x9c86d1926a0a39e906f20674d6a35f337be8625ebcb6b799ee8ff011f328bee2::liq::LIQ"}},{name:"Uni",symbol:"Uni",decimals:9,logoURL:"https://gateway.irys.xyz/HK51s6xHPbFRHjHjTLna5XyypW5Yk94c1zjok822FJ88",coinType:"0xaf9e228fd0292e2a27b4859bc57a2f3a9faedb9341b6307c84fef163e44790cc::uni::UNI",isVerified:!0},{name:"Kriya Staked SUI",symbol:"kSUI",decimals:9,logoURL:"https://gateway.irys.xyz/HdCzDMJeQ6zE5LPFrknSXBkZityS1KZX2SzC1isZn6Ey",coinType:"0x41ff228bfd566f0c707173ee6413962a77e3929588d010250e4e76f0d1cc0ad4::ksui::KSUI",isVerified:!0},{name:"Pugwifhat",symbol:"PUGWIF",decimals:9,logoURL:"https://2fqoiyw7ewk4ecchpakhk5rr4brbfy7abyidgjw6cphzlgg464ba.arweave.net/0WDkYt8llcIIR3gUdXYx4GIS4-AOEDMm3hPPlZjc9wI",coinType:"0x2cd6f14a4b64c3a0fa9c644e8ed88d9c91d789a071886d67d24e6b435147063d::pugwif::PUGWIF",isVerified:!0},{name:"swUSDC",symbol:"swUSDC",decimals:6,logoURL:"https://gateway.irys.xyz/29eNJ7Qu9B5CDy8Gr58TxtR8QWUKPN2XWsVYK9cLr4Zu",coinType:"0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC",isVerified:!0},{name:"awww~~~awww",symbol:"awww",decimals:9,logoURL:"https://gateway.irys.xyz/9GnzhvzZsXdpZPGV7YH4nEwaYogYdWTVV8Y2JYGgqmJf",coinType:"0x594b539e0020ca22f83e9a8f55c1fede4c5730130d5b100fcf01f98ddb4f94c8::awww::AWWW",isVerified:!0},{name:"KIMCHI",symbol:"KIMCHI",decimals:5,logoURL:"https://archive.cetus.zone/assets/image/sui/kimchi.png",coinType:"0xb6baa75577e4bbffba70207651824606e51d38ae23aa94fb9fb700e0ecf50064::kimchi::KIMCHI",isVerified:!0,extensionFields:{birdeyeid:"0xb6baa75577e4bbffba70207651824606e51d38ae23aa94fb9fb700e0ecf50064::kimchi::KIMCHI",coin_priority:600}},{name:"AXOL",symbol:"AXOL",decimals:9,logoURL:"https://p7op7v4f4nub263xmrqch45p32rkeclriobps4v6nrut5g7q464q.arweave.net/f9z_14XjaB17d2RgI_Ov3qKiCXFDgvlyvmxpPpvw57k",coinType:"0xae00e078a46616bf6e1e6fb673d18dcd2aa31319a07c9bc92f6063363f597b4e::AXOL::AXOL",isVerified:!0},{name:"sUSDC",symbol:"sUSDC",decimals:6,logoURL:"https://gateway.irys.xyz/29eNJ7Qu9B5CDy8Gr58TxtR8QWUKPN2XWsVYK9cLr4Zu",coinType:"0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC",isVerified:!0},{name:"Wrapped Bitcoin by Sui Bridge",symbol:"wBTC",decimals:9,logoURL:"https://bridge-assets.sui.io/suiWBTC.png",coinType:"0xaafb102dd0902f5055cadecd687fb5b71ca82ef0e0285d90afde828ec58ca96b::btc::BTC",isVerified:!0,extensionFields:{coin_priority:889,suggested_priority:880}},{name:"Lombard Staked BTC",symbol:"LBTC",decimals:8,logoURL:"https://www.lombard.finance/lbtc/LBTC.png",projectURL:"https://www.lombard.finance/",coinType:"0x3e8e9423d80e1774a7ca128fccd8bf5f1f7753be658c5e645929037f7c819040::lbtc::LBTC",isVerified:!0,extensionFields:{pyth_id:"8f257aab6e7698bb92b15511915e593d6f8eae914452f781874754b03d0c612b"}},{name:"xWSB on SUI",symbol:"WSB",decimals:6,logoURL:"https://api.movepump.com/uploads/asui_4106b1fb1d.jpg",coinType:"0x4db126eac4fa99207e98db61d968477021fdeae153de3b244bcfbdc468ef0722::wsb::WSB",isVerified:!0},{name:"MOVER USD",symbol:"moverUSD",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/moverUSD.png",coinType:"0x32d5056aaac1be1f9ae44c1d0728792255a05f1475d458287ee463cc26806ca0::mover_usd::MOVER_USD",isVerified:!0,extensionFields:{birdeyeid:"0x32d5056aaac1be1f9ae44c1d0728792255a05f1475d458287ee463cc26806ca0::mover_usd::MOVER_USD",coin_priority:570}},{name:"Wrapped BNB (Portal from BSC)",symbol:"WBNB",decimals:8,logoURL:"https://4hl5riddvifwsfzqzggti3dyrekvhogjvwkaduy5w5bgs2k7zwga.arweave.net/4dfYoGOqC2kXMMmNNGx4iRVTuMmtlAHTHbdCaWlfzYw",coinType:"0xb848cce11ef3a8f62eccea6eb5b35a12c4c2b1ee1af7755d02d7bd6218e8226f::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xb848cce11ef3a8f62eccea6eb5b35a12c4c2b1ee1af7755d02d7bd6218e8226f::coin::COIN",coin_priority:700,coingecko_id:"binance-coin-wormhole",labels:["Wormhole"],pyth_id:"2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f",rank:760}}];function RO(e,t){return{id:e.id||void 0,logo_url:e.iconUrl||void 0,coin_type:t,decimals:e.decimals,description:e.description,name:e.name,symbol:e.symbol}}function ic(e){var t;return{is_trusted:!!(e!=null&&e.isVerified)||(e==null?void 0:e.is_trusted),coin_type:Nr((e==null?void 0:e.coinType)||(e==null?void 0:e.coin_type)).full_address,logo_url:(e==null?void 0:e.logoURL)||(e==null?void 0:e.logo_url)||"",decimals:e==null?void 0:e.decimals,symbol:e==null?void 0:e.symbol,name:e==null?void 0:e.name,labels:((t=e==null?void 0:e.extensionFields)==null?void 0:t.labels)||(e==null?void 0:e.labels)}}function ao(){const{suiClient:e}=so(),{fetchByApi:t}=Yl(),{setTokenMap:r,tokenMap:n,setToken:i,requestTokenList:o,addRequestTokenList:s,setTrustedTokenList:a}=Va(),c=async()=>{var M;let y=[];try{const R=await t("/v3/sui/clmm/verified_coins_info","GET");if(!(R!=null&&R.list)||((M=R==null?void 0:R.list)==null?void 0:M.length)===0)throw Error("api no trust tokens data");y=R==null?void 0:R.list}catch{y=IO}const x=[],b=y==null?void 0:y.reduce((R,P)=>(R.set(P.coinType||P.coin_type,ic(P)),(P.isVerified||P!=null&&P.is_trusted)&&x.push(ic(P)),R),new Map);b&&(b.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")&&!b.get("0x2::sui::SUI")?b.set("0x2::sui::SUI",{...b.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"),coin_type:"0x2::sui::SUI"}):!b.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")&&b.get("0x2::sui::SUI")&&b.set("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",{...b.get("0x2::sui::SUI"),coin_type:"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"}),r(new Map([...n,...b])),a(x))},l=async y=>{var R;if((y==null?void 0:y.length)===0)return;const x=await t("/v3/sui/clmm/coins_info","POST",{coinTypes:y}),b=(R=x==null?void 0:x.data)==null?void 0:R.list,M=b==null?void 0:b.reduce((P,k)=>(P.set(k.coinType,ic(k)),P),new Map);return r(new Map([...n,...M])),M},u=async y=>{var x,b,M,R;try{if(!y)return;let P=y;y==="0x2::sui::SUI"&&(P="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI");const k=await t("/v3/sui/clmm/coins_info","POST",{coinTypes:[P]});if((b=(x=k==null?void 0:k.data)==null?void 0:x.list)!=null&&b[0]){const F=ic((R=(M=k==null?void 0:k.data)==null?void 0:M.list)==null?void 0:R[0]);return i(F),F}throw Error("api no this coin types")}catch(P){console.error("🚀 ~ getTokenInfo ~ 57:",P)}},d=async y=>{try{const x=p(y);if(x)return x;if(o.includes(y))return;s(y);try{const b=await u(y);if(b)return b;throw Error("api return is null")}catch{const M=await e.getCoinMetadata({coinType:y});if(M){eb(y)&&(M.iconUrl="https://archive.cetus.zone/assets/image/sui/sui.png");const R=RO(M,y);return i(R),R}}}catch{}},p=ie.useCallback(y=>{if(y)return n.get(Nr(y).full_address)||n.get(y)},[n]);return{getTrustTokens:c,fetchTokenInfo:d,getTokenInfo:p,getTokens:l}}const Sc=(e,t)=>{if(!(e!=null&&e.totalBalance)||t===void 0||t===null)return;const r=FE(e.totalBalance,t==null?void 0:t.decimals),n=Pr(r,4);return{...t,displayBalance:n,totalBalanceFormat:r}};function tl(e){const{suiClient:t}=so(),{currentAccount:r,setTokenBalanceObj:n,tokenBalanceObj:i}=Yr();ao();const[o,s]=ie.useState([]),a=async(u=(r==null?void 0:r.address)||"",d)=>{try{if(!u){c();return}let p=[];d?p=[await t.getBalance({owner:u,coinType:d})]:p=[...await t.getAllBalances({owner:u})],s(p);const y={};p.forEach(x=>{y[Nr(x.coinType).full_address]=x}),n(y)}catch{s([])}},c=()=>{n({})},l=ie.useMemo(()=>{const u=e==null?void 0:e.coin_type;if(u&&r){const d=i[u]||i[Nr(u).full_address];return d?Sc(d,e):void 0}},[e==null?void 0:e.coin_type,i,r]);return{getOwnerCoinBalances:a,balanceInfo:l}}const OO={id:"0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",coin_type:"0x2::sui::SUI",decimals:9,description:"",name:"Sui",symbol:"SUI",logo_url:"https://imagedelivery.net/cBNDGgkrsEA-b_ixIp9SkQ/sui-coin.svg/public",is_trusted:!0,extensions:{rank:"880"}},PO={id:"0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6",coin_type:"0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",decimals:6,description:"",name:"USDC",symbol:"USDC",logo_url:"https://circle.com/usdc-icon",is_trusted:!0,extensions:{rank:"1000"}},aw=PO,cw=OO;function NO(e,t){const{fetchTokenInfo:r}=ao(),{setFromCoin:n,setToCoin:i,setDefaultCoin:o}=nn(),{setSlippage:s,setRpcList:a,setCurrentRpc:c}=Fr(),{tokenMapIsInit:l}=Va(),u=ie.useRef({}),d=async(y,x)=>{const b=y?await r(y):aw,M=x?await r(x):cw;n(b),i(M),o(b==null?void 0:b.coin_type,M==null?void 0:M.coin_type)},p=(y,x)=>{const b=[Hc[0]];let M=Hc[0];y.forEach(R=>{const P={name:R,link:R,isCustom:!1};b.push(P),R===x&&(M=P)}),a([...b,{name:"Custom RPC URL",link:"",isCustom:!0}]),c(M)};return ie.useEffect(()=>{if(l&&!a0(e,u.current)){const{defaultFromToken:y,defaultToToken:x,defaultSlippage:b,customRpcList:M,defaultRpc:R}=e;d(y,x),b&&s(b),(M==null?void 0:M.length)>0&&p(M,R),u.current=e}},[e,l]),{handleSetDefaultPair:d}}function kO(){const{currentRpc:e}=Fr(),{setSuiClient:t,setAggregatorSDK:r}=so(),{currentAccount:n}=Yr();ie.useEffect(()=>{if(e){const i=new ps({url:e.link});t(i)}},[e]),ie.useEffect(()=>{if(e){const i=new Jv({endpoint:ls.aggregatorUrl,signer:(n==null?void 0:n.address)||"",client:new ps({url:e.link}),env:o0.Mainnet});r(i)}},[e.link,n==null?void 0:n.address])}const U0=Oi((e,t)=>({transactionData:void 0,setTransactionData:r=>{e(()=>({transactionData:r}))}})),Er=[];for(let e=0;e<256;++e)Er.push((e+256).toString(16).slice(1));function jO(e,t=0){return(Er[e[t+0]]+Er[e[t+1]]+Er[e[t+2]]+Er[e[t+3]]+"-"+Er[e[t+4]]+Er[e[t+5]]+"-"+Er[e[t+6]]+Er[e[t+7]]+"-"+Er[e[t+8]]+Er[e[t+9]]+"-"+Er[e[t+10]]+Er[e[t+11]]+Er[e[t+12]]+Er[e[t+13]]+Er[e[t+14]]+Er[e[t+15]]).toLowerCase()}let ef;const DO=new Uint8Array(16);function LO(){if(!ef){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ef=crypto.getRandomValues.bind(crypto)}return ef(DO)}const BO=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qp={randomUUID:BO};function Hp(e,t,r){var i;if(qp.randomUUID&&!t&&!e)return qp.randomUUID();e=e||{};const n=e.random??((i=e.rng)==null?void 0:i.call(e))??LO();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return jO(n)}var Mo=(e=>(e[e.CalculateError=1e4]="CalculateError",e[e.NumberTooLarge=10001]="NumberTooLarge",e[e.NoRouter=10002]="NoRouter",e[e.InsufficientLiquidity=10003]="InsufficientLiquidity",e[e.HoneyPot=10004]="HoneyPot",e))(Mo||{});const UO=new ps({url:Xm("mainnet")}),FO=["0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC","0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD","0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD","0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb::usdy::USDY","0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF"],$O=["deny_list","DenyList","DenyCap","create_regulated_currency"],VO={showType:!0,showContent:!0,showOwner:!1,showPreviousTransaction:!1,showStorageRebate:!1,showDisplay:!1},zO=async e=>{let t=!1;if(FO.includes(e))return t;const r=e.split("::"),n=r[0]&&Bt(r[0]),i=r[1],o=await UO.getObject({id:n,options:VO}),s="disassembled"in o.data.content?o.data.content.disassembled[i]:null;return s&&typeof s=="string"&&new RegExp($O.join("|"),"i").test(s)&&(t=!0),t},qO=e=>{var n;if(!e)return"";const t=e==null?void 0:e.split(",");return(n=t==null?void 0:t.map(i=>Ti(i,!1)))==null?void 0:n.join(",")};function HO(){const{fetchByApi:e}=Yl(),t=async n=>{try{const i={...n},o=qO(n==null?void 0:n.coin_type);o&&(i.coin_type=o);const s=await e("/v2/sui/stats_pools","GET",i);if(s!=null&&s.lp_list)return{list:(s==null?void 0:s.lp_list)||[],total:s==null?void 0:s.total}}catch(i){return console.error("getPoolList ~ Error:",i),await r(n)}return{list:[],total:0}},r=async n=>{var i,o,s,a;try{const c=Ot("/data/pools.json"),l=await fetch(c).then(u=>u.json());if((i=l==null?void 0:l.data)!=null&&i.lp_list){const u=(o=l==null?void 0:l.data)==null?void 0:o.lp_list;let d=u;if(n!=null&&n.coin_type){const y=(a=(s=n==null?void 0:n.coin_type)==null?void 0:s.split(","))==null?void 0:a.map(x=>Pn(x).source_address);d=u==null?void 0:u.filter(x=>{var R,P;const b=Pn((R=x==null?void 0:x.coin_a)==null?void 0:R.address).source_address,M=Pn((P=x==null?void 0:x.coin_b)==null?void 0:P.address).source_address;return(y==null?void 0:y.length)>1&&y.includes(b)&&y.includes(M)?!0:!!((y==null?void 0:y.length)===1&&(y.includes(b)||y.includes(M)))})}n!=null&&n.is_vaults&&(d=u==null?void 0:u.filter(y=>y==null?void 0:y.is_vaults)),n!=null&&n.has_farming&&!(n!=null&&n.is_vaults)&&!(n!=null&&n.has_mining)&&!(n!=null&&n.no_incentives)&&(d=u==null?void 0:u.filter(y=>y==null?void 0:y.has_farming));const p=d;return{list:p,total:(p==null?void 0:p.length)||0}}}catch(c){console.error("getLocalJsonPoolList Error:",c)}return{list:[],total:0}};return{getPoolList:t,getLocalJsonPoolList:r}}function WO(e=!0){const{poolApiMap:t,setPoolApiMap:r}=Fr(),{getPoolList:n,getLocalJsonPoolList:i}=HO();return{getPoolListByCoinType:async(s,a)=>{if(s&&a){const c=[s,a].sort(),l=`${c[0]}_${c[1]}`,u=t[l];if(u)return u;const d={coin_type:`${s},${a}`,display_all_pools:!0,offset:0,limit:100,order_by:"-tvl",no_incentives:!0,has_farming:!0,has_mining:!0};let p=e?await i(d):void 0;(p===void 0||p.list.length===0)&&(p=await n(d));const y=p.list;if(y.length>0)return t[l]=y,r(l,y),y}return[]}}}function GO(e){const{routerData:t}=nn();return{priceAcceptRouterData:ie.useMemo(()=>{if(t&&e){if(e.byAmountIn){if(!Be(e.toAmountUi).eq(t.toAmountUi||"0"))return t}else if(!Be(e.fromAmountUi).eq(t.fromAmountUi||"0"))return t;return}},[t,e])}}function lw(e,t){return{amountLimit:ie.useMemo(()=>{if(t&&t.routerData){const{byAmountIn:n,fromAmountUi:i,toAmountUi:o}=t;return n?Be(o).mul(Be(1).sub(Be(e).div(100))).toString():Be(i).mul(Be(1).add(Be(e).div(100))).toString()}},[e,t])}}function KO(e){const{getTokenInfo:t,fetchTokenInfo:r}=ao();return{formatSwapRouter:ie.useMemo(()=>{if(e&&e.routerData){const i=[],o=e.byAmountIn?e.routerData.amountIn.toString():e.routerData.amountOut.toString(),s=[],a=[];let c=Be(0);if(e.routerData.routes.forEach((u,d)=>{const p={},y=e.byAmountIn?u.amountIn.toString():u.amountOut.toString();d===e.routerData.routes.length-1?p.percentage=Be(1).sub(c).toFixed(2):p.percentage=Be(y).div(o).toFixed(2),c=Be(c).add(p.percentage);const x=[];u.path.forEach(b=>{i.includes(b.provider)||i.push(b.provider);const M=Nr(b.from).full_address,R=Nr(b.target).full_address,P=t(M),k=t(R);P||a.includes(M)&&a.push(M),k||a.includes(R)&&a.push(R);const F=b.provider===sa.SCALLOP||b.provider===sa.FLOWX||b.provider===sa.FLOWXV3;x.push({from_type:M,to_type:R,pool_address:F?"":b.id,fee_rate:b.feeRate,provider:b.provider})}),p.paths=x,s.push(p)}),a.length>0)for(const u in a)r(u);return{router_summery:`${e.routerData.routes.length} Streams`,providers:i,routers:s}}},[e])}}function YO(){const{fromCoin:e,toCoin:t}=nn(),{getPoolListByCoinType:r}=WO();return{getSwapPoolAddress:async()=>e&&t?(await r(e.coin_type,t.coin_type)).map(s=>s.address):[]}}function uw(e,t,r){return ie.useMemo(()=>t&&r&&+t&&+r?e?Be(r).div(t).toString():Be(t).div(r).toString():"0",[t,r,e])}function Wp(e){const[t,r]=ie.useState(),n=async i=>{if(i.is_trusted)return!1;try{return await zO(i.coin_type)}catch{}return!1};return ie.useEffect(()=>{r(void 0),e&&n(e).then(i=>{r(i)})},[e==null?void 0:e.coin_type]),{isScamsCoin:t}}function XO(e,t){const{defaultFromCoinType:r,defaultToCoinCoinType:n}=nn(),{getTokenInfo:i}=ao(),{ignoreWarnTokenMap:o}=Fr(),s=i(e),a=i(t),c=ie.useMemo(()=>!Ya(r,aw.coin_type)||!Ya(n,cw.coin_type),[r,n]),l=ie.useCallback(d=>d&&!o[Ti(d.coin_type)]&&(Ya(r,d.coin_type)||Ya(n,d.coin_type))?!d.is_trusted:!1,[r,n,o]),u=ie.useMemo(()=>{const d=[];return c&&(s&&l(s)&&d.push({...s}),a&&l(a)&&d.push({...a})),d},[s==null?void 0:s.coin_type,a==null?void 0:a.coin_type,c,o]);return{isCustomMode:c,customWarnTokenList:u}}function JO(){const{aggregatorSDK:e}=so(),{getSwapPoolAddress:t}=YO(),r=o=>o&&o.error?o.error.code===Mo.InsufficientLiquidity||Mo.HoneyPot||Mo.NumberTooLarge:!1,n=async o=>{const{fromToken:s,toToken:a,amount:c,providersKeys:l,by_amount_in:u,uuid:d}=o;try{const p={from:s.coin_type,target:a.coin_type,amount:new yh(c),byAmountIn:u,depth:3,splitAlgorithm:void 0,splitFactor:void 0,splitCount:void 0,providers:l},y=await e.findRouters(p);if(y&&r(y))return i(!1,u,d,s,a,y);if(!y||y.routes.length===0)throw Error("not find router");return i(!1,u,d,s,a,y)}catch{const y=await t(),x={from:s.coin_type,target:a.coin_type,amount:new yh(c),byAmountIn:u,pools:y};try{const b=await e.swapInPools(x);return!b||!b.routeData?i(!0,u,d,s,a):i(!0,u,d,s,a,b.routeData)}catch{return{uuid:d,byAmountIn:u,isDegrade:!0}}}},i=(o,s,a,c,l,u)=>{var d;if(u){const p=u.error!==void 0,y=qf(u.amountIn.toString(),c.decimals).toString(),x=qf(u.amountOut.toString(),l.decimals).toString();return{routerData:p?void 0:u,fromAmountUi:p?s?y:"":y,toAmountUi:p&&s?"":x,uuid:a,byAmountIn:s,isDegrade:o,errorCode:(d=u.error)==null?void 0:d.code}}else return{uuid:a,byAmountIn:s,isDegrade:o}};return{findBestRouters:n}}function Zo(e){const t=ie.useRef(e);return ie.useEffect(()=>{t.current=e},[e]),t}function ZO(e){try{return e&&e.toString().includes("Rejected from user")}catch{return!1}}function QO(e){const t=String(e);return t.indexOf("withdraw_with_proof")>-1||t.indexOf("check_coin_threshold")>-1||t.indexOf('Identifier("balance")')>-1}function eP(e){return!!String(e).includes("Could not find the referenced transaction")}function tP(e){return ZO(e)?"User rejected the request":QO(e)?"Exceeded price slippage":eP(e)?"Oops. Failed to sync data from your txid. Please check your txn status from explorer or from your wallet.":"Transaction failed"}var F0={},rP=Tr&&Tr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(F0,"__esModule",{value:!0});var nP=F0.executeAuction=fw;const iP=rP(O1),oP="https://rpc.getshio.com",sP=500,aP=300;function fw(e,t,r=sP){const n={jsonrpc:"2.0",method:"shio_executeAuction",params:[e,t],id:1};return new Promise((i,o)=>{setTimeout(i,r),iP.default.post(oP,n,{headers:{"Content-Type":"application/json"},timeout:r}).then(s=>{console.log("Shio executeAuction response:",s.data),setTimeout(i,aP)}).catch(o)})}F0.default={executeAuction:fw};function cP(){const{suiClient:e}=so(),{currentAccount:t}=Yr(),{mutateAsync:r}=Vr.useSignTransaction(),{mutate:n}=Vr.useSignAndExecuteTransaction({execute:async({bytes:c,signature:l})=>await o(c,l)}),i=ie.useMemo(()=>t==null?void 0:t.chains[0],[t]),o=async(c,l,u=!1)=>{var p,y;if(u){const x=await e.devInspectTransactionBlock({transactionBlock:To.from(Sr(c)),sender:t.address});if(!x||((p=x.effects)==null?void 0:p.status.status)==="failure")throw Error((y=x.effects)==null?void 0:y.status.error)}return await e.executeTransactionBlock({transactionBlock:c,signature:l,options:{showEvents:!0,showRawEffects:!0,showEffects:!0,showBalanceChanges:!0,showObjectChanges:!0,showInput:!0}})};return{signAndExecuteTransactionBlock:async(c,l=!1)=>{var d,p;let u;if(typeof c=="string"?u=To.from(c):u=c,l){const y=await e.devInspectTransactionBlock({transactionBlock:c,sender:t.address});if(!y||((d=y.effects)==null?void 0:d.status.status)==="failure")throw Error((p=y.effects)==null?void 0:p.status.error)}return u.setGasBudget(1e8),new Promise((y,x)=>{n({transaction:u,chain:i},{onSuccess:b=>{y(b)},onError:b=>{console.error("signAndExecuteTransactionBlock transaction failed",b),x(b)}})})},signTransactionBlock:async c=>(c instanceof Uint8Array&&(c=To.from(c)),typeof c=="string"&&(c=To.from(Sr(c))),new Promise((l,u)=>{r({transaction:c,chain:i},{onSuccess:d=>{l(d)},onError:d=>{console.error("signTransactionBlock failed",d),u(d)},onSettled:(d,p,y,x)=>{console.error("signTransactionBlock onSettled",{data:d,error:p,variables:y})}})})),executeTransactionBlock:o}}function lP(){const{signTransactionBlock:e,executeTransactionBlock:t,signAndExecuteTransactionBlock:r}=cP(),{currentAccount:n}=Yr(),{suiClient:i}=so(),{setTransactionData:o}=U0(),{addTxToast:s,removeToast:a}=ks(),c=5,l=2e3;async function u(y,x=1){try{let b;try{b=await i.getTransactionBlock({digest:y,options:{showEvents:!0,showEffects:!0,showBalanceChanges:!0,showInput:!0,showRawInput:!0,showObjectChanges:!0}})}catch{b=await i.getTransactionBlock({digest:y,options:{showEvents:!0,showEffects:!0}})}if(b)return b;throw new Error("Empty response")}catch(b){if(console.error(`Attempt ${x} failed:`,b),x>=c)throw new Error("Failed to fetch transaction status after maximum retries.");return await fp(l),u(y,x+1)}}const d=async(y,x,b={useDevInspect:!1,useMev:!1,txAction:"signTransactionBlock"})=>{var F,B;const{useDevInspect:M=!1,useMev:R,txAction:P="signTransactionBlock"}=b;let k;x.status="confirmation",o(x);try{let W;if(P==="signTransactionBlock"){const G=await e(y),{bytes:re,signature:oe}=G;if(R)try{const se=await nP(re,oe,500)}catch{}W=await t(re,oe,M)}else W=await r(y,M);x.status="submitted",o({...x}),x.tx=W.digest,k=s(x),await fp(l);const z=await u(W.digest,0);if(!z||((F=z.effects)==null?void 0:F.status.status)==="failure")p(x,(B=z.effects)==null?void 0:B.status.error);else{const G=HE(z,n==null?void 0:n.address,!1);if(x.buildShowInfo){const re=x.buildShowInfo("success",G);x.buildShowInfo=oe=>re}a(k),x.status="success",o({...x})}return z}catch(W){p(x,W)}},p=(y,x)=>{const b=tP(x);if(y.buildShowInfo){const M=y.buildShowInfo("confirmation");y.buildShowInfo=R=>(M.toastDescriptionContent=b,M.modalDescriptionText=b,M),y.status="rejected",o({...y})}else y.buildShowInfo=M=>{const R={};return R.toastDescriptionContent=b,R.modalDescriptionText=b,R},y.status="rejected",o({...y})};return{signAndExecuteTransaction:d}}function $0(e,t=1e3){const r=ie.useRef(),n=ie.useCallback((...i)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(...i)},t)},[e,t]);return ie.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),n}function uP(){const{aggregatorSDK:e}=so(),{findBestRouters:t}=JO(),{getTokenAmountValue:r,fetchTokenPrices:n}=$a(),{providers:i,slippage:o,mevProtect:s}=Fr(),{signAndExecuteTransaction:a}=lP(),{setTransactionData:c}=U0(),{addTxToast:l}=ks(),{fromCoin:u,toCoin:d,setFromCoin:p,setToCoin:y,setToAmount:x,fromAmount:b,toAmount:M,setFromAmount:R,setFindRouterLoading:P,setRouterData:k,setByAmountIn:F,byAmountIn:B}=nn(),[W,z]=ie.useState(""),G=Zo(W),re=Zo(B),oe=Zo(b),se=Zo(M),q=Zo(u),L=Zo(d),{balanceInfo:h,getOwnerCoinBalances:f}=tl(u),{balanceInfo:m}=tl(d),S=r(u==null?void 0:u.coin_type,b),T=r(d==null?void 0:d.coin_type,M),I=$0(async(pe,Le,Ae)=>{if(q.current&&L.current&&+pe){(+oe.current||+se.current)&&P(!0);const Je=VE(pe,Le?q.current.decimals:L.current.decimals),ft=await t({fromToken:q.current,toToken:L.current,amount:Je.toString(),providersKeys:i,by_amount_in:Le,uuid:Ae});P(!1),G.current===Ae&&(Le?+oe.current?(x(ft.toAmountUi||""),k(ft)):x(""):+se.current?(R(ft.fromAmountUi||"ß"),k(ft)):R(""))}else v(!Le)},500),C=(pe,Le,Ae=!1)=>{if(F(Le),Le?(R(pe),Ae&&x("")):(x(pe),Ae&&R("")),+pe){const Je=Hp();z(Je),I(pe,Le,Je)}else P(!1),k(void 0),v(!Le)},g=(pe,Le=!0)=>{v(),Le?((pe==null?void 0:pe.coin_type)===(d==null?void 0:d.coin_type)&&y(u),p(pe)):((pe==null?void 0:pe.coin_type)===(u==null?void 0:u.coin_type)&&p(d),y(pe))},v=pe=>{pe===void 0?(R(""),x("")):pe?R(""):x(""),P(!1),k(void 0)},j=()=>{const pe=re.current?oe.current:se.current;if(+pe){const Le=Hp();z(Le),I(pe,re.current,Le)}},Q=async(pe,Le)=>{const{routerData:Ae,byAmountIn:Je,fromAmountUi:ft,toAmountUi:je}=pe,pt=new To,we={routers:Ae,slippage:Number(o)/100,txb:pt,partner:Le||QE};try{await e.fastRouterSwap(we);const he={status:"confirmation",buildShowInfo:(Ve,ke)=>{const Te=`Swap ${Pr(ft,u==null?void 0:u.decimals)} ${u==null?void 0:u.symbol} for ${Pr(je,d==null?void 0:d.decimals)} ${d==null?void 0:d.symbol}`,Me={modalDescriptionText:Te,toastTitleText:Te};if(Ve==="success"){let Ue=ft,lt=je;ke&&(Ue=dp(ke,u)||ft,lt=dp(ke,d)||je);const ut=`Swapped ${Pr(Ue,u==null?void 0:u.decimals)} ${u==null?void 0:u.symbol} for ${Pr(lt,d==null?void 0:d.decimals)} ${d==null?void 0:d.symbol}`;Me.toastTitleText=ut,Me.modalDescriptionText=ut}return Me},id:0};c(he),await a(pt,he,{useMev:s})?(v(),f()):j()}catch(he){String(he).includes("TypeError: Failed to fetch")&&l({id:0,status:"rejected",buildShowInfo(Ce,Ve){return{toastTitleText:"RPC loading failed",toastDescriptionContent:"Try resubmission. Or to check your network and switch an RPC in settings to try again."}}})}};ie.useEffect(()=>{Z(),v()},[u==null?void 0:u.coin_type,d==null?void 0:d.coin_type]);const Z=()=>{const pe=[];u&&pe.push(u.coin_type),d&&pe.push(d.coin_type),pe.length>0&&n(pe)},{isScamsCoin:ce}=Wp(u),{isScamsCoin:be}=Wp(d),xe=ie.useMemo(()=>{if(!(!ce&&!be)){if(ce&&be)return`${u==null?void 0:u.symbol} and ${d==null?void 0:d.symbol} are`;if(ce)return`${u==null?void 0:u.symbol} token is `;if(be)return`${d==null?void 0:d.symbol} token is `}},[ce,be]);return{handleAmountChange:C,handleSelectToken:g,fromBalanceInfo:h,toBalanceInfo:m,fromAmountValue:S,toAmountValue:T,doSwapAction:Q,reCalculateRouteData:j,refreshMarketPrice:Z,scamsText:xe}}function fP(e){const{fromCoin:t,toCoin:r,fromAmount:n,toAmount:i,routerData:o}=nn(),{currentAccount:s}=Yr(),a=ie.useMemo(()=>{const c={text:"Swap",disabled:!1};if(!(s!=null&&s.address))return c.text="Connect Wallet",c.disabled=!1,c;if(!t||!r)return c.text="Select a token",c.disabled=!0,c;if(!+n&&!+i)return c.text="Enter an amount",c.disabled=!0,c;if(o&&o.errorCode){if(o.errorCode===Mo.InsufficientLiquidity)return c.text="Insufficient liquidity for this trade",c.disabled=!0,c;if(o.errorCode===Mo.NoRouter||o.errorCode===Mo.HoneyPot)return c.text="No Available Route",c.disabled=!0,c}return+n&&Be(n).gt(e||0)?(c.disabled=!0,c.text=`Insufficient ${dn(t==null?void 0:t.symbol)} Balance`,c):((!+n||!+i)&&(c.disabled=!0),c)},[s==null?void 0:s.address,n,i,e,o==null?void 0:o.errorCode,t,r]);return{btnText:a.text,btnDisabled:a.disabled}}function dw({size:e="24px",strokeWidth:t="10",color:r="#909ca4",emptyColor:n="transparent",gapPercentage:i=.5}){const o=50-parseFloat(t),s=2*Math.PI*o,a=s*i,c=s-a;return w.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100",children:[w.jsx("circle",{cx:"50",cy:"50",r:o,fill:"none",stroke:n,strokeWidth:t}),w.jsx("circle",{cx:"50",cy:"50",r:o,fill:"none",stroke:r,strokeWidth:t,strokeDasharray:`${c} ${a}`,strokeDashoffset:"0",strokeLinecap:"round",style:{animation:"dash 0.5s linear infinite"}}),w.jsx("style",{children:`
|
|
93
|
+
`)},tI=0,Jo=[];function rI(e){var t=R.useRef([]),r=R.useRef([0,0]),n=R.useRef(),i=R.useState(tI++)[0],o=R.useState(Iy)[0],s=R.useRef(e);R.useEffect(function(){s.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=_M([e.lockRef.current],(e.shards||[]).map(Fp),!0).filter(Boolean);return b.forEach(function(M){return M.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(M){return M.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=R.useCallback(function(b,M){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var O=nc(b),P=r.current,k="deltaX"in b?b.deltaX:P[0]-O[0],F="deltaY"in b?b.deltaY:P[1]-O[1],B,W=b.target,z=Math.abs(k)>Math.abs(F)?"h":"v";if("touches"in b&&z==="h"&&W.type==="range")return!1;var G=Bp(z,W);if(!G)return!0;if(G?B=z:(B=z==="v"?"h":"v",G=Bp(z,W)),!G)return!1;if(!n.current&&"changedTouches"in b&&(k||F)&&(n.current=B),!B)return!0;var re=n.current||B;return ZM(re,M,b,re==="h"?k:F,!0)},[]),c=R.useCallback(function(b){var M=b;if(!(!Jo.length||Jo[Jo.length-1]!==o)){var O="deltaY"in M?Up(M):nc(M),P=t.current.filter(function(B){return B.name===M.type&&(B.target===M.target||M.target===B.shadowParent)&&QM(B.delta,O)})[0];if(P&&P.should){M.cancelable&&M.preventDefault();return}if(!P){var k=(s.current.shards||[]).map(Fp).filter(Boolean).filter(function(B){return B.contains(M.target)}),F=k.length>0?a(M,k[0]):!s.current.noIsolation;F&&M.cancelable&&M.preventDefault()}}},[]),l=R.useCallback(function(b,M,O,P){var k={name:b,delta:M,target:O,should:P,shadowParent:nI(O)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(F){return F!==k})},1)},[]),u=R.useCallback(function(b){r.current=nc(b),n.current=void 0},[]),d=R.useCallback(function(b){l(b.type,Up(b),b.target,a(b,e.lockRef.current))},[]),p=R.useCallback(function(b){l(b.type,nc(b),b.target,a(b,e.lockRef.current))},[]);R.useEffect(function(){return Jo.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Xo),document.addEventListener("touchmove",c,Xo),document.addEventListener("touchstart",u,Xo),function(){Jo=Jo.filter(function(b){return b!==o}),document.removeEventListener("wheel",c,Xo),document.removeEventListener("touchmove",c,Xo),document.removeEventListener("touchstart",u,Xo)}},[]);var y=e.removeScrollBar,x=e.inert;return R.createElement(R.Fragment,null,x?R.createElement(o,{styles:eI(i)}):null,y?R.createElement(HM,{gapMode:e.gapMode}):null)}function nI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const iI=PM(My,rI);var Ny=R.forwardRef(function(e,t){return R.createElement(Hl,Gn({},e,{ref:t,sideCar:iI}))});Ny.classNames=Hl.classNames;const oI=Ny;function sI(e,t){return R.useReducer((r,n)=>t[r][n]??r,e)}var T0="ScrollArea",[ky,tU]=Pi(T0),[aI,gn]=ky(T0),jy=R.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:i,scrollHideDelay:o=600,...s}=e,[a,c]=R.useState(null),[l,u]=R.useState(null),[d,p]=R.useState(null),[y,x]=R.useState(null),[b,M]=R.useState(null),[O,P]=R.useState(0),[k,F]=R.useState(0),[B,W]=R.useState(!1),[z,G]=R.useState(!1),re=ir(t,se=>c(se)),oe=S0(i);return w.jsx(aI,{scope:r,type:n,dir:oe,scrollHideDelay:o,scrollArea:a,viewport:l,onViewportChange:u,content:d,onContentChange:p,scrollbarX:y,onScrollbarXChange:x,scrollbarXEnabled:B,onScrollbarXEnabledChange:W,scrollbarY:b,onScrollbarYChange:M,scrollbarYEnabled:z,onScrollbarYEnabledChange:G,onCornerWidthChange:P,onCornerHeightChange:F,children:w.jsx(Xt.div,{dir:oe,...s,ref:re,style:{position:"relative","--radix-scroll-area-corner-width":O+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});jy.displayName=T0;var Dy="ScrollAreaViewport",Ly=R.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:i,...o}=e,s=gn(Dy,r),a=R.useRef(null),c=ir(t,a,s.onViewportChange);return w.jsxs(w.Fragment,{children:[w.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),w.jsx(Xt.div,{"data-radix-scroll-area-viewport":"",...o,ref:c,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:w.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});Ly.displayName=Dy;var ri="ScrollAreaScrollbar",By=R.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=gn(ri,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,a=e.orientation==="horizontal";return R.useEffect(()=>(a?o(!0):s(!0),()=>{a?o(!1):s(!1)}),[a,o,s]),i.type==="hover"?w.jsx(cI,{...n,ref:t,forceMount:r}):i.type==="scroll"?w.jsx(lI,{...n,ref:t,forceMount:r}):i.type==="auto"?w.jsx(Uy,{...n,ref:t,forceMount:r}):i.type==="always"?w.jsx(A0,{...n,ref:t}):null});By.displayName=ri;var cI=R.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=gn(ri,e.__scopeScrollArea),[o,s]=R.useState(!1);return R.useEffect(()=>{const a=i.scrollArea;let c=0;if(a){const l=()=>{window.clearTimeout(c),s(!0)},u=()=>{c=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return a.addEventListener("pointerenter",l),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),a.removeEventListener("pointerenter",l),a.removeEventListener("pointerleave",u)}}},[i.scrollArea,i.scrollHideDelay]),w.jsx(Ln,{present:r||o,children:w.jsx(Uy,{"data-state":o?"visible":"hidden",...n,ref:t})})}),lI=R.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=gn(ri,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Gl(()=>c("SCROLL_END"),100),[a,c]=sI("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return R.useEffect(()=>{if(a==="idle"){const l=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[a,i.scrollHideDelay,c]),R.useEffect(()=>{const l=i.viewport,u=o?"scrollLeft":"scrollTop";if(l){let d=l[u];const p=()=>{const y=l[u];d!==y&&(c("SCROLL"),s()),d=y};return l.addEventListener("scroll",p),()=>l.removeEventListener("scroll",p)}},[i.viewport,o,c,s]),w.jsx(Ln,{present:r||a!=="hidden",children:w.jsx(A0,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Qe(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Qe(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Uy=R.forwardRef((e,t)=>{const r=gn(ri,e.__scopeScrollArea),{forceMount:n,...i}=e,[o,s]=R.useState(!1),a=e.orientation==="horizontal",c=Gl(()=>{if(r.viewport){const l=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;s(a?l:u)}},10);return xs(r.viewport,c),xs(r.content,c),w.jsx(Ln,{present:n||o,children:w.jsx(A0,{"data-state":o?"visible":"hidden",...i,ref:t})})}),A0=R.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,i=gn(ri,e.__scopeScrollArea),o=R.useRef(null),s=R.useRef(0),[a,c]=R.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=qy(a.viewport,a.content),u={...n,sizes:a,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:p=>o.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function d(p,y){return mI(p,s.current,a,y)}return r==="horizontal"?w.jsx(uI,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollLeft,y=$p(p,a,i.dir);o.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=d(p,i.dir))}}):r==="vertical"?w.jsx(fI,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const p=i.viewport.scrollTop,y=$p(p,a);o.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=d(p))}}):null}),uI=R.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,o=gn(ri,e.__scopeScrollArea),[s,a]=R.useState(),c=R.useRef(null),l=ir(t,c,o.onScrollbarXChange);return R.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.jsx($y,{"data-orientation":"horizontal",...i,ref:l,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Wl(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(o.viewport){const p=o.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),Wy(p,d)&&u.preventDefault()}},onResize:()=>{c.current&&o.viewport&&s&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:Zc(s.paddingLeft),paddingEnd:Zc(s.paddingRight)}})}})}),fI=R.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,o=gn(ri,e.__scopeScrollArea),[s,a]=R.useState(),c=R.useRef(null),l=ir(t,c,o.onScrollbarYChange);return R.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.jsx($y,{"data-orientation":"vertical",...i,ref:l,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Wl(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(o.viewport){const p=o.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),Wy(p,d)&&u.preventDefault()}},onResize:()=>{c.current&&o.viewport&&s&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:Zc(s.paddingTop),paddingEnd:Zc(s.paddingBottom)}})}})}),[dI,Fy]=ky(ri),$y=R.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...p}=e,y=gn(ri,r),[x,b]=R.useState(null),M=ir(t,re=>b(re)),O=R.useRef(null),P=R.useRef(""),k=y.viewport,F=n.content-n.viewport,B=br(u),W=br(c),z=Gl(d,10);function G(re){if(O.current){const oe=re.clientX-O.current.left,se=re.clientY-O.current.top;l({x:oe,y:se})}}return R.useEffect(()=>{const re=oe=>{const se=oe.target;(x==null?void 0:x.contains(se))&&B(oe,F)};return document.addEventListener("wheel",re,{passive:!1}),()=>document.removeEventListener("wheel",re,{passive:!1})},[k,x,F,B]),R.useEffect(W,[n,W]),xs(x,z),xs(y.content,z),w.jsx(dI,{scope:r,scrollbar:x,hasThumb:i,onThumbChange:br(o),onThumbPointerUp:br(s),onThumbPositionChange:W,onThumbPointerDown:br(a),children:w.jsx(Xt.div,{...p,ref:M,style:{position:"absolute",...p.style},onPointerDown:Qe(e.onPointerDown,re=>{re.button===0&&(re.target.setPointerCapture(re.pointerId),O.current=x.getBoundingClientRect(),P.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),G(re))}),onPointerMove:Qe(e.onPointerMove,G),onPointerUp:Qe(e.onPointerUp,re=>{const oe=re.target;oe.hasPointerCapture(re.pointerId)&&oe.releasePointerCapture(re.pointerId),document.body.style.webkitUserSelect=P.current,y.viewport&&(y.viewport.style.scrollBehavior=""),O.current=null})})})}),Jc="ScrollAreaThumb",Vy=R.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=Fy(Jc,e.__scopeScrollArea);return w.jsx(Ln,{present:r||i.hasThumb,children:w.jsx(hI,{ref:t,...n})})}),hI=R.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...i}=e,o=gn(Jc,r),s=Fy(Jc,r),{onThumbPositionChange:a}=s,c=ir(t,d=>s.onThumbChange(d)),l=R.useRef(void 0),u=Gl(()=>{l.current&&(l.current(),l.current=void 0)},100);return R.useEffect(()=>{const d=o.viewport;if(d){const p=()=>{if(u(),!l.current){const y=gI(d,a);l.current=y,a()}};return a(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[o.viewport,u,a]),w.jsx(Xt.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Qe(e.onPointerDownCapture,d=>{const y=d.target.getBoundingClientRect(),x=d.clientX-y.left,b=d.clientY-y.top;s.onThumbPointerDown({x,y:b})}),onPointerUp:Qe(e.onPointerUp,s.onThumbPointerUp)})});Vy.displayName=Jc;var M0="ScrollAreaCorner",zy=R.forwardRef((e,t)=>{const r=gn(M0,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?w.jsx(pI,{...e,ref:t}):null});zy.displayName=M0;var pI=R.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,i=gn(M0,r),[o,s]=R.useState(0),[a,c]=R.useState(0),l=!!(o&&a);return xs(i.scrollbarX,()=>{var d;const u=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(u),c(u)}),xs(i.scrollbarY,()=>{var d;const u=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(u),s(u)}),l?w.jsx(Xt.div,{...n,ref:t,style:{width:o,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Zc(e){return e?parseInt(e,10):0}function qy(e,t){const r=e/t;return isNaN(r)?0:r}function Wl(e){const t=qy(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function mI(e,t,r,n="ltr"){const i=Wl(r),o=i/2,s=t||o,a=i-s,c=r.scrollbar.paddingStart+s,l=r.scrollbar.size-r.scrollbar.paddingEnd-a,u=r.content-r.viewport,d=n==="ltr"?[0,u]:[u*-1,0];return Hy([c,l],d)(e)}function $p(e,t,r="ltr"){const n=Wl(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,a=o-n,c=r==="ltr"?[0,s]:[s*-1,0],l=uM(e,c);return Hy([0,s],[0,a])(l)}function Hy(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Wy(e,t){return e>0&&e<t}var gI=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=r.left!==o.left,a=r.top!==o.top;(s||a)&&t(),r=o,n=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(n)};function Gl(e,t){const r=br(e),n=R.useRef(0);return R.useEffect(()=>()=>window.clearTimeout(n.current),[]),R.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function xs(e,t){const r=br(t);Zi(()=>{let n=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return i.observe(e),()=>{window.cancelAnimationFrame(n),i.unobserve(e)}}},[e,r])}var vI=jy,bI=Ly,Vp=By,zp=Vy,yI=zy,I0="Switch",[wI,rU]=Pi(I0),[xI,SI]=wI(I0),Gy=R.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:o,required:s,disabled:a,value:c="on",onCheckedChange:l,form:u,...d}=e,[p,y]=R.useState(null),x=ir(t,k=>y(k)),b=R.useRef(!1),M=p?u||!!p.closest("form"):!0,[O=!1,P]=Da({prop:i,defaultProp:o,onChange:l});return w.jsxs(xI,{scope:r,checked:O,disabled:a,children:[w.jsx(Xt.button,{type:"button",role:"switch","aria-checked":O,"aria-required":s,"data-state":Xy(O),"data-disabled":a?"":void 0,disabled:a,value:c,...d,ref:x,onClick:Qe(e.onClick,k=>{P(F=>!F),M&&(b.current=k.isPropagationStopped(),b.current||k.stopPropagation())})}),M&&w.jsx(_I,{control:p,bubbles:!b.current,name:n,value:c,checked:O,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});Gy.displayName=I0;var Ky="SwitchThumb",Yy=R.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,i=SI(Ky,r);return w.jsx(Xt.span,{"data-state":Xy(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:t})});Yy.displayName=Ky;var _I=e=>{const{control:t,checked:r,bubbles:n=!0,...i}=e,o=R.useRef(null),s=uy(r),a=b0(t);return R.useEffect(()=>{const c=o.current,l=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(l,"checked").set;if(s!==r&&d){const p=new Event("click",{bubbles:n});d.call(c,r),c.dispatchEvent(p)}},[s,r,n]),w.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Xy(e){return e?"checked":"unchecked"}var EI=Gy,CI=Yy;const TI=["1","2","3"],AI=["classic","surface","soft"],Hs={size:{type:"enum",values:TI,default:"2",responsive:!0},variant:{type:"enum",values:AI,default:"surface"},color:La,highContrast:$l,radius:E0},Jy=R.forwardRef((e,t)=>{const{rest:r,...n}=Rs(e),{className:i,style:o,size:s=Hs.size.default,variant:a=Hs.variant.default,color:c=Hs.color.default,highContrast:l=Hs.highContrast.default,radius:u=Hs.radius.default,...d}=r;return R.createElement("span",{"data-radius":u,className:er("rt-SwitchRoot",i,St(s,"rt-r-size"),`rt-variant-${a}`,{"rt-high-contrast":l},Ps(n)),style:o},R.createElement(EI,{"data-accent-color":c,...d,ref:t,className:er("rt-reset","rt-SwitchButton",{"rt-high-contrast":l})},R.createElement(CI,{className:er("rt-SwitchThumb",{"rt-high-contrast":l})})))});Jy.displayName="Switch";var td=["Enter"," "],MI=["ArrowDown","PageUp","Home"],Zy=["ArrowUp","PageDown","End"],II=[...MI,...Zy],OI={ltr:[...td,"ArrowRight"],rtl:[...td,"ArrowLeft"]},RI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ba="Menu",[ba,PI,NI]=gy(Ba),[$o,Qy]=Pi(Ba,[NI,Ll,by]),Ua=Ll(),e2=by(),[t2,oo]=$o(Ba),[kI,Fa]=$o(Ba),r2=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:o,modal:s=!0}=e,a=Ua(t),[c,l]=R.useState(null),u=R.useRef(!1),d=br(o),p=S0(i);return R.useEffect(()=>{const y=()=>{u.current=!0,document.addEventListener("pointerdown",x,{capture:!0,once:!0}),document.addEventListener("pointermove",x,{capture:!0,once:!0})},x=()=>u.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",x,{capture:!0}),document.removeEventListener("pointermove",x,{capture:!0})}},[]),w.jsx(Kb,{...a,children:w.jsx(t2,{scope:t,open:r,onOpenChange:d,content:c,onContentChange:l,children:w.jsx(kI,{scope:t,onClose:R.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:s,children:n})})})};r2.displayName=Ba;var jI="MenuAnchor",O0=R.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=Ua(r);return w.jsx(Yb,{...i,...n,ref:t})});O0.displayName=jI;var R0="MenuPortal",[DI,n2]=$o(R0,{forceMount:void 0}),i2=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,o=oo(R0,t);return w.jsx(DI,{scope:t,forceMount:r,children:w.jsx(Ln,{present:r||o.open,children:w.jsx(Zb,{asChild:!0,container:i,children:n})})})};i2.displayName=R0;var pn="MenuContent",[LI,P0]=$o(pn),o2=R.forwardRef((e,t)=>{const r=n2(pn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=oo(pn,e.__scopeMenu),s=Fa(pn,e.__scopeMenu);return w.jsx(ba.Provider,{scope:e.__scopeMenu,children:w.jsx(Ln,{present:n||o.open,children:w.jsx(ba.Slot,{scope:e.__scopeMenu,children:s.modal?w.jsx(BI,{...i,ref:t}):w.jsx(UI,{...i,ref:t})})})})}),BI=R.forwardRef((e,t)=>{const r=oo(pn,e.__scopeMenu),n=R.useRef(null),i=ir(t,n);return R.useEffect(()=>{const o=n.current;if(o)return SM(o)},[]),w.jsx(N0,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Qe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),UI=R.forwardRef((e,t)=>{const r=oo(pn,e.__scopeMenu);return w.jsx(N0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),N0=R.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:y,disableOutsideScroll:x,...b}=e,M=oo(pn,r),O=Fa(pn,r),P=Ua(r),k=e2(r),F=PI(r),[B,W]=R.useState(null),z=R.useRef(null),G=ir(t,z,M.onContentChange),re=R.useRef(0),oe=R.useRef(""),se=R.useRef(0),q=R.useRef(null),L=R.useRef("right"),h=R.useRef(0),f=x?oI:R.Fragment,m=x?{as:Ai,allowPinchZoom:!0}:void 0,S=E=>{var ce,be;const I=oe.current+E,C=F().filter(xe=>!xe.disabled),g=document.activeElement,v=(ce=C.find(xe=>xe.ref.current===g))==null?void 0:ce.textValue,j=C.map(xe=>xe.textValue),Q=JI(j,I,v),Z=(be=C.find(xe=>xe.textValue===Q))==null?void 0:be.ref.current;(function xe(pe){oe.current=pe,window.clearTimeout(re.current),pe!==""&&(re.current=window.setTimeout(()=>xe(""),1e3))})(I),Z&&setTimeout(()=>Z.focus())};R.useEffect(()=>()=>window.clearTimeout(re.current),[]),fM();const T=R.useCallback(E=>{var C,g;return L.current===((C=q.current)==null?void 0:C.side)&&QI(E,(g=q.current)==null?void 0:g.area)},[]);return w.jsx(LI,{scope:r,searchRef:oe,onItemEnter:R.useCallback(E=>{T(E)&&E.preventDefault()},[T]),onItemLeave:R.useCallback(E=>{var I;T(E)||((I=z.current)==null||I.focus(),W(null))},[T]),onTriggerLeave:R.useCallback(E=>{T(E)&&E.preventDefault()},[T]),pointerGraceTimerRef:se,onPointerGraceIntentChange:R.useCallback(E=>{q.current=E},[]),children:w.jsx(f,{...m,children:w.jsx(_y,{asChild:!0,trapped:i,onMountAutoFocus:Qe(o,E=>{var I;E.preventDefault(),(I=z.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:w.jsx(u0,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:y,children:w.jsx(cM,{asChild:!0,...k,dir:O.dir,orientation:"vertical",loop:n,currentTabStopId:B,onCurrentTabStopIdChange:W,onEntryFocus:Qe(c,E=>{O.isUsingKeyboardRef.current||E.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(Xb,{role:"menu","aria-orientation":"vertical","data-state":S2(M.open),"data-radix-menu-content":"",dir:O.dir,...P,...b,ref:G,style:{outline:"none",...b.style},onKeyDown:Qe(b.onKeyDown,E=>{const C=E.target.closest("[data-radix-menu-content]")===E.currentTarget,g=E.ctrlKey||E.altKey||E.metaKey,v=E.key.length===1;C&&(E.key==="Tab"&&E.preventDefault(),!g&&v&&S(E.key));const j=z.current;if(E.target!==j||!II.includes(E.key))return;E.preventDefault();const Z=F().filter(ce=>!ce.disabled).map(ce=>ce.ref.current);Zy.includes(E.key)&&Z.reverse(),YI(Z)}),onBlur:Qe(e.onBlur,E=>{E.currentTarget.contains(E.target)||(window.clearTimeout(re.current),oe.current="")}),onPointerMove:Qe(e.onPointerMove,ya(E=>{const I=E.target,C=h.current!==E.clientX;if(E.currentTarget.contains(I)&&C){const g=E.clientX>h.current?"right":"left";L.current=g,h.current=E.clientX}}))})})})})})})});o2.displayName=pn;var FI="MenuGroup",k0=R.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Xt.div,{role:"group",...n,ref:t})});k0.displayName=FI;var $I="MenuLabel",s2=R.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Xt.div,{...n,ref:t})});s2.displayName=$I;var Qc="MenuItem",qp="menu.itemSelect",Kl=R.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,o=R.useRef(null),s=Fa(Qc,e.__scopeMenu),a=P0(Qc,e.__scopeMenu),c=ir(t,o),l=R.useRef(!1),u=()=>{const d=o.current;if(!r&&d){const p=new CustomEvent(qp,{bubbles:!0,cancelable:!0});d.addEventListener(qp,y=>n==null?void 0:n(y),{once:!0}),Cb(d,p),p.defaultPrevented?l.current=!1:s.onClose()}};return w.jsx(a2,{...i,ref:c,disabled:r,onClick:Qe(e.onClick,u),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),l.current=!0},onPointerUp:Qe(e.onPointerUp,d=>{var p;l.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:Qe(e.onKeyDown,d=>{const p=a.searchRef.current!=="";r||p&&d.key===" "||td.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Kl.displayName=Qc;var a2=R.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=e,s=P0(Qc,r),a=e2(r),c=R.useRef(null),l=ir(t,c),[u,d]=R.useState(!1),[p,y]=R.useState("");return R.useEffect(()=>{const x=c.current;x&&y((x.textContent??"").trim())},[o.children]),w.jsx(ba.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:w.jsx(lM,{asChild:!0,...a,focusable:!n,children:w.jsx(Xt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:l,onPointerMove:Qe(e.onPointerMove,ya(x=>{n?s.onItemLeave(x):(s.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Qe(e.onPointerLeave,ya(x=>s.onItemLeave(x))),onFocus:Qe(e.onFocus,()=>d(!0)),onBlur:Qe(e.onBlur,()=>d(!1))})})})}),VI="MenuCheckboxItem",c2=R.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...i}=e;return w.jsx(h2,{scope:e.__scopeMenu,checked:r,children:w.jsx(Kl,{role:"menuitemcheckbox","aria-checked":el(r)?"mixed":r,...i,ref:t,"data-state":L0(r),onSelect:Qe(i.onSelect,()=>n==null?void 0:n(el(r)?!0:!r),{checkForDefaultPrevented:!1})})})});c2.displayName=VI;var l2="MenuRadioGroup",[zI,qI]=$o(l2,{value:void 0,onValueChange:()=>{}}),u2=R.forwardRef((e,t)=>{const{value:r,onValueChange:n,...i}=e,o=br(n);return w.jsx(zI,{scope:e.__scopeMenu,value:r,onValueChange:o,children:w.jsx(k0,{...i,ref:t})})});u2.displayName=l2;var f2="MenuRadioItem",d2=R.forwardRef((e,t)=>{const{value:r,...n}=e,i=qI(f2,e.__scopeMenu),o=r===i.value;return w.jsx(h2,{scope:e.__scopeMenu,checked:o,children:w.jsx(Kl,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":L0(o),onSelect:Qe(n.onSelect,()=>{var s;return(s=i.onValueChange)==null?void 0:s.call(i,r)},{checkForDefaultPrevented:!1})})})});d2.displayName=f2;var j0="MenuItemIndicator",[h2,HI]=$o(j0,{checked:!1}),p2=R.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...i}=e,o=HI(j0,r);return w.jsx(Ln,{present:n||el(o.checked)||o.checked===!0,children:w.jsx(Xt.span,{...i,ref:t,"data-state":L0(o.checked)})})});p2.displayName=j0;var WI="MenuSeparator",m2=R.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Xt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});m2.displayName=WI;var GI="MenuArrow",g2=R.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=Ua(r);return w.jsx(Jb,{...i,...n,ref:t})});g2.displayName=GI;var D0="MenuSub",[KI,v2]=$o(D0),b2=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:i}=e,o=oo(D0,t),s=Ua(t),[a,c]=R.useState(null),[l,u]=R.useState(null),d=br(i);return R.useEffect(()=>(o.open===!1&&d(!1),()=>d(!1)),[o.open,d]),w.jsx(Kb,{...s,children:w.jsx(t2,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:w.jsx(KI,{scope:t,contentId:ma(),triggerId:ma(),trigger:a,onTriggerChange:c,children:r})})})};b2.displayName=D0;var Qs="MenuSubTrigger",y2=R.forwardRef((e,t)=>{const r=oo(Qs,e.__scopeMenu),n=Fa(Qs,e.__scopeMenu),i=v2(Qs,e.__scopeMenu),o=P0(Qs,e.__scopeMenu),s=R.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=o,l={__scopeMenu:e.__scopeMenu},u=R.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return R.useEffect(()=>u,[u]),R.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),c(null)}},[a,c]),w.jsx(O0,{asChild:!0,...l,children:w.jsx(a2,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":S2(r.open),...e,ref:Nl(t,i.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Qe(e.onPointerMove,ya(d=>{o.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:Qe(e.onPointerLeave,ya(d=>{var y,x;u();const p=(y=r.content)==null?void 0:y.getBoundingClientRect();if(p){const b=(x=r.content)==null?void 0:x.dataset.side,M=b==="right",O=M?-5:5,P=p[M?"left":"right"],k=p[M?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+O,y:d.clientY},{x:P,y:p.top},{x:k,y:p.top},{x:k,y:p.bottom},{x:P,y:p.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Qe(e.onKeyDown,d=>{var y;const p=o.searchRef.current!=="";e.disabled||p&&d.key===" "||OI[n.dir].includes(d.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),d.preventDefault())})})})});y2.displayName=Qs;var w2="MenuSubContent",x2=R.forwardRef((e,t)=>{const r=n2(pn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=oo(pn,e.__scopeMenu),s=Fa(pn,e.__scopeMenu),a=v2(w2,e.__scopeMenu),c=R.useRef(null),l=ir(t,c);return w.jsx(ba.Provider,{scope:e.__scopeMenu,children:w.jsx(Ln,{present:n||o.open,children:w.jsx(ba.Slot,{scope:e.__scopeMenu,children:w.jsx(N0,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=c.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Qe(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Qe(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Qe(e.onKeyDown,u=>{var y;const d=u.currentTarget.contains(u.target),p=RI[s.dir].includes(u.key);d&&p&&(o.onOpenChange(!1),(y=a.trigger)==null||y.focus(),u.preventDefault())})})})})})});x2.displayName=w2;function S2(e){return e?"open":"closed"}function el(e){return e==="indeterminate"}function L0(e){return el(e)?"indeterminate":e?"checked":"unchecked"}function YI(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function XI(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function JI(e,t,r){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let s=XI(e,Math.max(o,0));i.length===1&&(s=s.filter(l=>l!==r));const c=s.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function ZI(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,c=t[o].y,l=t[s].x,u=t[s].y;c>n!=u>n&&r<(l-a)*(n-c)/(u-c)+a&&(i=!i)}return i}function QI(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return ZI(r,t)}function ya(e){return t=>t.pointerType==="mouse"?e(t):void 0}var eO=r2,tO=O0,rO=i2,nO=o2,iO=k0,oO=s2,sO=Kl,aO=c2,cO=u2,lO=d2,uO=p2,fO=m2,dO=g2,hO=b2,pO=y2,mO=x2,B0="DropdownMenu",[gO,nU]=Pi(B0,[Qy]),Lr=Qy(),[vO,_2]=gO(B0),E2=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,c=Lr(t),l=R.useRef(null),[u=!1,d]=Da({prop:i,defaultProp:o,onChange:s});return w.jsx(vO,{scope:t,triggerId:ma(),triggerRef:l,contentId:ma(),open:u,onOpenChange:d,onOpenToggle:R.useCallback(()=>d(p=>!p),[d]),modal:a,children:w.jsx(eO,{...c,open:u,onOpenChange:d,dir:n,modal:a,children:r})})};E2.displayName=B0;var C2="DropdownMenuTrigger",T2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,o=_2(C2,r),s=Lr(r);return w.jsx(tO,{asChild:!0,...s,children:w.jsx(Xt.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:Nl(t,o.triggerRef),onPointerDown:Qe(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:Qe(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});T2.displayName=C2;var bO="DropdownMenuPortal",A2=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Lr(t);return w.jsx(rO,{...n,...r})};A2.displayName=bO;var M2="DropdownMenuContent",I2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=_2(M2,r),o=Lr(r),s=R.useRef(!1);return w.jsx(nO,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...n,ref:t,onCloseAutoFocus:Qe(e.onCloseAutoFocus,a=>{var c;s.current||(c=i.triggerRef.current)==null||c.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Qe(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!i.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});I2.displayName=M2;var yO="DropdownMenuGroup",O2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Lr(r);return w.jsx(iO,{...i,...n,ref:t})});O2.displayName=yO;var wO="DropdownMenuLabel",R2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Lr(r);return w.jsx(oO,{...i,...n,ref:t})});R2.displayName=wO;var xO="DropdownMenuItem",P2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Lr(r);return w.jsx(sO,{...i,...n,ref:t})});P2.displayName=xO;var SO="DropdownMenuCheckboxItem",N2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Lr(r);return w.jsx(aO,{...i,...n,ref:t})});N2.displayName=SO;var _O="DropdownMenuRadioGroup",k2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Lr(r);return w.jsx(cO,{...i,...n,ref:t})});k2.displayName=_O;var EO="DropdownMenuRadioItem",j2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Lr(r);return w.jsx(lO,{...i,...n,ref:t})});j2.displayName=EO;var CO="DropdownMenuItemIndicator",D2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Lr(r);return w.jsx(uO,{...i,...n,ref:t})});D2.displayName=CO;var TO="DropdownMenuSeparator",L2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Lr(r);return w.jsx(fO,{...i,...n,ref:t})});L2.displayName=TO;var AO="DropdownMenuArrow",MO=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Lr(r);return w.jsx(dO,{...i,...n,ref:t})});MO.displayName=AO;var IO=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:i,defaultOpen:o}=e,s=Lr(t),[a=!1,c]=Da({prop:n,defaultProp:o,onChange:i});return w.jsx(hO,{...s,open:a,onOpenChange:c,children:r})},OO="DropdownMenuSubTrigger",B2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Lr(r);return w.jsx(pO,{...i,...n,ref:t})});B2.displayName=OO;var RO="DropdownMenuSubContent",U2=R.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Lr(r);return w.jsx(mO,{...i,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});U2.displayName=RO;var PO=E2,NO=T2,F2=A2,kO=I2,jO=O2,DO=R2,LO=P2,BO=N2,UO=k2,FO=j2,$2=D2,$O=L2,VO=IO,zO=B2,qO=U2;const HO=["1","2","3"],WO=["vertical","horizontal","both"],Ju={size:{type:"enum",values:HO,default:"1",responsive:!0},radius:E0,scrollbars:{type:"enum",values:WO,default:"both"}},U0=R.forwardRef((e,t)=>{const{rest:r,...n}=Rs(e),{className:i,style:o,type:s,scrollHideDelay:a=s!=="scroll"?0:void 0,dir:c,size:l=Ju.size.default,radius:u=Ju.radius.default,scrollbars:d=Ju.scrollbars.default,...p}=r;return R.createElement(vI,{type:s,scrollHideDelay:a,className:er("rt-ScrollAreaRoot",i,Ps(n)),style:o},R.createElement(bI,{...p,ref:t,className:"rt-ScrollAreaViewport"}),R.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),d!=="vertical"?R.createElement(Vp,{"data-radius":u,orientation:"horizontal",className:er("rt-ScrollAreaScrollbar",St(l,"rt-r-size"))},R.createElement(zp,{className:"rt-ScrollAreaThumb"})):null,d!=="horizontal"?R.createElement(Vp,{"data-radius":u,orientation:"vertical",className:er("rt-ScrollAreaScrollbar",St(l,"rt-r-size"))},R.createElement(zp,{className:"rt-ScrollAreaThumb"})):null,d==="both"?R.createElement(yI,{className:"rt-ScrollAreaCorner"}):null)});U0.displayName="ScrollArea";const GO=["1","2"],KO=["solid","soft"],Zu={size:{type:"enum",values:GO,default:"2",responsive:!0},variant:{type:"enum",values:KO,default:"solid"},color:La,highContrast:$l},V2={color:La,shortcut:{type:"string",default:void 0}},z2=e=>R.createElement(PO,{...e});z2.displayName="DropdownMenuRoot";const q2=R.forwardRef((e,t)=>R.createElement(NO,{...e,ref:t,asChild:!0}));q2.displayName="DropdownMenuTrigger";const H2=R.createContext({}),W2=R.forwardRef((e,t)=>{const r=TA(),{className:n,children:i,size:o=Zu.size.default,variant:s=Zu.variant.default,highContrast:a=Zu.highContrast.default,color:c=V2.color.default,container:l,forceMount:u,...d}=e,p=c??r.accentColor;return R.createElement(F2,{container:l,forceMount:u},R.createElement(Fl,{asChild:!0},R.createElement(kO,{"data-accent-color":p,align:"start",sideOffset:4,collisionPadding:10,...d,ref:t,className:er("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",n,St(o,"rt-r-size"),`rt-variant-${s}`,{"rt-high-contrast":a})},R.createElement(U0,{type:"auto"},R.createElement("div",{className:er("rt-BaseMenuViewport","rt-DropdownMenuViewport")},R.createElement(H2.Provider,{value:R.useMemo(()=>({size:o,variant:s,color:p,highContrast:a}),[o,s,p,a])},i))))))});W2.displayName="DropdownMenuContent";const G2=R.forwardRef((e,t)=>R.createElement(DO,{...e,ref:t,className:er("rt-BaseMenuLabel","rt-DropdownMenuLabel",e.className)}));G2.displayName="DropdownMenuLabel";const K2=R.forwardRef((e,t)=>{const{className:r,children:n,color:i=V2.color.default,shortcut:o,...s}=e;return R.createElement(LO,{"data-accent-color":i,...s,ref:t,className:er("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",r)},R.createElement(Ms,null,n),o&&R.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},o))});K2.displayName="DropdownMenuItem";const Y2=R.forwardRef((e,t)=>R.createElement(jO,{...e,ref:t,className:er("rt-BaseMenuGroup","rt-DropdownMenuGroup",e.className)}));Y2.displayName="DropdownMenuGroup";const X2=R.forwardRef((e,t)=>R.createElement(UO,{...e,ref:t,className:er("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",e.className)}));X2.displayName="DropdownMenuRadioGroup";const J2=R.forwardRef((e,t)=>{const{children:r,className:n,...i}=e;return R.createElement(FO,{...i,ref:t,className:er("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",n)},R.createElement(Ms,null,r),R.createElement($2,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},R.createElement(Vl,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})))});J2.displayName="DropdownMenuRadioItem";const Z2=R.forwardRef((e,t)=>{const{children:r,className:n,shortcut:i,...o}=e;return R.createElement(BO,{...o,ref:t,className:er("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",n)},R.createElement(Ms,null,r),R.createElement($2,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},R.createElement(Vl,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),i&&R.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},i))});Z2.displayName="DropdownMenuCheckboxItem";const Q2=e=>R.createElement(VO,{...e});Q2.displayName="DropdownMenuSub";const ew=R.forwardRef((e,t)=>{const{className:r,children:n,...i}=e;return R.createElement(zO,{...i,ref:t,className:er("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",r)},R.createElement(Ms,null,n),R.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},R.createElement(my,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"})))});ew.displayName="DropdownMenuSubTrigger";const tw=R.forwardRef((e,t)=>{const{className:r,children:n,container:i,forceMount:o,...s}=e,{size:a,variant:c,color:l,highContrast:u}=R.useContext(H2);return R.createElement(F2,{container:i,forceMount:o},R.createElement(Fl,{asChild:!0},R.createElement(qO,{"data-accent-color":l,alignOffset:-Number(a)*4,sideOffset:1,collisionPadding:10,...s,ref:t,className:er("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",r,St(a,"rt-r-size"),`rt-variant-${c}`,{"rt-high-contrast":u})},R.createElement(U0,{type:"auto"},R.createElement("div",{className:er("rt-BaseMenuViewport","rt-DropdownMenuViewport")},n)))))});tw.displayName="DropdownMenuSubContent";const rw=R.forwardRef((e,t)=>R.createElement($O,{...e,ref:t,className:er("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",e.className)}));rw.displayName="DropdownMenuSeparator";const mn=Object.assign({},{Root:z2,Trigger:q2,Content:W2,Label:G2,Item:K2,Group:Y2,RadioGroup:X2,RadioItem:J2,CheckboxItem:Z2,Sub:Q2,SubTrigger:ew,SubContent:tw,Separator:rw}),YO=["1","2","3","4"],XO=["classic","solid","soft","surface","outline","ghost"],Ws={size:{type:"enum",values:YO,default:"2",responsive:!0},variant:{type:"enum",values:XO,default:"solid"},color:La,highContrast:$l,radius:E0},nw=R.forwardRef((e,t)=>{const{rest:r,...n}=Rs(e),{className:i,asChild:o=!1,size:s=Ws.size.default,variant:a=Ws.variant.default,color:c=Ws.color.default,highContrast:l=Ws.highContrast.default,radius:u=Ws.radius.default,...d}=r,p=o?Ai:"button";return R.createElement(p,{"data-disabled":d.disabled||void 0,"data-accent-color":c,"data-radius":u,...d,ref:t,className:er("rt-reset","rt-BaseButton",i,St(s,"rt-r-size"),`rt-variant-${a}`,{"rt-high-contrast":l},Ps(n))})});nw.displayName="BaseButton";const iw=R.forwardRef((e,t)=>R.createElement(nw,{...e,ref:t,className:er("rt-Button",e.className)}));iw.displayName="Button";const JO={loading:{type:"boolean",default:!0}},Ns=R.forwardRef((e,t)=>{const{rest:r,...n}=Rs(e),{className:i,children:o,loading:s=JO.loading.default,...a}=r;if(!s)return R.createElement(R.Fragment,null,o);const c=R.isValidElement(o)?Ai:"span";return R.createElement(c,{ref:t,"aria-hidden":!0,className:er("rt-Skeleton",i,Ps(n)),"data-inline-skeleton":R.isValidElement(o)?void 0:!0,tabIndex:-1,inert:"",...a},o)});Ns.displayName="Skeleton";const ZO=At("/images/ghost_loading.png"),QO=At("/images/primary_loading.png"),eR={primary:QO,ghost:ZO};function tR({size:e="24px",variant:t="primary",wrapStyle:r={}}){return w.jsx(ly,{align:"center",justify:"center",style:{width:"100%",height:"100%",...r},children:w.jsx("img",{src:eR[t],alt:"Loading",style:{width:e,height:e,animation:"spin 1s linear infinite"}})})}const rR="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAPKADAAQAAAABAAAAPAAAAACL3+lcAAAJW0lEQVRoBd1be1BU1xk/LstLdtlVUYKoKKA8fJBKJDVxovYxTadC0zY1/2jaKWM0GRsnTTOpEQNGqc34mGicNpqxGkirMYk4QFONqTG01WioFXzwFhRfUJTl/dple37XnmUf93Hu3Uuknpmdc/ec7/vO97vn9Z3vfHcUGaa0a+2PxlnN9hVWU+Aia5gxLsIaHGk1GUNCAgMCRocaRqHZ7p5BZ++Aw2HrtPe22PqabF32Olun46Stw/Du6s0Fd4ZDNaFhvQS/k/P95ChryKb4iaO/NX1yWHhgwD1gauUPOAadNY1d7bU3u0/csvVmrcr562W1MqTodQGcvzlj9cwppqw5ceYJFKMuMpnCFLuzvK6j+dK1zk3L1xbuYuVac7+Uy8tNf2legiU7cYrJolUBNXyV1zrbSqvas5evK9yhhs+dVhPgd9YvSUmJCzvyzeQxU92FfV3PX15ubSir63pq1cbiMrVtBqhlyM/9wfqli6MOxkaFjVHLqxf9pPGh1sSY0SuT46MGC07UlKiRq6qHC3c8Vbhk/kNLKJMqPjUKqaF1EuIsPn27OGPNkQxePi7F976ZYU6ICDn3+Oyx8byCv066f164W1vV0js389XCDqV2FYf07pz0xAWJlsq5MyxRSsLuV/2UyNCxoQGjVs9JjikoPlndIqeHbA+jZx+LC79BV2GznBDeuu4+B9l+qI4Un2oSWNIfe4j86plYEhqk+N65mqCreMepuvZouZ42yknCMNYLbL/dSX7xu/Pk3zVtribzjjWSC1faSd66b5Ago8FVrvUBut5p6z9H+adLyZB8tVigvpM6fr4Uo9ry7YeukE++vNez7ry37/aRvv5BsmD2WPdizc8Y3qmzJqUeOFp5QEyIKGBsPU8vjF6p12pMhxpZu6eCOOmyKpbKaS9/O3U8ibAEiVWrLpsx2TQjfmqk6JblAxhGBfbZYKM2O9hbO2D85VsXyM2WXu8q13+8iCr6Un6yaKIu+x06KjY6bFHMpIlHikuqPYaVz8SBBWUKMcouZi5NOR4+/Pymx7yVYsHc/ujkTalq1eXAACzejB6A83Mz1uhpLrZ2DJBtdFXmTVs/qCPg0SsBCzC5y/MA/EhC+Ab3Sn+ftxysJTYVAEAL0Homb0wuwHmb0l/U89Rzjg7Rj7+4pVp3DGvw6pWACdiYPBfgWdPMr7FCf3O7w0ly9lVxizGFGsn8WUPbEnjpOZibX4nQHZsAGJ4KHN6VGHnrYVBg1eVJgXR9/MPLc0hb59DcBe97Rxt52LlogA0YQSwAhltGL09FU2sfeftwPZci8I1sfWEmocOOVFz1tPt3FTQQyNIjARswQpYAGD4oPQRDRm5+DenudXCJy3p2BnkybQIprbL5GCVdPXZBFpcgDiKG0QDvIhxuHDyKJH8vv0uOnW1WpAPBqh9OJcu+O0mgPVthE+WBLMjUIwEjsBrgStXqXXRXpG9gkGzYz7dQ/fiJKPLST2Nd7GcrWl3P3g9vvFdFcPDwNwEjsBrgN/ZXGPh3F14ljc09iqIWPjyObMxMdNF10KF7ucFz/roq6cO1ph4qu8G9SPMzsBrgJNcs4X+MDbe7yZ6iBkUxKfHhZMeLs4gxYMhyLa1s85m/3oIA+CoF7m8CVgNuBPwVtGF/NRlQGHbTokaT3S+n+Bz2z1Qoz1HI5p0ucliAlQ5pY4gckVIdzrinLsorPWFMMNn76sNkjDnQR9xXtId5EvVbiZ6neXgZDbAacdfDCtTmnXT+bf5TrSwbrKh3X0kh0RG+7xXG1NzpFpISFy7IYOflkvI75LrIeoC2nkgZRyBTSwJWI7vY0iJg58f1pFnGOGBWFAwLsYQT97rlnt6Yo3QrOvC362LkQlto87VlnjyixCKFwCoYHiJ1ikXwYuR/Kq4YmJkVlZZoVZTFCM7Q7enXv78ku4ihTbStNRlxZWkxqfNuYFd8/Y+VZFDGwI8eH0rOXLYJP3a9RrdCspb2jlhrAPHC9guKix/azKaHi4PZqaq9I8BqxP2shahzGcKLUVbbLvuSMQf//JnnCJg5zSwK9gZ1/6zYUkawJvCk8/T4CB2WLp7IQ+6iAVYDLqNdJRwPdzv6NR/S05J8hzc8HJlvnpddC8TUgicFuqhJwGrAzbsapi0H6jyOcmp405I87996+h1k5bYyUn+rW40YgVbwjhxU5x0BVgPCDHhb+1e1jRwuUe/FgHzM43luCxicBGt2XlScGnK6waMCnXgTsNIh7TjJw3DPi1HNQypKkxRjJma3/XP93kryxXn/wzhy9lUT6MaTgNWAABLEVCgx5B27TqobtW8HjyYPDWfcL2kdKd56QifoppSAEVgNiJZBAIkcwz0vxhU5EsU6tmC9f/y6cLJSZFBB8PbhK6TZJu8dAUZgFQwPRMvIyccb5PViiMnB/H0kwUpgRW3K0z4txGSjDLrt+0TeB8YwCoCb2u3rES0jJfDTr/i8GFL8MC1hWChZUVL8POXHS/8jSQZsCH8CgQD4udeLLiE0SIrDX2ea1RxEnt9WrmhFSbXPUy43pIGNxXq5bGnqdciVEhxLz7L+pNP0+MhrRWltJz46TJIVMV6scsj1QEsqPlpmg6eeVbIcjrTntpbJ2s6M9n7kAdSDgiPo427OfKYHnUptSU+/7zLxPM7Cj6bE9NGz6fcYMctjIkPJQnoObe+2E1vXAOmlF9jSM55xDX8eYQ0SQG5emUTm0UVRLB092/KbghNVZ1idRw+j8PT+Z+r1vEFkDd2PHAFs83/+wTT3tl1zmBUiwq2zV8FBxYhHcA4MwOKtoseQRiVuzBHhNjvOsoh2v88I8BYwEv/T/dX54ec3sjOz/3LIWz8fwCBAOB8CQxImmxK8Gf4f/iM6b+krRc+L6Srbg//Yu7RmpEbfiYFBGaLyFmQeknR6+cxhd0EI56PLuvS1gDvxCHiGrtBZThXRIc0YCj+r6kc4X1iw4Wc0pCiYlY/EHGBLLralrcgqko2MkR3SDNiDFFzKBZgBfxDCh2WHNAPKcoTzIcINQV80NlLVy2Iy9Mqxz2LrkVqNpdpRBRhCsGUhws3ucDyJyHQpwcNZDgvqeGnrYrF9Vqldv3oJQV+IgxI7cCg1rKUeB4H78pGHt7KIg0Jo0HB+xnOxvuO3z2YV7fRuW+1/v3rYu7E9b6TPjAw3bnzgP9TyBo7/2j/FG6Cf4hmH7VO8/wJSjxTWAm8L8gAAAABJRU5ErkJggg==",Qu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAABGUUKwAAAQcklEQVR4Ac07C3BUVZb33vfp7nQSgiEhYYYgESEj40oZjERH/MxAnFEGQQYUZILRGix1y3V3q3bZqd2trZpZqram1rJ2tMZZiUGFAURQ4romiALjmlkFB2eGEVyMEAQSEiSQ9O+9fvfuOfe923Q66aQ7dDS3q/vcd9+553fPOffzXlMyxqX4hc1Vls9p4Iao5nm8Mp5HSoSfmsIUGjcJRfbMIoJa1CFRbhlh2k3CrJ3F6EG/rTWee3DlkbEUUQqQawYTX3ppVTxInoxN4rPjVxAfAf0kDwG/WEM4RKGUEiEEQYgF0ITxJY2ZPfSwHiJPnV+9etMQ3S6rKWcGmPTcq+XWxOhzVhlfGJ8oQGkoSlnFJcUAAlSk8EHoort1bPMaXGN5lzoao5O1muf9a3vW3nvGRbq8XyXaqKlMebG5IpTXtzF6JZ/PfYINSyjFADDUoCA0eiN+SVvXINIuKKF3qQzKLMr9x9n+YLig/vSPF3UMy3OEm6M2ALgqLd6y5fnwVXyNCJChFZcKU2GcoyGtlx6FuD7MYuQDjemHhNC7mLggR5HTCeWUxic7JD6HG6QGDDmbTxSzrCtEELRPKyOLEB74jDWdu+++hyFslJlGUHng7bTEB6INvPrGC6/O65tmt1iTeKGKWxfDGy7OhL+Tduq9ZLMZ9j19uuGekwMpZHY1pfG1qVZe7Il4EV8ZLSNlYGZgIK3qEXDrZje5GOgw67oevPd3mVG+hJW1AUpf3vpI+GrxjAOj7qmrIpZQhwr/CdbG+sz67tWLj11ic/m1kpden8ELrI2RabyWaIO9QkNv+D/9sbMPLPtVNtyyMsDkra809s8iawjjXj9lAhjxk+TTYLdY1bFm+cFsBMgWt6JpW3WomG6KVpCZhCg5XCqUMBE8Qpq6VvyoIVO6GRmg+oAwvji9sy00zalWKrsMBPF1sW69kzzU9eNlzZkyzQXelM2vLbImORtik3mJoqeCw39CO1gxZUntwbnUVvfSwRENgMp39OzoiJWJsgFZG5JO8BjdfWbpkrp0xL+K9sk7drZEruILYDZxZ0/PCj7IQRXFSytGMsLQ2TtJ8tOnX2+zy2kZo5CBgAdCZjNR8Alb/3Urj2J2wQAUHNHWs7gGczBmSfxlxC6jZadA9iRVhqwOa4CpW3c1RqeRalRcKg+E9X5m5x81lp1acc9Ph6T4NTSiLPlH2TI9BEMDJlDyxipI9dStzY3DiZQ2BK78TfMjfVXiWYHUvKKHme1v1+Z0PPCDP6u28QQrXn7zmmilcyieB6sJKFJwUAA85NHj99815OwwpAfM2PLmvHCleAbmeHR86VK6o4n8z/X7xqvyqDDKhjKirDIc0HOhhKc7z6BOiJNaBhkAV3jhUtEiTMZcV5ImEAXt+vr2Vd/fkUpgvF2jjCgrGEAagaED+xiTOmGiTCmDGiq3v7khdBVpkHjeOj3vBG39/J7v5yTbz9y2pyZO4/cIH68RGisV1PEJjerUZr3MEqepTd+JGUUvnlp647kUWbO6nL7rv1vC3+QLZRzgzAAl2E4b25f94CH3yv0dYICq37Rd2VfZ+5ljgNdjQeP10O4TC+4sddFH94tTae/J1v+0J4il9kRRgHbFkroXSuyLOBG+bnbcd8H4+6Mr7tjmYmf/O233W2djk0SJUpLGCJ/YUTD98PLvdChqA0IgHux/QRiUuRMJ/moi0E0HWEx1zBRevW33yp7w7guRaaTeLiIFFBwTJ2z5wRjFD0L4qqkWJKDWZDK972p7y1Vv7P4thmWm/JLxUHYIBJnHZS6HsI75IxuTcRKEv/Xq/vL+qdEvhA7B42H4z7Kjn935varkDtnUZ2/f+9cXKuxfEH1oBbw1S2K3m0obhUOcwBn6x2N3LfiL1PuZXF/91ttHwiV8lsJlccLzv/B/85N755/BtoQHCM1+juhgepnzYfS5JvIuslWqY7Zw1ta9t/dNc35BNfR0dy7BnS3W5Q4XR9yrJzzOa8PEJZOXB2EneO23tu/5WbYyIL4fdGACZgVcwCE/g8El6OqVhAGsK8hC5YoI8zq1tj8uv2NUGxt0WV4qXgd+lKEFgB5+UQAFk+uJ+x4u9pFf7IF1+MRK2d8oobOBqAPqInl44WaDroqGNMC1r7y3igeZLyEc7OeDjlmvkLKF1726/x/sQoz3S/GtaCPUYESCZ/S2CZ/7/nLSZ+bcwuPaT/292peEo0uC4wNMrmMbDwr/ddvfW56tLIjvt7QHkSfSQWM6Qeq79pV90rt1RIDT2ielc4KzYsz5e1nnR4tvGvV+PjaBPCGVl2kes72XaoA4A+MWHGf1Hy+/5SXk7RX0tH+dtWffWasIsrbKTIAv6ygUFJg6lwDIelb4eOktn1a17uu0ilm5O9OAQfPok0Brk/SAeFDMxpjDDI3QF9ZfRoajKTVv/2+xU0QnSWvLpQjGM9JF21OS36ntTFE+wSZw3vgXxFOeI3uAPAjx42gkkcwSnTKs+EJsM+YepIPQBp2xK6vefqDKKdB8ig06qBHW/yNDuoPQ7Ivxh3HIL9FT4sOkaml81qKb07qxYeu70BM176PqCGVd6P2DGGbYYEZ9T+O0rsKAg86oOxOG1QCjLnMk+r+vn4U+vL/mZIZ0B6E5wfxfFp7QH8w/pW0PnGPHjQizlQK+C/TYKxQegKQpIo/f7I4QIKD7w0gpKHMHZ6fSdB2xGXUy+2kIB0Z6GAdgOA260Fk1k5GPvAQxI9rREakNg/CHuutCcLvJ+0rM2uYDVZbD7xe287FsSPNj+cXPpHAw3ljQj2BGkRCMKLSY9m9pumbUjLo5QQ6nWi59WPNU67DyqyTczTJyrozTP2VELQuktkVz8fHWPw/XZe6uD/89VMwrKYehUVkQvQCFBeg/T08eWHbD74ejMdI9nWuHIQNUKzyui0omfLRERSlaH7aSHyqErwreuPPAP0ZK+V8BfxmK0k1lunIj1rA1J9hv/PBy5dFs9gHqqkKSmFqJDkskHzapAiIcUvWvAtb810cbw6V8NSjtPtrA0XcdUoYkCCzyusnj7y29ftjwyURWqZsAD1PIBjV1ouHy1ysQb36f2aUuxxLiarHmrY/ejxTzeaiwikulPPLW4owHv6SPv7/4+iFPc7KVD3ULEczBrsaCMU2nGuiPqwNsBuubNC43CbJhDH/mtfz+gFVMr8cHWirmVcJDqEdppKBPq9t393W/zZUYqFtykoVzCKpj4kOGsiiYK45p6Nz8xh/+KTTRcZXH0fDYq4QX6NU+KY36bty1uKovDYlRN8NaAAzudsddtq7B4yzHSwIogBXVy+H2qJfBmUhm5Yu/w5GQkqDRPYnAE/D8YdP/3HXt6kzoZIuDulEShwnV7QkPuCAK4hT0dz/SPQxtcraEs8G/tfmTRTzA8uQuD4yQgFDP+5K1jJXyKCMF3dwlPww18NMc5jDmUAsb5VeGA5+TjUJZ4zJxp4x7GAU5JXnQtDWrvG723VnTy6KDcPgceeokp0IIhjixdCPOuh2Bz+HBQvDljN6QBc2sUSHpTlErT+yssr8ZoYeGWyZnzWiIDtSgNW4SdG/qFu1msPBp12Dk8St3gxr99hB9c9hE8y+FnAo95K3hEnpMC+yEZrte5+qqC61d17h2kApxB3LG0eAmHfWWMxPpNc4+CPSTShcXfQ4zEmRjTrN+uSETfsk43NRmUbkQcqcBqfvC5s+r+kvif5ZPVyU2FfkX6bTWuhmj3hEmMx0v9YUtx6b2F/ATcpTdmUfk9xjXsNZF04+YMRZTbgnOAZMRe2K8CJ4rOVAn1E3paVoshrrLIzHDZocdgyd2SY5JVgLjv80Vc0Xn7uaeb0Ty+xJr+ksB4GIELO3h5rqK1xR+LiHqJDdZEHH4cp5hk8NIH3aHcAji6E956UhOTXaAlv3w3ZMz8F4uC2fRYNwniuM+Ir+2V0eIXzgLxUVYzgvqYvnhHQdQ3D0Wg2M/x3wKGUkDvFE3dZNhURkGOE3gCVGc8425lqQACMqZBgRBYSQvD8qFiStOrtkSC3RJuD8EAaw5YqgzMpIGwIrfYq3JAsX8tPaultOJsECcyy4+d/GT7sEIYdpls0glgDrYAVarpj+EvhhtVXgJA5j+wFo4O4fXrnBssBmSoc6llRRyLiCuAlUiSoW5oJ9KQ+qAp2rg2cgbpmFu8sBahZcwwI75JWf8UbbftZTrnpaPzry35dQihXz50Jd40qP4KIgCqofSl8/HpYCyW342UxkaBxZ13HFnSWLLnzAAdvH7J9aDD3DVAb0garINuRII0q2Me3c0UBzwNsw53ifXISBlT4w+GJhrHHVM1sddEiW1LNl9dkPY7zRgEwSBPCvIg/yw87uT65LQRl39kRBpAz2Xe4Ele7paIj6ReAaIAgcirHHngtKHkoUfZAA8qlq8r7vX1gS8BwyzBsQNPOEUeRG2fvv3Jo2bN8OSlUitL3u75+chP193aXULD4UdevH1W0uKcJmXjD8gBPAGIgRsrQ4e6cN7GuieYAU4R4yYfN2Kd3qWJncej3WUMWqKdTiVQyaTwQWvFnPUKVV5lH+QAbBx64Li3wUd/TGNum9byVgFN4jpbMuqt/uuQZzxWFA2lBFHEZWXD9YpE/mO+RjqNJTMQxoAEbfcfsWvIPabXC9w05QD/2CJmM6h8egJK945vzRsxA/BatJQSRZlRx223F6U9lR5UA5ItdLydy8ciGnePgGxMSdAbsxztPWbbyscFzlh5d6LPw8zZx2Kliw//IHl4LZbJ8xNbkutp/UAhVh0W2Gtj7NOdClpWeQB8RXWxLqVe/taFN7XBVEGlAWHRYYqyIfQz7XOovmFtSPJNcBi6ZB/IoTRv7+/LUrEwKUxuILBRXfAMR9q+q6/OV3/sWhfs+fioohGNsCj5xJFHyMfj/gDVDsYvCWv9tc0B6/LK+IIH9jb3xhjdA3HA3VZcEYBzwC+JiefGpyu2nhHcFTvFbn0Rv6tfydU7TC6KcbETJyyB/TA0OS06cXbgg0D2oe5GEhgGER1a827oUcijDwjX+fBcPCOtLz7wk9oW4Hhr3/2JprTZwuPvi9m9NmRjVFCwK09xV37SxEglnlAkMeabg+mTXhKh2SYtQGw88PvWfMijtNiC1KYbADwBLlwwreMDSE6dUI3BwK+p5+toaM6Xnv0AzE1EoE/TRGyEly9LHXE0d3R7eFU52JA0+qe/4455FSXrHBqfVQGQCIoTMN+6/kYERASQ68nJDNYWIEhQhoRR+H57580h3zo9xuHoE9XXpDITUk4RMpjlEymUXsOvAd0A4TYtx1CZ8UJHNenunmSBvBUk8PuoqlxvvnV/m0uSQbyxGFR0X8uvjFGyHzO4eB5mKJGDKEsKRGEM436N+lQZJTHg4fhHwL2Fxbr9U/Pph1D4WbaNmoPSGXwk/2inAvnOYuLhfAA2of3lcCeuoMzhooZhLIDYKo2t2XArw7vSxqEtsLjtLW/nk+l9wxAGMVFzgyQzPvRNrHKtvmTNiezwZV96dx4JAPBcgPCR8R0Sg6bJnvq2Vqa+wOaZMHHov74+6LKiZMGSGTVEPeV4P0lkMNNgBrMJHIAIG7gRRV4c0EQS6OkG1rbIbEd1HTS+Mub6JGxkEvR/H/1GixGG+ou8QAAAABJRU5ErkJggg==";function Gr({src:e,alt:t,className:r,style:n,showWarn:i,...o}){const[s,a]=ie.useState(Qu),c=l=>{a(Qu)};return ie.useEffect(()=>{a(e||Qu)},[e]),w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},children:[w.jsx("img",{src:s,alt:t||"",className:r,loading:"lazy",decoding:"async",style:{borderRadius:"100%",...n},onError:c,...o}),i&&w.jsx("img",{style:{position:"absolute",right:-2,bottom:-2,width:"16px",height:"16px"},src:rR})]})}function nR({toastData:e,onClose:t}){const{status:r,buildShowInfo:n,tx:i,id:o}=e,{getExplorerUrl:s}=As(),a=ie.useMemo(()=>{if(n&&r)return n(r)},[r]),c=ie.useMemo(()=>{if(r){if(r==="rejected")return"#ff5073";if(r==="success")return"#68ffd8"}return"#909ca4"},[r]);return w.jsxs("div",{className:"cs-toast",children:[w.jsxs("div",{style:{gap:"0px",display:"flex",flexDirection:"column"},children:[w.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[r==="submitted"&&w.jsx("div",{children:w.jsx(tR,{})}),w.jsxs("svg",{className:"cs-icon",style:{width:"16px",height:"16px",fill:c},children:[r==="rejected"&&w.jsx("use",{xlinkHref:"#icon-close"}),r==="success"&&w.jsx("use",{xlinkHref:"#icon-sel"})]}),r==="submitted"&&w.jsxs("span",{style:{marginLeft:"-28px"},children:[" ","Transaction in progress"," "]}),r==="rejected"&&w.jsx("span",{className:"red",children:(a==null?void 0:a.toastTitleText)||"Transaction failed"}),r==="success"&&w.jsx("span",{className:"green",children:(a==null?void 0:a.toastTitleText)||"Transaction Successful"})]}),r==="submitted"&&w.jsxs("div",{children:[a!=null&&a.toastDescriptionContent&&typeof a.toastDescriptionContent=="function"?a.toastDescriptionContent():w.jsx("span",{children:a==null?void 0:a.toastDescriptionContent}),!(a!=null&&a.toastDescriptionContent)&&i&&w.jsx(_b,{text:"Confirmation is in progress. Check your transaction on here",keywords:["here"],text_highlight_color:"#72c1f7",onKeywordClick:()=>{window.open(s(i,"tx"),"_blank")}})]}),r==="rejected"&&w.jsxs(w.Fragment,{children:[a!=null&&a.toastDescriptionContent&&typeof a.toastDescriptionContent=="function"?a.toastDescriptionContent():w.jsx("span",{children:a==null?void 0:a.toastDescriptionContent}),!(a!=null&&a.toastDescriptionContent)&&w.jsx("span",{children:"Something went wrong"})]}),r==="success"&&w.jsx(w.Fragment,{children:a!=null&&a.toastDescriptionContent&&typeof a.toastDescriptionContent=="function"?a.toastDescriptionContent():w.jsx("span",{children:a==null?void 0:a.toastDescriptionContent})}),r==="success"&&i&&w.jsxs("div",{className:"view-transaction",children:[w.jsx("span",{children:"View Transaction"}),Pl.map(l=>w.jsx("a",{href:s(i,"tx",l.link),target:"_blank",children:w.jsx(Gr,{src:l.img})},l.link))]})]}),w.jsx("svg",{className:"cs-icon close","aria-hidden":"true",onClick:()=>t(o),children:w.jsx("use",{xlinkHref:"#icon-close"})})]})}const iR=Ri((e,t)=>({toasts:[],setToasts:r=>{e(n=>({toasts:[...n.toasts,r]})),setTimeout(()=>{e(n=>({toasts:n.toasts.filter(i=>i.id!==r.id)}))},3e3)},removeToast:r=>{e(n=>({toasts:n.toasts.filter(i=>i.id!==r)}))}})),ks=(e="cs-swap-widget")=>{const{toasts:t,setToasts:r,removeToast:n}=iR(),i=(a,c="success")=>{const u={id:Date.now(),status:c,buildShowInfo:()=>({toastTitleText:a})};r(u)},o=a=>{const c=Date.now();return a.id=c,r(a),c},s=ie.useCallback(()=>{let a=document.getElementById(e);return a||(a=document.createElement("div"),a.id=e,document.body.appendChild(a)),ol.createPortal(w.jsx("div",{className:"cs-toast-wrapper",children:t&&t.map(c=>w.jsx(nR,{toastData:c,onClose:()=>{n(c.id)}},c.id))}),a)},[t]);return{addCommonToast:i,addTxToast:o,ToastContainer:s,removeToast:n}};function oR(){const{mevProtect:e,setMevProtect:t}=$r();return w.jsxs(mn.Root,{children:[w.jsx(mn.Trigger,{children:w.jsx("div",{className:"cs-settings-btn",children:w.jsx("svg",{"aria-hidden":"true",cursor:"pointer",fill:e?"var(--cs-primary)":"var(--cs-icon-fill)",children:w.jsx("use",{xlinkHref:"#icon-mev"})})})}),w.jsx(mn.Content,{variant:"soft",className:"cs-dropdown-content",side:"bottom",align:"end",style:{maxWidth:"328px"},children:w.jsxs("div",{className:"mev-settings-box",children:[w.jsxs("div",{className:"mev-setting-title",children:[w.jsxs("div",{className:"name",children:[w.jsx("img",{src:At("/images/icon_mev@2x.png")}),w.jsx("span",{children:"MEV Protect"})]}),w.jsx(Jy,{checked:e,className:"cs-switch",onClick:()=>{t(!e)}})]}),w.jsx("p",{className:"mev-tips",children:"By enabling this, your txn will be submitted via 3rd party MEV service provider. MEV value retained will be redistributed to all users who successfully execute their trades with Shio through its point campaign."})]})})]})}function sR({onClick:e}){const[t,r]=ie.useState(!1),n=()=>{r(!0),setTimeout(()=>{r(!1)},1e3),e()};return w.jsx("div",{className:"refresh-button",children:w.jsx("svg",{className:t?"rotate cs-icon-hover":"cs-icon-hover","aria-hidden":"true",onClick:n,children:w.jsx("use",{xlinkHref:"#icon-refresh"})})})}function F0(e){const{text:t,onClick:r,className:n,btnIsDisabled:i=!1}=e,o=()=>{r&&r()};return w.jsx(iw,{disabled:i,className:n?`cs-button ${n}`:"cs-button",onClick:o,children:t})}function aR(){const{setIsOpenSlippageDialog:e,isOpenSlippageDialog:t,slippage:r}=$r();return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"slippage-button",onClick:()=>e(!0),children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-verticalslider"})}),w.jsxs("span",{children:[r,"%"]})]}),t&&w.jsx(cR,{onClose:()=>e(!1)})]})}function cR({onClose:e}){const{slippage:t,setSlippage:r}=$r(),[n,i]=ie.useState(t),o=l=>{i(l.display)},s=l=>{const u=new RegExp("[^\\d-]*(\\d*(?:\\.\\d{0,2})?).*$");l.target.value=l.target.value.replace(u,"$1"),i(l.target.value)},a=()=>{n&&r(n),e()},c=ie.useMemo(()=>+n?Number(n)>50||Number(n)<.01:!0,[t,n]);return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"dialog-mask",style:{zIndex:"100"}}),w.jsx("div",{className:"slippage-settings-dialog",style:{zIndex:"100"},children:w.jsxs("div",{className:"slippage-settings",children:[w.jsxs("div",{className:"slippage-settings-header",children:[w.jsx("div",{className:"title",children:"Slippage Settings"}),w.jsx("svg",{className:"cs-icon","aria-hidden":"true",onClick:e,children:w.jsx("use",{xlinkHref:"#icon-close"})})]}),w.jsxs("div",{className:"title",children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-verticalslider"})}),w.jsx("span",{children:"Slippage Tolerance"})]}),w.jsxs("div",{className:"form-box",children:[w.jsx("div",{className:"slippage-tab-list",children:rC.map(l=>w.jsxs("span",{className:l.display===n?"active":"",onClick:()=>o(l),children:[l.display," %"]}))}),w.jsxs("div",{className:"input-box",children:[w.jsx("span",{children:"Custom"}),w.jsx("input",{className:"cs-input",placeholder:"0.0",value:n,onChange:s}),w.jsx("div",{style:{fontSize:"14px",color:"#fff"},children:"%"})]})]}),Number(n)<=.05&&w.jsx("div",{className:"tips warning",children:"Slippage is low. Your transaction may fail."}),Number(n)<=50&&Number(n)>1&&w.jsx("div",{className:"tips warning",children:"Your transaction may frontrun"}),Number(n)>50&&w.jsx("div",{className:"tips error",children:" Enter a valid slippage percentage"}),w.jsx(F0,{text:"Save",btnIsDisabled:c,className:"slippage-save-btn",onClick:a})]})})]})}function lR({handleRefresh:e}){return w.jsx(w.Fragment,{children:w.jsxs("div",{className:"swap-header",children:[w.jsx("h3",{className:"swap-title",children:"Swap"}),w.jsxs("div",{className:"right",children:[w.jsx(aR,{}),w.jsx(oR,{}),w.jsx(sR,{onClick:e})]})]})})}function uR(){const[e,t]=ie.useState(!1);return w.jsxs(mn.Root,{open:e,onOpenChange:t,children:[w.jsx(mn.Trigger,{children:w.jsx("div",{className:"cs-settings-btn",children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-settings"})})})}),w.jsx(mn.Content,{variant:"soft",className:"cs-dropdown-content",style:{backgroundColor:"#2B3643"},side:"bottom",align:"end",children:w.jsxs("div",{className:"cs-settings-box",children:[w.jsx("h3",{children:"Settings"}),w.jsx(fR,{}),w.jsx(hR,{onClose:()=>{t(!1)}})]})})]})}function fR(){const{currentExplorer:e,setCurrentExplorer:t,currentRpc:r,setCurrentRpc:n}=$r(),i=o=>{t(o)};return w.jsxs("div",{className:"settings-card",style:{marginTop:"12px"},children:[w.jsxs("h3",{className:"card-title",children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-plorer"})}),w.jsx("span",{children:"Preferred Explorer"})]}),w.jsx("div",{className:"explorer-checkbox-group",children:Pl.map(o=>w.jsxs("div",{className:"group-item",style:{justifyContent:"center"},onClick:()=>i(o.link),children:[w.jsx(zl,{color:"indigo",checked:o.link===e,variant:"soft",className:"cs-checkbox"}),w.jsx("img",{src:o.img}),w.jsx("span",{children:o.name})]}))})]})}const dR=e=>!/^(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/.test(e);function hR({onClose:e}){const{addTxToast:t}=ks(),{currentRpc:r,setCurrentRpc:n,customRpc:i,setCustomRpc:o,rpcList:s}=$r(),[a,c]=ie.useState(i),[l,u]=ie.useState(r),d=b=>{t({id:0,status:"success",buildShowInfo:()=>({toastTitleText:"RPC update",toastDescriptionContent:`RPC is currently set to ${b}`})})},p=b=>{u(b),b.isCustom||(n(b),d(b.link),e())},y=b=>{c(b.target.value)},x=()=>{if(a){const b={name:"Custom RPC URL",link:a,isCustom:!0};o(a),n(b),d(a),e()}};return w.jsxs("div",{className:"settings-card rpc-settings-card",children:[w.jsxs("h3",{className:"card-title",children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-settings"})}),w.jsx("span",{children:"RPC Node"})]}),w.jsxs("div",{className:"rpc-checkbox-group",children:[s.map(b=>w.jsxs("div",{className:"rpc-item",onClick:()=>p(b),children:[w.jsx(zl,{color:"indigo",checked:l.name===b.name,variant:"soft",className:"cs-checkbox"}),w.jsx("span",{children:b.name})]})),l.isCustom&&w.jsxs("div",{className:"custom-rpc-input-box",children:[w.jsx("input",{className:"cs-input",placeholder:"Custom RPC URL",onChange:y,value:a}),w.jsx(F0,{btnIsDisabled:dR(a),text:"Save",onClick:x})]})]})]})}const Yr=Ri((e,t)=>({accounts:[],currentAccount:void 0,isOpenWalletModal:!1,saveCurrentAccount:r=>{e({currentAccount:r})},saveAccounts:r=>{e({accounts:r})},onWalletModal:r=>{e({isOpenWalletModal:r})},isOpenAccountList:!1,setIsOpenAccountList:r=>{e(()=>({isOpenAccountList:r}))},tokenBalanceObj:{},setTokenBalanceObj:r=>{e(()=>({tokenBalanceObj:r}))},accountServiceNameObj:{},setAccountServiceNameObj:r=>{const n=t().accountServiceNameObj;e({accountServiceNameObj:{...n,...r}})}})),so=Ri((e,t)=>({suiClient:new ps({url:ls.fullRpcUrl}),setSuiClient:r=>{e(()=>({suiClient:r}))},aggregatorSDK:new Qv({signer:ls.simulationAccount,client:new ps({url:ls.fullRpcUrl}),env:a0.Mainnet}),setAggregatorSDK:r=>{e(()=>({aggregatorSDK:r}))}}));function ow(){const{suiClient:e}=so(),{setAccountServiceNameObj:t,accountServiceNameObj:r}=Yr(),n=async o=>{if(!((o==null?void 0:o.length)<1))try{const s=o.map(async l=>{var d;const u=await e.resolveNameServiceNames({address:l});return{address:l,name:((d=u==null?void 0:u.data)==null?void 0:d[0])||""}}),a=await Promise.all(s),c=Object.fromEntries(a==null?void 0:a.map(l=>[l.address,l.name]));t(c)}catch{}};return{fetchServiceNames:n,getServiceNames:async o=>{const s=[];o==null||o.forEach(a=>{const c=a==null?void 0:a.address;r!=null&&r[c]||s.push(c)}),(s==null?void 0:s.length)>0&&n(s)}}}var pR=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));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||r.forEach(function(i){e.addRange(i)}),t&&t.focus()}},mR=pR,Hp={"text/plain":"Text","text/html":"Url",default:"Text"},gR="Copy to clipboard: #{key}, Enter";function vR(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function bR(e,t){var r,n,i,o,s,a,c=!1;t||(t={}),r=t.debug||!1;try{i=mR(),o=document.createRange(),s=document.getSelection(),a=document.createElement("span"),a.textContent=e,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(u){if(u.stopPropagation(),t.format)if(u.preventDefault(),typeof u.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var d=Hp[t.format]||Hp.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(a),o.selectNodeContents(a),s.addRange(o);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){r&&console.error("unable to copy using execCommand: ",u),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),c=!0}catch(d){r&&console.error("unable to copy using clipboardData: ",d),r&&console.error("falling back to prompt"),n=vR("message"in t?t.message:gR),window.prompt(n,e)}}finally{s&&(typeof s.removeRange=="function"?s.removeRange(o):s.removeAllRanges()),a&&document.body.removeChild(a),i()}return c}var yR=bR;const sw=Ta(yR);function wR({currentAccount:e}){const{mutate:t}=zr.useSwitchAccount(),r=zr.useAccounts(),{isOpenAccountList:n,setIsOpenAccountList:i,accountServiceNameObj:o}=Yr(),{getServiceNames:s}=ow(),a=ie.useCallback(()=>{n||s(r),i(!n)},[n,r]);ie.useEffect(()=>()=>{i(!1)},[]);const c=ie.useMemo(()=>r.filter(u=>u.address!==e),[r,e]);ie.useEffect(()=>{},[c]);const l=u=>{t({account:u},{onSuccess:()=>{}})};return w.jsxs("div",{className:"cs-account-switch",children:[w.jsxs("div",{className:"account",onClick:a,children:[w.jsx("span",{children:e&&(o==null?void 0:o[e])||Po(e)}),(c==null?void 0:c.length)>0&&w.jsx("svg",{className:`cs-icon ${n?"open":"close"}`,"aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-unfold"})})]}),w.jsx("div",{className:`account-list ${n?"open":"close"}`,children:c.map(u=>w.jsxs("div",{className:"account-item",children:[w.jsxs("div",{className:"left",children:[w.jsx("div",{className:"label",children:u==null?void 0:u.label}),w.jsx("div",{className:"address",children:(o==null?void 0:o[u==null?void 0:u.address])||Po(u==null?void 0:u.address)})]}),w.jsx("button",{className:"cs-outline-btn",onClick:()=>l(u),children:"Switch"})]}))})]})}const xR=ie.forwardRef(({connect:e})=>{const t=zr.useCurrentAccount();return w.jsx("div",{children:t?w.jsx(SR,{}):w.jsx(F0,{text:"Connect",className:"cs-connect-button",onClick:()=>e(!0)})})});function SR(){const{mutate:e}=zr.useDisconnectWallet(),t=zr.useCurrentAccount(),{currentWallet:r}=zr.useCurrentWallet(),{addCommonToast:n}=ks(),{getExplorerUrl:i}=As(),{accountServiceNameObj:o}=Yr(),s=()=>{t&&(sw(t.address||"",{debug:!1,message:"message"}),n("Copied"))},a=()=>{t&&window.open(i(t.address,"account"),"_blank")};return ie.useEffect(()=>{},[r]),w.jsxs(mn.Root,{children:[w.jsx(mn.Trigger,{children:w.jsxs("div",{className:"cs-connected-button",children:[w.jsx("img",{src:r==null?void 0:r.icon,style:{width:"20px",height:"20px"}}),w.jsx("span",{children:(t==null?void 0:t.address)&&(o==null?void 0:o[t==null?void 0:t.address])||Po(t==null?void 0:t.address)})]})}),w.jsx(mn.Content,{variant:"soft",className:"cs-dropdown-content",style:{backgroundColor:"#2B3643"},side:"bottom",align:"end",children:w.jsxs("div",{className:"account-op-box",children:[w.jsx("span",{style:{fontSize:"14px",color:"#909CA4",marginBottom:"6px"},children:t==null?void 0:t.label}),w.jsx(wR,{currentAccount:t==null?void 0:t.address}),w.jsxs("div",{className:"account-op-item",onClick:s,style:{marginTop:"12px"},children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-copy"})}),w.jsx("span",{children:"Copy address"})]}),w.jsxs("div",{className:"account-op-item",onClick:a,children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-link"})}),w.jsx("span",{children:"Open explorer"})]}),w.jsxs("div",{className:"account-op-item",onClick:()=>e(),children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-disconnect"})}),w.jsx("span",{children:"Disconnect"})]})]})})]})}function _R(){const{fetchServiceNames:e}=ow(),t=zr.useCurrentAccount();zr.useCurrentWallet();const{isOpenWalletModal:r,onWalletModal:n,saveCurrentAccount:i}=Yr();return zr.useWallets(),ie.useEffect(()=>{t!=null&&t.address&&e([t==null?void 0:t.address])},[t==null?void 0:t.address]),w.jsx(w.Fragment,{children:w.jsx(zr.ConnectModal,{trigger:w.jsx(xR,{connect:n}),open:r,onOpenChange:o=>n(o)})})}function ER({independentWallet:e,customWallet:t}){return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"widget-header",children:[w.jsx("img",{src:At("/images/logo@2x.png"),className:"cetus-logo"}),w.jsxs("div",{className:"right",children:[e&&w.jsx(_R,{}),w.jsx(uR,{})]})]}),w.jsx("div",{style:{marginTop:"20px"}})]})}const aw=()=>{const e=ie.useRef(null);ie.useEffect(()=>{if(e.current){const n=e.current.style;n.setProperty("--size-loader","50px"),n.setProperty("--size-orbe","10px")}},[]);const t=n=>({position:"absolute",width:"100%",height:"100%",animation:`webLoading ease-in-out 1.5s calc(${n} * 0.1s) infinite`,opacity:`calc(1 - calc(0.2 * ${n}))`}),r={position:"absolute",content:"''",top:0,left:0,width:"var(--size-orbe)",height:"var(--size-orbe)",backgroundColor:"#75C8FF",boxShadow:"0px 0px 20px 2px #75C8FF",borderRadius:"50%"};return w.jsx("div",{style:{width:"100%",height:"100%",position:"absolute",zIndex:100},children:w.jsx("div",{ref:e,style:{width:"var(--size-loader)",height:"var(--size-loader)",position:"absolute",top:"50%",left:"50%",marginTop:"-25px",marginLeft:"-25px",transform:"rotate(45deg)"},children:[...Array(5)].map((n,i)=>w.jsx("div",{style:t(i),children:w.jsx("div",{style:r})},i))})})};function CR({onClose:e,transactionData:t}){const{status:r,buildShowInfo:n,tx:i}=t,o=ie.useMemo(()=>{if(n&&r)return n(r)},[r]);return w.jsxs("div",{className:"ts-status-dialog",children:[(r==="confirmation"||r==="submitted")&&w.jsx(TR,{info:o,status:r}),(r==="success"||r==="rejected")&&w.jsx(AR,{info:o,status:r,tx:i,onClose:e})]})}function TR({info:e,status:t}){return w.jsxs("div",{className:"progress-dialog",children:[w.jsx("div",{className:"title",children:t==="confirmation"?"Waiting for Confirmation":"Transaction in progress"}),w.jsx("div",{className:"loading-box",children:w.jsx(aw,{})}),w.jsxs("div",{className:"ts-content",children:[e==null?void 0:e.modalDescriptionText," "]}),w.jsxs("p",{className:"ts-desc",children:[" ",t==="confirmation"?"Confirm this transaction in your wallet.":"Confirmation is in progress."]})]})}function AR({info:e,status:t,tx:r,onClose:n}){const{getExplorerUrl:i}=As();return w.jsxs("div",{className:"finally-status-dialog",children:[w.jsxs("div",{className:"center-content",children:[w.jsxs("div",{className:t==="success"?"status-box is-success":"status-box is-error",children:[w.jsx("div",{className:"status-icon-box",children:w.jsx("div",{className:"status-icon",children:w.jsx("svg",{className:"icon","aria-hidden":"true",children:t==="success"?w.jsx("use",{xlinkHref:"#icon-sel"}):w.jsx("use",{xlinkHref:"#icon-caution"})})})}),t==="success"?w.jsx("span",{children:"Swap Success"}):w.jsx("span",{children:"Swap failed"})]}),w.jsx("div",{className:"ts-content",children:e==null?void 0:e.modalDescriptionText}),r&&w.jsxs("div",{className:"view-transaction",children:[w.jsx("span",{children:"View Transaction"}),Pl.map(o=>w.jsx("a",{href:i(r,"tx",o.link),target:"_blank",children:w.jsx("img",{src:o.img})},o.link))]})]}),w.jsx("button",{className:"cs-solid-btn swap-more-btn",onClick:n,children:t==="success"?"Swap More":"Retry"})]})}function Yl(){return{fetchByApi:async(t,r,n,i)=>{try{return r==="GET"?await QE(`${i||ls.api}${t}`,n):await eC(`${i||ls.api}${t}`,n)}catch(o){throw o}}}}function MR(){const{fetchByApi:e}=Yl(),{setProviders:t}=$r();return{fetchRouterConfig:async()=>{try{const n=await e("/router_v2/status","GET"),{providers:i}=n;i&&t(i)}catch{}}}}function IR({interval:e,callback:t}){const r=ie.useRef(),n=ie.useRef(null);ie.useEffect(()=>{r.current=t},[t]);const i=ie.useCallback(()=>{n.current&&clearInterval(n.current),e>0&&(n.current=setInterval(()=>{r.current&&r.current(Date.now())},e))},[e]),o=ie.useCallback(()=>{n.current&&(clearInterval(n.current),n.current=null)},[]);return ie.useEffect(()=>(i(),()=>o()),[]),{startTimer:i,stopTimer:o}}const OR=(e,t)=>({coinPriceObj:{},setPriceObj:r=>{const n=t().coinPriceObj;e({coinPriceObj:{...n,...r}})},clearPriceObj:r=>{const n=t().coinPriceObj;r.forEach(i=>{delete n[kr(i).full_address]}),e({coinPriceObj:{...n}})}}),cw=Ri(OR);function RR(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function $a(){const{fetchByApi:e}=Yl(),{coinPriceObj:t,setPriceObj:r,clearPriceObj:n}=cw(),i=async a=>{const l=RR(a,10);try{const d=(await Promise.all(l.map(p=>e("/v2/sui/market_price","GET",{base_symbol_address_pair:p.map(y=>Ti(y,!1))})))).map(p=>p.prices).flat();if(d){const p={};d.forEach(y=>{p[kr(y.base_symbol).full_address]=y}),r(p)}return d}catch{return n(a),null}},o=ie.useCallback(a=>{if(!a)return;const c=t[kr(a).full_address];if(c)return c},[t]),s=ie.useCallback((a,c,l)=>{const u=Number(c)==0||!l?"0":l;if(c&&a&&+c){const d=o(a);if(d)return Be(c).mul(d.price).toString()}return u},[t]);return{fetchTokenPrices:i,getTokenPrice:o,getTokenAmountValue:s}}const PR=(e,t)=>({isOpenTokensDialog:!1,defaultFromCoinType:void 0,defaultToCoinCoinType:void 0,isOpenSecondary:!1,byAmountIn:!0,findRouterLoading:!1,fromAmount:"",toAmount:"",fromCoin:void 0,toCoin:void 0,routerData:void 0,setDefaultCoin:(r,n)=>{e(()=>({defaultFromCoinType:r,defaultToCoinCoinType:n}))},setFromCoin:r=>{e(()=>({fromCoin:r}))},setToCoin:r=>{e(()=>({toCoin:r}))},setFromAmount:r=>{e(()=>({fromAmount:r}))},setToAmount:r=>{e(()=>({toAmount:r}))},setRouterData:r=>{e(()=>({routerData:r}))},setFindRouterLoading:r=>{e(()=>({findRouterLoading:r}))},setByAmountIn:r=>{e(()=>({byAmountIn:r}))},setIsOpenSecondary:r=>{e(()=>({isOpenSecondary:r}))},setIsOpenTokensDialog:r=>{e(()=>({isOpenTokensDialog:r}))}}),nn=Ri(PR);function NR(){const{tokenBalanceObj:e}=Yr(),{fetchTokenPrices:t}=$a(),{isOpenTokensDialog:r}=nn(),n=ie.useCallback(()=>{if(ZE(e)){const i=Object.keys(e);t(i)}},[e]);return ie.useEffect(()=>{r&&n()},[r]),{getMyAssetsPrice:n}}const kR=(e,t)=>({tokenMapIsInit:!1,requestTokenList:[],addRequestTokenList:r=>{e(()=>({requestTokenList:[...t().requestTokenList,r]}))},setToken:r=>{const{tokenMap:n,requestTokenList:i}=t(),o=kr(r.coin_type).full_address;if(!n.has(o)){const s=new Map(n);s.set(o,r);const a=i.filter(c=>c!==r.coin_type);e(()=>({tokenMap:s,requestTokenList:[...a]})),Si.setItem(Hf,s)}},tokenMap:new Map,setTokenMap:(r,n=!1)=>{r.size>0?e(()=>({tokenMap:r,tokenMapIsInit:!0})):e(()=>({tokenMap:r})),n||Si.setItem(Hf,r)},trustedTokenList:[],setTrustedTokenList:(r,n=!1)=>{e(()=>({trustedTokenList:r})),n||Si.setItem(vb,r)}}),Va=Ri(kR);Si.getItem(Hf).then(e=>{e!==null&&Va.getState().setTokenMap(e,!0)});Si.getItem(vb).then(e=>{e!==null&&Va.getState().setTrustedTokenList(e,!0)});const jR=[{name:"Sudo LP Token",symbol:"SLP",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/slp.png",coinType:"0xc44d97a4bc4e5a33ca847b72b123172c88a6328196b71414f32c3070233604b2::slp::SLP",isVerified:!0,extensionFields:{birdeyeid:"0xc44d97a4bc4e5a33ca847b72b123172c88a6328196b71414f32c3070233604b2::slp::SLP",coin_priority:720,coingecko_id:"slp"}},{name:"❄️ WAL",symbol:"wWAL",decimals:9,logoURL:"https://interestprotocol.infura-ipfs.io/ipfs/QmPLCVWv7citJSc813NbcbZnRSXAEJ4BWVKq4zK8pPVEWq",coinType:"0xb1b0650a8862e30e3f604fd6c5838bc25464b8d3d827fbd58af7cb9685b832bf::wwal::WWAL",isVerified:!0},{name:"Wrapped GLMR (Portal from Moonbeam)",symbol:"WGLMR",decimals:8,logoURL:"https://zuwfvhekgt5rgxaa5e5yraqnxeivprtu2siky5qtffa2ysvcvh6q.arweave.net/zSxanIo0-xNcAOk7iIINuRFXxnTUkKx2EylBrEqiqf0",coinType:"0x66f87084e49c38f76502d17f87d17f943f183bb94117561eb573e075fdc5ff75::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x66f87084e49c38f76502d17f87d17f943f183bb94117561eb573e075fdc5ff75::coin::COIN",labels:["Wormhole"]}},{name:"Spring SUI",symbol:"sSUI",decimals:8,logoURL:"https://gateway.irys.xyz/5iJkTTWnZnTF5vpZA31F5vZZSqGPHuTMNCQSBTqkYGMV",coinType:"0x83556891f4a0f233ce7b05cfe7f957d4020492a34f5405b2cb9377d060bef4bf::spring_sui::SPRING_SUI",isVerified:!0,extensionFields:{coin_priority:908,rank:840,suggested_priority:909}},{name:"Volo Staked SUI",symbol:"vSUI",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/vsui.png",coinType:"0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT",isVerified:!0,extensionFields:{birdeyeid:"0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT",coin_priority:910,coingecko_id:"volo-staked-sui",pyth_id:"57ff7100a282e4af0c91154679c5dae2e5dcacb93fd467ea9cb7e58afdcfde27",rank:860,suggested_priority:910}},{name:"AXOLcoin",symbol:"AXOL",decimals:9,logoURL:"https://api.interestlabs.io/files/99e91dc540e4d32971972eed8ecae0958f0cb3e84018dd1b.png",coinType:"0xf00eb7ab086967a33c04a853ad960e5c6b0955ef5a47d50b376d83856dc1215e::axol::AXOL",isVerified:!0},{name:"SEND",symbol:"SEND",decimals:6,logoURL:"https://suilend-assets.s3.us-east-2.amazonaws.com/SEND/SEND.svg",coinType:"0xb45fcfcc2cc07ce0702cc2d229621e046c906ef14d9b25e8e4d25f6e8763fef7::send::SEND",isVerified:!0},{name:"TIMES",symbol:"TIMES",decimals:5,logoURL:"https://assets.playdarktimes.com/images/icons/darktimes_logo.png",coinType:"0x46fbe54691b27d7abd2c9e5a01088913531f241b98f3c2351f8215e45cc17a4c::times::TIMES",isVerified:!0,extensionFields:{coingecko_id:"times"}},{name:"Aptos Coin (Portal from Aptos)",symbol:"APT",decimals:8,logoURL:"https://hvyfngb6s6wsyytjzbvqjunzqvwlzjjhfmk4z44yacx7sq7fidxa.arweave.net/PXBWmD6XrSxiachrBNG5hWy8pScrFczzmACv-UPlQO4",coinType:"0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x3a5143bb1196e3bcdfab6203d1683ae29edd26294fc8bfeafe4aaa9d2704df37::coin::COIN",coin_priority:590,labels:["Wormhole"],pyth_id:"03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5"}},{name:"Haedal staked SUI",symbol:"haSUI",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/hasui.png",coinType:"0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI",isVerified:!0,extensionFields:{birdeyeid:"0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI",coin_priority:960,coingecko_id:"haedal-staked-sui",pyth_id:"6120ffcf96395c70aa77e72dcb900bf9d40dccab228efca59a17b90ce423d5e8",rank:870,suggested_priority:960}},{name:"sNS",symbol:"sNS",decimals:6,logoURL:"https://3vhaecwgpni3lhtpvmwylermast5evx5e7x46x3hw534olzdqq7q.arweave.net/3U4CCsZ7UbWeb6sthZIsBKfSVv0n789fZ7d3xy8jhD8",coinType:"0x6511052d2f1404934e0d877709949bcda7c1d451d1218a4b2643ca2f3fa93991::scallop_ns::SCALLOP_NS",isVerified:!0},{name:"sSCA",symbol:"sSCA",decimals:9,logoURL:"https://gateway.irys.xyz/6HrUJbgHzoHMq952F1PG36L94BQkuyjnqAjfPLo3hJ3D",coinType:"0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA",isVerified:!0,extensionFields:{rank:820}},{name:"CAP",symbol:"CAP",decimals:9,logoURL:"https://owhanwxsgozv6rpjuntz4a32lqhb2tl4kurcmyltpd6ipysudv2a.arweave.net/dY4G2vIzs19F6aNnngN6XA4dTXxVIiZhc3j8h-JUHXQ",coinType:"0x893aa3f358b70e7dbcf957c64a1f016633630af42fb6097f25c33ef9fa738dd2::cap::CAP",isVerified:!0},{name:"mUSD",symbol:"mUSD",decimals:9,logoURL:"https://mstable.io/coins/musd.svg",coinType:"0xe44df51c0b21a27ab915fa1fe2ca610cd3eaa6d9666fe5e62b988bf7f0bd8722::musd::MUSD",isVerified:!0},{name:"sSBUSDT",symbol:"sSBUSDT",decimals:6,logoURL:"https://zu6izvoktna456r6pbxg3knacc4bysfalutz25xo6zfkx6x3wvda.arweave.net/zTyM1cqbQc76PnhubamgELgcSKBdJ5127vZKq_r7tUY",coinType:"0xb1d7df34829d1513b73ba17cb7ad90c88d1e104bb65ab8f62f13e0cc103783d3::scallop_sb_usdt::SCALLOP_SB_USDT",isVerified:!0},{name:"Wrapped AVAX (Portal from Avalanche)",symbol:"WAVAX",decimals:8,logoURL:"https://dvv5kcjybfklcqlql7dj7mfrfzj4bgunkcdgz6uh3re4usboi5ba.arweave.net/HWvVCTgJVLFBcF_Gn7CxLlPAmo1Qhmz6h9xJykguR0I",coinType:"0x1e8b532cca6569cab9f9b9ebc73f8c13885012ade714729aa3b450e0339ac766::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x1e8b532cca6569cab9f9b9ebc73f8c13885012ade714729aa3b450e0339ac766::coin::COIN",coingecko_id:"avalanche-wormhole",labels:["Wormhole"],pyth_id:"93da3352f9f1d105fdfe4971cfa80e9dd777bfc5d0f683ebb6e1294b92137bb7"}},{name:"suibeaver",symbol:"DAM",decimals:9,logoURL:"https://gateway.irys.xyz/8yU5QsDMFoLAoXFfSDrE5m3ZMMAzCzewtwfAy6qHvpju",coinType:"0xaf3aae4940a248739ce4964857381fc3f3149a6d05375bfbb2118592907e3bbb::dam::DAM",isVerified:!0},{name:"svSUI",symbol:"svSUI",decimals:9,logoURL:"https://gateway.irys.xyz/8ot3tVqpC3hhGQhf2sNyGC27Z877ZtcEb79RY1W4fzrB",coinType:"0xe1a1cc6bcf0001a015eab84bcc6713393ce20535f55b8b6f35c142e057a25fbe::scallop_v_sui::SCALLOP_V_SUI",isVerified:!0},{name:"USD Coin (Portal from Eth)",symbol:"wUSDC",decimals:6,logoURL:"https://klrhtty4kphjcsrez2eaeh6r27tbaayw3odjadigbrek544f3i2a.arweave.net/UuJ5zxxTzpFKJM6IAh_R1-YQAxbbhpANBgxIrvOF2jQ",coinType:"0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN",coin_priority:990,coingecko_id:"usd-coin-wormhole-from-ethereum",labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:990}},{name:"Wrapped Ether (Portal from Eth)",symbol:"WETH",decimals:8,logoURL:"https://t4gq524jdiihjr6ihouhzsemfczi3eq2cnjyhbfms5utl3hueu6q.arweave.net/nw0O64kaEHTHyDuofMiMKLKNkhoTU4OErJdpNez0JT0",coinType:"0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN",coin_priority:940,coingecko_id:"ethereum-wormhole",labels:["Wormhole"],pyth_id:"ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",rank:800}},{name:"Mirai Staked SUI",symbol:"mSUI",decimals:9,logoURL:"https://gateway.irys.xyz/3pwmCNEzHcDWVdobJJa2275EVQupXGzffjahSCPiw9G4",coinType:"0x922d15d7f55c13fd790f6e54397470ec592caa2b508df292a2e8553f3d3b274f::msui::MSUI",isVerified:!0},{name:"ZO Perpetuals LP Token",symbol:"ZLP",decimals:6,logoURL:"https://img.zofinance.io/zlp.png",coinType:"0xf7fade57462e56e2eff1d7adef32e4fd285b21fd81f983f407bb7110ca766cda::zlp::ZLP",isVerified:!0},{name:"Wrapped Fantom (Portal from Fantom)",symbol:"WFTM",decimals:8,logoURL:"https://tqhb43iz7vqrys2frjp73jn2o3uzehbmybq2sv2me2fpo4rocbja.arweave.net/nA4ebRn9YRxLRYpf_aW6dumSHCzAYalXTCaK93IuEFI",coinType:"0x6081300950a4f1e2081580e919c210436a1bed49080502834950d31ee55a2396::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x6081300950a4f1e2081580e919c210436a1bed49080502834950d31ee55a2396::coin::COIN",labels:["Wormhole"],pyth_id:"5c6c0d2386e3352356c3ab84434fafb5ea067ac2678a38a338c4a69ddc4bdb0c"}},{name:"swUSDT",symbol:"swUSDT",decimals:6,logoURL:"https://gateway.irys.xyz/GNNHRxZcwE3QnxL39LZQksEHB1JARX2bhBHGbcZCvfWg",coinType:"0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT",isVerified:!0},{name:"sUSDY",symbol:"sUSDY",decimals:6,logoURL:"https://v4kpvw5rr2kprz4echmm33xktmu4lu7kh3qncwrw7xvzdipatkya.arweave.net/rxT627GOlPjnhBHYze7qmynF0-o-4NFaNv3rkaHgmrA",coinType:"0xd285cbbf54c87fd93cd15227547467bb3e405da8bbf2ab99f83f323f88ac9a65::scallop_usdy::SCALLOP_USDY",isVerified:!0},{name:"$DRF",symbol:"DRF",decimals:6,logoURL:"https://gateway.irys.xyz/4tJCmQbwABnc8z1e8Wyy89j8kCinLdN915LucsZusH2r",coinType:"0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF",isVerified:!0},{name:"swSOL",symbol:"swSOL",decimals:8,logoURL:"https://gateway.irys.xyz/38CYobsZ6resAMb939doWgMwcKrVJm7mDXzXNjKHxTfX",coinType:"0x1392650f2eca9e3f6ffae3ff89e42a3590d7102b80e2b430f674730bc30d3259::scallop_wormhole_sol::SCALLOP_WORMHOLE_SOL",isVerified:!0},{name:"Scallop",symbol:"SCA",decimals:9,logoURL:"https://vrr7y7aent4hea3r444jrrsvgvgwsz6zi2r2vv2odhgfrgvvs6iq.arweave.net/rGP8fARs-HIDcec4mMZVNU1pZ9lGo6rXThnMWJq1l5E",coinType:"0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA",isVerified:!0,extensionFields:{birdeyeid:"0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA",coin_priority:900,coingecko_id:"scallop-2",pyth_id:"7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc",rank:830}},{name:"Daossui Token",symbol:"DAOS",decimals:6,logoURL:"https://public.daossui.io/dao-sui/assets/daossui-token.png",projectURL:"https://daossui.io/",coinType:"0xd40cec91f6dca0673b25451fb0d654e62ad13bf6546a32a21ef0c59eba42e71c::daos::DAOS",isVerified:!0},{name:"SPT",symbol:"SPT",decimals:9,logoURL:"https://seapad.s3.ap-southeast-1.amazonaws.com/uploads/PROD/public/media/images/logo_1685439392353.png",coinType:"0xb779486cfd6c19e9218cc7dc17c453014d2d9ba12d2ee4dbb0ec4e1e02ae1cca::spt::SPT",isVerified:!0},{name:"Suiba Inu",symbol:"SUIB",decimals:9,logoURL:"https://fvies4qayyhittfc6gxdfldafsmynmk5o5yitbrtnujlpbktv77a.arweave.net/LVBJcgDGDonMovGuMqxgLJmGsV13cImGM20St4VTr_4",coinType:"0xed4504e791e1dad7bf93b41e089b4733c27f35fde505693e18186c2ba8e2e14b::suib::SUIB",isVerified:!0},{name:"USD Coin (Celer)",symbol:"cUSDC",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/usdc_celer.png",coinType:"0x94e7a8e71830d2b34b3edaa195dc24c45d142584f06fa257b73af753d766e690::celer_usdc_coin::CELER_USDC_COIN",isVerified:!0,extensionFields:{birdeyeid:"0x94e7a8e71830d2b34b3edaa195dc24c45d142584f06fa257b73af753d766e690::celer_usdc_coin::CELER_USDC_COIN",coin_priority:830,labels:["Celer"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:930}},{name:"FOMO",symbol:"FOMO",decimals:2,logoURL:"https://7ms6dw2zbrlaaeadpyyz7cy5pwdlz64atqh6gdkpuws3uxpesxeq.arweave.net/-yXh21kMVgAQA34xn4sdfYa8-4CcD-MNT6Wlul3klck",coinType:"0xa340e3db1332c21f20f5c08bef0fa459e733575f9a7e2f5faca64f72cd5a54f2::fomo::FOMO",isVerified:!0},{name:"MOVE",symbol:"MOVE",decimals:9,logoURL:"https://gk4id6fee24ru5cdipjxyz6cl42yjtzl3xfuizlpqjub42hx5rvq.arweave.net/MriB-KQmuRp0Q0PTfGfCXzWEzyvdy0Rlb4JoHmj37Gs",coinType:"0x648f9eab1434c056d509ad857fb657ac170528798d771f7eb1edc35639e3e75c::movecoin::MOVECOIN",isVerified:!0,extensionFields:{birdeyeid:"0x648f9eab1434c056d509ad857fb657ac170528798d771f7eb1edc35639e3e75c::movecoin::MOVECOIN",coin_priority:690}},{name:"KOI",symbol:"KOI",decimals:6,logoURL:"https://ubxwf7ujw5ktuqvndqeqogfoiu343qxl2a3h3i5l5zkzj66fp6xa.arweave.net/oG9i_om3VTpCrRwJBxiuRTfNwuvQNn2jq-5VlPvFf64",coinType:"0x01d430425a8a681ef26315e78a082fe744f8d0bbdbd1ab76b9fd78ada09bedca::Koi::KOI",isVerified:!0},{name:"Bucket Token",symbol:"BUT",decimals:9,logoURL:"https://aqua-natural-grasshopper-705.mypinata.cloud/ipfs/QmUKAX4PME9Wb9VU6CMJPisNysaVKZNKpiB3gtMVVZTfjt",coinType:"0xbc858cb910b9914bee64fff0f9b38855355a040c49155a17b265d9086d256545::but::BUT",isVerified:!0},{name:"USD Coin (Portal from BSC)",symbol:"USDCbnb",decimals:8,logoURL:"https://co3xbx3vz2ww7tcs2tp4p36hdnkz677tuvqt6wgyfyoeefj6or6a.arweave.net/E7dw33XOrW_MUtTfx-_HG1Wff_OlYT9Y2C4cQhU-dHw",coinType:"0x909cba62ce96d54de25bec9502de5ca7b4f28901747bbf96b76c2e63ec5f1cba::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x909cba62ce96d54de25bec9502de5ca7b4f28901747bbf96b76c2e63ec5f1cba::coin::COIN",coin_priority:860,coingecko_id:"usd-coin-wormhole-bnb",labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:970}},{name:"haWAL",symbol:"haWAL",decimals:9,logoURL:"https://assets.haedal.xyz/logos/hawal.svg",coinType:"0x8b4d553839b219c3fd47608a0cc3d5fcc572cb25d41b7df3833208586a8d2470::hawal::HAWAL",isVerified:!0},{name:"USD Coin (Portal from Solana)",symbol:"USDCsol",decimals:6,logoURL:"https://gateway.irys.xyz/2q5BcNXs91mPPSaYLCbLRS8Pyha8N76dafj51HdMmrh6",coinType:"0xb231fcda8bbddb31f2ef02e6161444aec64a514e2c89279584ac9806ce9cf037::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xb231fcda8bbddb31f2ef02e6161444aec64a514e2c89279584ac9806ce9cf037::coin::COIN",coin_priority:870,labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:980}},{name:"SPAM",symbol:"SPAM",decimals:4,logoURL:"https://3fc4a4tjkjryoqps44rgwhydihn5htqyfjmrrmlouf6rt5qyxjbq.arweave.net/2UXAcmlSY4dB8uciax8DQdvTzhgqWRixbqF9GfYYukM",coinType:"0x30a644c3485ee9b604f52165668895092191fcaf5489a846afa7fc11cdb9b24a::spam::SPAM",isVerified:!0,extensionFields:{birdeyeid:"0x30a644c3485ee9b604f52165668895092191fcaf5489a846afa7fc11cdb9b24a::spam::SPAM"}},{name:"sKART",symbol:"sKARTCOIN",decimals:9,logoURL:"https://osp3bhhpqkgtrtuww3cn6cqpcy36lxhu2j4djhbr5fu4fzusrt2a.arweave.net/dJ-wnO-CjTjOlrbE3woPFjfl3PTSeDScMelpwuaSjPQ",coinType:"0xfd48ffd0e62ed5cb839400b7e0bee870cd752f9d01c657a665be2afff16995eb::skart::SKART",isVerified:!0,extensionFields:{birdeyeid:"0xfd48ffd0e62ed5cb839400b7e0bee870cd752f9d01c657a665be2afff16995eb::skart::SKART",coin_priority:770}},{name:"FUD Staked SUI",symbol:"fudSUI",decimals:9,logoURL:"https://gateway.irys.xyz/8qhJwoDEavz5KdkJEK9FaiHp9rYEqbWhF7HrqsJpUG4F",coinType:"0x02358129a7d66f943786a10b518fdc79145f1fc8d23420d9948c4aeea190f603::fud_sui::FUD_SUI",isVerified:!0},{name:"suitard",symbol:"STD",decimals:9,logoURL:"https://hawbf2zd3vl47ileyqlznfwluvtyis7bnbfkadg7vpsvxbpe5h4a.arweave.net/OCwS6yPdV8-hZMQXlpbLpWeES-FoSqAM36vlW4Xk6fg",coinType:"0x2cddfc6d4fc855917e990e71cd122b1ee8098aa890186ee15a84524ed17cd8c9::suitard::SUITARD",isVerified:!0,extensionFields:{birdeyeid:"0x2cddfc6d4fc855917e990e71cd122b1ee8098aa890186ee15a84524ed17cd8c9::suitard::SUITARD",coingecko_id:"suitard"}},{name:"NAVX Token",symbol:"NAVX",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/navx.png",coinType:"0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX",isVerified:!0,extensionFields:{birdeyeid:"0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX",coin_priority:950,coingecko_id:"navi",pyth_id:"88250f854c019ef4f88a5c073d52a18bb1c6ac437033f5932cd017d24917ab46",rank:770}},{name:"Wrapped SOL (Portal from Solana)",symbol:"WSOL",decimals:8,logoURL:"https://gateway.irys.xyz/Ek2PhfPT6AgsJ7TYXx4NQJ1WPtNSxPkCo5bVmGRr1aUo",coinType:"0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN",coin_priority:790,labels:["Wormhole"],pyth_id:"ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d"}},{name:"Suilama",symbol:"SUILAMA",decimals:6,logoURL:"https://api.movepump.com/uploads/1000030596_8a14750351.jpg",coinType:"0x5a4f64079daed04d923c93f3ac4ee04b637e5b3ea2db87d591981c1049508a27::suilama::SUILAMA",isVerified:!0},{name:"MEMEFI",symbol:"MEMEFI",decimals:9,logoURL:"https://gateway.irys.xyz/AymYAvpqK3rnQE9AqtXwzHzPMQeiqdmm9yamxryDsZCT",coinType:"0x506a6fc25f1c7d52ceb06ea44a3114c9380f8e2029b4356019822f248b49e411::memefi::MEMEFI",isVerified:!0},{name:"SCUBA DOG",symbol:"SCUBA",decimals:6,logoURL:"https://j3i5gtlp36ptsx6lyygrujd2cx7vgzaxbqyeiyqded67ihlbehva.arweave.net/TtHTTW_fnzlfy8YNGiR6Ff9TZBcMMERiAyD99B1hIeo",coinType:"0x9e6d6124287360cc110044d1f1d7d04a0954eb317c76cf7927244bef0706b113::SCUBA::SCUBA",isVerified:!0},{name:"Suiman",symbol:"Suiman",decimals:6,logoURL:"https://cwwuyv2vk4qwk4vdtkub2hlhwy7vy7wqm5ar6hmxdikusgzcxi4a.arweave.net/Fa1MV1VXIWVyo5qoHR1ntj9cftBnQR8dlxoVSRsiujg",coinType:"0xa8b69040684d576828475115b30cc4ce7c7743eab9c7d669535ee31caccef4f5::suiman::SUIMAN",isVerified:!0},{name:"ALPHA Token",symbol:"ALPHA",decimals:9,logoURL:"https://7taj6jfau6n3dri7agspzfnva7qbj5sizz5xc3lb56nmxpsyoiba.arweave.net/_MCfJKCnm7HFHwGk_JW1B-AU9kjOe3FtYe-ay75YcgI",coinType:"0xfe3afec26c59e874f3c1d60b8203cb3852d2bb2aa415df9548b8d688e6683f93::alpha::ALPHA",isVerified:!0,extensionFields:{birdeyeid:"0xfe3afec26c59e874f3c1d60b8203cb3852d2bb2aa415df9548b8d688e6683f93::alpha::ALPHA",coingecko_id:"alpha-fi"}},{name:"sSBWBTC",symbol:"sSBWBTC",decimals:8,logoURL:"https://ferq2danvxy5xrhvml37sv3nlwaraso6iwfjtdops7rscscy7zba.arweave.net/KSMNDA2t8dvE9WL3-VdtXYEQSd5FipmNz5fjIUhY_kI",coinType:"0x08c0fe357d3a138f4552bee393ce3a28a45bebcca43373d6a90bc44ab76f82e2::scallop_sb_wbtc::SCALLOP_SB_WBTC",isVerified:!0},{name:"DeepBook Token",symbol:"DEEP",decimals:6,logoURL:"https://gateway.irys.xyz/5LqWyWG5EU9wPknvW5rY6qSQPtnNAfP27X1PnAiesyFG",coinType:"0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",isVerified:!0,extensionFields:{coingecko_id:"deep",suggested_priority:908}},{name:"sDEEP",symbol:"sDEEP",decimals:6,logoURL:"https://lkjkjfqta7322ikfbcklyovddpnjqrba3hlhhq4u4ilhcfbbjecq.arweave.net/WpKklhMH960hRQiUvDqjG9qYRCDZ1nPDlOIWcRQhSQU",coinType:"0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP",isVerified:!0},{name:"SUIME",symbol:"SUIME",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/suime.png",coinType:"0x934692a74595c4f5a0c026130eb2143eea6fc313742f5d7dd9e45fd6ddbb00f1::suime::SUIME",isVerified:!0,extensionFields:{birdeyeid:"0x934692a74595c4f5a0c026130eb2143eea6fc313742f5d7dd9e45fd6ddbb00f1::suime::SUIME",coin_priority:610}},{name:"dak",symbol:"dak",decimals:6,logoURL:"https://gateway.irys.xyz/JAgm2ztSdQGU5CncYUtNSp4Ce6qtv29nttZKAeQn441S",coinType:"0x41636c138167952207c88f5a75e433c9e880bc7bd5e4e46047d82be266d36712::dak::DAK",isVerified:!0},{name:"Tocen Token",symbol:"TOCE",decimals:9,logoURL:"https://ipfs.tocen.co/tocen/toce.png",coinType:"0xd2013e206f7983f06132d5b61f7c577638ff63171221f4f600a98863febdfb47::toce::TOCE",isVerified:!0,extensionFields:{birdeyeid:"0xd2013e206f7983f06132d5b61f7c577638ff63171221f4f600a98863febdfb47::toce::TOCE",coin_priority:650}},{name:"sWAL",symbol:"sWAL",decimals:9,logoURL:"https://demac7qmvo7cyr42swwzpki63in27j35g4b6rropmrwsmiszjbsq.arweave.net/GRgBfgyrvixHmpWtl6ke2huvp303A-jFz2RtJiJZSGU",coinType:"0x622345b3f80ea5947567760eec7b9639d0582adcfd6ab9fccb85437aeda7c0d0::scallop_wal::SCALLOP_WAL",isVerified:!0},{name:"safSUI",symbol:"safSUI",decimals:9,logoURL:"https://gateway.irys.xyz/3XoP2XumjxAAYDBWRJHhBLSHsLzH4jNnxWF6DB4rfWhN",coinType:"0x00671b1fa2a124f5be8bdae8b91ee711462c5d9e31bda232e70fd9607b523c88::scallop_af_sui::SCALLOP_AF_SUI",isVerified:!0},{name:"Agent S",symbol:"S",decimals:9,logoURL:"https://gateway.irys.xyz/B1xigsnVycuq7LkED5LybeZ6HhLyU14ZMDffDL4q577D",coinType:"0xea65bb5a79ff34ca83e2995f9ff6edd0887b08da9b45bf2e31f930d3efb82866::s::S",isVerified:!0},{name:"OceansGallerie",symbol:"OCEANS",decimals:9,logoURL:"https://gateway.irys.xyz/8a67JLSE8m56kK8bMFFt9HUhpSa1XeGFzSxqdrRcKtjB",coinType:"0xe90c71d308d8e6fed933d20f8b94d811e1dac649dac7815762520e90f84392f7::oceans::OCEANS",isVerified:!0},{name:"SuiBoxer",symbol:"SBOX",decimals:1,logoURL:"https://archive.cetus.zone/assets/image/sui/sbox.png",coinType:"0xbff8dc60d3f714f678cd4490ff08cabbea95d308c6de47a150c79cc875e0c7c6::sbox::SBOX",isVerified:!0,extensionFields:{birdeyeid:"0xbff8dc60d3f714f678cd4490ff08cabbea95d308c6de47a150c79cc875e0c7c6::sbox::SBOX",coin_priority:630,coingecko_id:"suiboxer"}},{name:"Fud The Pug",symbol:"FUD",decimals:5,logoURL:"https://archive.cetus.zone/assets/image/sui/fud.png",coinType:"0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",isVerified:!0,extensionFields:{birdeyeid:"0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1::fud::FUD",coin_priority:820,pyth_id:"6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75"}},{name:"sBLUB",symbol:"sBLUB",decimals:2,logoURL:"https://gutxmo5scqefen42iu6ysi5unhdsdenwtcqe2z5hxszz3ssdhzsa.arweave.net/NSd2O7IUCFI3mkU9iSO0acchkbaYoE1np7yzncpDPmQ",coinType:"0xe72f65446eabfad2103037af2d49d24599106fb44bf4c046c1e7e9acf6844dd0::scallop_blub::SCALLOP_BLUB",isVerified:!0},{name:"Typus",symbol:"TYPUS",decimals:9,logoURL:"https://gateway.irys.xyz/CQCvjKXMzASaCMXWx1SyUMa6syFJqtwAaAsAhbzsHGXi",coinType:"0xf82dc05634970553615eef6112a1ac4fb7bf10272bf6cbe0f80ef44a6c489385::typus::TYPUS",isVerified:!0},{name:"sFUD",symbol:"sFUD",decimals:5,logoURL:"https://enx3zetzw42z2gpckvye66ljal2vfu63rb2qc5arvq7wof3xdbhq.arweave.net/I2-8knm3NZ0Z4lVwT3lpAvVS09uIdQF0Eaw_Zxd3GE8",coinType:"0xe56d5167f427cbe597da9e8150ef5c337839aaf46891d62468dcf80bdd8e10d1::scallop_fud::SCALLOP_FUD",isVerified:!0},{name:"shaSUI",symbol:"shaSUI",decimals:9,logoURL:"https://gateway.irys.xyz/8raXDMcjv2y9sV6pXSJkiyw6PXa7B44GRXNzuBBstfQL",coinType:"0x9a2376943f7d22f88087c259c5889925f332ca4347e669dc37d54c2bf651af3c::scallop_ha_sui::SCALLOP_HA_SUI",isVerified:!0,extensionFields:{birdeyeid:"0x9a2376943f7d22f88087c259c5889925f332ca4347e669dc37d54c2bf651af3c::scallop_ha_sui::SCALLOP_HA_SUI"}},{name:"Lorenzo stBTC",symbol:"stBTC",decimals:8,logoURL:"https://node1.irys.xyz/qg69O3RwWkFt8QG2_GeTh-xGOQEkLbaiPjuU-yDsHqM",coinType:"0x5f496ed5d9d045c5b788dc1bb85f54100f2ede11e46f6a232c29daada4c5bdb6::coin::COIN",isVerified:!0,extensionFields:{coingecko_id:"lorenzo-stbtc"}},{name:"Suia Token",symbol:"SUIA",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/suia.png",coinType:"0x1d58e26e85fbf9ee8596872686da75544342487f95b1773be3c9a49ab1061b19::suia_token::SUIA_TOKEN",isVerified:!0,extensionFields:{birdeyeid:"0x1d58e26e85fbf9ee8596872686da75544342487f95b1773be3c9a49ab1061b19::suia_token::SUIA_TOKEN",coin_priority:800,coingecko_id:"suia"}},{name:"Wrapped Matic (Portal from Polygon)",symbol:"WMATIC",decimals:8,logoURL:"https://fe3wnx45vysrtzfr7kwg4aowt7aqb2tku4szytg2ayfwdyp3jk6q.arweave.net/KTdm352uJRnksfqsbgHWn8EA6mqnJZxM2gYLYeH7Sr0",coinType:"0xdbe380b13a6d0f5cdedd58de8f04625263f113b3f9db32b3e1983f49e2841676::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xdbe380b13a6d0f5cdedd58de8f04625263f113b3f9db32b3e1983f49e2841676::coin::COIN",coin_priority:710,coingecko_id:"matic-wormhole",labels:["Wormhole"],pyth_id:"5de33a9112c2b700b8d30b8a3402c103578ccfa2765696471cc672bd5cf6ac52"}},{name:"Bucket USD",symbol:"BUCK",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/buck.png",coinType:"0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK",isVerified:!0,extensionFields:{birdeyeid:"0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK",coin_priority:920,coingecko_id:"bucket-protocol-buck-stablecoin",pyth_id:"fdf28a46570252b25fd31cb257973f865afc5ca2f320439e45d95e0394bc7382",rank:900,suggested_priority:900}},{name:"CETUS Token",symbol:"CETUS",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/cetus.png",coinType:"0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS",isVerified:!0,extensionFields:{birdeyeid:"0x06864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS",coin_priority:970,coingecko_id:"cetus-protocol",pyth_id:"e5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef",rank:810,suggested_priority:980}},{name:"Ondo US Dollar Yield",symbol:"USDY",decimals:6,logoURL:"https://66wosxwjgpz7qbv4psulb555d35nxqn6h6jtgu2cxzw4awrbtw3q.arweave.net/96zpXskz8_gGvHyosPe9Hvrbwb4_kzNTQr5twFohnbc",coinType:"0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb::usdy::USDY",isVerified:!0,extensionFields:{birdeyeid:"0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb::usdy::USDY",coin_priority:880,coingecko_id:"ondo-us-dollar-yield",pyth_id:"e393449f6aff8a4b6d3e1165a7c9ebec103685f3b41e60db4277b5b6d10e7326",rank:890}},{name:"Bluefin",symbol:"BLUE",decimals:9,logoURL:"https://gateway.irys.xyz/CppTxB1NXfoDaJL4cjB6RyzFFwzySRF8zD8t2pBaMy8s",coinType:"0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca::blue::BLUE",isVerified:!0},{name:"swBTC",symbol:"swBTC",decimals:8,logoURL:"https://gateway.irys.xyz/82YqjZLgZo2wjsbktvPnKgAaSrUbkfJuL3zq4GBASjnP",coinType:"0x2cf76a9cf5d3337961d1154283234f94da2dcff18544dfe5cbdef65f319591b5::scallop_wormhole_btc::SCALLOP_WORMHOLE_BTC",isVerified:!0},{name:"Tether (Celer)",symbol:"cUSDT",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/usdt_celer.png",coinType:"0x94e7a8e71830d2b34b3edaa195dc24c45d142584f06fa257b73af753d766e690::celer_usdt_coin::CELER_USDT_COIN",isVerified:!0,extensionFields:{birdeyeid:"0x94e7a8e71830d2b34b3edaa195dc24c45d142584f06fa257b73af753d766e690::celer_usdt_coin::CELER_USDT_COIN",labels:["Celer"],pyth_id:"2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b"}},{name:"WEWE",symbol:"WEWE",decimals:9,logoURL:"https://file-walletapp.waveonsui.com/logos/wewe.png",coinType:"0xb5b603827d1bfb2859200fd332d5e139ccac2598f0625de153a87cf78954e0c4::wewe::WEWE",isVerified:!0},{name:"sSUI",symbol:"sSUI",decimals:9,logoURL:"https://gateway.irys.xyz/GYmShkpMcYFgSsEcpCEZUPiChhBaFeXMQnFrxxjqZdhE",coinType:"0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI",isVerified:!0,extensionFields:{birdeyeid:"0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI"}},{name:"USD Coin (Portal from Arbitrum, New)",symbol:"USDCarb",decimals:6,logoURL:"https://boqgq74qfqr7gfo4x7tpesefwkzawnbe4e3anop54gwsh3ctfdoa.arweave.net/C6Bof5AsI_MV3L_m8kiFsrILNCThNga5_eGtI-xTKNw",coinType:"0xc3f8927de33d3deb52c282a836082a413bc73c6ee0bd4d7ec7e3b6b4c28e9abf::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xc3f8927de33d3deb52c282a836082a413bc73c6ee0bd4d7ec7e3b6b4c28e9abf::coin::COIN",coin_priority:841,labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:950}},{name:"Meadow",symbol:"MED",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/meadow.png",coinType:"0x9a7ca7b6de5b6e9a4dadec42fada7cd84068aebd7adbd1faeb713622c4628ca9::meadow::MEADOW",isVerified:!0,extensionFields:{birdeyeid:"0x9a7ca7b6de5b6e9a4dadec42fada7cd84068aebd7adbd1faeb713622c4628ca9::meadow::MEADOW",coin_priority:670,coingecko_id:"meadow"}},{name:"Tether by Sui Bridge",symbol:"suiUSDT",decimals:6,logoURL:"https://gateway.irys.xyz/H6RiSi7PDvKaKCzgsLybW1Pdaq4pvakBHnTvghWD5Kad",coinType:"0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT",isVerified:!0,extensionFields:{coin_priority:831,rank:931,suggested_priority:990}},{name:"BLUB",symbol:"BLUB",decimals:2,logoURL:"https://453ilwcfza3uzupxtaell2f2acwezft7jynjduuc3skuehtu76pq.arweave.net/53aF2EXIN0zR95gItei6AKxMln9OGpHSgtyVQh50_58",coinType:"0xfa7ac3951fdca92c5200d468d31a365eb03b2be9936fde615e69f0c1274ad3a0::BLUB::BLUB",isVerified:!0,extensionFields:{birdeyeid:"0xfa7ac3951fdca92c5200d468d31a365eb03b2be9936fde615e69f0c1274ad3a0::BLUB::BLUB",coin_priority:821,coingecko_id:"blub"}},{name:"Pum Pup",symbol:"PUP",decimals:9,logoURL:"https://res.cetus.zone/coin-metadata/mainnet/icon/pup.png",coinType:"0x980ec1e7d5a3d11c95039cab901f02a044df2d82bc79d99b60455c02524fad83::pup::PUP",isVerified:!0,extensionFields:{birdeyeid:"0x980ec1e7d5a3d11c95039cab901f02a044df2d82bc79d99b60455c02524fad83::pup::PUP"}},{name:"sSBETH",symbol:"sSBETH",decimals:8,logoURL:"https://gateway.irys.xyz/4Zaceo2mJ9SQFKFdoqib1WMjdW1oYkNmTqV8MEsHjCCP",coinType:"0xb14f82d8506d139eacef109688d1b71e7236bcce9b2c0ad526abcd6aa5be7de0::scallop_sb_eth::SCALLOP_SB_ETH",isVerified:!0},{name:"USD Coin (Portal from Arbitrum, Old)",symbol:"USDCarb",decimals:6,logoURL:"https://zesrehijzslvuwaf7vplw5qsnhjdz4cpsighhn65watc4fwl22gq.arweave.net/ySUSHQnMl1pYBf1eu3YSadI88E-SDHO33bAmLhbL1o0",coinType:"0xe32d3ebafa42e6011b87ef1087bbc6053b499bf6f095807b9013aff5a6ecd7bb::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xe32d3ebafa42e6011b87ef1087bbc6053b499bf6f095807b9013aff5a6ecd7bb::coin::COIN",coin_priority:840,coingecko_id:"usd-coin-wormhole-arb",labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:940}},{name:"aaa cat",symbol:"AAA",decimals:6,logoURL:"https://45hgkrkliypqc7rpknvnhhqvsdpk23m2sfphh3vcmqrukddd74la.arweave.net/505lRUtGHwF-L1Nq054VkN6tbZqRXnPuomQjRQxj_xY",coinType:"0xd976fda9a9786cda1a36dee360013d775a5e5f206f8e20f84fad3385e99eeb2d::aaa::AAA",isVerified:!0},{name:"mETH",symbol:"mETH",decimals:8,logoURL:"https://gateway.irys.xyz/83AAjCZKyL3VKpxDZG71f4qNWuuqg4uHp4BHVLA3G14e",coinType:"0xccd628c2334c5ed33e6c47d6c21bb664f8b6307b2ac32c2462a61f69a31ebcee::meth::METH",isVerified:!0},{name:"WAVE",symbol:"WAV",decimals:9,logoURL:"https://files.waveonsui.com/logos/wav.png",coinType:"0x82616322719cb327186d5b83a6d7783ce5cef4c5dbd4c6d1b5f3d6e5d288e2be::wav::WAV",isVerified:!0},{name:"PIGU",symbol:"PIGU",decimals:5,logoURL:"https://idcawqx5x4ziq6wq7xck7wlleckqbzv5jbhqpgbbeynww2kd4pda.arweave.net/QMQLQv2_Moh60P3Er9lrIJUA5r1ITweYISYba2lD48Y",coinType:"0xfc71274a94f5d9cd1ae6928ecfc9fa910d03eb28258fddeb9842ac3c7b4f3ae6::pigu::PIGU",isVerified:!0},{name:"Tether (Portal from Eth)",symbol:"wUSDT",decimals:6,logoURL:"https://gateway.irys.xyz/DJs8CsKRW4sP5dgi8zfZRWiFXpzNsN3EnUYkQknu4dyd",coinType:"0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN",coin_priority:980,coingecko_id:"tether-usd-wormhole-from-ethereum",labels:["Wormhole"],pyth_id:"2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b",rank:920}},{name:"sMOVE",symbol:"sMOVECOIN",logoURL:"https://4g7mzcwybmcqsnwiygg4eotqtqkays7y6qyyuycm7tetewing4da.arweave.net/4b7MitgLBQk2yMGNwjpwnBQMS_j0MYpgTPzJMlkNNwY",coinType:"0xf925a9e67cbe498c7e5cd87a17fc09692c455b940f065f4b462f885ea196a89d::smove::SMOVE",isVerified:!0,extensionFields:{birdeyeid:"0xf925a9e67cbe498c7e5cd87a17fc09692c455b940f065f4b462f885ea196a89d::smove::SMOVE",coin_priority:760}},{name:"SuiAI",symbol:"SUAI",decimals:6,logoURL:"https://api.suiai.fun/uploads/suai_logo.png",coinType:"0xbc732bc5f1e9a9f4bdf4c0672ee538dbf56c161afe04ff1de2176efabdf41f92::suai::SUAI",isVerified:!0},{name:"SuiPad",symbol:"SUIP",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/suip.png",coinType:"0xe4239cd951f6c53d9c41e25270d80d31f925ad1655e5ba5b543843d4a66975ee::SUIP::SUIP",isVerified:!0,extensionFields:{birdeyeid:"0xe4239cd951f6c53d9c41e25270d80d31f925ad1655e5ba5b543843d4a66975ee::SUIP::SUIP",coin_priority:780,coingecko_id:"suipad"}},{name:"BULLA",symbol:"BULLA",decimals:8,logoURL:"https://i.imgur.com/YPFKKZw.jpeg",coinType:"0xeec46a9527885ade0b62b984315f2f45d4cd40d9a8c19a553e553e722ab33239::bulla::BULLA",isVerified:!0},{name:"Dungeon Gold",symbol:"DGG",decimals:6,logoURL:"https://h6bzmql5j4nlpj3hiiizzqdmygd7xfbkzcn2gtfy4chmjsmmpdsq.arweave.net/P4OWQX1PGrenZ0IRnMBswYf7lCrIm6NMuOCOxMmMeOU",coinType:"0x625d518a3cc78899742d76cf785609cd707e15228d4284aa4fee5ca53caa9849::dgg_token::DGG_TOKEN",isVerified:!0,extensionFields:{birdeyeid:"0x625d518a3cc78899742d76cf785609cd707e15228d4284aa4fee5ca53caa9849::dgg_token::DGG_TOKEN"}},{name:"sFDUSD",symbol:"sFDUSD",decimals:6,logoURL:"https://am6vo2vn4mg2lm7vmajonsipgkat56z75mxe55babpztrbssmb4a.arweave.net/Az1Xaq3jDaWz9WAS5skPMoE--z_rLk70IAvzOIZSYHg",coinType:"0x6711551c1e7652a270d9fbf0eee25d99594c157cde3cb5fbb49035eb59b1b001::scallop_fdusd::SCALLOP_FDUSD",isVerified:!0},{name:"KDX",symbol:"KDX",decimals:6,logoURL:"https://i.ibb.co/Wsbch2z/kriya.png",coinType:"0x3b68324b392cee9cd28eba82df39860b6b220dc89bdd9b21f675d23d6b7416f1::kdx::KDX",isVerified:!0},{name:"LuckyStar",symbol:"LUCK",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/luck.png",coinType:"0x202591744d54ee4f4af736ef3b8508f3d46d982c36747d9587032bd549122179::luck::LUCK",isVerified:!0,extensionFields:{birdeyeid:"0x202591744d54ee4f4af736ef3b8508f3d46d982c36747d9587032bd549122179::luck::LUCK",coin_priority:640}},{name:"OTTER",symbol:"OTTER",decimals:9,logoURL:"https://i52dwsbjw2rvuagb4yknsxruq2vwqprdhga6p53ik3co6kzdiwea.arweave.net/R3Q7SCm2o1oAweYU2V40hqtoPiM5gef3aFbE7ysjRYg",coinType:"0x297b7f887a47fdcdf82364b5b175c2f00c2ece012c06ec7dc58ee7bc0c63aa07::otter::OTTER",isVerified:!0,extensionFields:{birdeyeid:"0x297b7f887a47fdcdf82364b5b175c2f00c2ece012c06ec7dc58ee7bc0c63aa07::otter::OTTER",coin_priority:660}},{name:"Suiswap",symbol:"SSWP",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/sswp.png",coinType:"0x361dd589b98e8fcda9a7ee53b85efabef3569d00416640d2faa516e3801d7ffc::TOKEN::TOKEN",isVerified:!0,extensionFields:{birdeyeid:"0x361dd589b98e8fcda9a7ee53b85efabef3569d00416640d2faa516e3801d7ffc::TOKEN::TOKEN",coin_priority:740}},{name:"First Digital USD",symbol:"FDUSD",decimals:6,logoURL:"https://cdn.1stdigital.com/icon/fdusd.svg",coinType:"0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD",isVerified:!0,extensionFields:{coin_priority:971,pyth_id:"ccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979"}},{name:"Dripward",symbol:"DRIP",decimals:9,logoURL:"https://gh63r3fltrhlf22hh6722j667hyk546aycyevlmody46swnzh5da.arweave.net/Mf247KucTrLrRz-_rSfe-fCu88DAsEqtjh456Vm5P0Y",coinType:"0x9eed28fc98688a799fe51aa6ed39b851bd09d950fc785b2d7c9f543796254631::drip::DRIP",isVerified:!0,extensionFields:{birdeyeid:"0x9eed28fc98688a799fe51aa6ed39b851bd09d950fc785b2d7c9f543796254631::drip::DRIP"}},{name:"superSUI",symbol:"superSUI",decimals:9,logoURL:"https://gateway.irys.xyz/TAKkVW5fTxDGTTgM22eFNEQX2V6JbLuN2ckBtFybrix",coinType:"0x790f258062909e3a0ffc78b3c53ac2f62d7084c3bab95644bdeb05add7250001::super_sui::SUPER_SUI",isVerified:!0,extensionFields:{birdeyeid:"0x790f258062909e3a0ffc78b3c53ac2f62d7084c3bab95644bdeb05add7250001::super_sui::SUPER_SUI"}},{name:"SuiNS Token",symbol:"NS",decimals:6,logoURL:"https://gateway.irys.xyz/FRs7eLL3B5eABDW3hG5xwtaATaU4x8fEZm9V5z8GdFYr",coinType:"0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS",isVerified:!0},{name:"ARTFI",symbol:"ARTFI",decimals:9,logoURL:"https://rao3tdm6qnrnk3z6tga4jsnn5ufuapmlqoffpatiqligyjb2vnga.arweave.net/iB25jZ6DYtVvPpmBxMmt7QtAPYuDileCaILQbCQ6q0w",coinType:"0x706fa7723231e13e8d37dad56da55c027f3163094aa31c867ca254ba0e0dc79f::artfi::ARTFI",isVerified:!0,extensionFields:{birdeyeid:"0x706fa7723231e13e8d37dad56da55c027f3163094aa31c867ca254ba0e0dc79f::artfi::ARTFI",coingecko_id:"artfi"}},{name:"sCETUS",symbol:"sCETUS",decimals:9,logoURL:"https://gateway.irys.xyz/FfmvsmthhRiAaBwY8nZjx8uavV2ySs7USgn5xamsxFf5",coinType:"0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS",isVerified:!0,extensionFields:{birdeyeid:"0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS"}},{name:"Sacabam",symbol:"SCB",decimals:5,logoURL:"https://archive.cetus.zone/assets/image/sui/scb.png",coinType:"0x9a5502414b5d51d01c8b5641db7436d789fa15a245694b24aa37c25c2a6ce001::scb::SCB",isVerified:!0,extensionFields:{birdeyeid:"0x9a5502414b5d51d01c8b5641db7436d789fa15a245694b24aa37c25c2a6ce001::scb::SCB",coin_priority:730,coingecko_id:"sacabam"}},{name:"Pearl",symbol:"PRL",decimals:12,logoURL:"https://archive.cetus.zone/assets/image/sui/pearl.png",coinType:"0x4e56b39acd75721999cf833062dfb77b1d51e749b02d90f049a5688e21919a64::prl::PRL",isVerified:!0,extensionFields:{birdeyeid:"0x4e56b39acd75721999cf833062dfb77b1d51e749b02d90f049a5688e21919a64::prl::PRL"}},{name:"Pyth Network",symbol:"PYTH",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/pyth.png",coinType:"0x9c6d76eb273e6b5ba2ec8d708b7fa336a5531f6be59f326b5be8d4d8b12348a4::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x9c6d76eb273e6b5ba2ec8d708b7fa336a5531f6be59f326b5be8d4d8b12348a4::coin::COIN",coin_priority:810,pyth_id:"0bbf28e9a841a1cc788f6a361b17ca072d0ea3098a1e5df1c3922d06719579ff"}},{name:"LOOPY",symbol:"LOOPY",decimals:6,logoURL:"https://lk47si3fdmkhszxbmzuksrg5gcbum5rbnudnjd7cnzxor7g2cd7a.arweave.net/Wrn5I2UbFHlm4WZoqUTdMINGdiFtBtSP4m5u6PzaEP4",coinType:"0x9b9c0e26a8ace7edb8fce14acd81507c507c677a400cfb9cc9a0ca4a8432a97a::loopy_sui::LOOPY_SUI",isVerified:!0},{name:"JWLSCA",symbol:"JWLSCA",decimals:9,logoURL:"https://ocknifrosvx5vmpte2zavnpv7fpkauqsqu5tij43iy5shxdle6ha.arweave.net/cJTUFi6Vb9qx8yayCrX1-V6gUhKFOzQnm0Y7I9xrJ44",coinType:"0x0e25582daef54ee41052390c4db5e70a82ec1baed97942db0eb6094267624b5d::jwlsca::JWLSCA",isVerified:!0},{name:"JWLSUI",symbol:"JWLSUI",decimals:9,logoURL:"https://bwxyokyoypcv4zjesyqn6gnjfopzohnrcv2lqwdvcccgahccintq.arweave.net/Da-HKw7DxV5lJJYg3xmpK5-XHbEVdLhYdRCEYBxCQ2c",coinType:"0x2921ca2fe6ee99698b095f046bc9759ce7a764d2e91ab0ad182c143649c3df79::jwlsui::JWLSUI",isVerified:!0},{name:"SLOVE",symbol:"SLOVE",decimals:6,logoURL:"https://ipfs.io/ipfs/bafkreigt2pvpzokflugamigupuwo3xfw3agg3xcfuiduqpv3j6hfooh65a",coinType:"0x6dd439dee053557b3dd340287a4b81099b3e729cb48fbdae726dd2dff82736c3::slove::SLOVE",isVerified:!0},{name:"FroggnRatt",symbol:"FRATT",decimals:2,logoURL:"https://xatontgesaqf7cfeboedtsik7xnnz2wespeifbf3igqzifiqi6fa.arweave.net/uCbmzMSQIF-IpAuIOckK_drc6sSTyIKEu0GhlBUQR4o",coinType:"0x31348f17429e6b37ed269cc667cc83947ff8c54593dcbd1a56cae06a895a38be::fratt::FRATT",isVerified:!0},{name:"Aftermath Staked SUI",symbol:"afSUI",decimals:9,logoURL:"https://aftermath.finance/coins/afsui.svg",coinType:"0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI",isVerified:!0,extensionFields:{birdeyeid:"0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI",coin_priority:909,pyth_id:"17cd845b16e874485b2684f8b8d1517d744105dbb904eec30222717f4bc9ee0d",rank:850}},{name:"JWLCETUS",symbol:"JWLCETUS",decimals:9,logoURL:"https://t3d7i5s4u6ntxge7nqkwjnfnyswrk22ymd4utk4qmaxlh7zofgyq.arweave.net/nsf0dlynmzuYn2wVZLStxK0Va1hg-UmrkGAus_8uKbE",coinType:"0x0e25582daef54ee41052390c4db5e70a82ec1baed97942db0eb6094267624b5d::jwlcetus::JWLCETUS",isVerified:!0,extensionFields:{birdeyeid:"0x0e25582daef54ee41052390c4db5e70a82ec1baed97942db0eb6094267624b5d::jwlcetus::JWLCETUS"}},{name:"SUI Token",symbol:"SUI",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/sui.png",coinType:"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",isVerified:!0,extensionFields:{birdeyeid:"0x2::sui::SUI",coin_priority:1e3,coingecko_id:"sui",pyth_id:"23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",rank:880,suggested_priority:1e3}},{name:"LOFI",symbol:"LOFI",decimals:9,logoURL:"https://gateway.irys.xyz/GqFLYxhLNuKYbSYCVJrjqnARisqogKhggngtYg9sZ9uw",coinType:"0xf22da9a24ad027cccb5f2d496cbe91de953d363513db08a3a734d361c7c17503::LOFI::LOFI",isVerified:!0},{name:"Sonic Snipe Bot",symbol:"Sonic",decimals:9,logoURL:"https://gateway.irys.xyz/E82DQkogizAv1CYi8nbgWydVx49DHy42qSRzksMx4iwx",coinType:"0x555f3aa7c9c60ca67f906557777fab78fd70a302da7d66a23fcb4f8808d15010::sonic::SONIC",isVerified:!0},{name:"Sui Plop",symbol:"PLOP",decimals:6,logoURL:"https://fj74jg6iknyhnkkajybduxndrgvp3r7lklyjnlj7w2cvflsc574a.arweave.net/Kn_Em8hTcHapQE4COl2jiar9x-tS8JatP7aFUq5C7_g",coinType:"0x1c6cd615ed4c42a34977212a3407a28eec21acc572c8dbe7d0382bf0289a2590::plop::PLOP",isVerified:!0},{name:"WAL Token",symbol:"WAL",decimals:9,logoURL:"https://gateway.irys.xyz/7dgjqChkGXxmhFvqR5AWP4vWUs8hNiJpe9Cw7K4x7GP2",coinType:"0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL",isVerified:!0,extensionFields:{suggested_priority:904}},{name:"Native USDC",symbol:"USDC",decimals:6,logoURL:"https://gateway.irys.xyz/EGpc2cG886CrWwLMneF2RyVpZ7D33a6znz6XE8n8nU7h",coinType:"0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",isVerified:!0,extensionFields:{coin_priority:991,coingecko_id:"usd-coin",pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:1e3,suggested_priority:991}},{name:"STASH",symbol:"STASH",decimals:9,logoURL:"https://7kyn2qaielikddp6kpi7dtriubzemb2pthesca33bxsxskusunhq.arweave.net/-rDdQAgi0KGN_lPR8c4ooHJGB0-ZySEDew3leSqSo08",coinType:"0x2cff601fe16f622fd6203f8f64bef4e68d687f51f4d06f13c2bbba17cb84c87e::stash::STASH",isVerified:!0,extensionFields:{birdeyeid:"0x2cff601fe16f622fd6203f8f64bef4e68d687f51f4d06f13c2bbba17cb84c87e::stash::STASH"}},{name:"swETH",symbol:"swETH",decimals:8,logoURL:"https://gateway.irys.xyz/J1Ni98whDmtXgtGYDmk7Hy6qfoHas9MJYwMnixgDSdNo",coinType:"0x67540ceb850d418679e69f1fb6b2093d6df78a2a699ffc733f7646096d552e9b::scallop_wormhole_eth::SCALLOP_WORMHOLE_ETH",isVerified:!0},{name:"meow",symbol:"meow",decimals:6,logoURL:"https://g2eop2adggvbnllpabicghum55pai3bt23c5yvo3c5gohtix6fma.arweave.net/Nojn6AMxqhatbwBQIx6M714EbDPWxdxV2xdM480X8Vg",coinType:"0x06b145d0322e389d6225f336ab57bba4c67e4e701bd6c6bc959d90675900a17e::meow::MEOW",isVerified:!0,extensionFields:{birdeyeid:"0x06b145d0322e389d6225f336ab57bba4c67e4e701bd6c6bc959d90675900a17e::meow::MEOW"}},{name:"SUI TRUMP",symbol:"SUITRUMP",decimals:6,logoURL:"https://gateway.irys.xyz/9Q89LeyqhQSDGun24w1PYZC6zZ4KTGhCPDC2rJpQieY1",coinType:"0xdeb831e796f16f8257681c0d5d4108fa94333060300b2459133a96631bf470b8::suitrump::SUITRUMP",isVerified:!0},{name:"Wrapped BTC (Portal from Eth)",symbol:"WBTC",decimals:8,logoURL:"https://gateway.irys.xyz/dNcUM18WoBxiGE55MrQVgt9kZ7yho9WbyJWa8NbSxDH",coinType:"0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN",coin_priority:890,coingecko_id:"wrapped-btc-wormhole",labels:["Wormhole"],pyth_id:"e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",rank:790}},{name:"Releap",symbol:"REAP",decimals:9,logoURL:"https://archive.cetus.zone/assets/image/sui/reap.png",coinType:"0xde2d3e02ba60b806f81ee9220be2a34932a513fe8d7f553167649e95de21c066::reap_token::REAP_TOKEN",isVerified:!0,extensionFields:{birdeyeid:"0xde2d3e02ba60b806f81ee9220be2a34932a513fe8d7f553167649e95de21c066::reap_token::REAP_TOKEN",coin_priority:750}},{name:"ETH by Sui Bridge",symbol:"ETH",decimals:8,logoURL:"https://gateway.irys.xyz/435auUGaKQ3FAT7CZnegmvNNJnbuRc7aSkwTTDJ5JmNw",coinType:"0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH",isVerified:!0,extensionFields:{coin_priority:941,coingecko_id:"ethereum",pyth_id:"ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",rank:780,suggested_priority:890}},{name:"BonkCoin (Portal from Solana)",symbol:"BONK",decimals:5,logoURL:"https://3dgyzd2llawd2e6monsrlnrj4ijs3n3zkno37khmqcfbfjquvknq.arweave.net/2M2Mj0tYLD0TzHNlFbYp4hMtt3lTXb-o7ICKEqYUqps",coinType:"0x6907963ca849faff0957b9a8269a7a07065e3def2eef49cc33b50ab946ea5a9f::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0x6907963ca849faff0957b9a8269a7a07065e3def2eef49cc33b50ab946ea5a9f::coin::COIN",coin_priority:680,labels:["Wormhole"],pyth_id:"72b021217ca3fe68922a19aaf990109cb9d84e9ad004b4d2025ad6f529314419"}},{name:"SroomAI DAO",symbol:"SHR0",decimals:9,logoURL:"https://suidaos.com/logo/shro.png",coinType:"0x16ab6a14d76a90328a6b04f06b0a0ce952847017023624e0c37bf8aa314c39ba::shr::SHR",isVerified:!0},{name:"USD Coin (Portal from Polygon)",symbol:"USDCpol",decimals:6,logoURL:"https://otjatct2scltanet7e7untvl3lx4kccddwx5pusxqr6a2pd3qe5a.arweave.net/dNIJinqQlzA0k_k_Rs6r2u_FCEMdr9fSV4R8DTx7gTo",coinType:"0xcf72ec52c0f8ddead746252481fb44ff6e8485a39b803825bde6b00d77cdb0bb::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xcf72ec52c0f8ddead746252481fb44ff6e8485a39b803825bde6b00d77cdb0bb::coin::COIN",coin_priority:850,labels:["Wormhole"],pyth_id:"eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",rank:960}},{name:"AlphaFi Staked SUI",symbol:"stSUI",decimals:9,logoURL:"https://images.alphafi.xyz/stSUI.png",coinType:"0xd1b72982e40348d069bb1ff701e634c117bb5f741f44dff91e472d3b01461e55::stsui::STSUI",isVerified:!0},{name:"FLAMINGO GRINGO",symbol:"FLAMINGO",decimals:6,logoURL:"https://oggdkiqjw4niipp2w7r2ooeujubnhynevxkdwlqlqzqnrb7lufwa.arweave.net/cYw1Igm3GoQ9-rfjpziUTQLT4aSt1DsuC4Zg2IfroWw",coinType:"0x17c334979cd0698ccf9450a3ec2ae0ce1e4c6b0935353fe5facbf69fa77a72af::flamingo::FLAMINGO",isVerified:!0},{name:"AUSD",symbol:"AUSD",decimals:6,logoURL:"https://qele7wvrqjkzonp2egfsagymxbgrewy7adtywuxng4tmpdaycfxa.arweave.net/gRZP2rGCVZc1-iGLIBsMuE0SWx8A54tS7Tcmx4wYEW4",coinType:"0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD",isVerified:!0,extensionFields:{birdeyeid:"0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD",coin_priority:822,coingecko_id:"agora-dollar",rank:910}},{name:"Chirp Token",symbol:"CHIRP",decimals:10,logoURL:"https://download.chirpwireless.io/images/CHIRP_White_OBG.svg",coinType:"0x1ef4c0b20340b8c6a59438204467ca71e1e7cbe918526f9c2c6c5444517cd5ca::chirp::CHIRP",isVerified:!0},{name:"pSTAKE Finance",symbol:"PSTAKE",decimals:8,logoURL:"https://gateway.irys.xyz/3iYkJnAE2Kt14r6DoRvbbntbdVRjBt9LAURH4DTKmmrb",coinType:"0x61017ce4bd0b75b266af53edd60bbe391ba1a9fbe9a7d8553657c94ef73ee2ab::coin::COIN",isVerified:!0},{name:"xAIFRENS",symbol:"xAIFRENS",logoURL:"https://archive.cetus.zone/assets/image/sui/xAIFRENS.png",coinType:"0x9fe1780ac27ec50c9c441fb31822f5c148f841f09ee455c6a0daf7c634a30a27::aifrens::AIFRENS",isVerified:!0,extensionFields:{birdeyeid:"0x9fe1780ac27ec50c9c441fb31822f5c148f841f09ee455c6a0daf7c634a30a27::aifrens::AIFRENS",coin_priority:620}},{name:"Tardi",symbol:"TARDI",decimals:9,logoURL:"https://bafybeieycjagqv7xtenzxss5xkcxgeru7wql6izhzokr4ay4xdbrul4ef4.ipfs.w3s.link",coinType:"0x4cf08813756dfa7519cb480a1a1a3472b5b4ec067592a8bee0f826808d218158::tardi::TARDI",isVerified:!0},{name:"Turbos",symbol:"TURBOS",decimals:9,logoURL:"https://gateway.irys.xyz/4ov3eH2cE4B4DzTsSLmAQNnnmo8zc5MRSFR6wcN4XyLU",coinType:"0x5d1f47ea69bb0de31c313d7acf89b890dbb8991ea8e03c6c355171f84bb1ba4a::turbos::TURBOS",isVerified:!0},{name:"sudeng",symbol:"HIPPO",decimals:9,logoURL:"https://i.imgur.com/j2EuFh5.png",coinType:"0x8993129d72e733985f7f1a00396cbd055bad6f817fee36576ce483c8bbb8b87b::sudeng::SUDENG",isVerified:!0},{name:"Liquor",symbol:"LIQ",decimals:6,logoURL:"https://cehaawdywth4eyp6isj3vmv3ie2g5s3x4w36u3yrl6ytjeqcnulq.arweave.net/EQ4AWHi0z8Jh_kSTurK7QTRuy3flt-pvEV-xNJICbRc",coinType:"0x9c86d1926a0a39e906f20674d6a35f337be8625ebcb6b799ee8ff011f328bee2::liq::LIQ",isVerified:!0,extensionFields:{birdeyeid:"0x9c86d1926a0a39e906f20674d6a35f337be8625ebcb6b799ee8ff011f328bee2::liq::LIQ"}},{name:"Uni",symbol:"Uni",decimals:9,logoURL:"https://gateway.irys.xyz/HK51s6xHPbFRHjHjTLna5XyypW5Yk94c1zjok822FJ88",coinType:"0xaf9e228fd0292e2a27b4859bc57a2f3a9faedb9341b6307c84fef163e44790cc::uni::UNI",isVerified:!0},{name:"Kriya Staked SUI",symbol:"kSUI",decimals:9,logoURL:"https://gateway.irys.xyz/HdCzDMJeQ6zE5LPFrknSXBkZityS1KZX2SzC1isZn6Ey",coinType:"0x41ff228bfd566f0c707173ee6413962a77e3929588d010250e4e76f0d1cc0ad4::ksui::KSUI",isVerified:!0},{name:"Pugwifhat",symbol:"PUGWIF",decimals:9,logoURL:"https://2fqoiyw7ewk4ecchpakhk5rr4brbfy7abyidgjw6cphzlgg464ba.arweave.net/0WDkYt8llcIIR3gUdXYx4GIS4-AOEDMm3hPPlZjc9wI",coinType:"0x2cd6f14a4b64c3a0fa9c644e8ed88d9c91d789a071886d67d24e6b435147063d::pugwif::PUGWIF",isVerified:!0},{name:"swUSDC",symbol:"swUSDC",decimals:6,logoURL:"https://gateway.irys.xyz/29eNJ7Qu9B5CDy8Gr58TxtR8QWUKPN2XWsVYK9cLr4Zu",coinType:"0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC",isVerified:!0},{name:"awww~~~awww",symbol:"awww",decimals:9,logoURL:"https://gateway.irys.xyz/9GnzhvzZsXdpZPGV7YH4nEwaYogYdWTVV8Y2JYGgqmJf",coinType:"0x594b539e0020ca22f83e9a8f55c1fede4c5730130d5b100fcf01f98ddb4f94c8::awww::AWWW",isVerified:!0},{name:"KIMCHI",symbol:"KIMCHI",decimals:5,logoURL:"https://archive.cetus.zone/assets/image/sui/kimchi.png",coinType:"0xb6baa75577e4bbffba70207651824606e51d38ae23aa94fb9fb700e0ecf50064::kimchi::KIMCHI",isVerified:!0,extensionFields:{birdeyeid:"0xb6baa75577e4bbffba70207651824606e51d38ae23aa94fb9fb700e0ecf50064::kimchi::KIMCHI",coin_priority:600}},{name:"AXOL",symbol:"AXOL",decimals:9,logoURL:"https://p7op7v4f4nub263xmrqch45p32rkeclriobps4v6nrut5g7q464q.arweave.net/f9z_14XjaB17d2RgI_Ov3qKiCXFDgvlyvmxpPpvw57k",coinType:"0xae00e078a46616bf6e1e6fb673d18dcd2aa31319a07c9bc92f6063363f597b4e::AXOL::AXOL",isVerified:!0},{name:"sUSDC",symbol:"sUSDC",decimals:6,logoURL:"https://gateway.irys.xyz/29eNJ7Qu9B5CDy8Gr58TxtR8QWUKPN2XWsVYK9cLr4Zu",coinType:"0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC",isVerified:!0},{name:"Wrapped Bitcoin by Sui Bridge",symbol:"wBTC",decimals:9,logoURL:"https://bridge-assets.sui.io/suiWBTC.png",coinType:"0xaafb102dd0902f5055cadecd687fb5b71ca82ef0e0285d90afde828ec58ca96b::btc::BTC",isVerified:!0,extensionFields:{coin_priority:889,suggested_priority:880}},{name:"Lombard Staked BTC",symbol:"LBTC",decimals:8,logoURL:"https://www.lombard.finance/lbtc/LBTC.png",projectURL:"https://www.lombard.finance/",coinType:"0x3e8e9423d80e1774a7ca128fccd8bf5f1f7753be658c5e645929037f7c819040::lbtc::LBTC",isVerified:!0,extensionFields:{pyth_id:"8f257aab6e7698bb92b15511915e593d6f8eae914452f781874754b03d0c612b"}},{name:"xWSB on SUI",symbol:"WSB",decimals:6,logoURL:"https://api.movepump.com/uploads/asui_4106b1fb1d.jpg",coinType:"0x4db126eac4fa99207e98db61d968477021fdeae153de3b244bcfbdc468ef0722::wsb::WSB",isVerified:!0},{name:"MOVER USD",symbol:"moverUSD",decimals:6,logoURL:"https://archive.cetus.zone/assets/image/sui/moverUSD.png",coinType:"0x32d5056aaac1be1f9ae44c1d0728792255a05f1475d458287ee463cc26806ca0::mover_usd::MOVER_USD",isVerified:!0,extensionFields:{birdeyeid:"0x32d5056aaac1be1f9ae44c1d0728792255a05f1475d458287ee463cc26806ca0::mover_usd::MOVER_USD",coin_priority:570}},{name:"Wrapped BNB (Portal from BSC)",symbol:"WBNB",decimals:8,logoURL:"https://4hl5riddvifwsfzqzggti3dyrekvhogjvwkaduy5w5bgs2k7zwga.arweave.net/4dfYoGOqC2kXMMmNNGx4iRVTuMmtlAHTHbdCaWlfzYw",coinType:"0xb848cce11ef3a8f62eccea6eb5b35a12c4c2b1ee1af7755d02d7bd6218e8226f::coin::COIN",isVerified:!0,extensionFields:{birdeyeid:"0xb848cce11ef3a8f62eccea6eb5b35a12c4c2b1ee1af7755d02d7bd6218e8226f::coin::COIN",coin_priority:700,coingecko_id:"binance-coin-wormhole",labels:["Wormhole"],pyth_id:"2f95862b045670cd22bee3114c39763a4a08beeb663b145d283c31d7d1101c4f",rank:760}}];function DR(e,t){return{id:e.id||void 0,logo_url:e.iconUrl||void 0,coin_type:t,decimals:e.decimals,description:e.description,name:e.name,symbol:e.symbol}}function ic(e){var t;return{is_trusted:!!(e!=null&&e.isVerified)||(e==null?void 0:e.is_trusted),coin_type:kr((e==null?void 0:e.coinType)||(e==null?void 0:e.coin_type)).full_address,logo_url:(e==null?void 0:e.logoURL)||(e==null?void 0:e.logo_url)||"",decimals:e==null?void 0:e.decimals,symbol:e==null?void 0:e.symbol,name:e==null?void 0:e.name,labels:((t=e==null?void 0:e.extensionFields)==null?void 0:t.labels)||(e==null?void 0:e.labels)}}function ao(){const{suiClient:e}=so(),{fetchByApi:t}=Yl(),{setTokenMap:r,tokenMap:n,setToken:i,requestTokenList:o,addRequestTokenList:s,setTrustedTokenList:a}=Va(),c=async()=>{var M;let y=[];try{const O=await t("/v3/sui/clmm/verified_coins_info","GET");if(!(O!=null&&O.list)||((M=O==null?void 0:O.list)==null?void 0:M.length)===0)throw Error("api no trust tokens data");y=O==null?void 0:O.list}catch{y=jR}const x=[],b=y==null?void 0:y.reduce((O,P)=>(O.set(P.coinType||P.coin_type,ic(P)),(P.isVerified||P!=null&&P.is_trusted)&&x.push(ic(P)),O),new Map);b&&(b.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")&&!b.get("0x2::sui::SUI")?b.set("0x2::sui::SUI",{...b.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"),coin_type:"0x2::sui::SUI"}):!b.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")&&b.get("0x2::sui::SUI")&&b.set("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",{...b.get("0x2::sui::SUI"),coin_type:"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"}),r(new Map([...n,...b])),a(x))},l=async y=>{var O;if((y==null?void 0:y.length)===0)return;const x=await t("/v3/sui/clmm/coins_info","POST",{coinTypes:y}),b=(O=x==null?void 0:x.data)==null?void 0:O.list,M=b==null?void 0:b.reduce((P,k)=>(P.set(k.coinType,ic(k)),P),new Map);return r(new Map([...n,...M])),M},u=async y=>{var x,b,M,O;try{if(!y)return;let P=y;y==="0x2::sui::SUI"&&(P="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI");const k=await t("/v3/sui/clmm/coins_info","POST",{coinTypes:[P]});if((b=(x=k==null?void 0:k.data)==null?void 0:x.list)!=null&&b[0]){const F=ic((O=(M=k==null?void 0:k.data)==null?void 0:M.list)==null?void 0:O[0]);return i(F),F}throw Error("api no this coin types")}catch(P){console.error("🚀 ~ getTokenInfo ~ 57:",P)}},d=async y=>{try{const x=p(y);if(x)return x;if(o.includes(y))return;s(y);try{const b=await u(y);if(b)return b;throw Error("api return is null")}catch{const M=await e.getCoinMetadata({coinType:y});if(M){rb(y)&&(M.iconUrl="https://archive.cetus.zone/assets/image/sui/sui.png");const O=DR(M,y);return i(O),O}}}catch{}},p=ie.useCallback(y=>{if(y)return n.get(kr(y).full_address)||n.get(y)},[n]);return{getTrustTokens:c,fetchTokenInfo:d,getTokenInfo:p,getTokens:l}}const Sc=(e,t)=>{if(!(e!=null&&e.totalBalance)||t===void 0||t===null)return;const r=WE(e.totalBalance,t==null?void 0:t.decimals),n=Nr(r,4);return{...t,displayBalance:n,totalBalanceFormat:r}};function tl(e){const{suiClient:t}=so(),{currentAccount:r,setTokenBalanceObj:n,tokenBalanceObj:i}=Yr();ao();const[o,s]=ie.useState([]),a=async(u=(r==null?void 0:r.address)||"",d)=>{try{if(!u){c();return}let p=[];d?p=[await t.getBalance({owner:u,coinType:d})]:p=[...await t.getAllBalances({owner:u})],s(p);const y={};p.forEach(x=>{y[kr(x.coinType).full_address]=x}),n(y)}catch{s([])}},c=()=>{n({})},l=ie.useMemo(()=>{const u=e==null?void 0:e.coin_type;if(u&&r){const d=i[u]||i[kr(u).full_address];return d?Sc(d,e):void 0}},[e==null?void 0:e.coin_type,i,r]);return{getOwnerCoinBalances:a,balanceInfo:l}}const LR={id:"0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",coin_type:"0x2::sui::SUI",decimals:9,description:"",name:"Sui",symbol:"SUI",logo_url:"https://imagedelivery.net/cBNDGgkrsEA-b_ixIp9SkQ/sui-coin.svg/public",is_trusted:!0,extensions:{rank:"880"}},BR={id:"0x69b7a7c3c200439c1b5f3b19d7d495d5966d5f08de66c69276152f8db3992ec6",coin_type:"0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC",decimals:6,description:"",name:"USDC",symbol:"USDC",logo_url:"https://circle.com/usdc-icon",is_trusted:!0,extensions:{rank:"1000"}},lw=BR,uw=LR;function UR(e,t){const{fetchTokenInfo:r}=ao(),{setFromCoin:n,setToCoin:i,setDefaultCoin:o}=nn(),{setSlippage:s,setRpcList:a,setCurrentRpc:c}=$r(),{tokenMapIsInit:l}=Va(),u=ie.useRef({}),d=async(y,x)=>{const b=y?await r(y):lw,M=x?await r(x):uw;n(b),i(M),o(b==null?void 0:b.coin_type,M==null?void 0:M.coin_type)},p=(y,x)=>{const b=[Hc[0]];let M=Hc[0];y.forEach(O=>{const P={name:O,link:O,isCustom:!1};b.push(P),O===x&&(M=P)}),a([...b,{name:"Custom RPC URL",link:"",isCustom:!0}]),c(M)};return ie.useEffect(()=>{if(l&&!l0(e,u.current)){const{defaultFromToken:y,defaultToToken:x,defaultSlippage:b,customRpcList:M,defaultRpc:O}=e;d(y,x),b&&s(b),(M==null?void 0:M.length)>0&&p(M,O),u.current=e}},[e,l]),{handleSetDefaultPair:d}}function FR(){const{currentRpc:e}=$r(),{setSuiClient:t,setAggregatorSDK:r}=so(),{currentAccount:n}=Yr();ie.useEffect(()=>{if(e){const i=new ps({url:e.link});t(i)}},[e]),ie.useEffect(()=>{if(e){const i=new Qv({endpoint:ls.aggregatorUrl,signer:(n==null?void 0:n.address)||"",client:new ps({url:e.link}),env:a0.Mainnet});r(i)}},[e.link,n==null?void 0:n.address])}const $0=Ri((e,t)=>({transactionData:void 0,setTransactionData:r=>{e(()=>({transactionData:r}))}})),Cr=[];for(let e=0;e<256;++e)Cr.push((e+256).toString(16).slice(1));function $R(e,t=0){return(Cr[e[t+0]]+Cr[e[t+1]]+Cr[e[t+2]]+Cr[e[t+3]]+"-"+Cr[e[t+4]]+Cr[e[t+5]]+"-"+Cr[e[t+6]]+Cr[e[t+7]]+"-"+Cr[e[t+8]]+Cr[e[t+9]]+"-"+Cr[e[t+10]]+Cr[e[t+11]]+Cr[e[t+12]]+Cr[e[t+13]]+Cr[e[t+14]]+Cr[e[t+15]]).toLowerCase()}let ef;const VR=new Uint8Array(16);function zR(){if(!ef){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ef=crypto.getRandomValues.bind(crypto)}return ef(VR)}const qR=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Wp={randomUUID:qR};function Gp(e,t,r){var i;if(Wp.randomUUID&&!t&&!e)return Wp.randomUUID();e=e||{};const n=e.random??((i=e.rng)==null?void 0:i.call(e))??zR();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return $R(n)}var Mo=(e=>(e[e.CalculateError=1e4]="CalculateError",e[e.NumberTooLarge=10001]="NumberTooLarge",e[e.NoRouter=10002]="NoRouter",e[e.InsufficientLiquidity=10003]="InsufficientLiquidity",e[e.HoneyPot=10004]="HoneyPot",e))(Mo||{});const HR=new ps({url:Zm("mainnet")}),WR=["0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC","0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD","0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD","0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb::usdy::USDY","0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF"],GR=["deny_list","DenyList","DenyCap","create_regulated_currency"],KR={showType:!0,showContent:!0,showOwner:!1,showPreviousTransaction:!1,showStorageRebate:!1,showDisplay:!1},YR=async e=>{let t=!1;if(WR.includes(e))return t;const r=e.split("::"),n=r[0]&&Bt(r[0]),i=r[1],o=await HR.getObject({id:n,options:KR}),s="disassembled"in o.data.content?o.data.content.disassembled[i]:null;return s&&typeof s=="string"&&new RegExp(GR.join("|"),"i").test(s)&&(t=!0),t},XR=e=>{var n;if(!e)return"";const t=e==null?void 0:e.split(",");return(n=t==null?void 0:t.map(i=>Ti(i,!1)))==null?void 0:n.join(",")};function JR(){const{fetchByApi:e}=Yl(),t=async n=>{try{const i={...n},o=XR(n==null?void 0:n.coin_type);o&&(i.coin_type=o);const s=await e("/v2/sui/stats_pools","GET",i);if(s!=null&&s.lp_list)return{list:(s==null?void 0:s.lp_list)||[],total:s==null?void 0:s.total}}catch(i){return console.error("getPoolList ~ Error:",i),await r(n)}return{list:[],total:0}},r=async n=>{var i,o,s,a;try{const c=At("/data/pools.json"),l=await fetch(c).then(u=>u.json());if((i=l==null?void 0:l.data)!=null&&i.lp_list){const u=(o=l==null?void 0:l.data)==null?void 0:o.lp_list;let d=u;if(n!=null&&n.coin_type){const y=(a=(s=n==null?void 0:n.coin_type)==null?void 0:s.split(","))==null?void 0:a.map(x=>Rn(x).source_address);d=u==null?void 0:u.filter(x=>{var O,P;const b=Rn((O=x==null?void 0:x.coin_a)==null?void 0:O.address).source_address,M=Rn((P=x==null?void 0:x.coin_b)==null?void 0:P.address).source_address;return(y==null?void 0:y.length)>1&&y.includes(b)&&y.includes(M)?!0:!!((y==null?void 0:y.length)===1&&(y.includes(b)||y.includes(M)))})}n!=null&&n.is_vaults&&(d=u==null?void 0:u.filter(y=>y==null?void 0:y.is_vaults)),n!=null&&n.has_farming&&!(n!=null&&n.is_vaults)&&!(n!=null&&n.has_mining)&&!(n!=null&&n.no_incentives)&&(d=u==null?void 0:u.filter(y=>y==null?void 0:y.has_farming));const p=d;return{list:p,total:(p==null?void 0:p.length)||0}}}catch(c){console.error("getLocalJsonPoolList Error:",c)}return{list:[],total:0}};return{getPoolList:t,getLocalJsonPoolList:r}}function ZR(e=!0){const{poolApiMap:t,setPoolApiMap:r}=$r(),{getPoolList:n,getLocalJsonPoolList:i}=JR();return{getPoolListByCoinType:async(s,a)=>{if(s&&a){const c=[s,a].sort(),l=`${c[0]}_${c[1]}`,u=t[l];if(u)return u;const d={coin_type:`${s},${a}`,display_all_pools:!0,offset:0,limit:100,order_by:"-tvl",no_incentives:!0,has_farming:!0,has_mining:!0};let p=e?await i(d):void 0;(p===void 0||p.list.length===0)&&(p=await n(d));const y=p.list;if(y.length>0)return t[l]=y,r(l,y),y}return[]}}}function QR(e){const{routerData:t}=nn();return{priceAcceptRouterData:ie.useMemo(()=>{if(t&&e){if(e.byAmountIn){if(!Be(e.toAmountUi).eq(t.toAmountUi||"0"))return t}else if(!Be(e.fromAmountUi).eq(t.fromAmountUi||"0"))return t;return}},[t,e])}}function fw(e,t){return{amountLimit:ie.useMemo(()=>{if(t&&t.routerData){const{byAmountIn:n,fromAmountUi:i,toAmountUi:o}=t;return n?Be(o).mul(Be(1).sub(Be(e).div(100))).toString():Be(i).mul(Be(1).add(Be(e).div(100))).toString()}},[e,t])}}function eP(e){const{getTokenInfo:t,fetchTokenInfo:r}=ao();return{formatSwapRouter:ie.useMemo(()=>{if(e&&e.routerData){const i=[],o=e.byAmountIn?e.routerData.amountIn.toString():e.routerData.amountOut.toString(),s=[],a=[];let c=Be(0);if(e.routerData.routes.forEach((u,d)=>{const p={},y=e.byAmountIn?u.amountIn.toString():u.amountOut.toString();d===e.routerData.routes.length-1?p.percentage=Be(1).sub(c).toFixed(2):p.percentage=Be(y).div(o).toFixed(2),c=Be(c).add(p.percentage);const x=[];u.path.forEach(b=>{i.includes(b.provider)||i.push(b.provider);const M=kr(b.from).full_address,O=kr(b.target).full_address,P=t(M),k=t(O);P||a.includes(M)&&a.push(M),k||a.includes(O)&&a.push(O);const F=b.provider===sa.SCALLOP||b.provider===sa.FLOWX||b.provider===sa.FLOWXV3;x.push({from_type:M,to_type:O,pool_address:F?"":b.id,fee_rate:b.feeRate,provider:b.provider})}),p.paths=x,s.push(p)}),a.length>0)for(const u in a)r(u);return{router_summery:`${e.routerData.routes.length} Streams`,providers:i,routers:s}}},[e])}}function tP(){const{fromCoin:e,toCoin:t}=nn(),{getPoolListByCoinType:r}=ZR();return{getSwapPoolAddress:async()=>e&&t?(await r(e.coin_type,t.coin_type)).map(s=>s.address):[]}}function dw(e,t,r){return ie.useMemo(()=>t&&r&&+t&&+r?e?Be(r).div(t).toString():Be(t).div(r).toString():"0",[t,r,e])}function Kp(e){const[t,r]=ie.useState(),n=async i=>{if(i.is_trusted)return!1;try{return await YR(i.coin_type)}catch{}return!1};return ie.useEffect(()=>{r(void 0),e&&n(e).then(i=>{r(i)})},[e==null?void 0:e.coin_type]),{isScamsCoin:t}}function rP(e,t){const{defaultFromCoinType:r,defaultToCoinCoinType:n}=nn(),{getTokenInfo:i}=ao(),{ignoreWarnTokenMap:o}=$r(),s=i(e),a=i(t),c=ie.useMemo(()=>!Ya(r,lw.coin_type)||!Ya(n,uw.coin_type),[r,n]),l=ie.useCallback(d=>d&&!o[Ti(d.coin_type)]&&(Ya(r,d.coin_type)||Ya(n,d.coin_type))?!d.is_trusted:!1,[r,n,o]),u=ie.useMemo(()=>{const d=[];return c&&(s&&l(s)&&d.push({...s}),a&&l(a)&&d.push({...a})),d},[s==null?void 0:s.coin_type,a==null?void 0:a.coin_type,c,o]);return{isCustomMode:c,customWarnTokenList:u}}function nP(){const{aggregatorSDK:e}=so(),{getSwapPoolAddress:t}=tP(),r=o=>o&&o.error?o.error.code===Mo.InsufficientLiquidity||Mo.HoneyPot||Mo.NumberTooLarge:!1,n=async o=>{const{fromToken:s,toToken:a,amount:c,providersKeys:l,by_amount_in:u,uuid:d}=o;try{const p={from:s.coin_type,target:a.coin_type,amount:new xh(c),byAmountIn:u,depth:3,splitAlgorithm:void 0,splitFactor:void 0,splitCount:void 0,providers:l},y=await e.findRouters(p);if(y&&r(y))return i(!1,u,d,s,a,y);if(!y||y.routes.length===0)throw Error("not find router");return i(!1,u,d,s,a,y)}catch{const y=await t(),x={from:s.coin_type,target:a.coin_type,amount:new xh(c),byAmountIn:u,pools:y};try{const b=await e.swapInPools(x);return!b||!b.routeData?i(!0,u,d,s,a):i(!0,u,d,s,a,b.routeData)}catch{return{uuid:d,byAmountIn:u,isDegrade:!0}}}},i=(o,s,a,c,l,u)=>{var d;if(u){const p=u.error!==void 0,y=qf(u.amountIn.toString(),c.decimals).toString(),x=qf(u.amountOut.toString(),l.decimals).toString();return{routerData:p?void 0:u,fromAmountUi:p?s?y:"":y,toAmountUi:p&&s?"":x,uuid:a,byAmountIn:s,isDegrade:o,errorCode:(d=u.error)==null?void 0:d.code}}else return{uuid:a,byAmountIn:s,isDegrade:o}};return{findBestRouters:n}}function Zo(e){const t=ie.useRef(e);return ie.useEffect(()=>{t.current=e},[e]),t}function iP(e){try{return e&&e.toString().includes("Rejected from user")}catch{return!1}}function oP(e){const t=String(e);return t.indexOf("withdraw_with_proof")>-1||t.indexOf("check_coin_threshold")>-1||t.indexOf('Identifier("balance")')>-1}function sP(e){return!!String(e).includes("Could not find the referenced transaction")}function aP(e){return iP(e)?"User rejected the request":oP(e)?"Exceeded price slippage":sP(e)?"Oops. Failed to sync data from your txid. Please check your txn status from explorer or from your wallet.":"Transaction failed"}var V0={},cP=Ar&&Ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(V0,"__esModule",{value:!0});var lP=V0.executeAuction=hw;const uP=cP(N1),fP="https://rpc.getshio.com",dP=500,hP=300;function hw(e,t,r=dP){const n={jsonrpc:"2.0",method:"shio_executeAuction",params:[e,t],id:1};return new Promise((i,o)=>{setTimeout(i,r),uP.default.post(fP,n,{headers:{"Content-Type":"application/json"},timeout:r}).then(s=>{setTimeout(i,hP)}).catch(o)})}V0.default={executeAuction:hw};function pP(){const{suiClient:e}=so(),{currentAccount:t}=Yr(),{mutateAsync:r}=zr.useSignTransaction(),{mutate:n}=zr.useSignAndExecuteTransaction({execute:async({bytes:c,signature:l})=>await o(c,l)}),i=ie.useMemo(()=>t==null?void 0:t.chains[0],[t]),o=async(c,l,u=!1)=>{var p,y;if(u){const x=await e.devInspectTransactionBlock({transactionBlock:To.from(Sr(c)),sender:t.address});if(!x||((p=x.effects)==null?void 0:p.status.status)==="failure")throw Error((y=x.effects)==null?void 0:y.status.error)}return await e.executeTransactionBlock({transactionBlock:c,signature:l,options:{showEvents:!0,showRawEffects:!0,showEffects:!0,showBalanceChanges:!0,showObjectChanges:!0,showInput:!0}})};return{signAndExecuteTransactionBlock:async(c,l=!1)=>{var d,p;let u;if(typeof c=="string"?u=To.from(c):u=c,l){const y=await e.devInspectTransactionBlock({transactionBlock:c,sender:t.address});if(!y||((d=y.effects)==null?void 0:d.status.status)==="failure")throw Error((p=y.effects)==null?void 0:p.status.error)}return u.setGasBudget(1e8),new Promise((y,x)=>{n({transaction:u,chain:i},{onSuccess:b=>{y(b)},onError:b=>{console.error("signAndExecuteTransactionBlock transaction failed",b),x(b)}})})},signTransactionBlock:async c=>(c instanceof Uint8Array&&(c=To.from(c)),typeof c=="string"&&(c=To.from(Sr(c))),new Promise((l,u)=>{r({transaction:c,chain:i},{onSuccess:d=>{l(d)},onError:d=>{console.error("signTransactionBlock failed",d),u(d)},onSettled:(d,p,y,x)=>{console.error("signTransactionBlock onSettled",{data:d,error:p,variables:y})}})})),executeTransactionBlock:o}}function mP(){const{signTransactionBlock:e,executeTransactionBlock:t,signAndExecuteTransactionBlock:r}=pP(),{currentAccount:n}=Yr(),{suiClient:i}=so(),{setTransactionData:o}=$0(),{addTxToast:s,removeToast:a}=ks(),c=5,l=2e3;async function u(y,x=1){try{let b;try{b=await i.getTransactionBlock({digest:y,options:{showEvents:!0,showEffects:!0,showBalanceChanges:!0,showInput:!0,showRawInput:!0,showObjectChanges:!0}})}catch{b=await i.getTransactionBlock({digest:y,options:{showEvents:!0,showEffects:!0}})}if(b)return b;throw new Error("Empty response")}catch(b){if(console.error(`Attempt ${x} failed:`,b),x>=c)throw new Error("Failed to fetch transaction status after maximum retries.");return await hp(l),u(y,x+1)}}const d=async(y,x,b={useDevInspect:!1,useMev:!1,txAction:"signTransactionBlock"})=>{var F,B;const{useDevInspect:M=!1,useMev:O,txAction:P="signTransactionBlock"}=b;let k;x.status="confirmation",o(x);try{let W;if(P==="signTransactionBlock"){const G=await e(y),{bytes:re,signature:oe}=G;if(O)try{const se=await lP(re,oe,500)}catch{}W=await t(re,oe,M)}else W=await r(y,M);x.status="submitted",o({...x}),x.tx=W.digest,k=s(x),await hp(l);const z=await u(W.digest,0);if(!z||((F=z.effects)==null?void 0:F.status.status)==="failure")p(x,(B=z.effects)==null?void 0:B.status.error);else{const G=JE(z,n==null?void 0:n.address,!1);if(x.buildShowInfo){const re=x.buildShowInfo("success",G);x.buildShowInfo=oe=>re}a(k),x.status="success",o({...x})}return z}catch(W){p(x,W)}},p=(y,x)=>{const b=aP(x);if(y.buildShowInfo){const M=y.buildShowInfo("confirmation");y.buildShowInfo=O=>(M.toastDescriptionContent=b,M.modalDescriptionText=b,M),y.status="rejected",o({...y})}else y.buildShowInfo=M=>{const O={};return O.toastDescriptionContent=b,O.modalDescriptionText=b,O},y.status="rejected",o({...y})};return{signAndExecuteTransaction:d}}function z0(e,t=1e3){const r=ie.useRef(),n=ie.useCallback((...i)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(...i)},t)},[e,t]);return ie.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),n}function gP(){const{aggregatorSDK:e}=so(),{findBestRouters:t}=nP(),{getTokenAmountValue:r,fetchTokenPrices:n}=$a(),{providers:i,slippage:o,mevProtect:s}=$r(),{signAndExecuteTransaction:a}=mP(),{setTransactionData:c}=$0(),{addTxToast:l}=ks(),{fromCoin:u,toCoin:d,setFromCoin:p,setToCoin:y,setToAmount:x,fromAmount:b,toAmount:M,setFromAmount:O,setFindRouterLoading:P,setRouterData:k,setByAmountIn:F,byAmountIn:B}=nn(),[W,z]=ie.useState(""),G=Zo(W),re=Zo(B),oe=Zo(b),se=Zo(M),q=Zo(u),L=Zo(d),{balanceInfo:h,getOwnerCoinBalances:f}=tl(u),{balanceInfo:m}=tl(d),S=r(u==null?void 0:u.coin_type,b),T=r(d==null?void 0:d.coin_type,M),I=z0(async(pe,Le,Ae)=>{if(q.current&&L.current&&+pe){(+oe.current||+se.current)&&P(!0);const Je=KE(pe,Le?q.current.decimals:L.current.decimals),dt=await t({fromToken:q.current,toToken:L.current,amount:Je.toString(),providersKeys:i,by_amount_in:Le,uuid:Ae});P(!1),G.current===Ae&&(Le?+oe.current?(x(dt.toAmountUi||""),k(dt)):x(""):+se.current?(O(dt.fromAmountUi||"ß"),k(dt)):O(""))}else v(!Le)},500),C=(pe,Le,Ae=!1)=>{if(F(Le),Le?(O(pe),Ae&&x("")):(x(pe),Ae&&O("")),+pe){const Je=Gp();z(Je),I(pe,Le,Je)}else P(!1),k(void 0),v(!Le)},g=(pe,Le=!0)=>{v(),Le?((pe==null?void 0:pe.coin_type)===(d==null?void 0:d.coin_type)&&y(u),p(pe)):((pe==null?void 0:pe.coin_type)===(u==null?void 0:u.coin_type)&&p(d),y(pe))},v=pe=>{pe===void 0?(O(""),x("")):pe?O(""):x(""),P(!1),k(void 0)},j=()=>{const pe=re.current?oe.current:se.current;if(+pe){const Le=Gp();z(Le),I(pe,re.current,Le)}},Q=async(pe,Le)=>{const{routerData:Ae,byAmountIn:Je,fromAmountUi:dt,toAmountUi:je}=pe,pt=new To,we={routers:Ae,slippage:Number(o)/100,txb:pt,partner:Le||oC};try{await e.fastRouterSwap(we);const he={status:"confirmation",buildShowInfo:(Ve,ke)=>{const Te=`Swap ${Nr(dt,u==null?void 0:u.decimals)} ${u==null?void 0:u.symbol} for ${Nr(je,d==null?void 0:d.decimals)} ${d==null?void 0:d.symbol}`,Me={modalDescriptionText:Te,toastTitleText:Te};if(Ve==="success"){let Ue=dt,ut=je;ke&&(Ue=pp(ke,u)||dt,ut=pp(ke,d)||je);const ft=`Swapped ${Nr(Ue,u==null?void 0:u.decimals)} ${u==null?void 0:u.symbol} for ${Nr(ut,d==null?void 0:d.decimals)} ${d==null?void 0:d.symbol}`;Me.toastTitleText=ft,Me.modalDescriptionText=ft}return Me},id:0};c(he),await a(pt,he,{useMev:s})?(v(),f()):j()}catch(he){String(he).includes("TypeError: Failed to fetch")&&l({id:0,status:"rejected",buildShowInfo(Ce,Ve){return{toastTitleText:"RPC loading failed",toastDescriptionContent:"Try resubmission. Or to check your network and switch an RPC in settings to try again."}}})}};ie.useEffect(()=>{Z(),v()},[u==null?void 0:u.coin_type,d==null?void 0:d.coin_type]);const Z=()=>{const pe=[];u&&pe.push(u.coin_type),d&&pe.push(d.coin_type),pe.length>0&&n(pe)},{isScamsCoin:ce}=Kp(u),{isScamsCoin:be}=Kp(d),xe=ie.useMemo(()=>{if(!(!ce&&!be)){if(ce&&be)return`${u==null?void 0:u.symbol} and ${d==null?void 0:d.symbol} are`;if(ce)return`${u==null?void 0:u.symbol} token is `;if(be)return`${d==null?void 0:d.symbol} token is `}},[ce,be]);return{handleAmountChange:C,handleSelectToken:g,fromBalanceInfo:h,toBalanceInfo:m,fromAmountValue:S,toAmountValue:T,doSwapAction:Q,reCalculateRouteData:j,refreshMarketPrice:Z,scamsText:xe}}function vP(e){const{fromCoin:t,toCoin:r,fromAmount:n,toAmount:i,routerData:o}=nn(),{currentAccount:s}=Yr(),a=ie.useMemo(()=>{const c={text:"Swap",disabled:!1};if(!(s!=null&&s.address))return c.text="Connect Wallet",c.disabled=!1,c;if(!t||!r)return c.text="Select a token",c.disabled=!0,c;if(!+n&&!+i)return c.text="Enter an amount",c.disabled=!0,c;if(o&&o.errorCode){if(o.errorCode===Mo.InsufficientLiquidity)return c.text="Insufficient liquidity for this trade",c.disabled=!0,c;if(o.errorCode===Mo.NoRouter||o.errorCode===Mo.HoneyPot)return c.text="No Available Route",c.disabled=!0,c}return+n&&Be(n).gt(e||0)?(c.disabled=!0,c.text=`Insufficient ${dn(t==null?void 0:t.symbol)} Balance`,c):((!+n||!+i)&&(c.disabled=!0),c)},[s==null?void 0:s.address,n,i,e,o==null?void 0:o.errorCode,t,r]);return{btnText:a.text,btnDisabled:a.disabled}}function pw({size:e="24px",strokeWidth:t="10",color:r="#909ca4",emptyColor:n="transparent",gapPercentage:i=.5}){const o=50-parseFloat(t),s=2*Math.PI*o,a=s*i,c=s-a;return w.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100",children:[w.jsx("circle",{cx:"50",cy:"50",r:o,fill:"none",stroke:n,strokeWidth:t}),w.jsx("circle",{cx:"50",cy:"50",r:o,fill:"none",stroke:r,strokeWidth:t,strokeDasharray:`${c} ${a}`,strokeDashoffset:"0",strokeLinecap:"round",style:{animation:"dash 0.5s linear infinite"}}),w.jsx("style",{children:`
|
|
94
94
|
@keyframes dash {
|
|
95
95
|
0% {
|
|
96
96
|
stroke-dashoffset: 0;
|
|
@@ -99,7 +99,7 @@ body { background-color: var(--color-page-background); }
|
|
|
99
99
|
stroke-dashoffset: -${s};
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
`})]})}function V0({baseToken:e,quoteToken:t,baseAmount:r,quoteAmount:n,loading:i}){const[o,s]=ie.useState(!0),a=uw(o,r,n);return w.jsxs("div",{className:"current-price-block",style:{cursor:"pointer"},onClick:()=>{s(!o)},children:[w.jsx(Gr,{src:o?e==null?void 0:e.logo_url:t==null?void 0:t.logo_url}),w.jsxs("span",{style:{display:"flex",alignItems:"center",color:"var(--cs-text-title)",fontSize:"12px",maxWidth:"80%"},children:["1"," ",dn(o?e==null?void 0:e.symbol:t==null?void 0:t.symbol)," ","="," ",i?w.jsx(Ns,{style:{height:"16px",width:"40px",marginLeft:"2px",marginRight:"2px"}}):Pr(a,t==null?void 0:t.decimals)," ",dn(o?t==null?void 0:t.symbol:e==null?void 0:e.symbol)]}),w.jsx(Gr,{src:o?t==null?void 0:t.logo_url:e==null?void 0:e.logo_url}),w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-swap"})})]})}function Xl(){const[e,t]=ie.useState(window.innerWidth),r=$0(()=>{t(window.innerWidth)},300);ie.useEffect(()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}),[]);const n=ie.useMemo(()=>e<810,[e]);return{windowWidth:e,isApp:n}}function hw(e,t,r,n){const{getTokenPrice:i}=$a(),o=i(e==null?void 0:e.coin_type),s=i(t==null?void 0:t.coin_type),a=uw(!0,r,n),c=ie.useMemo(()=>{if(s&&o)return Be(o.price).div(s.price).toString()},[o==null?void 0:o.price,s==null?void 0:s.price]),l=ie.useMemo(()=>{if(c&&+a)return Be(a).sub(c).div(a).mul(100).toFixed(10)},[c,a]),u=ie.useMemo(()=>{const b=[];return o&&b.push(o.market),s&&!b.includes(s.market)&&b.push(s.market),b},[o==null?void 0:o.market,s==null?void 0:s.market]),d=ie.useMemo(()=>l&&Be(l).lt(0)?Be(l).abs().gt(5):!1,[l]),p=ie.useMemo(()=>l&&Be(l).lt(0)?Be(l).abs().gt(10):!1,[l]),y=ie.useMemo(()=>{let b,M="yellow";if(l)if(Be(l).gt(0))M="green",Be(l).lt(.1)?b="< 0.1% cheaper than":b=`${Pr(l,2,!0,Ur.ROUND_UP)}% cheaper than`;else if(Be(l).eq(0))b="0%",M="green";else{const R=Be(l).abs();R.lte(5)?(M="green",b=`Within ${Pr(R.toString(),2,!0,Ur.ROUND_UP)}%`):R.lte(10)?(M="yellow",b=`${Pr(R.toString(),2,!0,Ur.ROUND_UP)}% more than`):R.lte(100)?(M="red",b=`${Pr(R.toString(),2,!0,Ur.ROUND_UP)}% more than`):(M="red",b="> 100% more than")}return{priceImpactText:b,textColor:M}},[l]),x=ie.useMemo(()=>(o==null?void 0:o.market)==="Cetus"||(s==null?void 0:s.market)==="Cetus",[o,s]);return{swapPrice:a,marketPrice:c,priceImpact:l,sources:u,showPriceImpactTips:d,showPriceImpactWarn:p,priceImpactTextInfo:y,hideShowPriceImpact:x}}function Jl({content:e,children:t,position:r="top",delay:n=0}){const[i,o]=ie.useState(!1),[s,a]=ie.useState(!1),c=ie.useRef(null),l=()=>{c.current&&(clearTimeout(c.current),c.current=null),o(!0)};ie.useEffect(()=>()=>{i||c.current&&(clearTimeout(c.current),c.current=null)},[i]);const u=()=>{c.current=setTimeout(()=>{s||(o(!1),c.current&&(clearTimeout(c.current),c.current=null))},0)},d=()=>{switch(r){case"top":return{transform:"translateX(-50%)"};case"bottom":return{transform:"translateX(-50%)",marginTop:"0px"};case"left":return{transform:"translateY(-50%)",marginRight:"8px"};case"right":return{transform:"translateY(-50%)"};default:return{}}},p=ie.useRef(null),[y,x]=ie.useState({left:void 0,top:void 0});return ie.useEffect(()=>{var b;if(i&&p.current){const M=(b=p.current)==null?void 0:b.getBoundingClientRect();let R,P;r==="top"?(R=`${window.scrollX+M.left+M.width/2}px`,P=`${window.scrollY+M.top-2*M.height-8}px`):r==="bottom"?(R=`${window.scrollX+M.left+M.width/2}px`,P=`${window.scrollY+M.bottom}px`):r==="left"?(R=`${window.scrollX+M.left-8}px`,P=`${window.scrollY+M.top+M.height/2}px`):r==="right"?(R=`${window.scrollX+M.right+8}px`,P=`${window.scrollY+M.top+M.height/2}px`):(R=`${window.scrollX+M.left+M.width/2}px`,P=`${window.scrollY+M.top+M.height/2}px`),x({left:R,top:P})}},[i]),w.jsxs("div",{ref:p,style:{position:"relative",display:"inline-block"},onMouseEnter:l,onMouseLeave:u,children:[t,i&&ol.createPortal(w.jsx("div",{style:{transition:"opacity 0.3s ease",opacity:i?1:0,position:"absolute",zIndex:9e3,padding:"8px 12px",backgroundColor:"var(--cs-dialog-bg)",color:"var(--cs-text-con)",borderRadius:"8px",fontSize:"12px",whiteSpace:"nowrap",border:"1px solid",borderColor:"var(--cs-border)",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.1)",...d(),...y},onMouseEnter:()=>a(!0),onMouseLeave:()=>{c.current&&(clearTimeout(c.current),c.current=null),a(!1),o(!1)},children:e}),document.body)]})}function pw({content:e,children:t,position:r,autoSwitchTooltip:n=!1}){const{isApp:i}=Xl();return i&&n?w.jsxs(mn.Root,{children:[w.jsx(mn.Trigger,{children:w.jsx("button",{style:{background:"none",border:"none",padding:"0",margin:"0",outline:"none",boxShadow:"none",color:"inherit",font:"inherit",textAlign:"inherit"},children:t})}),w.jsx(mn.Content,{variant:"soft",style:{transition:"opacity 0.3s ease",display:"block",zIndex:9e3,padding:"8px 12px",backgroundColor:"var(--cs-dialog-bg)",color:"var(--cs-text-con)",borderRadius:"8px",fontSize:"12px",whiteSpace:"nowrap",border:"1px solid",borderColor:"var(--cs-border)",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.1)"},side:r,align:"center",children:e})]}):w.jsx(Jl,{content:e,position:r,children:t})}function mw({isLoading:e,routerData:t,noTips:r}){const{fromCoin:n,toCoin:i,fromAmount:o,toAmount:s}=nn();Xl();const{priceImpact:a,sources:c,marketPrice:l,priceImpactTextInfo:u,hideShowPriceImpact:d}=hw(n,i,t==null?void 0:t.fromAmountUi,t==null?void 0:t.toAmountUi);return w.jsx(w.Fragment,{children:d?w.jsx(w.Fragment,{}):w.jsxs(w.Fragment,{children:[!r&&Be(a).lte(-30)&&w.jsx("div",{className:"price-impact-tips red",children:"High price difference. Be cautious before submitting your order."}),w.jsxs("div",{className:"price-impact-block",children:[w.jsxs("div",{className:"left",children:[w.jsx("span",{style:{color:"var(--cs-text-con)"},children:"Price Difference"}),w.jsx(pw,{autoSwitchTooltip:!0,position:"top",content:w.jsx(dP,{fromToken:n,toToken:i,sources:c,baseAmount:"1",quoteAmount:l}),children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{cursor:"pointer",width:"20px",height:"20px"},children:w.jsx("use",{xlinkHref:"#icon-tips"})})})]}),w.jsxs("div",{children:[e&&w.jsx(Ns,{style:{width:"80px",height:"20px"}}),!e&&w.jsxs("div",{className:"right",children:[w.jsx("span",{className:u==null?void 0:u.textColor,children:u.priceImpactText?u==null?void 0:u.priceImpactText:"Incalculable"}),w.jsx("div",{className:"platforms",children:c.map(p=>w.jsx(Jl,{content:w.jsx("span",{style:{fontSize:"12px"},children:yb[p]}),position:"top",delay:300,children:w.jsx(Gr,{src:iC[p]})},p))})]})]})]})]})})}function dP({fromToken:e,toToken:t,baseAmount:r,quoteAmount:n,sources:i}){const{isApp:o}=Xl();return w.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[w.jsx("p",{style:{color:"var(--cs-text-con)",fontSize:"12px",lineHeight:"18px",width:o?"200px":"300px",textAlign:"start",whiteSpace:"normal"},children:"The difference between the market price and estimated price due to trade size."}),w.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[w.jsx("p",{style:{fontSize:"12px",color:"var(--cs-text-title)"},children:"Market price sources:"}),r&&n?w.jsx(V0,{baseToken:e,quoteToken:t,baseAmount:"1",quoteAmount:n,loading:!1}):w.jsx("p",{style:{color:"var(--cs-text-title)",fontSize:"12px"},children:"Price is unknown"})]}),w.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"5px"},children:[w.jsx("p",{style:{color:"var(--cs-text-con)",fontSize:"12px",whiteSpace:"pre"},children:"Market price sources:"}),w.jsx("p",{style:{color:"var(--cs-text-con)",fontSize:"12px",whiteSpace:"pre"},children:i.map(s=>yb[s]+" ").join("")})]})]})}function gw({pr:e="8px",pl:t="8px",amountLimit:r,isLoading:n}){const{fromCoin:i,toCoin:o,byAmountIn:s}=nn();return w.jsxs("div",{className:"swap-info-between",style:{paddingLeft:t,paddingRight:e},children:[w.jsx("div",{className:"left",children:s?"Minimum Received":"Maximum Sold"}),n?w.jsx(Ns,{style:{height:"18px",width:"80px"}}):w.jsxs("div",{className:"right",children:[Pr(r,s?o==null?void 0:o.decimals:i==null?void 0:i.decimals,!1,Ur.ROUND_DOWN)," ",dn(s?(o==null?void 0:o.symbol)||"":(i==null?void 0:i.symbol)||"")]})]})}function hP({scamsText:e}){return w.jsxs("div",{style:{marginTop:"16px",borderRadius:"8px",border:"1px solid #2A3238",paddingTop:"12px",width:"100%",backgroundColor:"#161A1E"},children:[w.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 12px",justifyContent:"center",textAlign:"center"},children:[w.jsx("svg",{className:"cs-icon",style:{width:"20px",height:"20px",fill:"#ffca68"},"aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-alert"})}),w.jsx("span",{style:{color:"#ffca68",marginLeft:"4px"},children:"Alert"})]}),w.jsx("div",{style:{borderRadius:"8px",padding:"11px",margin:"-1px",marginTop:"14px",border:"1px solid #2A3238",lineHeight:"1"},children:w.jsx(xb,{text:`${e} detected to have Deny List feature. It's an optional feature on Sui designed for regulated coins (learn more). However, it could be misused by HoneyPot scams, which may restrict users from selling the tokens after buying. Please be cautious.`,keywords:["learn more"],onKeywordClick:t=>{window.open("https://docs.sui.io/guides/developer/coin/regulated","_blank")}})})]})}function pP({onClick:e}){return w.jsxs("div",{className:"cs-icon-button cs-back-button",onClick:t=>{t.stopPropagation(),e()},children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-back"})}),w.jsx("span",{children:"Back"})]})}function z0({title:e,backClick:t}){return w.jsxs("div",{className:"cs-have-back-header",children:[w.jsx(pP,{onClick:t}),w.jsx("span",{className:"title",children:e})]})}const oc=globalThis||void 0||self;var mP=typeof oc=="object"&&oc&&oc.Object===Object&&oc;const vw=mP;var gP=typeof self=="object"&&self&&self.Object===Object&&self,vP=vw||gP||Function("return this")();const ni=vP;var bP=ni.Symbol;const ei=bP;var bw=Object.prototype,yP=bw.hasOwnProperty,wP=bw.toString,Gs=ei?ei.toStringTag:void 0;function xP(e){var t=yP.call(e,Gs),r=e[Gs];try{e[Gs]=void 0;var n=!0}catch{}var i=wP.call(e);return n&&(t?e[Gs]=r:delete e[Gs]),i}var SP=Object.prototype,_P=SP.toString;function EP(e){return _P.call(e)}var CP="[object Null]",TP="[object Undefined]",Gp=ei?ei.toStringTag:void 0;function js(e){return e==null?e===void 0?TP:CP:Gp&&Gp in Object(e)?xP(e):EP(e)}function ro(e){return e!=null&&typeof e=="object"}var AP="[object Symbol]";function wa(e){return typeof e=="symbol"||ro(e)&&js(e)==AP}function _c(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var MP=Array.isArray;const Kr=MP;var IP=1/0,Kp=ei?ei.prototype:void 0,Yp=Kp?Kp.toString:void 0;function yw(e){if(typeof e=="string")return e;if(Kr(e))return _c(e,yw)+"";if(wa(e))return Yp?Yp.call(e):"";var t=e+"";return t=="0"&&1/e==-IP?"-0":t}function Ds(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function ww(e){return e}var RP="[object AsyncFunction]",OP="[object Function]",PP="[object GeneratorFunction]",NP="[object Proxy]";function xw(e){if(!Ds(e))return!1;var t=js(e);return t==OP||t==PP||t==RP||t==NP}var kP=ni["__core-js_shared__"];const tf=kP;var Xp=function(){var e=/[^.]+$/.exec(tf&&tf.keys&&tf.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function jP(e){return!!Xp&&Xp in e}var DP=Function.prototype,LP=DP.toString;function Vo(e){if(e!=null){try{return LP.call(e)}catch{}try{return e+""}catch{}}return""}var BP=/[\\^$.*+?()[\]{}|]/g,UP=/^\[object .+?Constructor\]$/,FP=Function.prototype,$P=Object.prototype,VP=FP.toString,zP=$P.hasOwnProperty,qP=RegExp("^"+VP.call(zP).replace(BP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function HP(e){if(!Ds(e)||jP(e))return!1;var t=xw(e)?qP:UP;return t.test(Vo(e))}function WP(e,t){return e==null?void 0:e[t]}function zo(e,t){var r=WP(e,t);return HP(r)?r:void 0}var GP=zo(ni,"WeakMap");const rd=GP;var Jp=Object.create,KP=function(){function e(){}return function(t){if(!Ds(t))return{};if(Jp)return Jp(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();const YP=KP;function XP(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var JP=function(){try{var e=zo(Object,"defineProperty");return e({},"",{}),e}catch{}}();const Zp=JP;function ZP(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var QP=9007199254740991,eN=/^(?:0|[1-9]\d*)$/;function Sw(e,t){var r=typeof e;return t=t??QP,!!t&&(r=="number"||r!="symbol"&&eN.test(e))&&e>-1&&e%1==0&&e<t}function _w(e,t,r){t=="__proto__"&&Zp?Zp(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function q0(e,t){return e===t||e!==e&&t!==t}var tN=Object.prototype,rN=tN.hasOwnProperty;function Ew(e,t,r){var n=e[t];(!(rN.call(e,t)&&q0(n,r))||r===void 0&&!(t in e))&&_w(e,t,r)}function Zl(e,t,r,n){var i=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var a=t[o],c=n?n(r[a],e[a],a,r,e):void 0;c===void 0&&(c=e[a]),i?_w(r,a,c):Ew(r,a,c)}return r}var nN=9007199254740991;function H0(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=nN}function Ql(e){return e!=null&&H0(e.length)&&!xw(e)}var iN=Object.prototype;function W0(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||iN;return e===r}function oN(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var sN="[object Arguments]";function Qp(e){return ro(e)&&js(e)==sN}var Cw=Object.prototype,aN=Cw.hasOwnProperty,cN=Cw.propertyIsEnumerable,lN=Qp(function(){return arguments}())?Qp:function(e){return ro(e)&&aN.call(e,"callee")&&!cN.call(e,"callee")};const Tw=lN;function uN(){return!1}var Aw=typeof exports=="object"&&exports&&!exports.nodeType&&exports,em=Aw&&typeof module=="object"&&module&&!module.nodeType&&module,fN=em&&em.exports===Aw,tm=fN?ni.Buffer:void 0,dN=tm?tm.isBuffer:void 0,hN=dN||uN;const rl=hN;var pN="[object Arguments]",mN="[object Array]",gN="[object Boolean]",vN="[object Date]",bN="[object Error]",yN="[object Function]",wN="[object Map]",xN="[object Number]",SN="[object Object]",_N="[object RegExp]",EN="[object Set]",CN="[object String]",TN="[object WeakMap]",AN="[object ArrayBuffer]",MN="[object DataView]",IN="[object Float32Array]",RN="[object Float64Array]",ON="[object Int8Array]",PN="[object Int16Array]",NN="[object Int32Array]",kN="[object Uint8Array]",jN="[object Uint8ClampedArray]",DN="[object Uint16Array]",LN="[object Uint32Array]",Qt={};Qt[IN]=Qt[RN]=Qt[ON]=Qt[PN]=Qt[NN]=Qt[kN]=Qt[jN]=Qt[DN]=Qt[LN]=!0;Qt[pN]=Qt[mN]=Qt[AN]=Qt[gN]=Qt[MN]=Qt[vN]=Qt[bN]=Qt[yN]=Qt[wN]=Qt[xN]=Qt[SN]=Qt[_N]=Qt[EN]=Qt[CN]=Qt[TN]=!1;function BN(e){return ro(e)&&H0(e.length)&&!!Qt[js(e)]}function eu(e){return function(t){return e(t)}}var Mw=typeof exports=="object"&&exports&&!exports.nodeType&&exports,aa=Mw&&typeof module=="object"&&module&&!module.nodeType&&module,UN=aa&&aa.exports===Mw,rf=UN&&vw.process,FN=function(){try{var e=aa&&aa.require&&aa.require("util").types;return e||rf&&rf.binding&&rf.binding("util")}catch{}}();const Ss=FN;var rm=Ss&&Ss.isTypedArray,$N=rm?eu(rm):BN;const Iw=$N;var VN=Object.prototype,zN=VN.hasOwnProperty;function Rw(e,t){var r=Kr(e),n=!r&&Tw(e),i=!r&&!n&&rl(e),o=!r&&!n&&!i&&Iw(e),s=r||n||i||o,a=s?oN(e.length,String):[],c=a.length;for(var l in e)(t||zN.call(e,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Sw(l,c)))&&a.push(l);return a}function Ow(e,t){return function(r){return e(t(r))}}var qN=Ow(Object.keys,Object);const HN=qN;var WN=Object.prototype,GN=WN.hasOwnProperty;function KN(e){if(!W0(e))return HN(e);var t=[];for(var r in Object(e))GN.call(e,r)&&r!="constructor"&&t.push(r);return t}function za(e){return Ql(e)?Rw(e):KN(e)}function YN(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var XN=Object.prototype,JN=XN.hasOwnProperty;function ZN(e){if(!Ds(e))return YN(e);var t=W0(e),r=[];for(var n in e)n=="constructor"&&(t||!JN.call(e,n))||r.push(n);return r}function G0(e){return Ql(e)?Rw(e,!0):ZN(e)}var QN=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ek=/^\w*$/;function K0(e,t){if(Kr(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||wa(e)?!0:ek.test(e)||!QN.test(e)||t!=null&&e in Object(t)}var tk=zo(Object,"create");const xa=tk;function rk(){this.__data__=xa?xa(null):{},this.size=0}function nk(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ik="__lodash_hash_undefined__",ok=Object.prototype,sk=ok.hasOwnProperty;function ak(e){var t=this.__data__;if(xa){var r=t[e];return r===ik?void 0:r}return sk.call(t,e)?t[e]:void 0}var ck=Object.prototype,lk=ck.hasOwnProperty;function uk(e){var t=this.__data__;return xa?t[e]!==void 0:lk.call(t,e)}var fk="__lodash_hash_undefined__";function dk(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=xa&&t===void 0?fk:t,this}function ko(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ko.prototype.clear=rk;ko.prototype.delete=nk;ko.prototype.get=ak;ko.prototype.has=uk;ko.prototype.set=dk;function hk(){this.__data__=[],this.size=0}function tu(e,t){for(var r=e.length;r--;)if(q0(e[r][0],t))return r;return-1}var pk=Array.prototype,mk=pk.splice;function gk(e){var t=this.__data__,r=tu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():mk.call(t,r,1),--this.size,!0}function vk(e){var t=this.__data__,r=tu(t,e);return r<0?void 0:t[r][1]}function bk(e){return tu(this.__data__,e)>-1}function yk(e,t){var r=this.__data__,n=tu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Ni(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ni.prototype.clear=hk;Ni.prototype.delete=gk;Ni.prototype.get=vk;Ni.prototype.has=bk;Ni.prototype.set=yk;var wk=zo(ni,"Map");const Sa=wk;function xk(){this.size=0,this.__data__={hash:new ko,map:new(Sa||Ni),string:new ko}}function Sk(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ru(e,t){var r=e.__data__;return Sk(t)?r[typeof t=="string"?"string":"hash"]:r.map}function _k(e){var t=ru(this,e).delete(e);return this.size-=t?1:0,t}function Ek(e){return ru(this,e).get(e)}function Ck(e){return ru(this,e).has(e)}function Tk(e,t){var r=ru(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function ki(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ki.prototype.clear=xk;ki.prototype.delete=_k;ki.prototype.get=Ek;ki.prototype.has=Ck;ki.prototype.set=Tk;var Ak="Expected a function";function Y0(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Ak);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Y0.Cache||ki),r}Y0.Cache=ki;var Mk=500;function Ik(e){var t=Y0(e,function(n){return r.size===Mk&&r.clear(),n}),r=t.cache;return t}var Rk=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ok=/\\(\\)?/g,Pk=Ik(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Rk,function(r,n,i,o){t.push(i?o.replace(Ok,"$1"):n||r)}),t});const Nk=Pk;function kk(e){return e==null?"":yw(e)}function Pw(e,t){return Kr(e)?e:K0(e,t)?[e]:Nk(kk(e))}var jk=1/0;function nu(e){if(typeof e=="string"||wa(e))return e;var t=e+"";return t=="0"&&1/e==-jk?"-0":t}function X0(e,t){t=Pw(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[nu(t[r++])];return r&&r==n?e:void 0}function Dk(e,t,r){var n=e==null?void 0:X0(e,t);return n===void 0?r:n}function Nw(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Lk=Ow(Object.getPrototypeOf,Object);const kw=Lk;function Bk(){this.__data__=new Ni,this.size=0}function Uk(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Fk(e){return this.__data__.get(e)}function $k(e){return this.__data__.has(e)}var Vk=200;function zk(e,t){var r=this.__data__;if(r instanceof Ni){var n=r.__data__;if(!Sa||n.length<Vk-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ki(n)}return r.set(e,t),this.size=r.size,this}function Xn(e){var t=this.__data__=new Ni(e);this.size=t.size}Xn.prototype.clear=Bk;Xn.prototype.delete=Uk;Xn.prototype.get=Fk;Xn.prototype.has=$k;Xn.prototype.set=zk;function qk(e,t){return e&&Zl(t,za(t),e)}function Hk(e,t){return e&&Zl(t,G0(t),e)}var jw=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nm=jw&&typeof module=="object"&&module&&!module.nodeType&&module,Wk=nm&&nm.exports===jw,im=Wk?ni.Buffer:void 0,om=im?im.allocUnsafe:void 0;function Gk(e,t){if(t)return e.slice();var r=e.length,n=om?om(r):new e.constructor(r);return e.copy(n),n}function Dw(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Lw(){return[]}var Kk=Object.prototype,Yk=Kk.propertyIsEnumerable,sm=Object.getOwnPropertySymbols,Xk=sm?function(e){return e==null?[]:(e=Object(e),Dw(sm(e),function(t){return Yk.call(e,t)}))}:Lw;const J0=Xk;function Jk(e,t){return Zl(e,J0(e),t)}var Zk=Object.getOwnPropertySymbols,Qk=Zk?function(e){for(var t=[];e;)Nw(t,J0(e)),e=kw(e);return t}:Lw;const Bw=Qk;function ej(e,t){return Zl(e,Bw(e),t)}function Uw(e,t,r){var n=t(e);return Kr(e)?n:Nw(n,r(e))}function nd(e){return Uw(e,za,J0)}function tj(e){return Uw(e,G0,Bw)}var rj=zo(ni,"DataView");const id=rj;var nj=zo(ni,"Promise");const od=nj;var ij=zo(ni,"Set");const sd=ij;var am="[object Map]",oj="[object Object]",cm="[object Promise]",lm="[object Set]",um="[object WeakMap]",fm="[object DataView]",sj=Vo(id),aj=Vo(Sa),cj=Vo(od),lj=Vo(sd),uj=Vo(rd),wo=js;(id&&wo(new id(new ArrayBuffer(1)))!=fm||Sa&&wo(new Sa)!=am||od&&wo(od.resolve())!=cm||sd&&wo(new sd)!=lm||rd&&wo(new rd)!=um)&&(wo=function(e){var t=js(e),r=t==oj?e.constructor:void 0,n=r?Vo(r):"";if(n)switch(n){case sj:return fm;case aj:return am;case cj:return cm;case lj:return lm;case uj:return um}return t});const _a=wo;var fj=Object.prototype,dj=fj.hasOwnProperty;function hj(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&dj.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var pj=ni.Uint8Array;const nl=pj;function Z0(e){var t=new e.constructor(e.byteLength);return new nl(t).set(new nl(e)),t}function mj(e,t){var r=t?Z0(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var gj=/\w*$/;function vj(e){var t=new e.constructor(e.source,gj.exec(e));return t.lastIndex=e.lastIndex,t}var dm=ei?ei.prototype:void 0,hm=dm?dm.valueOf:void 0;function bj(e){return hm?Object(hm.call(e)):{}}function yj(e,t){var r=t?Z0(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var wj="[object Boolean]",xj="[object Date]",Sj="[object Map]",_j="[object Number]",Ej="[object RegExp]",Cj="[object Set]",Tj="[object String]",Aj="[object Symbol]",Mj="[object ArrayBuffer]",Ij="[object DataView]",Rj="[object Float32Array]",Oj="[object Float64Array]",Pj="[object Int8Array]",Nj="[object Int16Array]",kj="[object Int32Array]",jj="[object Uint8Array]",Dj="[object Uint8ClampedArray]",Lj="[object Uint16Array]",Bj="[object Uint32Array]";function Uj(e,t,r){var n=e.constructor;switch(t){case Mj:return Z0(e);case wj:case xj:return new n(+e);case Ij:return mj(e,r);case Rj:case Oj:case Pj:case Nj:case kj:case jj:case Dj:case Lj:case Bj:return yj(e,r);case Sj:return new n;case _j:case Tj:return new n(e);case Ej:return vj(e);case Cj:return new n;case Aj:return bj(e)}}function Fj(e){return typeof e.constructor=="function"&&!W0(e)?YP(kw(e)):{}}var $j="[object Map]";function Vj(e){return ro(e)&&_a(e)==$j}var pm=Ss&&Ss.isMap,zj=pm?eu(pm):Vj;const qj=zj;var Hj="[object Set]";function Wj(e){return ro(e)&&_a(e)==Hj}var mm=Ss&&Ss.isSet,Gj=mm?eu(mm):Wj;const Kj=Gj;var Yj=1,Xj=2,Jj=4,Fw="[object Arguments]",Zj="[object Array]",Qj="[object Boolean]",eD="[object Date]",tD="[object Error]",$w="[object Function]",rD="[object GeneratorFunction]",nD="[object Map]",iD="[object Number]",Vw="[object Object]",oD="[object RegExp]",sD="[object Set]",aD="[object String]",cD="[object Symbol]",lD="[object WeakMap]",uD="[object ArrayBuffer]",fD="[object DataView]",dD="[object Float32Array]",hD="[object Float64Array]",pD="[object Int8Array]",mD="[object Int16Array]",gD="[object Int32Array]",vD="[object Uint8Array]",bD="[object Uint8ClampedArray]",yD="[object Uint16Array]",wD="[object Uint32Array]",Yt={};Yt[Fw]=Yt[Zj]=Yt[uD]=Yt[fD]=Yt[Qj]=Yt[eD]=Yt[dD]=Yt[hD]=Yt[pD]=Yt[mD]=Yt[gD]=Yt[nD]=Yt[iD]=Yt[Vw]=Yt[oD]=Yt[sD]=Yt[aD]=Yt[cD]=Yt[vD]=Yt[bD]=Yt[yD]=Yt[wD]=!0;Yt[tD]=Yt[$w]=Yt[lD]=!1;function Ec(e,t,r,n,i,o){var s,a=t&Yj,c=t&Xj,l=t&Jj;if(r&&(s=i?r(e,n,i,o):r(e)),s!==void 0)return s;if(!Ds(e))return e;var u=Kr(e);if(u){if(s=hj(e),!a)return XP(e,s)}else{var d=_a(e),p=d==$w||d==rD;if(rl(e))return Gk(e,a);if(d==Vw||d==Fw||p&&!i){if(s=c||p?{}:Fj(e),!a)return c?ej(e,Hk(s,e)):Jk(e,qk(s,e))}else{if(!Yt[d])return i?e:{};s=Uj(e,d,a)}}o||(o=new Xn);var y=o.get(e);if(y)return y;o.set(e,s),Kj(e)?e.forEach(function(M){s.add(Ec(M,t,r,M,e,o))}):qj(e)&&e.forEach(function(M,R){s.set(R,Ec(M,t,r,R,e,o))});var x=l?c?tj:nd:c?G0:za,b=u?void 0:x(e);return ZP(b||e,function(M,R){b&&(R=M,M=e[R]),Ew(s,R,Ec(M,t,r,R,e,o))}),s}var xD=1,SD=4;function _D(e){return Ec(e,xD|SD)}var ED="__lodash_hash_undefined__";function CD(e){return this.__data__.set(e,ED),this}function TD(e){return this.__data__.has(e)}function il(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new ki;++t<r;)this.add(e[t])}il.prototype.add=il.prototype.push=CD;il.prototype.has=TD;function AD(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function MD(e,t){return e.has(t)}var ID=1,RD=2;function zw(e,t,r,n,i,o){var s=r&ID,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var l=o.get(e),u=o.get(t);if(l&&u)return l==t&&u==e;var d=-1,p=!0,y=r&RD?new il:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var x=e[d],b=t[d];if(n)var M=s?n(b,x,d,t,e,o):n(x,b,d,e,t,o);if(M!==void 0){if(M)continue;p=!1;break}if(y){if(!AD(t,function(R,P){if(!MD(y,P)&&(x===R||i(x,R,r,n,o)))return y.push(P)})){p=!1;break}}else if(!(x===b||i(x,b,r,n,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function OD(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function PD(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var ND=1,kD=2,jD="[object Boolean]",DD="[object Date]",LD="[object Error]",BD="[object Map]",UD="[object Number]",FD="[object RegExp]",$D="[object Set]",VD="[object String]",zD="[object Symbol]",qD="[object ArrayBuffer]",HD="[object DataView]",gm=ei?ei.prototype:void 0,nf=gm?gm.valueOf:void 0;function WD(e,t,r,n,i,o,s){switch(r){case HD:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case qD:return!(e.byteLength!=t.byteLength||!o(new nl(e),new nl(t)));case jD:case DD:case UD:return q0(+e,+t);case LD:return e.name==t.name&&e.message==t.message;case FD:case VD:return e==t+"";case BD:var a=OD;case $D:var c=n&ND;if(a||(a=PD),e.size!=t.size&&!c)return!1;var l=s.get(e);if(l)return l==t;n|=kD,s.set(e,t);var u=zw(a(e),a(t),n,i,o,s);return s.delete(e),u;case zD:if(nf)return nf.call(e)==nf.call(t)}return!1}var GD=1,KD=Object.prototype,YD=KD.hasOwnProperty;function XD(e,t,r,n,i,o){var s=r&GD,a=nd(e),c=a.length,l=nd(t),u=l.length;if(c!=u&&!s)return!1;for(var d=c;d--;){var p=a[d];if(!(s?p in t:YD.call(t,p)))return!1}var y=o.get(e),x=o.get(t);if(y&&x)return y==t&&x==e;var b=!0;o.set(e,t),o.set(t,e);for(var M=s;++d<c;){p=a[d];var R=e[p],P=t[p];if(n)var k=s?n(P,R,p,t,e,o):n(R,P,p,e,t,o);if(!(k===void 0?R===P||i(R,P,r,n,o):k)){b=!1;break}M||(M=p=="constructor")}if(b&&!M){var F=e.constructor,B=t.constructor;F!=B&&"constructor"in e&&"constructor"in t&&!(typeof F=="function"&&F instanceof F&&typeof B=="function"&&B instanceof B)&&(b=!1)}return o.delete(e),o.delete(t),b}var JD=1,vm="[object Arguments]",bm="[object Array]",sc="[object Object]",ZD=Object.prototype,ym=ZD.hasOwnProperty;function QD(e,t,r,n,i,o){var s=Kr(e),a=Kr(t),c=s?bm:_a(e),l=a?bm:_a(t);c=c==vm?sc:c,l=l==vm?sc:l;var u=c==sc,d=l==sc,p=c==l;if(p&&rl(e)){if(!rl(t))return!1;s=!0,u=!1}if(p&&!u)return o||(o=new Xn),s||Iw(e)?zw(e,t,r,n,i,o):WD(e,t,c,r,n,i,o);if(!(r&JD)){var y=u&&ym.call(e,"__wrapped__"),x=d&&ym.call(t,"__wrapped__");if(y||x){var b=y?e.value():e,M=x?t.value():t;return o||(o=new Xn),i(b,M,r,n,o)}}return p?(o||(o=new Xn),XD(e,t,r,n,i,o)):!1}function iu(e,t,r,n,i){return e===t?!0:e==null||t==null||!ro(e)&&!ro(t)?e!==e&&t!==t:QD(e,t,r,n,iu,i)}var eL=1,tL=2;function rL(e,t,r,n){var i=r.length,o=i,s=!n;if(e==null)return!o;for(e=Object(e);i--;){var a=r[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=r[i];var c=a[0],l=e[c],u=a[1];if(s&&a[2]){if(l===void 0&&!(c in e))return!1}else{var d=new Xn;if(n)var p=n(l,u,c,e,t,d);if(!(p===void 0?iu(u,l,eL|tL,n,d):p))return!1}}return!0}function qw(e){return e===e&&!Ds(e)}function nL(e){for(var t=za(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,qw(i)]}return t}function Hw(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function iL(e){var t=nL(e);return t.length==1&&t[0][2]?Hw(t[0][0],t[0][1]):function(r){return r===e||rL(r,e,t)}}function oL(e,t){return e!=null&&t in Object(e)}function sL(e,t,r){t=Pw(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var s=nu(t[n]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&H0(i)&&Sw(s,i)&&(Kr(e)||Tw(e)))}function aL(e,t){return e!=null&&sL(e,t,oL)}var cL=1,lL=2;function uL(e,t){return K0(e)&&qw(t)?Hw(nu(e),t):function(r){var n=Dk(r,e);return n===void 0&&n===t?aL(r,e):iu(t,n,cL|lL)}}function fL(e){return function(t){return t==null?void 0:t[e]}}function dL(e){return function(t){return X0(t,e)}}function hL(e){return K0(e)?fL(nu(e)):dL(e)}function Ww(e){return typeof e=="function"?e:e==null?ww:typeof e=="object"?Kr(e)?uL(e[0],e[1]):iL(e):hL(e)}function pL(e){return function(t,r,n){for(var i=-1,o=Object(t),s=n(t),a=s.length;a--;){var c=s[e?a:++i];if(r(o[c],c,o)===!1)break}return t}}var mL=pL();const gL=mL;function vL(e,t){return e&&gL(e,t,za)}function bL(e,t){return function(r,n){if(r==null)return r;if(!Ql(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Object(r);(t?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var yL=bL(vL);const Gw=yL;function wL(e,t){var r=[];return Gw(e,function(n,i,o){t(n,i,o)&&r.push(n)}),r}function xL(e,t){var r=Kr(e)?Dw:wL;return r(e,Ww(t))}function SL(e,t){var r=-1,n=Ql(e)?Array(e.length):[];return Gw(e,function(i,o,s){n[++r]=t(i,o,s)}),n}function _L(e,t){return iu(e,t)}function EL(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}function CL(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,o=wa(e),s=t!==void 0,a=t===null,c=t===t,l=wa(t);if(!a&&!l&&!o&&e>t||o&&s&&c&&!a&&!l||n&&s&&c||!r&&c||!i)return 1;if(!n&&!o&&!l&&e<t||l&&r&&i&&!n&&!o||a&&r&&i||!s&&i||!c)return-1}return 0}function TL(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;++n<s;){var c=CL(i[n],o[n]);if(c){if(n>=a)return c;var l=r[n];return c*(l=="desc"?-1:1)}}return e.index-t.index}function AL(e,t,r){t.length?t=_c(t,function(o){return Kr(o)?function(s){return X0(s,o.length===1?o[0]:o)}:o}):t=[ww];var n=-1;t=_c(t,eu(Ww));var i=SL(e,function(o,s,a){var c=_c(t,function(l){return l(o)});return{criteria:c,index:++n,value:o}});return EL(i,function(o,s){return TL(o,s,r)})}function ML(e,t,r,n){return e==null?[]:(Kr(t)||(t=t==null?[]:[t]),r=n?void 0:r,Kr(r)||(r=r==null?[]:[r]),AL(e,t,r))}function IL({toBack:e,onSubmitClick:t,data:r}){const{fromCoin:n,toCoin:i}=nn(),o=ie.useRef(!1),{slippage:s}=Fr(),[a,c]=ie.useState(r),{fromAmountUi:l,toAmountUi:u,byAmountIn:d}=a,{amountLimit:p}=lw(s,a),{showPriceImpactTips:y,showPriceImpactWarn:x}=hw(n,i,l,u),{priceAcceptRouterData:b}=GO(a),[M,R]=ie.useState(!1),[P,k]=ie.useState(!1);ie.useMemo(()=>d?i:n,[d]);const F=ie.useMemo(()=>b!==void 0,[b]),B=()=>{if(b){if(o.current)return;o.current=!0;const z=_D(b);c(z),setTimeout(()=>{o.current=!1},300)}},W=ie.useMemo(()=>M?!1:!!x,[M,x]);return w.jsxs("div",{className:"secondary-dialog",children:[w.jsx(z0,{title:"Review your order",backClick:e}),w.jsxs("div",{className:"secondary-content",children:[w.jsxs("div",{className:"trade-info",children:[w.jsxs("div",{className:"amount-info",children:[w.jsx("span",{className:"amount",children:bs(l||"")}),w.jsx("img",{src:n==null?void 0:n.logo_url}),w.jsx("span",{className:"symbol",children:dn((n==null?void 0:n.symbol)||"")})]}),w.jsx("div",{className:"dividing-line",children:w.jsx("div",{className:"swap-icon",children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-trade"})})})}),w.jsxs("div",{className:"amount-info",children:[w.jsx("span",{className:"amount",children:bs(u||"")}),w.jsx("img",{src:i==null?void 0:i.logo_url}),w.jsx("span",{className:"symbol",children:dn((i==null?void 0:i.symbol)||"")})]})]}),w.jsxs("div",{className:"current-price-tips-box yellow",style:{fontSize:"12px",marginTop:"8px",flexDirection:"column",justifyContent:"start",gap:"10px"},children:[w.jsx("div",{className:"current-price-box",style:{backgroundColor:"#1b242c",marginTop:"-1px"},children:w.jsx(V0,{baseToken:n,quoteToken:i,baseAmount:l||"0",quoteAmount:u||"0",loading:!1})}),y&&w.jsx("div",{style:{paddingBottom:"10px",color:"var(--cs-warning)"},children:"High price difference. Be cautious before submitting your order."})]}),w.jsxs("div",{className:"swap-info-between",children:[w.jsx("div",{className:"left",children:"Slippage Tolerance"}),w.jsxs("div",{className:"right",children:[s,"%"]})]}),w.jsx(gw,{pl:"0px",pr:"0px",isLoading:!1,amountLimit:p}),w.jsx(mw,{isLoading:!1,routerData:a,noTips:!0}),x&&w.jsxs("div",{style:{width:"100%",marginTop:"8px",gap:"1px"},children:[w.jsx("div",{style:{width:"100%",gap:"8px",fontSize:"12px",backgroundColor:"var(--cs-error-10)",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderRadius:"12px",color:"#ff5073"},children:"The exchange rate of this order deviates from the market price by a large percentage. Are you sure you want to continue the swap?"}),w.jsxs("div",{style:{width:"100%",gap:"16px",display:"flex",flexDirection:"row",marginTop:"-10px"},children:[w.jsx("button",{className:"swap-btn cs-outline-btn secondary-btn",style:{fontSize:"14px",height:"42px",flex:1,color:M?"#72c1f7":"#7F98A7"},onClick:()=>{R(!0)},children:"Yes, please continue."}),w.jsx("button",{className:"swap-btn cs-outline-btn secondary-btn",style:{fontSize:"14px",height:"42px",color:"#7F98A7",flex:1},onClick:()=>e(),children:"No,cancel it."})]})]})]}),!F&&w.jsx("button",{disabled:W||P,className:"swap-btn cs-solid-btn",style:{marginTop:"8px"},onClick:()=>{P||(k(!0),t(a))},children:P?w.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:w.jsx(dw,{})}):"Confirm Swap"}),F&&w.jsxs("div",{className:"price-update",children:[w.jsxs("div",{className:"left",children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-alert"})}),w.jsx("span",{children:"Price update"})]}),w.jsx("div",{className:"right",children:w.jsx("button",{className:"cs-solid-btn",onClick:B,children:"Accept"})})]})]})}function ou(e){const{text:t,type:r}=e,[n,i]=ie.useState(!1),{addCommonToast:o}=ks(),s=a=>{n||(Ol(a),iw(t,{debug:!1,message:"message"}),o("Copied"),i(!n))};return ie.useEffect(()=>{n&&setTimeout(()=>{i(!1)},2e3)},[n]),w.jsx(w.Fragment,{children:r==="btn"?w.jsxs("div",{className:"copy-btn",onClick:s,children:[w.jsx("svg",{className:"cs-icon cs-copy-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:n?"#icon-sel":"#icon-copy"})}),w.jsx("span",{children:"Copy"})]}):w.jsx("svg",{className:"cs-icon cs-copy-icon","aria-hidden":"true",onClick:s,children:w.jsx("use",{xlinkHref:n?"#icon-sel":"#icon-copy"})})})}function RL({toBack:e,data:t,isLoading:r}){const{fromCoin:n,toCoin:i,fromAmount:o,toAmount:s}=nn(),{getTokenInfo:a}=ao(),c=ie.useMemo(()=>{var l;return(l=t==null?void 0:t.routers)==null?void 0:l.map(u=>({...u,paths:u.paths.map(d=>({...d,fromToken:a(d.from_type),toToken:a(d.to_type)}))}))},[t]);return w.jsxs("div",{className:"route-dialog",children:[w.jsx(z0,{title:"Route",backClick:e}),w.jsxs("div",{className:"route-dialog-content",children:[w.jsx("div",{className:"simple-router-box",children:w.jsx(Kw,{hasSubMenu:!1,isLoading:r,formatSwapRouter:t})}),w.jsxs("div",{className:"center",style:{flexDirection:"column",gap:"0px"},children:[w.jsxs("div",{className:"center",style:{gap:"4px",marginTop:"16px"},children:[w.jsx(Gr,{src:n==null?void 0:n.logo_url,style:{width:"26px",height:"26px",borderRadius:"100%"}}),w.jsx("span",{className:"amount",children:Pr(o,n==null?void 0:n.decimals)}),w.jsx("span",{className:"symbol",children:n==null?void 0:n.symbol})]}),w.jsx("div",{className:"route-box-h5 center",children:w.jsx("div",{style:{width:"100%",gap:"32px",border:"1px dashed #2a3238",borderRadius:"8px",display:"flex",flexDirection:"column",paddingTop:"20px",paddingBottom:"20px",overflowY:"auto",maxHeight:"280px",position:"relative"},children:c==null?void 0:c.map((l,u)=>w.jsxs("div",{className:"route-item-box-h5",children:[w.jsxs("div",{className:"percent",children:[Be(l.percentage).mul(100).toString(),"%"]}),w.jsx("div",{className:l.paths.length>1?"route-two-h5":"",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},children:l.paths.map(d=>w.jsx("div",{className:"route-path-item",children:w.jsx(pw,{autoSwitchTooltip:!0,position:"bottom",content:w.jsxs("div",{className:"router-pool-tip-con",style:{display:"flex",flexDirection:"column",minWidth:"190px"},children:[w.jsx(PL,{poolAddress:d.pool_address}),w.jsx(wm,{token:d.fromToken}),w.jsx(wm,{token:d.toToken})]}),children:w.jsx(OL,{path:d})})},d.to_type))})]},u))})}),w.jsxs("div",{className:"center",style:{gap:"4px"},children:[w.jsx(Gr,{src:i==null?void 0:i.logo_url,style:{width:"26px",height:"26px",borderRadius:"100%"}}),w.jsx("span",{className:"amount",children:Pr(s,i==null?void 0:i.decimals)}),w.jsx("span",{className:"symbol",children:i==null?void 0:i.symbol})]})]})]})]})}function OL({path:e}){var t,r,n;return w.jsxs("div",{role:"button",style:{display:"flex",flexDirection:"row",gap:"0px",zIndex:3},children:[w.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[w.jsx(Gr,{src:(t=e.fromToken)==null?void 0:t.logo_url,style:{width:"24px",height:"24px",borderRadius:"100%"}}),w.jsx(Gr,{src:(r=e.toToken)==null?void 0:r.logo_url,style:{width:"24px",height:"24px",borderRadius:"100%"}})]}),w.jsxs("span",{className:"provider",children:[(n=wb[e.provider])==null?void 0:n.name," "]}),!!+e.fee_rate&&w.jsxs("div",{className:"fee-tier",children:[" ",Be(e.fee_rate).mul(100).toString(),"%"]})]})}function wm({token:e}){const{getExplorerUrl:t}=As();return w.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",height:"40px",fontSize:"12px",gap:"12px"},children:[w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexShrink:0},children:[w.jsx(Gr,{src:e==null?void 0:e.logo_url,style:{width:"20px",height:"20px",borderRadius:"100%"}}),w.jsx("span",{style:{color:"#fff",fontSize:"12px"},children:dn((e==null?void 0:e.symbol)||"")})]}),w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[w.jsx("a",{onClick:Ol,href:t(e==null?void 0:e.coin_type,"coin"),target:"_blank",style:{textDecoration:"none",color:"#909ca4"},children:Po(e==null?void 0:e.coin_type)}),w.jsx(ou,{text:(e==null?void 0:e.coin_type)||""})]})]})}function PL({poolAddress:e}){const{getExplorerUrl:t}=As();return w.jsxs(w.Fragment,{children:[e&&w.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",fontSize:"12px",gap:"12px"},children:[w.jsx("span",{style:{color:"fff",fontSize:"12px"},children:"Pool"}),w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[w.jsx("a",{style:{color:"#fff",textDecoration:"none"},onClick:Ol,href:t(e,"poolAddress"),target:"_blank",children:Po(e)}),w.jsx(ou,{text:e})]})]}),e&&w.jsx("div",{style:{width:"100%",height:"1px",marginTop:"12px",backgroundColor:"var(--cs-border)"}})]})}function Kw({hasSubMenu:e,isLoading:t,formatSwapRouter:r}){var d;const[n,i]=ie.useState(!1),{isApp:o}=Xl(),{fetchTokenInfo:s}=ao(),a=ie.useMemo(()=>(r==null?void 0:r.routers.length)===1,[r==null?void 0:r.routers.length]),[c,l]=ie.useState(""),u=async()=>{var b,M;const p=[],y=((M=(b=r==null?void 0:r.routers)==null?void 0:b[0])==null?void 0:M.paths)||[];for(let R=0;R<y.length;R++){const P=y[R],k=await s(P==null?void 0:P.to_type);if(R===0){const F=await s(P==null?void 0:P.from_type);p.push(`${F==null?void 0:F.symbol} > ${k==null?void 0:k.symbol}`)}else p.push(k==null?void 0:k.symbol)}const x=p.join(" > ");l(x)};return ie.useEffect(()=>{a&&u()},[a]),w.jsxs("div",{className:"simple-router-block",style:{paddingLeft:e?"8px":"0px",paddingRight:e?"8px":"0px"},children:[w.jsx("div",{className:"left",style:{whiteSpace:"nowrap",color:e?"var(--cs-text-con)":"#fff",paddingRight:"8px"},children:e?"Auto Router":"Route"}),t?w.jsx(Ns,{style:{width:"80px",height:"18px"}}):w.jsxs("div",{className:"right",onClick:()=>{i(!0)},children:[w.jsx("span",{style:{textAlign:"right",color:"#fff"},children:a?c:r==null?void 0:r.router_summery}),w.jsxs("div",{className:"providers",children:[(d=r==null?void 0:r.providers)==null?void 0:d.map((p,y)=>{var x;return o?w.jsx(Gr,{src:sr[p],style:{width:"16px",height:"16px"}}):w.jsx(Jl,{content:w.jsx("div",{children:((x=wb[p])==null?void 0:x.name)||p}),position:"top",delay:300,children:w.jsx(Gr,{src:sr[p],style:{width:"16px",height:"16px"}})},p)}),e&&w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{width:"16px",height:"16px",flexShrink:0},children:w.jsx("use",{xlinkHref:"#icon-spread"})})]})]}),n&&e&&w.jsx(RL,{data:r,isLoading:t,toBack:()=>i(!1)})]})}const qa=Oi((e,t)=>({currentTypeTab:"Default",setCurrentTypeTab:r=>{e(()=>({currentTypeTab:r}))},currentPlatformTab:"All",setCurrentPlatformTab:r=>{e(()=>({currentPlatformTab:r}))},platformList:["All","Wormhole"],setPlatformList:r=>{e(()=>({platformList:r}))},isOpenImportDialog:!1,setIsOpenImportDialog:r=>{e(()=>({isOpenImportDialog:r}))},collectTokenMap:new Map,setCollectTokenMap:(r,n=!1)=>{e(()=>({collectTokenMap:r})),n||Si.setItem(gb,r)},showTokenList:[],setShowTokenList:r=>{e(()=>({showTokenList:[...r]}))},combineTokenList:[],setComBineTokenList:r=>{e(()=>({combineTokenList:r}))},currentImportTokenData:void 0,setCurrentImportTokenData:r=>{e(()=>({currentImportTokenData:r}))},importTokenList:[],importTokenIsLoading:!1,setImportToken:(r,n)=>{const{importTokenList:i,setImportTokenList:o}=t();let s=i;if(n)s=[r,...s];else{const a=tp(r.coin_type);s=i.filter(c=>tp(c.coin_type)!==a)}return o(s),Si.setItem(vb,s),s},setImportTokenList:r=>{e(()=>({importTokenList:r}))},setImportTokenIsLoading:r=>{e(()=>({importTokenIsLoading:r}))},searchInput:"",setSearchInput:r=>{e(()=>({searchInput:r}))},showTokenListIsLoading:!1,setShowTokenListIsLoading:r=>{e(()=>({showTokenListIsLoading:r}))}}));Si.getItem(gb).then(e=>{e!==null&&qa.getState().setCollectTokenMap(e,!0)});Si.getItem(vb).then(e=>{e&&qa.getState().setImportTokenList(e)});function Yw(){const{setCollectTokenMap:e,collectTokenMap:t}=qa(),r=i=>{const o=new Map(t);o.get(i.coin_type)?o.delete(i.coin_type):o.set(i.coin_type,i),e(o)},n=ie.useCallback(i=>t.get(i.coin_type)!==void 0,[t]);return{handleCollectToken:r,isCollectToken:n,collectTokenMap:t}}function NL(e){const{trustedTokenList:t}=Va(),{tokenBalanceObj:r,currentAccount:n}=Yr(),{coinPriceObj:i}=sw(),{getTokenAmountValue:o}=$a(),{fetchTokenInfo:s}=ao(),{currentTypeTab:a,showTokenList:c,setShowTokenList:l,combineTokenList:u,importTokenList:d,setComBineTokenList:p,setImportToken:y,setCurrentImportTokenData:x,setImportTokenIsLoading:b,currentImportTokenData:M,searchInput:R,setSearchInput:P,importTokenIsLoading:k,showTokenListIsLoading:F,setCurrentTypeTab:B,setCurrentPlatformTab:W}=qa(),[z,G]=ie.useState(!1);ie.useEffect(()=>{t&&(t==null?void 0:t.length)>0&&G(!0)},[t]);const[re,oe]=ie.useState(!1);ie.useEffect(()=>{up(i)||oe(!0)},[i]);const se=ie.useRef({}),[q,L]=ie.useState(!1);ie.useEffect(()=>{(!up(r)||!a0(se.current,r))&&(se.current=r,L(!0))},[r]);const h=ie.useMemo(()=>(d==null?void 0:d.length)>1?d==null?void 0:d.map(Q=>{const Z=Sc(r==null?void 0:r[Q==null?void 0:Q.coin_type],Q),ce=Z==null?void 0:Z.totalBalanceFormat,be=Be(ce).gt("0")?o(Q==null?void 0:Q.coin_type,ce):"0";return{...Q,balance:ce,rate:be}}):d,[d,r,i]),f=(Q,Z)=>{const ce=Z&&Z.toLocaleLowerCase().trim(),be=Q.map(pe=>{let Le=0,Ae=0;pe.symbol.toLowerCase()===ce||pe.name.toLowerCase()===ce||pe.coin_type.toLowerCase()===ce?(Le=1e3,Ae=2):pe.symbol.toLowerCase().indexOf(ce)>-1?(Le=100,Ae=0):pe.name.toLowerCase().indexOf(ce)>-1?(Le=10,Ae=0):pe.coin_type.toLowerCase().indexOf(ce)>-1?(Le=1,Ae=0):pe.coin_type.toLowerCase()=="0x2::sui::sui"&&(Ae=1);let Je=Array.isArray(pe==null?void 0:pe.coin_priority)?Number(pe.coin_priority[0])||0:Number(pe==null?void 0:pe.coin_priority)||0;return e===pe.coin_type&&!Z&&(Ae=12,Le=1e3,Je=1e4),{...pe,mark:Le,sort:Ae,coin_priority_sort:Je,rateNumber:Number((pe==null?void 0:pe.rate)||"0"),balanceNumber:Number((pe==null?void 0:pe.balance)||"0")}});return ML(be,[pe=>!Z&&e===pe.coin_type?1:0,"rateNumber","balanceNumber","sort","mark","coin_priority_sort"],["desc","desc","desc","desc","desc","desc"])},m=(Q,Z=!1)=>{const ce=Z?Q.trim():Q.toLowerCase().trim(),be=["symbol","name","coin_type"];return xL(ce.length===0?u:[...u,...h],pe=>be.some(Le=>{const Ae=pe[Le];if(typeof Ae=="string"){const Je=Z?Ae:Ae.toLowerCase();return Le==="coin_type"?Je.includes(ce)||Ti(Je,!0).includes(Ti(ce,!0)):Je.includes(ce)}return!1}))},S=Q=>{Q||x(void 0);const Z=m(Q);if((Z==null?void 0:Z.length)===0){T(Q);return}else{const ce=f(Z,Q);l(ce)}},T=async Q=>{b(!0);try{if(pb(Q)){const Z=Q.trim(),ce=Nr(Z).full_address,be=await s(ce);if(!be){l([]);return}const xe=Sc(r==null?void 0:r[ce],be),pe=(xe==null?void 0:xe.totalBalanceFormat)||"0",Le=Be(pe).gt("0")?o(Z,pe):"0",Ae={...be,balance:pe,rate:Le};l([Ae]),x(Ae)}else{l([]);return}}catch{x(void 0),l([]);return}finally{b(!1)}},E=Q=>{if(Q==="Default")g("All"),W("All");else{const Z=f(h,R);l(Z)}},I=()=>{if(M){const Q=y(M,!0),Z=f(Q,R);l(Z),x(void 0),P("")}},C=Q=>{const Z=y(Q,!1),ce=f(Z,R);l(ce)},g=Q=>{const Z=Q==="All"?[...u]:u.filter(be=>Q=="Native"?!be.labels||be.labels.length==0||be.labels=="Native":be.labels&&be.labels.length>0&&be.labels[0].toLowerCase()==Q.toLowerCase()),ce=f(Z,R);l(ce)};ie.useEffect(()=>{if(!z||!(t!=null&&t.length)){p([]);return}if(!(n!=null&&n.address))p(t);else if(n!=null&&n.address){const Q=[];for(const Z of t){const ce=r==null?void 0:r[Z==null?void 0:Z.coin_type],be=Sc(ce,Z),xe=(be==null?void 0:be.totalBalanceFormat)||"0",pe=(be==null?void 0:be.displayBalance)||"0",Le=Be(xe).gt("0")?o(Z==null?void 0:Z.coin_type,xe):"0";Q.push({...Z,balance:pe,rate:Pr(Le,4,!0)})}p(Q)}},[z,re,q,n==null?void 0:n.address,i]);const v=ie.useRef([]);ie.useEffect(()=>{if((u==null?void 0:u.length)>0&&!_L(v.current,u)){v.current=u;const Q=f(u);e?h.find(ce=>ce.coin_type===e)!==void 0||a!=="Default"?(B("Imported"),E("Imported")):l(M?[M]:Q):l(Q)}},[u,e]);const j=ie.useMemo(()=>{if(a==="Default"){if(!F&&(c==null?void 0:c.length)===0)return!0}else if((c==null?void 0:c.length)===0&&!k)return!0;return!1},[R,c,M,k,F]);return{showTokenList:c,handleSearch:S,handleChangePlatform:g,currentImportTokenData:M,handleChangeType:E,handleImportClick:I,handleDeleteImportClick:C,isNoData:j}}function kL({tokenList:e,onHandleTokenAction:t}){return w.jsx("div",{className:"token-collect-list",children:e.map(r=>w.jsx(jL,{token:r,onHandleTokenAction:t},r.coin_type))})}function jL({token:e,onHandleTokenAction:t}){return w.jsxs("div",{className:"token-collect-item",onClick:()=>{t(e,"select_token")},children:[w.jsx("img",{src:e.logo_url,style:{marginRight:"8px"}}),w.jsx("span",{children:e.symbol}),w.jsx("i",{children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",onClick:r=>{r.stopPropagation(),t(e,"un_collect")},children:w.jsx("use",{xlinkHref:"#icon-close"})})})]})}const DL=Ot("/images/img_no_data@2x.png");function LL(e){const{img:t=DL,text:r,width:n="100%",height:i="auto",padding:o="20px",subItem:s}=e;return w.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:n,height:i,padding:o,boxSizing:"border-box",textAlign:"center"},children:[t&&w.jsx("img",{src:t,alt:"No Data",style:{width:"160px",height:"160px"}}),r&&w.jsx("div",{style:{color:"#fff",fontSize:"14px"},children:r}),s&&s]})}function BL({tabList:e,currentTab:t,changeTab:r}){return w.jsx("div",{className:"platform-tabs",children:e.map(n=>w.jsx("div",{className:t===n?"platform-tab-item active":"platform-tab-item",onClick:()=>{r(n)},children:n},n))})}var xm=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function UL(e,t){return!!(e===t||xm(e)&&xm(t))}function FL(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!UL(e[r],t[r]))return!1;return!0}function $L(e,t){t===void 0&&(t=FL);var r=null;function n(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(r&&r.lastThis===this&&t(i,r.lastArgs))return r.lastResult;var s=e.apply(this,i);return r={lastResult:s,lastArgs:i,lastThis:this},s}return n.clear=function(){r=null},n}function ad(){return ad=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ad.apply(null,arguments)}function Sm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cd(e,t){return cd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},cd(e,t)}function VL(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,cd(e,t)}var _m=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function zL(e,t){return!!(e===t||_m(e)&&_m(t))}function qL(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!zL(e[r],t[r]))return!1;return!0}function of(e,t){t===void 0&&(t=qL);var r,n=[],i,o=!1;function s(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return o&&r===this&&t(a,n)||(i=e.apply(this,a),o=!0,r=this,n=a),i}return s}function Em(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var HL=typeof performance=="object"&&typeof performance.now=="function",Cm=HL?function(){return performance.now()}:function(){return Date.now()};function Tm(e){cancelAnimationFrame(e.id)}function WL(e,t){var r=Cm();function n(){Cm()-r>=t?e.call(null):i.id=requestAnimationFrame(n)}var i={id:requestAnimationFrame(n)};return i}var sf=-1;function Am(e){if(e===void 0&&(e=!1),sf===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),sf=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return sf}var Qo=null;function Mm(e){if(e===void 0&&(e=!1),Qo===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?Qo="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Qo="negative":Qo="positive-ascending"),document.body.removeChild(t),Qo}return Qo}In.env.NODE_ENV;var GL=150,KL=function(t,r){return t},Cc=null,Tc=null;In.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Cc=new WeakSet,Tc=new WeakSet);function YL(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,i=e.getItemSize,o=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,c=e.initInstanceProps,l=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(d){VL(p,d);function p(x){var b;return b=d.call(this,x)||this,b._instanceProps=c(b.props,Sm(b)),b._outerRef=void 0,b._resetIsScrollingTimeoutId=null,b.state={instance:Sm(b),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof b.props.initialScrollOffset=="number"?b.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},b._callOnItemsRendered=void 0,b._callOnItemsRendered=of(function(M,R,P,k){return b.props.onItemsRendered({overscanStartIndex:M,overscanStopIndex:R,visibleStartIndex:P,visibleStopIndex:k})}),b._callOnScroll=void 0,b._callOnScroll=of(function(M,R,P){return b.props.onScroll({scrollDirection:M,scrollOffset:R,scrollUpdateWasRequested:P})}),b._getItemStyle=void 0,b._getItemStyle=function(M){var R=b.props,P=R.direction,k=R.itemSize,F=R.layout,B=b._getItemStyleCache(l&&k,l&&F,l&&P),W;if(B.hasOwnProperty(M))W=B[M];else{var z=r(b.props,M,b._instanceProps),G=i(b.props,M,b._instanceProps),re=P==="horizontal"||F==="horizontal",oe=P==="rtl",se=re?z:0;B[M]=W={position:"absolute",left:oe?void 0:se,right:oe?se:void 0,top:re?0:z,height:re?"100%":G,width:re?G:"100%"}}return W},b._getItemStyleCache=void 0,b._getItemStyleCache=of(function(M,R,P){return{}}),b._onScrollHorizontal=function(M){var R=M.currentTarget,P=R.clientWidth,k=R.scrollLeft,F=R.scrollWidth;b.setState(function(B){if(B.scrollOffset===k)return null;var W=b.props.direction,z=k;if(W==="rtl")switch(Mm()){case"negative":z=-k;break;case"positive-descending":z=F-P-k;break}return z=Math.max(0,Math.min(z,F-P)),{isScrolling:!0,scrollDirection:B.scrollOffset<z?"forward":"backward",scrollOffset:z,scrollUpdateWasRequested:!1}},b._resetIsScrollingDebounced)},b._onScrollVertical=function(M){var R=M.currentTarget,P=R.clientHeight,k=R.scrollHeight,F=R.scrollTop;b.setState(function(B){if(B.scrollOffset===F)return null;var W=Math.max(0,Math.min(F,k-P));return{isScrolling:!0,scrollDirection:B.scrollOffset<W?"forward":"backward",scrollOffset:W,scrollUpdateWasRequested:!1}},b._resetIsScrollingDebounced)},b._outerRefSetter=function(M){var R=b.props.outerRef;b._outerRef=M,typeof R=="function"?R(M):R!=null&&typeof R=="object"&&R.hasOwnProperty("current")&&(R.current=M)},b._resetIsScrollingDebounced=function(){b._resetIsScrollingTimeoutId!==null&&Tm(b._resetIsScrollingTimeoutId),b._resetIsScrollingTimeoutId=WL(b._resetIsScrolling,GL)},b._resetIsScrolling=function(){b._resetIsScrollingTimeoutId=null,b.setState({isScrolling:!1},function(){b._getItemStyleCache(-1,null)})},b}p.getDerivedStateFromProps=function(b,M){return XL(b,M),u(b),null};var y=p.prototype;return y.scrollTo=function(b){b=Math.max(0,b),this.setState(function(M){return M.scrollOffset===b?null:{scrollDirection:M.scrollOffset<b?"forward":"backward",scrollOffset:b,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},y.scrollToItem=function(b,M){M===void 0&&(M="auto");var R=this.props,P=R.itemCount,k=R.layout,F=this.state.scrollOffset;b=Math.max(0,Math.min(b,P-1));var B=0;if(this._outerRef){var W=this._outerRef;k==="vertical"?B=W.scrollWidth>W.clientWidth?Am():0:B=W.scrollHeight>W.clientHeight?Am():0}this.scrollTo(o(this.props,b,M,F,this._instanceProps,B))},y.componentDidMount=function(){var b=this.props,M=b.direction,R=b.initialScrollOffset,P=b.layout;if(typeof R=="number"&&this._outerRef!=null){var k=this._outerRef;M==="horizontal"||P==="horizontal"?k.scrollLeft=R:k.scrollTop=R}this._callPropsCallbacks()},y.componentDidUpdate=function(){var b=this.props,M=b.direction,R=b.layout,P=this.state,k=P.scrollOffset,F=P.scrollUpdateWasRequested;if(F&&this._outerRef!=null){var B=this._outerRef;if(M==="horizontal"||R==="horizontal")if(M==="rtl")switch(Mm()){case"negative":B.scrollLeft=-k;break;case"positive-ascending":B.scrollLeft=k;break;default:var W=B.clientWidth,z=B.scrollWidth;B.scrollLeft=z-W-k;break}else B.scrollLeft=k;else B.scrollTop=k}this._callPropsCallbacks()},y.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Tm(this._resetIsScrollingTimeoutId)},y.render=function(){var b=this.props,M=b.children,R=b.className,P=b.direction,k=b.height,F=b.innerRef,B=b.innerElementType,W=b.innerTagName,z=b.itemCount,G=b.itemData,re=b.itemKey,oe=re===void 0?KL:re,se=b.layout,q=b.outerElementType,L=b.outerTagName,h=b.style,f=b.useIsScrolling,m=b.width,S=this.state.isScrolling,T=P==="horizontal"||se==="horizontal",E=T?this._onScrollHorizontal:this._onScrollVertical,I=this._getRangeToRender(),C=I[0],g=I[1],v=[];if(z>0)for(var j=C;j<=g;j++)v.push(ie.createElement(M,{data:G,key:oe(j,G),index:j,isScrolling:f?S:void 0,style:this._getItemStyle(j)}));var Q=n(this.props,this._instanceProps);return ie.createElement(q||L||"div",{className:R,onScroll:E,ref:this._outerRefSetter,style:ad({position:"relative",height:k,width:m,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:P},h)},ie.createElement(B||W||"div",{children:v,ref:F,style:{height:T?"100%":Q,pointerEvents:S?"none":void 0,width:T?Q:"100%"}}))},y._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var b=this.props.itemCount;if(b>0){var M=this._getRangeToRender(),R=M[0],P=M[1],k=M[2],F=M[3];this._callOnItemsRendered(R,P,k,F)}}if(typeof this.props.onScroll=="function"){var B=this.state,W=B.scrollDirection,z=B.scrollOffset,G=B.scrollUpdateWasRequested;this._callOnScroll(W,z,G)}},y._getRangeToRender=function(){var b=this.props,M=b.itemCount,R=b.overscanCount,P=this.state,k=P.isScrolling,F=P.scrollDirection,B=P.scrollOffset;if(M===0)return[0,0,0,0];var W=s(this.props,B,this._instanceProps),z=a(this.props,W,B,this._instanceProps),G=!k||F==="backward"?Math.max(1,R):1,re=!k||F==="forward"?Math.max(1,R):1;return[Math.max(0,W-G),Math.max(0,Math.min(M-1,z+re)),W,z]},p}(ie.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var XL=function(t,r){var n=t.children,i=t.direction,o=t.height,s=t.layout,a=t.innerTagName,c=t.outerTagName,l=t.width,u=r.instance;if(In.env.NODE_ENV!=="production"){(a!=null||c!=null)&&Tc&&!Tc.has(u)&&(Tc.add(u),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var d=i==="horizontal"||s==="horizontal";switch(i){case"horizontal":case"vertical":Cc&&!Cc.has(u)&&(Cc.add(u),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+i+'" was specified.'))}switch(s){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+s+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(d&&typeof l!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(l===null?"null":typeof l)+'" was specified.'));if(!d&&typeof o!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(o===null?"null":typeof o)+'" was specified.'))}},JL=YL({getItemOffset:function(t,r){var n=t.itemSize;return r*n},getItemSize:function(t,r){var n=t.itemSize;return n},getEstimatedTotalSize:function(t){var r=t.itemCount,n=t.itemSize;return n*r},getOffsetForIndexAndAlignment:function(t,r,n,i,o,s){var a=t.direction,c=t.height,l=t.itemCount,u=t.itemSize,d=t.layout,p=t.width,y=a==="horizontal"||d==="horizontal",x=y?p:c,b=Math.max(0,l*u-x),M=Math.min(b,r*u),R=Math.max(0,r*u-x+u+s);switch(n==="smart"&&(i>=R-x&&i<=M+x?n="auto":n="center"),n){case"start":return M;case"end":return R;case"center":{var P=Math.round(R+(M-R)/2);return P<Math.ceil(x/2)?0:P>b+Math.floor(x/2)?b:P}case"auto":default:return i>=R&&i<=M?i:i<R?R:M}},getStartIndexForOffset:function(t,r){var n=t.itemCount,i=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/i)))},getStopIndexForStartIndex:function(t,r,n){var i=t.direction,o=t.height,s=t.itemCount,a=t.itemSize,c=t.layout,l=t.width,u=i==="horizontal"||c==="horizontal",d=r*a,p=u?l:o,y=Math.ceil((p+n-d)/a);return Math.max(0,Math.min(s-1,r+y-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(In.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function Im(e,t){for(var r in e)if(!(r in t))return!0;for(var n in t)if(e[n]!==t[n])return!0;return!1}var ZL=["style"],QL=["style"];function eB(e,t){var r=e.style,n=Em(e,ZL),i=t.style,o=Em(t,QL);return!Im(r,i)&&!Im(n,o)}const tB=ie.memo(({data:e,index:t,style:r})=>{const{items:n,onHandleTokenAction:i,showCollect:o,showDelete:s}=e,a=n[t];return w.jsx("div",{style:r,children:w.jsx(iB,{data:a,onHandleTokenAction:i,showCollect:o,showDelete:s})})},eB),rB=$L((e,t,r,n)=>({items:e,onHandleTokenAction:t,showCollect:r,showDelete:n}));function nB({showTokenList:e,onHandleTokenAction:t,showCollect:r=!0,showDelete:n=!1}){const i=ie.useRef(null);ie.useEffect(()=>{i.current&&i.current.scrollTo(0)},[e.length]);const o=rB(e,t,r,n);return w.jsx("div",{className:"token-list",children:w.jsx(JL,{ref:i,style:{overflowY:"scroll",scrollbarWidth:"none",msOverflowStyle:"none",padding:"8px"},height:360,itemCount:e.length,itemData:o,itemSize:72,width:"100%",children:tB})})}function iB({data:e,showCollect:t,showDelete:r,onHandleTokenAction:n}){const{isCollectToken:i}=Yw(),{getExplorerUrl:o}=As();return $a(),w.jsxs("div",{className:"token-list-item",onClick:s=>{t&&(s.stopPropagation(),n(e,"select_token"))},children:[w.jsx(Gr,{className:"token-img",src:e==null?void 0:e.logo_url,showWarn:!t}),w.jsxs("div",{className:"token-info",children:[w.jsx("h4",{className:"token-symbol",children:w.jsx("span",{children:dn(e.symbol)})}),w.jsx("p",{className:"token-name",children:dn(e==null?void 0:e.name,20)}),w.jsxs("div",{className:"copy",children:[w.jsx("a",{onClick:Ol,href:o(e==null?void 0:e.coin_type,"coin"),target:"_blank",style:{fontSize:"12px"},children:Po(e==null?void 0:e.coin_type)}),w.jsx(ou,{text:e==null?void 0:e.coin_type})]})]}),w.jsxs("div",{className:"token-balance",children:[w.jsxs("div",{className:"balance",children:[w.jsx("h4",{children:e==null?void 0:e.balance}),w.jsx("p",{children:e!=null&&e.rate?db(e==null?void 0:e.rate,2):""})]}),r&&w.jsx("div",{className:"collect-button",onClick:s=>{s.stopPropagation(),n(e,"delete_import")},children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_del"})})}),t&&w.jsx("div",{className:"collect-button",onClick:s=>{s.stopPropagation(),n(e,"collect_token")},children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:i(e)?"#icon-star_sel":"#icon-star"})})})]})]},e==null?void 0:e.coin_type)}function oB({currentType:e,changeTab:t}){const r=["Default","Imported"];return w.jsx("div",{className:"type-tabs",children:r.map(n=>w.jsx("div",{className:e===n?"type-tab-item active":"type-tab-item",onClick:()=>t(n),children:n},n))})}function sB({backClick:e,onSelectToken:t,currToken:r}){const{showTokenList:n,isNoData:i,handleSearch:o,handleChangePlatform:s,handleChangeType:a,handleImportClick:c,handleDeleteImportClick:l}=NL(r==null?void 0:r.coin_type),{importTokenList:u,currentTypeTab:d,setCurrentTypeTab:p,currentPlatformTab:y,setCurrentPlatformTab:x,platformList:b,isOpenImportDialog:M,setIsOpenImportDialog:R,setSearchInput:P,searchInput:k,importTokenIsLoading:F,currentImportTokenData:B,setCurrentImportTokenData:W}=qa();ie.useEffect(()=>()=>{P(""),x("All"),p("Default"),W(void 0)},[]);const{handleCollectToken:z,collectTokenMap:G}=Yw(),re=m=>{p(m),a(m)},oe=m=>{x(m),s(m)},se=()=>{c(),R(!1)},q=m=>{let S=m.replace(/[^a-zA-Z0-9\s]+$/g,"").trim();P(S),S?L(S):(L(""),re("Default"))},L=$0(m=>{pb(m)?o(Ti(m,!0)):o(m)},300),h=(m,S)=>{if(S==="delete_import"){l(m);return}if(S==="collect_token"||S==="un_collect"){z(m);return}S==="select_token"&&(t(m),e())},f=ie.useMemo(()=>Array.from(G.values()),[G]);return w.jsxs("div",{className:"token-select-modal",children:[w.jsx(z0,{backClick:e,title:"Select Token"}),w.jsxs("div",{className:"token-select-content",style:{position:"relative"},children:[w.jsxs("div",{className:"center-content",children:[w.jsxs("div",{className:"search-input",style:{position:"relative"},children:[w.jsx("input",{className:"token-search-input",placeholder:"Search by token or address",value:k,onChange:m=>q(m.target.value),style:{paddingRight:"40px"}}),k.length>0&&w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{width:"20px",height:"20px",cursor:"pointer",position:"absolute",top:"50%",transform:"translateY(-50%)",right:"12px"},onClick:m=>{q("")},children:w.jsx("use",{xlinkHref:"#icon-close"})})]}),f.length>0&&w.jsx(kL,{tokenList:f,onHandleTokenAction:h}),k.length===0&&w.jsx(oB,{currentType:d,changeTab:re}),k.length===0&&d==="Default"&&w.jsx(BL,{tabList:b,currentTab:y,changeTab:oe})]}),i&&w.jsx(aB,{showTooltip:k.length>0,text:k.length>0||B===void 0?"No tokens found":"No Imported Tokens"}),F&&w.jsx(ow,{}),B&&w.jsx("div",{style:{width:"93%",marginLeft:"16px",backgroundColor:"var(--cs-warning-10)",borderRadius:"12px",padding:"16px",fontSize:"12px",marginTop:"16px",color:" var(--cs-warning)"},children:"The token is not on the Frequently Traded List. Please note that anyone can create a token on Sui blockchain with any name, including creating fake versions of existing tokens or tokens that claim to represent projects that do not have a token. Always conduct your own research before trading."}),n.length>0&&w.jsxs("div",{style:{position:"relative"},children:[w.jsx(nB,{showTokenList:n,showCollect:!B,showDelete:!B&&d==="Imported",onHandleTokenAction:h}),B&&w.jsx("div",{className:"center",style:{position:"absolute",top:"100px",left:"50%",transform:"translateX(-50%)"},children:w.jsx("button",{className:"cs-solid-btn swap-btn",style:{height:"32px",width:"140px",fontSize:"14px",borderRadius:"8px",fontFamily:"Inter, Inter",fontWeight:500},onClick:()=>{se(),h(B,"select_token")},children:"Import"})})]})]})]})}function aB({showTooltip:e,text:t}){return w.jsx("div",{style:{height:"360px"},children:w.jsx(LL,{text:t,subItem:e?w.jsx("div",{children:w.jsx(Jl,{position:"bottom",content:w.jsx("div",{children:"The unique id of coin"}),children:w.jsxs("div",{style:{fontSize:"12px",color:"var(--cs-text-con)",display:"flex",flexDirection:"row"},children:["Or you can enter Coin Type",w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{cursor:"pointer",width:"20px",height:"20px"},children:w.jsx("use",{xlinkHref:"#icon-tips"})})]})})}):void 0})})}function cB({onClose:e,tokenList:t,onSureClick:r}){const[n,i]=ie.useState(!1),{setIgnoreWarnToken:o}=Fr();return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"dialog-mask",onClick:e}),w.jsxs("div",{className:"import-dialog",children:[w.jsxs("div",{className:"cs-dialog-header",children:[w.jsx("div",{className:"title",children:"Tips"}),w.jsx("svg",{className:"cs-icon","aria-hidden":"true",onClick:e,children:w.jsx("use",{xlinkHref:"#icon-close"})})]}),w.jsxs("div",{className:"import-content",children:[w.jsx("div",{className:"tip-text-box",children:w.jsx("p",{className:"tips-text",children:"The default trading pair given in this swap widget contains a community imported token that is imported by the integrator. Please acknowledge the risk and conduct your own research before interacting."})}),t.map(s=>w.jsxs("div",{className:"import-token-info",children:[w.jsx(Gr,{style:{marginRight:"4px",width:"30px",height:"30px",borderRadius:"36px"},src:s.logo_url}),w.jsxs("div",{className:"info",children:[w.jsx("div",{className:"name",children:w.jsxs("span",{children:[" ",s.symbol," "]})}),w.jsxs("div",{className:"address",children:[w.jsx("span",{children:Po(s.coin_type)}),w.jsx(ou,{text:s.coin_type})]})]})]},s.coin_type)),w.jsxs("div",{className:"risk-checkbox",children:[w.jsx(zl,{color:"indigo",checked:n,variant:"soft",className:"cs-checkbox",onClick:()=>{i(!n)}}),w.jsx("span",{children:"I acknowledge the risk"})]}),w.jsxs("div",{className:"button-block",children:[w.jsx("button",{className:"cs-outline-btn",onClick:e,children:"Cancel"}),w.jsx("button",{className:"cs-solid-btn",disabled:!n,onClick:()=>{r(),t.forEach(s=>{o(s.coin_type)})},children:"Confirm"})]})]})]})]})}function Xw(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}var Ea;(function(e){e.event="event",e.props="prop"})(Ea||(Ea={}));function zi(){}function lB(e){var t,r=void 0;return function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return t&&n.length===t.length&&n.every(function(o,s){return o===t[s]})||(t=n,r=e.apply(void 0,n)),r}}function Ca(e){return!!(e||"").match(/\d/)}function ds(e){return e==null}function uB(e){return typeof e=="number"&&isNaN(e)}function Jw(e){return ds(e)||uB(e)||typeof e=="number"&&!isFinite(e)}function Zw(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function fB(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function dB(e,t,r){var n=fB(r),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(n,"$1"+t)}function hB(e){var t=ie.useRef(e);t.current=e;var r=ie.useRef(function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return t.current.apply(t,n)});return r.current}function Q0(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var i=e.split("."),o=i[0],s=i[1]||"";return{beforeDecimal:o,afterDecimal:s,hasNegation:r,addNegation:n}}function pB(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",i=r[1]||"";return(t?"-":"")+n+(i?"."+i:"")}function Qw(e,t,r){for(var n="",i=r?"0":"",o=0;o<=t-1;o++)n+=e[o]||i;return n}function Rm(e,t){return Array(t+1).join(e)}function e6(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),i=n[0],o=n[1];if(o=Number(o),!o)return r+i;i=i.replace(".","");var s=1+o,a=i.length;return s<0?i="0."+Rm("0",Math.abs(s))+i:s>=a?i=i+Rm("0",s-a):i=(i.substring(0,s)||"0")+"."+i.substring(s),r+i}function Om(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,i=Q0(e),o=i.beforeDecimal,s=i.afterDecimal,a=i.hasNegation,c=parseFloat("0."+(s||"0")),l=s.length<=t?"0."+s:c.toFixed(t),u=l.split("."),d=o;o&&Number(u[0])&&(d=o.split("").reverse().reduce(function(b,M,R){return b.length>R?(Number(b[0])+Number(M)).toString()+b.substring(1,b.length):M+b},u[0]));var p=Qw(u[1]||"",t,r),y=a?"-":"",x=n?".":"";return""+y+d+x+p}function So(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var t6=lB(function(e,t){for(var r=0,n=0,i=e.length,o=t.length;e[r]===t[r]&&r<i;)r++;for(;e[i-1-n]===t[o-1-n]&&o-n>r&&i-n>r;)n++;return{from:{start:r,end:i-n},to:{start:r,end:o-n}}}),mB=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function gB(e,t,r){return Math.min(Math.max(e,t),r)}function af(e){return Math.max(e.selectionStart,e.selectionEnd)}function vB(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function bB(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function yB(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,i=e.formattedValueIndex;return t[n]===r[i]}function wB(e,t,r,n,i,o,s){s===void 0&&(s=yB);var a=i.findIndex(function(F){return F}),c=e.slice(0,a);!t&&!r.startsWith(c)&&(t=c,r=c+r,n=n+c.length);for(var l=r.length,u=e.length,d={},p=new Array(l),y=0;y<l;y++){p[y]=-1;for(var x=0,b=u;x<b;x++){var M=s({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:y,formattedValueIndex:x});if(M&&d[x]!==!0){p[y]=x,d[x]=!0;break}}}for(var R=n;R<l&&(p[R]===-1||!o(r[R]));)R++;var P=R===l||p[R]===-1?u:p[R];for(R=n-1;R>0&&p[R]===-1;)R--;var k=R===-1||p[R]===-1?0:p[R]+1;return k>P?P:n-k<P-n?k:P}function Pm(e,t,r,n){var i=e.length;if(t=gB(t,0,i),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=i&&!r[t];)t++;t>i&&(t=r.lastIndexOf(!0))}return t===-1&&(t=i),t}function xB(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(Ca(e[r])||Ca(e[r-1]));return t}function r6(e,t,r,n,i,o){o===void 0&&(o=zi);var s=hB(function(x,b){var M,R;return Jw(x)?(R="",M=""):typeof x=="number"||b?(R=typeof x=="number"?e6(x):x,M=n(R)):(R=i(x,void 0),M=n(R)),{formattedValue:M,numAsString:R}}),a=ie.useState(function(){return s(ds(e)?t:e,r)}),c=a[0],l=a[1],u=function(x,b){x.formattedValue!==c.formattedValue&&l({formattedValue:x.formattedValue,numAsString:x.value}),o(x,b)},d=e,p=r;ds(e)&&(d=c.numAsString,p=!0);var y=s(d,p);return ie.useMemo(function(){l(y)},[y.formattedValue]),[c,u]}function SB(e){return e.replace(/[^0-9]/g,"")}function _B(e){return e}function EB(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,i=e.renderText,o=e.getInputRef,s=e.format;s===void 0&&(s=_B);var a=e.removeFormatting;a===void 0&&(a=SB);var c=e.defaultValue,l=e.valueIsNumericString,u=e.onValueChange,d=e.isAllowed,p=e.onChange;p===void 0&&(p=zi);var y=e.onKeyDown;y===void 0&&(y=zi);var x=e.onMouseUp;x===void 0&&(x=zi);var b=e.onFocus;b===void 0&&(b=zi);var M=e.onBlur;M===void 0&&(M=zi);var R=e.value,P=e.getCaretBoundary;P===void 0&&(P=xB);var k=e.isValidInputCharacter;k===void 0&&(k=Ca);var F=e.isCharacterSame,B=Xw(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),W=r6(R,c,!!l,s,a,u),z=W[0],G=z.formattedValue,re=z.numAsString,oe=W[1],se=ie.useRef(),q=ie.useRef({formattedValue:G,numAsString:re}),L=function(we,he){q.current={formattedValue:we.formattedValue,numAsString:we.value},oe(we,he)},h=ie.useState(!1),f=h[0],m=h[1],S=ie.useRef(null),T=ie.useRef({setCaretTimeout:null,focusTimeout:null});ie.useEffect(function(){return m(!0),function(){clearTimeout(T.current.setCaretTimeout),clearTimeout(T.current.focusTimeout)}},[]);var E=s,I=function(we,he){var Ce=parseFloat(he);return{formattedValue:we,value:he,floatValue:isNaN(Ce)?void 0:Ce}},C=function(we,he,Ce){we.selectionStart===0&&we.selectionEnd===we.value.length||(So(we,he),T.current.setCaretTimeout=setTimeout(function(){we.value===Ce&&we.selectionStart!==he&&So(we,he)},0))},g=function(we,he,Ce){return Pm(we,he,P(we),Ce)},v=function(we,he,Ce){var Ve=P(he),ke=wB(he,G,we,Ce,Ve,k,F);return ke=Pm(he,ke,Ve),ke},j=function(we){var he=we.formattedValue;he===void 0&&(he="");var Ce=we.input,Ve=we.source,ke=we.event,Te=we.numAsString,Me;if(Ce){var Ue=we.inputValue||Ce.value,lt=af(Ce);Ce.value=he,Me=v(Ue,he,lt),Me!==void 0&&C(Ce,Me,he)}he!==G&&L(I(he,Te),{event:ke,source:Ve})};ie.useEffect(function(){var we=q.current,he=we.formattedValue,Ce=we.numAsString;(G!==he||re!==Ce)&&L(I(G,re),{event:void 0,source:Ea.props})},[G,re]);var Q=S.current?af(S.current):void 0,Z=typeof window<"u"?ie.useLayoutEffect:ie.useEffect;Z(function(){var we=S.current;if(G!==q.current.formattedValue&&we){var he=v(q.current.formattedValue,G,Q);we.value=G,C(we,he,G)}},[G]);var ce=function(we,he,Ce){var Ve=he.target,ke=se.current?mB(se.current,Ve.selectionEnd):t6(G,we),Te=Object.assign(Object.assign({},ke),{lastValue:G}),Me=a(we,Te),Ue=E(Me);if(Me=a(Ue,void 0),d&&!d(I(Ue,Me))){var lt=he.target,ut=af(lt),ze=v(we,G,ut);return lt.value=G,C(lt,ze,G),!1}return j({formattedValue:Ue,numAsString:Me,inputValue:we,event:he,source:Ce,input:he.target}),!0},be=function(we,he){he===void 0&&(he=0);var Ce=we.selectionStart,Ve=we.selectionEnd;se.current={selectionStart:Ce,selectionEnd:Ve+he}},xe=function(we){var he=we.target,Ce=he.value,Ve=ce(Ce,we,Ea.event);Ve&&p(we),se.current=void 0},pe=function(we){var he=we.target,Ce=we.key,Ve=he.selectionStart,ke=he.selectionEnd,Te=he.value;Te===void 0&&(Te="");var Me;Ce==="ArrowLeft"||Ce==="Backspace"?Me=Math.max(Ve-1,0):Ce==="ArrowRight"?Me=Math.min(Ve+1,Te.length):Ce==="Delete"&&(Me=Ve);var Ue=0;Ce==="Delete"&&Ve===ke&&(Ue=1);var lt=Ce==="ArrowLeft"||Ce==="ArrowRight";if(Me===void 0||Ve!==ke&&!lt){y(we),be(he,Ue);return}var ut=Me;if(lt){var ze=Ce==="ArrowLeft"?"left":"right";ut=g(Te,Me,ze),ut!==Me&&we.preventDefault()}else Ce==="Delete"&&!k(Te[Me])?ut=g(Te,Me,"right"):Ce==="Backspace"&&!k(Te[Me])&&(ut=g(Te,Me,"left"));ut!==Me&&C(he,ut,Te),y(we),be(he,Ue)},Le=function(we){var he=we.target,Ce=function(){var Ve=he.selectionStart,ke=he.selectionEnd,Te=he.value;if(Te===void 0&&(Te=""),Ve===ke){var Me=g(Te,Ve);Me!==Ve&&C(he,Me,Te)}};Ce(),requestAnimationFrame(function(){Ce()}),x(we),be(he)},Ae=function(we){we.persist&&we.persist();var he=we.target,Ce=we.currentTarget;S.current=he,T.current.focusTimeout=setTimeout(function(){var Ve=he.selectionStart,ke=he.selectionEnd,Te=he.value;Te===void 0&&(Te="");var Me=g(Te,Ve);Me!==Ve&&!(Ve===0&&ke===Te.length)&&C(he,Me,Te),b(Object.assign(Object.assign({},we),{currentTarget:Ce}))},0)},Je=function(we){S.current=null,clearTimeout(T.current.focusTimeout),clearTimeout(T.current.setCaretTimeout),M(we)},ft=f&&vB()?"numeric":void 0,je=Object.assign({inputMode:ft},B,{type:t,value:G,onChange:xe,onKeyDown:pe,onMouseUp:Le,onFocus:Ae,onBlur:Je});if(r==="text")return i?ie.createElement(ie.Fragment,null,i(G,B)||null):ie.createElement("span",Object.assign({},B,{ref:o}),G);if(n){var pt=n;return ie.createElement(pt,Object.assign({},je,{ref:o}))}return ie.createElement("input",Object.assign({},je,{ref:o}))}function Nm(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var o=t.suffix;o===void 0&&(o="");var s=t.allowNegative,a=t.thousandsGroupStyle;if(a===void 0&&(a="thousand"),e===""||e==="-")return e;var c=su(t),l=c.thousandSeparator,u=c.decimalSeparator,d=r!==0&&e.indexOf(".")!==-1||r&&n,p=Q0(e,s),y=p.beforeDecimal,x=p.afterDecimal,b=p.addNegation;return r!==void 0&&(x=Qw(x,r,!!n)),l&&(y=dB(y,l,a)),i&&(y=i+y),o&&(x=x+o),b&&(y="-"+y),e=y+(d&&u||"")+x,e}function su(e){var t=e.decimalSeparator;t===void 0&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return r===!0&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function CB(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),i=r.test(e),o=n.test(e);return e=e.replace(/-/g,""),i&&!o&&t&&(e="-"+e),e}function TB(e,t){return new RegExp("(^-)|[0-9]|"+Zw(e),t?"g":void 0)}function AB(e,t,r){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(r!=null&&r.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function MB(e,t,r){var n;t===void 0&&(t=bB(e));var i=r.allowNegative,o=r.prefix;o===void 0&&(o="");var s=r.suffix;s===void 0&&(s="");var a=r.decimalScale,c=t.from,l=t.to,u=l.start,d=l.end,p=su(r),y=p.allowedDecimalSeparators,x=p.decimalSeparator,b=e[d]===x;if(Ca(e)&&(e===o||e===s)&&t.lastValue==="")return e;if(d-u===1&&y.indexOf(e[u])!==-1){var M=a===0?"":x;e=e.substring(0,u)+M+e.substring(u+1,e.length)}var R=function(S,T,E){var I=!1,C=!1;o.startsWith("-")?I=!1:S.startsWith("--")?(I=!1,C=!0):s.startsWith("-")&&S.length===s.length?I=!1:S[0]==="-"&&(I=!0);var g=I?1:0;return C&&(g=2),g&&(S=S.substring(g),T-=g,E-=g),{value:S,start:T,end:E,hasNegation:I}},P=R(e,u,d),k=P.hasNegation;n=P,e=n.value,u=n.start,d=n.end;var F=R(t.lastValue,c.start,c.end),B=F.start,W=F.end,z=F.value,G=e.substring(u,d);e.length&&z.length&&(B>z.length-s.length||W<o.length)&&!(G&&s.startsWith(G))&&(e=z);var re=0;e.startsWith(o)?re+=o.length:u<o.length&&(re=u),e=e.substring(re),d-=re;var oe=e.length,se=e.length-s.length;e.endsWith(s)?oe=se:(d>se||d>e.length-s.length)&&(oe=d),e=e.substring(0,oe),e=CB(k?"-"+e:e,i),e=(e.match(TB(x,!0))||[]).join("");var q=e.indexOf(x);e=e.replace(new RegExp(Zw(x),"g"),function(S,T){return T===q?".":""});var L=Q0(e,i),h=L.beforeDecimal,f=L.afterDecimal,m=L.addNegation;return l.end-l.start<c.end-c.start&&h===""&&b&&!parseFloat(f)&&(e=m?"-":""),e}function IB(e,t){var r=t.prefix;r===void 0&&(r="");var n=t.suffix;n===void 0&&(n="");var i=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";i.fill(!1,0,r.length+(o?1:0));var s=e.length;return i.fill(!1,s-n.length+1,s+1),i}function RB(e){var t=su(e),r=t.thousandSeparator,n=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var o=e.allowNegative;if(o===void 0&&(o=!0),r===n)throw new Error(`
|
|
102
|
+
`})]})}function q0({baseToken:e,quoteToken:t,baseAmount:r,quoteAmount:n,loading:i}){const[o,s]=ie.useState(!0),a=dw(o,r,n);return w.jsxs("div",{className:"current-price-block",style:{cursor:"pointer"},onClick:()=>{s(!o)},children:[w.jsx(Gr,{src:o?e==null?void 0:e.logo_url:t==null?void 0:t.logo_url}),w.jsxs("span",{style:{display:"flex",alignItems:"center",color:"var(--cs-text-title)",fontSize:"12px",maxWidth:"80%"},children:["1"," ",dn(o?e==null?void 0:e.symbol:t==null?void 0:t.symbol)," ","="," ",i?w.jsx(Ns,{style:{height:"16px",width:"40px",marginLeft:"2px",marginRight:"2px"}}):Nr(a,t==null?void 0:t.decimals)," ",dn(o?t==null?void 0:t.symbol:e==null?void 0:e.symbol)]}),w.jsx(Gr,{src:o?t==null?void 0:t.logo_url:e==null?void 0:e.logo_url}),w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-swap"})})]})}function Xl(){const[e,t]=ie.useState(window.innerWidth),r=z0(()=>{t(window.innerWidth)},300);ie.useEffect(()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}),[]);const n=ie.useMemo(()=>e<810,[e]);return{windowWidth:e,isApp:n}}function mw(e,t,r,n){const{getTokenPrice:i}=$a(),o=i(e==null?void 0:e.coin_type),s=i(t==null?void 0:t.coin_type),a=dw(!0,r,n),c=ie.useMemo(()=>{if(s&&o)return Be(o.price).div(s.price).toString()},[o==null?void 0:o.price,s==null?void 0:s.price]),l=ie.useMemo(()=>{if(c&&+a)return Be(a).sub(c).div(a).mul(100).toFixed(10)},[c,a]),u=ie.useMemo(()=>{const b=[];return o&&b.push(o.market),s&&!b.includes(s.market)&&b.push(s.market),b},[o==null?void 0:o.market,s==null?void 0:s.market]),d=ie.useMemo(()=>l&&Be(l).lt(0)?Be(l).abs().gt(5):!1,[l]),p=ie.useMemo(()=>l&&Be(l).lt(0)?Be(l).abs().gt(10):!1,[l]),y=ie.useMemo(()=>{let b,M="yellow";if(l)if(Be(l).gt(0))M="green",Be(l).lt(.1)?b="< 0.1% cheaper than":b=`${Nr(l,2,!0,Fr.ROUND_UP)}% cheaper than`;else if(Be(l).eq(0))b="0%",M="green";else{const O=Be(l).abs();O.lte(5)?(M="green",b=`Within ${Nr(O.toString(),2,!0,Fr.ROUND_UP)}%`):O.lte(10)?(M="yellow",b=`${Nr(O.toString(),2,!0,Fr.ROUND_UP)}% more than`):O.lte(100)?(M="red",b=`${Nr(O.toString(),2,!0,Fr.ROUND_UP)}% more than`):(M="red",b="> 100% more than")}return{priceImpactText:b,textColor:M}},[l]),x=ie.useMemo(()=>(o==null?void 0:o.market)==="Cetus"||(s==null?void 0:s.market)==="Cetus",[o,s]);return{swapPrice:a,marketPrice:c,priceImpact:l,sources:u,showPriceImpactTips:d,showPriceImpactWarn:p,priceImpactTextInfo:y,hideShowPriceImpact:x}}function Jl({content:e,children:t,position:r="top",delay:n=0}){const[i,o]=ie.useState(!1),[s,a]=ie.useState(!1),c=ie.useRef(null),l=()=>{c.current&&(clearTimeout(c.current),c.current=null),o(!0)};ie.useEffect(()=>()=>{i||c.current&&(clearTimeout(c.current),c.current=null)},[i]);const u=()=>{c.current=setTimeout(()=>{s||(o(!1),c.current&&(clearTimeout(c.current),c.current=null))},0)},d=()=>{switch(r){case"top":return{transform:"translateX(-50%)"};case"bottom":return{transform:"translateX(-50%)",marginTop:"0px"};case"left":return{transform:"translateY(-50%)",marginRight:"8px"};case"right":return{transform:"translateY(-50%)"};default:return{}}},p=ie.useRef(null),[y,x]=ie.useState({left:void 0,top:void 0});return ie.useEffect(()=>{var b;if(i&&p.current){const M=(b=p.current)==null?void 0:b.getBoundingClientRect();let O,P;r==="top"?(O=`${window.scrollX+M.left+M.width/2}px`,P=`${window.scrollY+M.top-2*M.height-8}px`):r==="bottom"?(O=`${window.scrollX+M.left+M.width/2}px`,P=`${window.scrollY+M.bottom}px`):r==="left"?(O=`${window.scrollX+M.left-8}px`,P=`${window.scrollY+M.top+M.height/2}px`):r==="right"?(O=`${window.scrollX+M.right+8}px`,P=`${window.scrollY+M.top+M.height/2}px`):(O=`${window.scrollX+M.left+M.width/2}px`,P=`${window.scrollY+M.top+M.height/2}px`),x({left:O,top:P})}},[i]),w.jsxs("div",{ref:p,style:{position:"relative",display:"inline-block"},onMouseEnter:l,onMouseLeave:u,children:[t,i&&ol.createPortal(w.jsx("div",{style:{transition:"opacity 0.3s ease",opacity:i?1:0,position:"absolute",zIndex:9e3,padding:"8px 12px",backgroundColor:"var(--cs-dialog-bg)",color:"var(--cs-text-con)",borderRadius:"8px",fontSize:"12px",whiteSpace:"nowrap",border:"1px solid",borderColor:"var(--cs-border)",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.1)",...d(),...y},onMouseEnter:()=>a(!0),onMouseLeave:()=>{c.current&&(clearTimeout(c.current),c.current=null),a(!1),o(!1)},children:e}),document.body)]})}function gw({content:e,children:t,position:r,autoSwitchTooltip:n=!1}){const{isApp:i}=Xl();return i&&n?w.jsxs(mn.Root,{children:[w.jsx(mn.Trigger,{children:w.jsx("button",{style:{background:"none",border:"none",padding:"0",margin:"0",outline:"none",boxShadow:"none",color:"inherit",font:"inherit",textAlign:"inherit"},children:t})}),w.jsx(mn.Content,{variant:"soft",style:{transition:"opacity 0.3s ease",display:"block",zIndex:9e3,padding:"8px 12px",backgroundColor:"var(--cs-dialog-bg)",color:"var(--cs-text-con)",borderRadius:"8px",fontSize:"12px",whiteSpace:"nowrap",border:"1px solid",borderColor:"var(--cs-border)",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.1)"},side:r,align:"center",children:e})]}):w.jsx(Jl,{content:e,position:r,children:t})}function vw({isLoading:e,routerData:t,noTips:r}){const{fromCoin:n,toCoin:i,fromAmount:o,toAmount:s}=nn();Xl();const{priceImpact:a,sources:c,marketPrice:l,priceImpactTextInfo:u,hideShowPriceImpact:d}=mw(n,i,t==null?void 0:t.fromAmountUi,t==null?void 0:t.toAmountUi);return w.jsx(w.Fragment,{children:d?w.jsx(w.Fragment,{}):w.jsxs(w.Fragment,{children:[!r&&Be(a).lte(-30)&&w.jsx("div",{className:"price-impact-tips red",children:"High price difference. Be cautious before submitting your order."}),w.jsxs("div",{className:"price-impact-block",children:[w.jsxs("div",{className:"left",children:[w.jsx("span",{style:{color:"var(--cs-text-con)"},children:"Price Difference"}),w.jsx(gw,{autoSwitchTooltip:!0,position:"top",content:w.jsx(bP,{fromToken:n,toToken:i,sources:c,baseAmount:"1",quoteAmount:l}),children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{cursor:"pointer",width:"20px",height:"20px"},children:w.jsx("use",{xlinkHref:"#icon-tips"})})})]}),w.jsxs("div",{children:[e&&w.jsx(Ns,{style:{width:"80px",height:"20px"}}),!e&&w.jsxs("div",{className:"right",children:[w.jsx("span",{className:u==null?void 0:u.textColor,children:u.priceImpactText?u==null?void 0:u.priceImpactText:"Incalculable"}),w.jsx("div",{className:"platforms",children:c.map(p=>w.jsx(Jl,{content:w.jsx("span",{style:{fontSize:"12px"},children:xb[p]}),position:"top",delay:300,children:w.jsx(Gr,{src:uC[p]})},p))})]})]})]})]})})}function bP({fromToken:e,toToken:t,baseAmount:r,quoteAmount:n,sources:i}){const{isApp:o}=Xl();return w.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[w.jsx("p",{style:{color:"var(--cs-text-con)",fontSize:"12px",lineHeight:"18px",width:o?"200px":"300px",textAlign:"start",whiteSpace:"normal"},children:"The difference between the market price and estimated price due to trade size."}),w.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[w.jsx("p",{style:{fontSize:"12px",color:"var(--cs-text-title)"},children:"Market price sources:"}),r&&n?w.jsx(q0,{baseToken:e,quoteToken:t,baseAmount:"1",quoteAmount:n,loading:!1}):w.jsx("p",{style:{color:"var(--cs-text-title)",fontSize:"12px"},children:"Price is unknown"})]}),w.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"5px"},children:[w.jsx("p",{style:{color:"var(--cs-text-con)",fontSize:"12px",whiteSpace:"pre"},children:"Market price sources:"}),w.jsx("p",{style:{color:"var(--cs-text-con)",fontSize:"12px",whiteSpace:"pre"},children:i.map(s=>xb[s]+" ").join("")})]})]})}function bw({pr:e="8px",pl:t="8px",amountLimit:r,isLoading:n}){const{fromCoin:i,toCoin:o,byAmountIn:s}=nn();return w.jsxs("div",{className:"swap-info-between",style:{paddingLeft:t,paddingRight:e},children:[w.jsx("div",{className:"left",children:s?"Minimum Received":"Maximum Sold"}),n?w.jsx(Ns,{style:{height:"18px",width:"80px"}}):w.jsxs("div",{className:"right",children:[Nr(r,s?o==null?void 0:o.decimals:i==null?void 0:i.decimals,!1,Fr.ROUND_DOWN)," ",dn(s?(o==null?void 0:o.symbol)||"":(i==null?void 0:i.symbol)||"")]})]})}function yP({scamsText:e}){return w.jsxs("div",{style:{marginTop:"16px",borderRadius:"8px",border:"1px solid #2A3238",paddingTop:"12px",width:"100%",backgroundColor:"#161A1E"},children:[w.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 12px",justifyContent:"center",textAlign:"center"},children:[w.jsx("svg",{className:"cs-icon",style:{width:"20px",height:"20px",fill:"#ffca68"},"aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-alert"})}),w.jsx("span",{style:{color:"#ffca68",marginLeft:"4px"},children:"Alert"})]}),w.jsx("div",{style:{borderRadius:"8px",padding:"11px",margin:"-1px",marginTop:"14px",border:"1px solid #2A3238",lineHeight:"1"},children:w.jsx(_b,{text:`${e} detected to have Deny List feature. It's an optional feature on Sui designed for regulated coins (learn more). However, it could be misused by HoneyPot scams, which may restrict users from selling the tokens after buying. Please be cautious.`,keywords:["learn more"],onKeywordClick:t=>{window.open("https://docs.sui.io/guides/developer/coin/regulated","_blank")}})})]})}function wP({onClick:e}){return w.jsxs("div",{className:"cs-icon-button cs-back-button",onClick:t=>{t.stopPropagation(),e()},children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-back"})}),w.jsx("span",{children:"Back"})]})}function H0({title:e,backClick:t}){return w.jsxs("div",{className:"cs-have-back-header",children:[w.jsx(wP,{onClick:t}),w.jsx("span",{className:"title",children:e})]})}const oc=globalThis||void 0||self;var xP=typeof oc=="object"&&oc&&oc.Object===Object&&oc;const yw=xP;var SP=typeof self=="object"&&self&&self.Object===Object&&self,_P=yw||SP||Function("return this")();const ni=_P;var EP=ni.Symbol;const ei=EP;var ww=Object.prototype,CP=ww.hasOwnProperty,TP=ww.toString,Gs=ei?ei.toStringTag:void 0;function AP(e){var t=CP.call(e,Gs),r=e[Gs];try{e[Gs]=void 0;var n=!0}catch{}var i=TP.call(e);return n&&(t?e[Gs]=r:delete e[Gs]),i}var MP=Object.prototype,IP=MP.toString;function OP(e){return IP.call(e)}var RP="[object Null]",PP="[object Undefined]",Yp=ei?ei.toStringTag:void 0;function js(e){return e==null?e===void 0?PP:RP:Yp&&Yp in Object(e)?AP(e):OP(e)}function ro(e){return e!=null&&typeof e=="object"}var NP="[object Symbol]";function wa(e){return typeof e=="symbol"||ro(e)&&js(e)==NP}function _c(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var kP=Array.isArray;const Kr=kP;var jP=1/0,Xp=ei?ei.prototype:void 0,Jp=Xp?Xp.toString:void 0;function xw(e){if(typeof e=="string")return e;if(Kr(e))return _c(e,xw)+"";if(wa(e))return Jp?Jp.call(e):"";var t=e+"";return t=="0"&&1/e==-jP?"-0":t}function Ds(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Sw(e){return e}var DP="[object AsyncFunction]",LP="[object Function]",BP="[object GeneratorFunction]",UP="[object Proxy]";function _w(e){if(!Ds(e))return!1;var t=js(e);return t==LP||t==BP||t==DP||t==UP}var FP=ni["__core-js_shared__"];const tf=FP;var Zp=function(){var e=/[^.]+$/.exec(tf&&tf.keys&&tf.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function $P(e){return!!Zp&&Zp in e}var VP=Function.prototype,zP=VP.toString;function Vo(e){if(e!=null){try{return zP.call(e)}catch{}try{return e+""}catch{}}return""}var qP=/[\\^$.*+?()[\]{}|]/g,HP=/^\[object .+?Constructor\]$/,WP=Function.prototype,GP=Object.prototype,KP=WP.toString,YP=GP.hasOwnProperty,XP=RegExp("^"+KP.call(YP).replace(qP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function JP(e){if(!Ds(e)||$P(e))return!1;var t=_w(e)?XP:HP;return t.test(Vo(e))}function ZP(e,t){return e==null?void 0:e[t]}function zo(e,t){var r=ZP(e,t);return JP(r)?r:void 0}var QP=zo(ni,"WeakMap");const rd=QP;var Qp=Object.create,eN=function(){function e(){}return function(t){if(!Ds(t))return{};if(Qp)return Qp(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();const tN=eN;function rN(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var nN=function(){try{var e=zo(Object,"defineProperty");return e({},"",{}),e}catch{}}();const em=nN;function iN(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var oN=9007199254740991,sN=/^(?:0|[1-9]\d*)$/;function Ew(e,t){var r=typeof e;return t=t??oN,!!t&&(r=="number"||r!="symbol"&&sN.test(e))&&e>-1&&e%1==0&&e<t}function Cw(e,t,r){t=="__proto__"&&em?em(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function W0(e,t){return e===t||e!==e&&t!==t}var aN=Object.prototype,cN=aN.hasOwnProperty;function Tw(e,t,r){var n=e[t];(!(cN.call(e,t)&&W0(n,r))||r===void 0&&!(t in e))&&Cw(e,t,r)}function Zl(e,t,r,n){var i=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var a=t[o],c=n?n(r[a],e[a],a,r,e):void 0;c===void 0&&(c=e[a]),i?Cw(r,a,c):Tw(r,a,c)}return r}var lN=9007199254740991;function G0(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=lN}function Ql(e){return e!=null&&G0(e.length)&&!_w(e)}var uN=Object.prototype;function K0(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||uN;return e===r}function fN(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var dN="[object Arguments]";function tm(e){return ro(e)&&js(e)==dN}var Aw=Object.prototype,hN=Aw.hasOwnProperty,pN=Aw.propertyIsEnumerable,mN=tm(function(){return arguments}())?tm:function(e){return ro(e)&&hN.call(e,"callee")&&!pN.call(e,"callee")};const Mw=mN;function gN(){return!1}var Iw=typeof exports=="object"&&exports&&!exports.nodeType&&exports,rm=Iw&&typeof module=="object"&&module&&!module.nodeType&&module,vN=rm&&rm.exports===Iw,nm=vN?ni.Buffer:void 0,bN=nm?nm.isBuffer:void 0,yN=bN||gN;const rl=yN;var wN="[object Arguments]",xN="[object Array]",SN="[object Boolean]",_N="[object Date]",EN="[object Error]",CN="[object Function]",TN="[object Map]",AN="[object Number]",MN="[object Object]",IN="[object RegExp]",ON="[object Set]",RN="[object String]",PN="[object WeakMap]",NN="[object ArrayBuffer]",kN="[object DataView]",jN="[object Float32Array]",DN="[object Float64Array]",LN="[object Int8Array]",BN="[object Int16Array]",UN="[object Int32Array]",FN="[object Uint8Array]",$N="[object Uint8ClampedArray]",VN="[object Uint16Array]",zN="[object Uint32Array]",Qt={};Qt[jN]=Qt[DN]=Qt[LN]=Qt[BN]=Qt[UN]=Qt[FN]=Qt[$N]=Qt[VN]=Qt[zN]=!0;Qt[wN]=Qt[xN]=Qt[NN]=Qt[SN]=Qt[kN]=Qt[_N]=Qt[EN]=Qt[CN]=Qt[TN]=Qt[AN]=Qt[MN]=Qt[IN]=Qt[ON]=Qt[RN]=Qt[PN]=!1;function qN(e){return ro(e)&&G0(e.length)&&!!Qt[js(e)]}function eu(e){return function(t){return e(t)}}var Ow=typeof exports=="object"&&exports&&!exports.nodeType&&exports,aa=Ow&&typeof module=="object"&&module&&!module.nodeType&&module,HN=aa&&aa.exports===Ow,rf=HN&&yw.process,WN=function(){try{var e=aa&&aa.require&&aa.require("util").types;return e||rf&&rf.binding&&rf.binding("util")}catch{}}();const Ss=WN;var im=Ss&&Ss.isTypedArray,GN=im?eu(im):qN;const Rw=GN;var KN=Object.prototype,YN=KN.hasOwnProperty;function Pw(e,t){var r=Kr(e),n=!r&&Mw(e),i=!r&&!n&&rl(e),o=!r&&!n&&!i&&Rw(e),s=r||n||i||o,a=s?fN(e.length,String):[],c=a.length;for(var l in e)(t||YN.call(e,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Ew(l,c)))&&a.push(l);return a}function Nw(e,t){return function(r){return e(t(r))}}var XN=Nw(Object.keys,Object);const JN=XN;var ZN=Object.prototype,QN=ZN.hasOwnProperty;function ek(e){if(!K0(e))return JN(e);var t=[];for(var r in Object(e))QN.call(e,r)&&r!="constructor"&&t.push(r);return t}function za(e){return Ql(e)?Pw(e):ek(e)}function tk(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var rk=Object.prototype,nk=rk.hasOwnProperty;function ik(e){if(!Ds(e))return tk(e);var t=K0(e),r=[];for(var n in e)n=="constructor"&&(t||!nk.call(e,n))||r.push(n);return r}function Y0(e){return Ql(e)?Pw(e,!0):ik(e)}var ok=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sk=/^\w*$/;function X0(e,t){if(Kr(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||wa(e)?!0:sk.test(e)||!ok.test(e)||t!=null&&e in Object(t)}var ak=zo(Object,"create");const xa=ak;function ck(){this.__data__=xa?xa(null):{},this.size=0}function lk(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var uk="__lodash_hash_undefined__",fk=Object.prototype,dk=fk.hasOwnProperty;function hk(e){var t=this.__data__;if(xa){var r=t[e];return r===uk?void 0:r}return dk.call(t,e)?t[e]:void 0}var pk=Object.prototype,mk=pk.hasOwnProperty;function gk(e){var t=this.__data__;return xa?t[e]!==void 0:mk.call(t,e)}var vk="__lodash_hash_undefined__";function bk(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=xa&&t===void 0?vk:t,this}function ko(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ko.prototype.clear=ck;ko.prototype.delete=lk;ko.prototype.get=hk;ko.prototype.has=gk;ko.prototype.set=bk;function yk(){this.__data__=[],this.size=0}function tu(e,t){for(var r=e.length;r--;)if(W0(e[r][0],t))return r;return-1}var wk=Array.prototype,xk=wk.splice;function Sk(e){var t=this.__data__,r=tu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():xk.call(t,r,1),--this.size,!0}function _k(e){var t=this.__data__,r=tu(t,e);return r<0?void 0:t[r][1]}function Ek(e){return tu(this.__data__,e)>-1}function Ck(e,t){var r=this.__data__,n=tu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Ni(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ni.prototype.clear=yk;Ni.prototype.delete=Sk;Ni.prototype.get=_k;Ni.prototype.has=Ek;Ni.prototype.set=Ck;var Tk=zo(ni,"Map");const Sa=Tk;function Ak(){this.size=0,this.__data__={hash:new ko,map:new(Sa||Ni),string:new ko}}function Mk(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ru(e,t){var r=e.__data__;return Mk(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Ik(e){var t=ru(this,e).delete(e);return this.size-=t?1:0,t}function Ok(e){return ru(this,e).get(e)}function Rk(e){return ru(this,e).has(e)}function Pk(e,t){var r=ru(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function ki(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ki.prototype.clear=Ak;ki.prototype.delete=Ik;ki.prototype.get=Ok;ki.prototype.has=Rk;ki.prototype.set=Pk;var Nk="Expected a function";function J0(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Nk);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=e.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(J0.Cache||ki),r}J0.Cache=ki;var kk=500;function jk(e){var t=J0(e,function(n){return r.size===kk&&r.clear(),n}),r=t.cache;return t}var Dk=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lk=/\\(\\)?/g,Bk=jk(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Dk,function(r,n,i,o){t.push(i?o.replace(Lk,"$1"):n||r)}),t});const Uk=Bk;function Fk(e){return e==null?"":xw(e)}function kw(e,t){return Kr(e)?e:X0(e,t)?[e]:Uk(Fk(e))}var $k=1/0;function nu(e){if(typeof e=="string"||wa(e))return e;var t=e+"";return t=="0"&&1/e==-$k?"-0":t}function Z0(e,t){t=kw(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[nu(t[r++])];return r&&r==n?e:void 0}function Vk(e,t,r){var n=e==null?void 0:Z0(e,t);return n===void 0?r:n}function jw(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var zk=Nw(Object.getPrototypeOf,Object);const Dw=zk;function qk(){this.__data__=new Ni,this.size=0}function Hk(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Wk(e){return this.__data__.get(e)}function Gk(e){return this.__data__.has(e)}var Kk=200;function Yk(e,t){var r=this.__data__;if(r instanceof Ni){var n=r.__data__;if(!Sa||n.length<Kk-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ki(n)}return r.set(e,t),this.size=r.size,this}function Xn(e){var t=this.__data__=new Ni(e);this.size=t.size}Xn.prototype.clear=qk;Xn.prototype.delete=Hk;Xn.prototype.get=Wk;Xn.prototype.has=Gk;Xn.prototype.set=Yk;function Xk(e,t){return e&&Zl(t,za(t),e)}function Jk(e,t){return e&&Zl(t,Y0(t),e)}var Lw=typeof exports=="object"&&exports&&!exports.nodeType&&exports,om=Lw&&typeof module=="object"&&module&&!module.nodeType&&module,Zk=om&&om.exports===Lw,sm=Zk?ni.Buffer:void 0,am=sm?sm.allocUnsafe:void 0;function Qk(e,t){if(t)return e.slice();var r=e.length,n=am?am(r):new e.constructor(r);return e.copy(n),n}function Bw(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var s=e[r];t(s,r,e)&&(o[i++]=s)}return o}function Uw(){return[]}var ej=Object.prototype,tj=ej.propertyIsEnumerable,cm=Object.getOwnPropertySymbols,rj=cm?function(e){return e==null?[]:(e=Object(e),Bw(cm(e),function(t){return tj.call(e,t)}))}:Uw;const Q0=rj;function nj(e,t){return Zl(e,Q0(e),t)}var ij=Object.getOwnPropertySymbols,oj=ij?function(e){for(var t=[];e;)jw(t,Q0(e)),e=Dw(e);return t}:Uw;const Fw=oj;function sj(e,t){return Zl(e,Fw(e),t)}function $w(e,t,r){var n=t(e);return Kr(e)?n:jw(n,r(e))}function nd(e){return $w(e,za,Q0)}function aj(e){return $w(e,Y0,Fw)}var cj=zo(ni,"DataView");const id=cj;var lj=zo(ni,"Promise");const od=lj;var uj=zo(ni,"Set");const sd=uj;var lm="[object Map]",fj="[object Object]",um="[object Promise]",fm="[object Set]",dm="[object WeakMap]",hm="[object DataView]",dj=Vo(id),hj=Vo(Sa),pj=Vo(od),mj=Vo(sd),gj=Vo(rd),wo=js;(id&&wo(new id(new ArrayBuffer(1)))!=hm||Sa&&wo(new Sa)!=lm||od&&wo(od.resolve())!=um||sd&&wo(new sd)!=fm||rd&&wo(new rd)!=dm)&&(wo=function(e){var t=js(e),r=t==fj?e.constructor:void 0,n=r?Vo(r):"";if(n)switch(n){case dj:return hm;case hj:return lm;case pj:return um;case mj:return fm;case gj:return dm}return t});const _a=wo;var vj=Object.prototype,bj=vj.hasOwnProperty;function yj(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&bj.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var wj=ni.Uint8Array;const nl=wj;function eh(e){var t=new e.constructor(e.byteLength);return new nl(t).set(new nl(e)),t}function xj(e,t){var r=t?eh(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Sj=/\w*$/;function _j(e){var t=new e.constructor(e.source,Sj.exec(e));return t.lastIndex=e.lastIndex,t}var pm=ei?ei.prototype:void 0,mm=pm?pm.valueOf:void 0;function Ej(e){return mm?Object(mm.call(e)):{}}function Cj(e,t){var r=t?eh(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Tj="[object Boolean]",Aj="[object Date]",Mj="[object Map]",Ij="[object Number]",Oj="[object RegExp]",Rj="[object Set]",Pj="[object String]",Nj="[object Symbol]",kj="[object ArrayBuffer]",jj="[object DataView]",Dj="[object Float32Array]",Lj="[object Float64Array]",Bj="[object Int8Array]",Uj="[object Int16Array]",Fj="[object Int32Array]",$j="[object Uint8Array]",Vj="[object Uint8ClampedArray]",zj="[object Uint16Array]",qj="[object Uint32Array]";function Hj(e,t,r){var n=e.constructor;switch(t){case kj:return eh(e);case Tj:case Aj:return new n(+e);case jj:return xj(e,r);case Dj:case Lj:case Bj:case Uj:case Fj:case $j:case Vj:case zj:case qj:return Cj(e,r);case Mj:return new n;case Ij:case Pj:return new n(e);case Oj:return _j(e);case Rj:return new n;case Nj:return Ej(e)}}function Wj(e){return typeof e.constructor=="function"&&!K0(e)?tN(Dw(e)):{}}var Gj="[object Map]";function Kj(e){return ro(e)&&_a(e)==Gj}var gm=Ss&&Ss.isMap,Yj=gm?eu(gm):Kj;const Xj=Yj;var Jj="[object Set]";function Zj(e){return ro(e)&&_a(e)==Jj}var vm=Ss&&Ss.isSet,Qj=vm?eu(vm):Zj;const eD=Qj;var tD=1,rD=2,nD=4,Vw="[object Arguments]",iD="[object Array]",oD="[object Boolean]",sD="[object Date]",aD="[object Error]",zw="[object Function]",cD="[object GeneratorFunction]",lD="[object Map]",uD="[object Number]",qw="[object Object]",fD="[object RegExp]",dD="[object Set]",hD="[object String]",pD="[object Symbol]",mD="[object WeakMap]",gD="[object ArrayBuffer]",vD="[object DataView]",bD="[object Float32Array]",yD="[object Float64Array]",wD="[object Int8Array]",xD="[object Int16Array]",SD="[object Int32Array]",_D="[object Uint8Array]",ED="[object Uint8ClampedArray]",CD="[object Uint16Array]",TD="[object Uint32Array]",Yt={};Yt[Vw]=Yt[iD]=Yt[gD]=Yt[vD]=Yt[oD]=Yt[sD]=Yt[bD]=Yt[yD]=Yt[wD]=Yt[xD]=Yt[SD]=Yt[lD]=Yt[uD]=Yt[qw]=Yt[fD]=Yt[dD]=Yt[hD]=Yt[pD]=Yt[_D]=Yt[ED]=Yt[CD]=Yt[TD]=!0;Yt[aD]=Yt[zw]=Yt[mD]=!1;function Ec(e,t,r,n,i,o){var s,a=t&tD,c=t&rD,l=t&nD;if(r&&(s=i?r(e,n,i,o):r(e)),s!==void 0)return s;if(!Ds(e))return e;var u=Kr(e);if(u){if(s=yj(e),!a)return rN(e,s)}else{var d=_a(e),p=d==zw||d==cD;if(rl(e))return Qk(e,a);if(d==qw||d==Vw||p&&!i){if(s=c||p?{}:Wj(e),!a)return c?sj(e,Jk(s,e)):nj(e,Xk(s,e))}else{if(!Yt[d])return i?e:{};s=Hj(e,d,a)}}o||(o=new Xn);var y=o.get(e);if(y)return y;o.set(e,s),eD(e)?e.forEach(function(M){s.add(Ec(M,t,r,M,e,o))}):Xj(e)&&e.forEach(function(M,O){s.set(O,Ec(M,t,r,O,e,o))});var x=l?c?aj:nd:c?Y0:za,b=u?void 0:x(e);return iN(b||e,function(M,O){b&&(O=M,M=e[O]),Tw(s,O,Ec(M,t,r,O,e,o))}),s}var AD=1,MD=4;function ID(e){return Ec(e,AD|MD)}var OD="__lodash_hash_undefined__";function RD(e){return this.__data__.set(e,OD),this}function PD(e){return this.__data__.has(e)}function il(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new ki;++t<r;)this.add(e[t])}il.prototype.add=il.prototype.push=RD;il.prototype.has=PD;function ND(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function kD(e,t){return e.has(t)}var jD=1,DD=2;function Hw(e,t,r,n,i,o){var s=r&jD,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var l=o.get(e),u=o.get(t);if(l&&u)return l==t&&u==e;var d=-1,p=!0,y=r&DD?new il:void 0;for(o.set(e,t),o.set(t,e);++d<a;){var x=e[d],b=t[d];if(n)var M=s?n(b,x,d,t,e,o):n(x,b,d,e,t,o);if(M!==void 0){if(M)continue;p=!1;break}if(y){if(!ND(t,function(O,P){if(!kD(y,P)&&(x===O||i(x,O,r,n,o)))return y.push(P)})){p=!1;break}}else if(!(x===b||i(x,b,r,n,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function LD(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function BD(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var UD=1,FD=2,$D="[object Boolean]",VD="[object Date]",zD="[object Error]",qD="[object Map]",HD="[object Number]",WD="[object RegExp]",GD="[object Set]",KD="[object String]",YD="[object Symbol]",XD="[object ArrayBuffer]",JD="[object DataView]",bm=ei?ei.prototype:void 0,nf=bm?bm.valueOf:void 0;function ZD(e,t,r,n,i,o,s){switch(r){case JD:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case XD:return!(e.byteLength!=t.byteLength||!o(new nl(e),new nl(t)));case $D:case VD:case HD:return W0(+e,+t);case zD:return e.name==t.name&&e.message==t.message;case WD:case KD:return e==t+"";case qD:var a=LD;case GD:var c=n&UD;if(a||(a=BD),e.size!=t.size&&!c)return!1;var l=s.get(e);if(l)return l==t;n|=FD,s.set(e,t);var u=Hw(a(e),a(t),n,i,o,s);return s.delete(e),u;case YD:if(nf)return nf.call(e)==nf.call(t)}return!1}var QD=1,eL=Object.prototype,tL=eL.hasOwnProperty;function rL(e,t,r,n,i,o){var s=r&QD,a=nd(e),c=a.length,l=nd(t),u=l.length;if(c!=u&&!s)return!1;for(var d=c;d--;){var p=a[d];if(!(s?p in t:tL.call(t,p)))return!1}var y=o.get(e),x=o.get(t);if(y&&x)return y==t&&x==e;var b=!0;o.set(e,t),o.set(t,e);for(var M=s;++d<c;){p=a[d];var O=e[p],P=t[p];if(n)var k=s?n(P,O,p,t,e,o):n(O,P,p,e,t,o);if(!(k===void 0?O===P||i(O,P,r,n,o):k)){b=!1;break}M||(M=p=="constructor")}if(b&&!M){var F=e.constructor,B=t.constructor;F!=B&&"constructor"in e&&"constructor"in t&&!(typeof F=="function"&&F instanceof F&&typeof B=="function"&&B instanceof B)&&(b=!1)}return o.delete(e),o.delete(t),b}var nL=1,ym="[object Arguments]",wm="[object Array]",sc="[object Object]",iL=Object.prototype,xm=iL.hasOwnProperty;function oL(e,t,r,n,i,o){var s=Kr(e),a=Kr(t),c=s?wm:_a(e),l=a?wm:_a(t);c=c==ym?sc:c,l=l==ym?sc:l;var u=c==sc,d=l==sc,p=c==l;if(p&&rl(e)){if(!rl(t))return!1;s=!0,u=!1}if(p&&!u)return o||(o=new Xn),s||Rw(e)?Hw(e,t,r,n,i,o):ZD(e,t,c,r,n,i,o);if(!(r&nL)){var y=u&&xm.call(e,"__wrapped__"),x=d&&xm.call(t,"__wrapped__");if(y||x){var b=y?e.value():e,M=x?t.value():t;return o||(o=new Xn),i(b,M,r,n,o)}}return p?(o||(o=new Xn),rL(e,t,r,n,i,o)):!1}function iu(e,t,r,n,i){return e===t?!0:e==null||t==null||!ro(e)&&!ro(t)?e!==e&&t!==t:oL(e,t,r,n,iu,i)}var sL=1,aL=2;function cL(e,t,r,n){var i=r.length,o=i,s=!n;if(e==null)return!o;for(e=Object(e);i--;){var a=r[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=r[i];var c=a[0],l=e[c],u=a[1];if(s&&a[2]){if(l===void 0&&!(c in e))return!1}else{var d=new Xn;if(n)var p=n(l,u,c,e,t,d);if(!(p===void 0?iu(u,l,sL|aL,n,d):p))return!1}}return!0}function Ww(e){return e===e&&!Ds(e)}function lL(e){for(var t=za(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ww(i)]}return t}function Gw(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function uL(e){var t=lL(e);return t.length==1&&t[0][2]?Gw(t[0][0],t[0][1]):function(r){return r===e||cL(r,e,t)}}function fL(e,t){return e!=null&&t in Object(e)}function dL(e,t,r){t=kw(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var s=nu(t[n]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&G0(i)&&Ew(s,i)&&(Kr(e)||Mw(e)))}function hL(e,t){return e!=null&&dL(e,t,fL)}var pL=1,mL=2;function gL(e,t){return X0(e)&&Ww(t)?Gw(nu(e),t):function(r){var n=Vk(r,e);return n===void 0&&n===t?hL(r,e):iu(t,n,pL|mL)}}function vL(e){return function(t){return t==null?void 0:t[e]}}function bL(e){return function(t){return Z0(t,e)}}function yL(e){return X0(e)?vL(nu(e)):bL(e)}function Kw(e){return typeof e=="function"?e:e==null?Sw:typeof e=="object"?Kr(e)?gL(e[0],e[1]):uL(e):yL(e)}function wL(e){return function(t,r,n){for(var i=-1,o=Object(t),s=n(t),a=s.length;a--;){var c=s[e?a:++i];if(r(o[c],c,o)===!1)break}return t}}var xL=wL();const SL=xL;function _L(e,t){return e&&SL(e,t,za)}function EL(e,t){return function(r,n){if(r==null)return r;if(!Ql(r))return e(r,n);for(var i=r.length,o=t?i:-1,s=Object(r);(t?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var CL=EL(_L);const Yw=CL;function TL(e,t){var r=[];return Yw(e,function(n,i,o){t(n,i,o)&&r.push(n)}),r}function AL(e,t){var r=Kr(e)?Bw:TL;return r(e,Kw(t))}function ML(e,t){var r=-1,n=Ql(e)?Array(e.length):[];return Yw(e,function(i,o,s){n[++r]=t(i,o,s)}),n}function IL(e,t){return iu(e,t)}function OL(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}function RL(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,o=wa(e),s=t!==void 0,a=t===null,c=t===t,l=wa(t);if(!a&&!l&&!o&&e>t||o&&s&&c&&!a&&!l||n&&s&&c||!r&&c||!i)return 1;if(!n&&!o&&!l&&e<t||l&&r&&i&&!n&&!o||a&&r&&i||!s&&i||!c)return-1}return 0}function PL(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,s=i.length,a=r.length;++n<s;){var c=RL(i[n],o[n]);if(c){if(n>=a)return c;var l=r[n];return c*(l=="desc"?-1:1)}}return e.index-t.index}function NL(e,t,r){t.length?t=_c(t,function(o){return Kr(o)?function(s){return Z0(s,o.length===1?o[0]:o)}:o}):t=[Sw];var n=-1;t=_c(t,eu(Kw));var i=ML(e,function(o,s,a){var c=_c(t,function(l){return l(o)});return{criteria:c,index:++n,value:o}});return OL(i,function(o,s){return PL(o,s,r)})}function kL(e,t,r,n){return e==null?[]:(Kr(t)||(t=t==null?[]:[t]),r=n?void 0:r,Kr(r)||(r=r==null?[]:[r]),NL(e,t,r))}function jL({toBack:e,onSubmitClick:t,data:r}){const{fromCoin:n,toCoin:i}=nn(),o=ie.useRef(!1),{slippage:s}=$r(),[a,c]=ie.useState(r),{fromAmountUi:l,toAmountUi:u,byAmountIn:d}=a,{amountLimit:p}=fw(s,a),{showPriceImpactTips:y,showPriceImpactWarn:x}=mw(n,i,l,u),{priceAcceptRouterData:b}=QR(a),[M,O]=ie.useState(!1),[P,k]=ie.useState(!1);ie.useMemo(()=>d?i:n,[d]);const F=ie.useMemo(()=>b!==void 0,[b]),B=()=>{if(b){if(o.current)return;o.current=!0;const z=ID(b);c(z),setTimeout(()=>{o.current=!1},300)}},W=ie.useMemo(()=>M?!1:!!x,[M,x]);return w.jsxs("div",{className:"secondary-dialog",children:[w.jsx(H0,{title:"Review your order",backClick:e}),w.jsxs("div",{className:"secondary-content",children:[w.jsxs("div",{className:"trade-info",children:[w.jsxs("div",{className:"amount-info",children:[w.jsx("span",{className:"amount",children:bs(l||"")}),w.jsx("img",{src:n==null?void 0:n.logo_url}),w.jsx("span",{className:"symbol",children:dn((n==null?void 0:n.symbol)||"")})]}),w.jsx("div",{className:"dividing-line",children:w.jsx("div",{className:"swap-icon",children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-trade"})})})}),w.jsxs("div",{className:"amount-info",children:[w.jsx("span",{className:"amount",children:bs(u||"")}),w.jsx("img",{src:i==null?void 0:i.logo_url}),w.jsx("span",{className:"symbol",children:dn((i==null?void 0:i.symbol)||"")})]})]}),w.jsxs("div",{className:"current-price-tips-box yellow",style:{fontSize:"12px",marginTop:"8px",flexDirection:"column",justifyContent:"start",gap:"10px"},children:[w.jsx("div",{className:"current-price-box",style:{backgroundColor:"#1b242c",marginTop:"-1px"},children:w.jsx(q0,{baseToken:n,quoteToken:i,baseAmount:l||"0",quoteAmount:u||"0",loading:!1})}),y&&w.jsx("div",{style:{paddingBottom:"10px",color:"var(--cs-warning)"},children:"High price difference. Be cautious before submitting your order."})]}),w.jsxs("div",{className:"swap-info-between",children:[w.jsx("div",{className:"left",children:"Slippage Tolerance"}),w.jsxs("div",{className:"right",children:[s,"%"]})]}),w.jsx(bw,{pl:"0px",pr:"0px",isLoading:!1,amountLimit:p}),w.jsx(vw,{isLoading:!1,routerData:a,noTips:!0}),x&&w.jsxs("div",{style:{width:"100%",marginTop:"8px",gap:"1px"},children:[w.jsx("div",{style:{width:"100%",gap:"8px",fontSize:"12px",backgroundColor:"var(--cs-error-10)",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderRadius:"12px",color:"#ff5073"},children:"The exchange rate of this order deviates from the market price by a large percentage. Are you sure you want to continue the swap?"}),w.jsxs("div",{style:{width:"100%",gap:"16px",display:"flex",flexDirection:"row",marginTop:"-10px"},children:[w.jsx("button",{className:"swap-btn cs-outline-btn secondary-btn",style:{fontSize:"14px",height:"42px",flex:1,color:M?"#72c1f7":"#7F98A7"},onClick:()=>{O(!0)},children:"Yes, please continue."}),w.jsx("button",{className:"swap-btn cs-outline-btn secondary-btn",style:{fontSize:"14px",height:"42px",color:"#7F98A7",flex:1},onClick:()=>e(),children:"No,cancel it."})]})]})]}),!F&&w.jsx("button",{disabled:W||P,className:"swap-btn cs-solid-btn",style:{marginTop:"8px"},onClick:()=>{P||(k(!0),t(a))},children:P?w.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:w.jsx(pw,{})}):"Confirm Swap"}),F&&w.jsxs("div",{className:"price-update",children:[w.jsxs("div",{className:"left",children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-alert"})}),w.jsx("span",{children:"Price update"})]}),w.jsx("div",{className:"right",children:w.jsx("button",{className:"cs-solid-btn",onClick:B,children:"Accept"})})]})]})}function ou(e){const{text:t,type:r}=e,[n,i]=ie.useState(!1),{addCommonToast:o}=ks(),s=a=>{n||(Rl(a),sw(t,{debug:!1,message:"message"}),o("Copied"),i(!n))};return ie.useEffect(()=>{n&&setTimeout(()=>{i(!1)},2e3)},[n]),w.jsx(w.Fragment,{children:r==="btn"?w.jsxs("div",{className:"copy-btn",onClick:s,children:[w.jsx("svg",{className:"cs-icon cs-copy-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:n?"#icon-sel":"#icon-copy"})}),w.jsx("span",{children:"Copy"})]}):w.jsx("svg",{className:"cs-icon cs-copy-icon","aria-hidden":"true",onClick:s,children:w.jsx("use",{xlinkHref:n?"#icon-sel":"#icon-copy"})})})}function DL({toBack:e,data:t,isLoading:r}){const{fromCoin:n,toCoin:i,fromAmount:o,toAmount:s}=nn(),{fetchTokenInfo:a}=ao(),[c,l]=ie.useState([]),u=async()=>{var p;return await Promise.all(((p=t==null?void 0:t.routers)==null?void 0:p.map(async y=>({...y,paths:await Promise.all(y.paths.map(async x=>({...x,fromToken:await a(x.from_type),toToken:await a(x.to_type)})))})))||[])};return ie.useEffect(()=>{u().then(d=>{l(d)})},[t]),w.jsxs("div",{className:"route-dialog",children:[w.jsx(H0,{title:"Route",backClick:e}),w.jsxs("div",{className:"route-dialog-content",children:[w.jsx("div",{className:"simple-router-box",children:w.jsx(Xw,{hasSubMenu:!1,isLoading:r,formatSwapRouter:t})}),w.jsxs("div",{className:"center",style:{flexDirection:"column",gap:"0px"},children:[w.jsxs("div",{className:"center",style:{gap:"4px",marginTop:"16px"},children:[w.jsx(Gr,{src:n==null?void 0:n.logo_url,style:{width:"26px",height:"26px",borderRadius:"100%"}}),w.jsx("span",{className:"amount",children:Nr(o,n==null?void 0:n.decimals)}),w.jsx("span",{className:"symbol",children:n==null?void 0:n.symbol})]}),w.jsx("div",{className:"route-box-h5 center",children:w.jsx("div",{style:{width:"100%",gap:"32px",border:"1px dashed #2a3238",borderRadius:"8px",display:"flex",flexDirection:"column",paddingTop:"20px",paddingBottom:"20px",overflowY:"auto",maxHeight:"280px",position:"relative"},children:c==null?void 0:c.map((d,p)=>w.jsxs("div",{className:"route-item-box-h5",children:[w.jsxs("div",{className:"percent",children:[Be(d.percentage).mul(100).toString(),"%"]}),w.jsx("div",{className:d.paths.length>1?"route-two-h5":"",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},children:d.paths.map(y=>w.jsx("div",{className:"route-path-item",children:w.jsx(gw,{autoSwitchTooltip:!0,position:"bottom",content:w.jsxs("div",{className:"router-pool-tip-con",style:{display:"flex",flexDirection:"column",minWidth:"190px"},children:[w.jsx(BL,{poolAddress:y.pool_address}),w.jsx(Sm,{token:y.fromToken}),w.jsx(Sm,{token:y.toToken})]}),children:w.jsx(LL,{path:y})})},y.to_type))})]},p))})}),w.jsxs("div",{className:"center",style:{gap:"4px"},children:[w.jsx(Gr,{src:i==null?void 0:i.logo_url,style:{width:"26px",height:"26px",borderRadius:"100%"}}),w.jsx("span",{className:"amount",children:Nr(s,i==null?void 0:i.decimals)}),w.jsx("span",{className:"symbol",children:i==null?void 0:i.symbol})]})]})]})]})}function LL({path:e}){var t,r,n;return w.jsxs("div",{role:"button",style:{display:"flex",flexDirection:"row",gap:"0px",zIndex:3},children:[w.jsxs("div",{style:{display:"flex",flexDirection:"row"},children:[w.jsx(Gr,{src:(t=e.fromToken)==null?void 0:t.logo_url,style:{width:"24px",height:"24px",borderRadius:"100%"}}),w.jsx(Gr,{src:(r=e.toToken)==null?void 0:r.logo_url,style:{width:"24px",height:"24px",borderRadius:"100%"}})]}),w.jsxs("span",{className:"provider",children:[(n=Sb[e.provider])==null?void 0:n.name," "]}),!!+e.fee_rate&&w.jsxs("div",{className:"fee-tier",children:[" ",Be(e.fee_rate).mul(100).toString(),"%"]})]})}function Sm({token:e}){const{getExplorerUrl:t}=As();return w.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",height:"40px",fontSize:"12px",gap:"12px"},children:[w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexShrink:0},children:[w.jsx(Gr,{src:e==null?void 0:e.logo_url,style:{width:"20px",height:"20px",borderRadius:"100%"}}),w.jsx("span",{style:{color:"#fff",fontSize:"12px"},children:dn((e==null?void 0:e.symbol)||"")})]}),w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[w.jsx("a",{onClick:Rl,href:t(e==null?void 0:e.coin_type,"coin"),target:"_blank",style:{textDecoration:"none",color:"#909ca4"},children:Po(e==null?void 0:e.coin_type)}),w.jsx(ou,{text:(e==null?void 0:e.coin_type)||""})]})]})}function BL({poolAddress:e}){const{getExplorerUrl:t}=As();return w.jsxs(w.Fragment,{children:[e&&w.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",fontSize:"12px",gap:"12px"},children:[w.jsx("span",{style:{color:"fff",fontSize:"12px"},children:"Pool"}),w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[w.jsx("a",{style:{color:"#fff",textDecoration:"none"},onClick:Rl,href:t(e,"poolAddress"),target:"_blank",children:Po(e)}),w.jsx(ou,{text:e})]})]}),e&&w.jsx("div",{style:{width:"100%",height:"1px",marginTop:"12px",backgroundColor:"var(--cs-border)"}})]})}function Xw({hasSubMenu:e,isLoading:t,formatSwapRouter:r}){var d;const[n,i]=ie.useState(!1),{isApp:o}=Xl(),{fetchTokenInfo:s}=ao(),a=ie.useMemo(()=>(r==null?void 0:r.routers.length)===1,[r==null?void 0:r.routers.length]),[c,l]=ie.useState(""),u=async()=>{var b,M;const p=[],y=((M=(b=r==null?void 0:r.routers)==null?void 0:b[0])==null?void 0:M.paths)||[];for(let O=0;O<y.length;O++){const P=y[O],k=await s(P==null?void 0:P.to_type);if(O===0){const F=await s(P==null?void 0:P.from_type);p.push(`${F==null?void 0:F.symbol} > ${k==null?void 0:k.symbol}`)}else p.push(k==null?void 0:k.symbol)}const x=p.join(" > ");l(x)};return ie.useEffect(()=>{a&&u()},[a]),w.jsxs("div",{className:"simple-router-block",style:{paddingLeft:e?"8px":"0px",paddingRight:e?"8px":"0px"},children:[w.jsx("div",{className:"left",style:{whiteSpace:"nowrap",color:e?"var(--cs-text-con)":"#fff",paddingRight:"8px"},children:e?"Auto Router":"Route"}),t?w.jsx(Ns,{style:{width:"80px",height:"18px"}}):w.jsxs("div",{className:"right",onClick:()=>{i(!0)},children:[w.jsx("span",{style:{textAlign:"right",color:"#fff"},children:a?c:r==null?void 0:r.router_summery}),w.jsxs("div",{className:"providers",children:[(d=r==null?void 0:r.providers)==null?void 0:d.map((p,y)=>{var x;return o?w.jsx(Gr,{src:tr[p],style:{width:"16px",height:"16px"}}):w.jsx(Jl,{content:w.jsx("div",{children:((x=Sb[p])==null?void 0:x.name)||p}),position:"top",delay:300,children:w.jsx(Gr,{src:tr[p],style:{width:"16px",height:"16px"}})},p)}),e&&w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{width:"16px",height:"16px",flexShrink:0},children:w.jsx("use",{xlinkHref:"#icon-spread"})})]})]}),n&&e&&w.jsx(DL,{data:r,isLoading:t,toBack:()=>i(!1)})]})}const qa=Ri((e,t)=>({currentTypeTab:"Default",setCurrentTypeTab:r=>{e(()=>({currentTypeTab:r}))},currentPlatformTab:"All",setCurrentPlatformTab:r=>{e(()=>({currentPlatformTab:r}))},platformList:["All","Wormhole"],setPlatformList:r=>{e(()=>({platformList:r}))},isOpenImportDialog:!1,setIsOpenImportDialog:r=>{e(()=>({isOpenImportDialog:r}))},collectTokenMap:new Map,setCollectTokenMap:(r,n=!1)=>{e(()=>({collectTokenMap:r})),n||Si.setItem(bb,r)},showTokenList:[],setShowTokenList:r=>{e(()=>({showTokenList:[...r]}))},combineTokenList:[],setComBineTokenList:r=>{e(()=>({combineTokenList:r}))},currentImportTokenData:void 0,setCurrentImportTokenData:r=>{e(()=>({currentImportTokenData:r}))},importTokenList:[],importTokenIsLoading:!1,setImportToken:(r,n)=>{const{importTokenList:i,setImportTokenList:o}=t();let s=i;if(n)s=[r,...s];else{const a=np(r.coin_type);s=i.filter(c=>np(c.coin_type)!==a)}return o(s),Si.setItem(yb,s),s},setImportTokenList:r=>{e(()=>({importTokenList:r}))},setImportTokenIsLoading:r=>{e(()=>({importTokenIsLoading:r}))},searchInput:"",setSearchInput:r=>{e(()=>({searchInput:r}))},showTokenListIsLoading:!1,setShowTokenListIsLoading:r=>{e(()=>({showTokenListIsLoading:r}))}}));Si.getItem(bb).then(e=>{e!==null&&qa.getState().setCollectTokenMap(e,!0)});Si.getItem(yb).then(e=>{e&&qa.getState().setImportTokenList(e)});function Jw(){const{setCollectTokenMap:e,collectTokenMap:t}=qa(),r=i=>{const o=new Map(t);o.get(i.coin_type)?o.delete(i.coin_type):o.set(i.coin_type,i),e(o)},n=ie.useCallback(i=>t.get(i.coin_type)!==void 0,[t]);return{handleCollectToken:r,isCollectToken:n,collectTokenMap:t}}function UL(e){const{trustedTokenList:t}=Va(),{tokenBalanceObj:r,currentAccount:n}=Yr(),{coinPriceObj:i}=cw(),{getTokenAmountValue:o}=$a(),{fetchTokenInfo:s}=ao(),{currentTypeTab:a,showTokenList:c,setShowTokenList:l,combineTokenList:u,importTokenList:d,setComBineTokenList:p,setImportToken:y,setCurrentImportTokenData:x,setImportTokenIsLoading:b,currentImportTokenData:M,searchInput:O,setSearchInput:P,importTokenIsLoading:k,showTokenListIsLoading:F,setCurrentTypeTab:B,setCurrentPlatformTab:W}=qa(),[z,G]=ie.useState(!1);ie.useEffect(()=>{t&&(t==null?void 0:t.length)>0&&G(!0)},[t]);const[re,oe]=ie.useState(!1);ie.useEffect(()=>{dp(i)||oe(!0)},[i]);const se=ie.useRef({}),[q,L]=ie.useState(!1);ie.useEffect(()=>{(!dp(r)||!l0(se.current,r))&&(se.current=r,L(!0))},[r]);const h=ie.useMemo(()=>(d==null?void 0:d.length)>1?d==null?void 0:d.map(Q=>{const Z=Sc(r==null?void 0:r[Q==null?void 0:Q.coin_type],Q),ce=Z==null?void 0:Z.totalBalanceFormat,be=Be(ce).gt("0")?o(Q==null?void 0:Q.coin_type,ce):"0";return{...Q,balance:ce,rate:be}}):d,[d,r,i]),f=(Q,Z)=>{const ce=Z&&Z.toLocaleLowerCase().trim(),be=Q.map(pe=>{let Le=0,Ae=0;pe.symbol.toLowerCase()===ce||pe.name.toLowerCase()===ce||pe.coin_type.toLowerCase()===ce?(Le=1e3,Ae=2):pe.symbol.toLowerCase().indexOf(ce)>-1?(Le=100,Ae=0):pe.name.toLowerCase().indexOf(ce)>-1?(Le=10,Ae=0):pe.coin_type.toLowerCase().indexOf(ce)>-1?(Le=1,Ae=0):pe.coin_type.toLowerCase()=="0x2::sui::sui"&&(Ae=1);let Je=Array.isArray(pe==null?void 0:pe.coin_priority)?Number(pe.coin_priority[0])||0:Number(pe==null?void 0:pe.coin_priority)||0;return e===pe.coin_type&&!Z&&(Ae=12,Le=1e3,Je=1e4),{...pe,mark:Le,sort:Ae,coin_priority_sort:Je,rateNumber:Number((pe==null?void 0:pe.rate)||"0"),balanceNumber:Number((pe==null?void 0:pe.balance)||"0")}});return kL(be,[pe=>!Z&&e===pe.coin_type?1:0,"rateNumber","balanceNumber","sort","mark","coin_priority_sort"],["desc","desc","desc","desc","desc","desc"])},m=(Q,Z=!1)=>{const ce=Z?Q.trim():Q.toLowerCase().trim(),be=["symbol","name","coin_type"];return AL(ce.length===0?u:[...u,...h],pe=>be.some(Le=>{const Ae=pe[Le];if(typeof Ae=="string"){const Je=Z?Ae:Ae.toLowerCase();return Le==="coin_type"?Je.includes(ce)||Ti(Je,!0).includes(Ti(ce,!0)):Je.includes(ce)}return!1}))},S=Q=>{Q||x(void 0);const Z=m(Q);if((Z==null?void 0:Z.length)===0){T(Q);return}else{const ce=f(Z,Q);l(ce)}},T=async Q=>{b(!0);try{if(gb(Q)){const Z=Q.trim(),ce=kr(Z).full_address,be=await s(ce);if(!be){l([]);return}const xe=Sc(r==null?void 0:r[ce],be),pe=(xe==null?void 0:xe.totalBalanceFormat)||"0",Le=Be(pe).gt("0")?o(Z,pe):"0",Ae={...be,balance:pe,rate:Le};l([Ae]),x(Ae)}else{l([]);return}}catch{x(void 0),l([]);return}finally{b(!1)}},E=Q=>{if(Q==="Default")g("All"),W("All");else{const Z=f(h,O);l(Z)}},I=()=>{if(M){const Q=y(M,!0),Z=f(Q,O);l(Z),x(void 0),P("")}},C=Q=>{const Z=y(Q,!1),ce=f(Z,O);l(ce)},g=Q=>{const Z=Q==="All"?[...u]:u.filter(be=>Q=="Native"?!be.labels||be.labels.length==0||be.labels=="Native":be.labels&&be.labels.length>0&&be.labels[0].toLowerCase()==Q.toLowerCase()),ce=f(Z,O);l(ce)};ie.useEffect(()=>{if(!z||!(t!=null&&t.length)){p([]);return}if(!(n!=null&&n.address))p(t);else if(n!=null&&n.address){const Q=[];for(const Z of t){const ce=r==null?void 0:r[Z==null?void 0:Z.coin_type],be=Sc(ce,Z),xe=(be==null?void 0:be.totalBalanceFormat)||"0",pe=(be==null?void 0:be.displayBalance)||"0",Le=Be(xe).gt("0")?o(Z==null?void 0:Z.coin_type,xe):"0";Q.push({...Z,balance:pe,rate:Nr(Le,4,!0)})}p(Q)}},[z,re,q,n==null?void 0:n.address,i]);const v=ie.useRef([]);ie.useEffect(()=>{if((u==null?void 0:u.length)>0&&!IL(v.current,u)){v.current=u;const Q=f(u);e?h.find(ce=>ce.coin_type===e)!==void 0||a!=="Default"?(B("Imported"),E("Imported")):l(M?[M]:Q):l(Q)}},[u,e]);const j=ie.useMemo(()=>{if(a==="Default"){if(!F&&(c==null?void 0:c.length)===0)return!0}else if((c==null?void 0:c.length)===0&&!k)return!0;return!1},[O,c,M,k,F]);return{showTokenList:c,handleSearch:S,handleChangePlatform:g,currentImportTokenData:M,handleChangeType:E,handleImportClick:I,handleDeleteImportClick:C,isNoData:j}}function FL({tokenList:e,onHandleTokenAction:t}){return w.jsx("div",{className:"token-collect-list",children:e.map(r=>w.jsx($L,{token:r,onHandleTokenAction:t},r.coin_type))})}function $L({token:e,onHandleTokenAction:t}){return w.jsxs("div",{className:"token-collect-item",onClick:()=>{t(e,"select_token")},children:[w.jsx("img",{src:e.logo_url,style:{marginRight:"8px"}}),w.jsx("span",{children:e.symbol}),w.jsx("i",{children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",onClick:r=>{r.stopPropagation(),t(e,"un_collect")},children:w.jsx("use",{xlinkHref:"#icon-close"})})})]})}const VL=At("/images/img_no_data@2x.png");function zL(e){const{img:t=VL,text:r,width:n="100%",height:i="auto",padding:o="20px",subItem:s}=e;return w.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:n,height:i,padding:o,boxSizing:"border-box",textAlign:"center"},children:[t&&w.jsx("img",{src:t,alt:"No Data",style:{width:"160px",height:"160px"}}),r&&w.jsx("div",{style:{color:"#fff",fontSize:"14px"},children:r}),s&&s]})}function qL({tabList:e,currentTab:t,changeTab:r}){return w.jsx("div",{className:"platform-tabs",children:e.map(n=>w.jsx("div",{className:t===n?"platform-tab-item active":"platform-tab-item",onClick:()=>{r(n)},children:n},n))})}var _m=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function HL(e,t){return!!(e===t||_m(e)&&_m(t))}function WL(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!HL(e[r],t[r]))return!1;return!0}function GL(e,t){t===void 0&&(t=WL);var r=null;function n(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(r&&r.lastThis===this&&t(i,r.lastArgs))return r.lastResult;var s=e.apply(this,i);return r={lastResult:s,lastArgs:i,lastThis:this},s}return n.clear=function(){r=null},n}function ad(){return ad=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ad.apply(null,arguments)}function Em(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cd(e,t){return cd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},cd(e,t)}function KL(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,cd(e,t)}var Cm=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function YL(e,t){return!!(e===t||Cm(e)&&Cm(t))}function XL(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!YL(e[r],t[r]))return!1;return!0}function of(e,t){t===void 0&&(t=XL);var r,n=[],i,o=!1;function s(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return o&&r===this&&t(a,n)||(i=e.apply(this,a),o=!0,r=this,n=a),i}return s}function Tm(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var JL=typeof performance=="object"&&typeof performance.now=="function",Am=JL?function(){return performance.now()}:function(){return Date.now()};function Mm(e){cancelAnimationFrame(e.id)}function ZL(e,t){var r=Am();function n(){Am()-r>=t?e.call(null):i.id=requestAnimationFrame(n)}var i={id:requestAnimationFrame(n)};return i}var sf=-1;function Im(e){if(e===void 0&&(e=!1),sf===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),sf=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return sf}var Qo=null;function Om(e){if(e===void 0&&(e=!1),Qo===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?Qo="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Qo="negative":Qo="positive-ascending"),document.body.removeChild(t),Qo}return Qo}Mn.env.NODE_ENV;var QL=150,eB=function(t,r){return t},Cc=null,Tc=null;Mn.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Cc=new WeakSet,Tc=new WeakSet);function tB(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,i=e.getItemSize,o=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,c=e.initInstanceProps,l=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(d){KL(p,d);function p(x){var b;return b=d.call(this,x)||this,b._instanceProps=c(b.props,Em(b)),b._outerRef=void 0,b._resetIsScrollingTimeoutId=null,b.state={instance:Em(b),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof b.props.initialScrollOffset=="number"?b.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},b._callOnItemsRendered=void 0,b._callOnItemsRendered=of(function(M,O,P,k){return b.props.onItemsRendered({overscanStartIndex:M,overscanStopIndex:O,visibleStartIndex:P,visibleStopIndex:k})}),b._callOnScroll=void 0,b._callOnScroll=of(function(M,O,P){return b.props.onScroll({scrollDirection:M,scrollOffset:O,scrollUpdateWasRequested:P})}),b._getItemStyle=void 0,b._getItemStyle=function(M){var O=b.props,P=O.direction,k=O.itemSize,F=O.layout,B=b._getItemStyleCache(l&&k,l&&F,l&&P),W;if(B.hasOwnProperty(M))W=B[M];else{var z=r(b.props,M,b._instanceProps),G=i(b.props,M,b._instanceProps),re=P==="horizontal"||F==="horizontal",oe=P==="rtl",se=re?z:0;B[M]=W={position:"absolute",left:oe?void 0:se,right:oe?se:void 0,top:re?0:z,height:re?"100%":G,width:re?G:"100%"}}return W},b._getItemStyleCache=void 0,b._getItemStyleCache=of(function(M,O,P){return{}}),b._onScrollHorizontal=function(M){var O=M.currentTarget,P=O.clientWidth,k=O.scrollLeft,F=O.scrollWidth;b.setState(function(B){if(B.scrollOffset===k)return null;var W=b.props.direction,z=k;if(W==="rtl")switch(Om()){case"negative":z=-k;break;case"positive-descending":z=F-P-k;break}return z=Math.max(0,Math.min(z,F-P)),{isScrolling:!0,scrollDirection:B.scrollOffset<z?"forward":"backward",scrollOffset:z,scrollUpdateWasRequested:!1}},b._resetIsScrollingDebounced)},b._onScrollVertical=function(M){var O=M.currentTarget,P=O.clientHeight,k=O.scrollHeight,F=O.scrollTop;b.setState(function(B){if(B.scrollOffset===F)return null;var W=Math.max(0,Math.min(F,k-P));return{isScrolling:!0,scrollDirection:B.scrollOffset<W?"forward":"backward",scrollOffset:W,scrollUpdateWasRequested:!1}},b._resetIsScrollingDebounced)},b._outerRefSetter=function(M){var O=b.props.outerRef;b._outerRef=M,typeof O=="function"?O(M):O!=null&&typeof O=="object"&&O.hasOwnProperty("current")&&(O.current=M)},b._resetIsScrollingDebounced=function(){b._resetIsScrollingTimeoutId!==null&&Mm(b._resetIsScrollingTimeoutId),b._resetIsScrollingTimeoutId=ZL(b._resetIsScrolling,QL)},b._resetIsScrolling=function(){b._resetIsScrollingTimeoutId=null,b.setState({isScrolling:!1},function(){b._getItemStyleCache(-1,null)})},b}p.getDerivedStateFromProps=function(b,M){return rB(b,M),u(b),null};var y=p.prototype;return y.scrollTo=function(b){b=Math.max(0,b),this.setState(function(M){return M.scrollOffset===b?null:{scrollDirection:M.scrollOffset<b?"forward":"backward",scrollOffset:b,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},y.scrollToItem=function(b,M){M===void 0&&(M="auto");var O=this.props,P=O.itemCount,k=O.layout,F=this.state.scrollOffset;b=Math.max(0,Math.min(b,P-1));var B=0;if(this._outerRef){var W=this._outerRef;k==="vertical"?B=W.scrollWidth>W.clientWidth?Im():0:B=W.scrollHeight>W.clientHeight?Im():0}this.scrollTo(o(this.props,b,M,F,this._instanceProps,B))},y.componentDidMount=function(){var b=this.props,M=b.direction,O=b.initialScrollOffset,P=b.layout;if(typeof O=="number"&&this._outerRef!=null){var k=this._outerRef;M==="horizontal"||P==="horizontal"?k.scrollLeft=O:k.scrollTop=O}this._callPropsCallbacks()},y.componentDidUpdate=function(){var b=this.props,M=b.direction,O=b.layout,P=this.state,k=P.scrollOffset,F=P.scrollUpdateWasRequested;if(F&&this._outerRef!=null){var B=this._outerRef;if(M==="horizontal"||O==="horizontal")if(M==="rtl")switch(Om()){case"negative":B.scrollLeft=-k;break;case"positive-ascending":B.scrollLeft=k;break;default:var W=B.clientWidth,z=B.scrollWidth;B.scrollLeft=z-W-k;break}else B.scrollLeft=k;else B.scrollTop=k}this._callPropsCallbacks()},y.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Mm(this._resetIsScrollingTimeoutId)},y.render=function(){var b=this.props,M=b.children,O=b.className,P=b.direction,k=b.height,F=b.innerRef,B=b.innerElementType,W=b.innerTagName,z=b.itemCount,G=b.itemData,re=b.itemKey,oe=re===void 0?eB:re,se=b.layout,q=b.outerElementType,L=b.outerTagName,h=b.style,f=b.useIsScrolling,m=b.width,S=this.state.isScrolling,T=P==="horizontal"||se==="horizontal",E=T?this._onScrollHorizontal:this._onScrollVertical,I=this._getRangeToRender(),C=I[0],g=I[1],v=[];if(z>0)for(var j=C;j<=g;j++)v.push(ie.createElement(M,{data:G,key:oe(j,G),index:j,isScrolling:f?S:void 0,style:this._getItemStyle(j)}));var Q=n(this.props,this._instanceProps);return ie.createElement(q||L||"div",{className:O,onScroll:E,ref:this._outerRefSetter,style:ad({position:"relative",height:k,width:m,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:P},h)},ie.createElement(B||W||"div",{children:v,ref:F,style:{height:T?"100%":Q,pointerEvents:S?"none":void 0,width:T?Q:"100%"}}))},y._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var b=this.props.itemCount;if(b>0){var M=this._getRangeToRender(),O=M[0],P=M[1],k=M[2],F=M[3];this._callOnItemsRendered(O,P,k,F)}}if(typeof this.props.onScroll=="function"){var B=this.state,W=B.scrollDirection,z=B.scrollOffset,G=B.scrollUpdateWasRequested;this._callOnScroll(W,z,G)}},y._getRangeToRender=function(){var b=this.props,M=b.itemCount,O=b.overscanCount,P=this.state,k=P.isScrolling,F=P.scrollDirection,B=P.scrollOffset;if(M===0)return[0,0,0,0];var W=s(this.props,B,this._instanceProps),z=a(this.props,W,B,this._instanceProps),G=!k||F==="backward"?Math.max(1,O):1,re=!k||F==="forward"?Math.max(1,O):1;return[Math.max(0,W-G),Math.max(0,Math.min(M-1,z+re)),W,z]},p}(ie.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var rB=function(t,r){var n=t.children,i=t.direction,o=t.height,s=t.layout,a=t.innerTagName,c=t.outerTagName,l=t.width,u=r.instance;if(Mn.env.NODE_ENV!=="production"){(a!=null||c!=null)&&Tc&&!Tc.has(u)&&(Tc.add(u),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var d=i==="horizontal"||s==="horizontal";switch(i){case"horizontal":case"vertical":Cc&&!Cc.has(u)&&(Cc.add(u),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+i+'" was specified.'))}switch(s){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+s+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(d&&typeof l!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(l===null?"null":typeof l)+'" was specified.'));if(!d&&typeof o!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(o===null?"null":typeof o)+'" was specified.'))}},nB=tB({getItemOffset:function(t,r){var n=t.itemSize;return r*n},getItemSize:function(t,r){var n=t.itemSize;return n},getEstimatedTotalSize:function(t){var r=t.itemCount,n=t.itemSize;return n*r},getOffsetForIndexAndAlignment:function(t,r,n,i,o,s){var a=t.direction,c=t.height,l=t.itemCount,u=t.itemSize,d=t.layout,p=t.width,y=a==="horizontal"||d==="horizontal",x=y?p:c,b=Math.max(0,l*u-x),M=Math.min(b,r*u),O=Math.max(0,r*u-x+u+s);switch(n==="smart"&&(i>=O-x&&i<=M+x?n="auto":n="center"),n){case"start":return M;case"end":return O;case"center":{var P=Math.round(O+(M-O)/2);return P<Math.ceil(x/2)?0:P>b+Math.floor(x/2)?b:P}case"auto":default:return i>=O&&i<=M?i:i<O?O:M}},getStartIndexForOffset:function(t,r){var n=t.itemCount,i=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/i)))},getStopIndexForStartIndex:function(t,r,n){var i=t.direction,o=t.height,s=t.itemCount,a=t.itemSize,c=t.layout,l=t.width,u=i==="horizontal"||c==="horizontal",d=r*a,p=u?l:o,y=Math.ceil((p+n-d)/a);return Math.max(0,Math.min(s-1,r+y-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(Mn.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function Rm(e,t){for(var r in e)if(!(r in t))return!0;for(var n in t)if(e[n]!==t[n])return!0;return!1}var iB=["style"],oB=["style"];function sB(e,t){var r=e.style,n=Tm(e,iB),i=t.style,o=Tm(t,oB);return!Rm(r,i)&&!Rm(n,o)}const aB=ie.memo(({data:e,index:t,style:r})=>{const{items:n,onHandleTokenAction:i,showCollect:o,showDelete:s}=e,a=n[t];return w.jsx("div",{style:r,children:w.jsx(uB,{data:a,onHandleTokenAction:i,showCollect:o,showDelete:s})})},sB),cB=GL((e,t,r,n)=>({items:e,onHandleTokenAction:t,showCollect:r,showDelete:n}));function lB({showTokenList:e,onHandleTokenAction:t,showCollect:r=!0,showDelete:n=!1}){const i=ie.useRef(null);ie.useEffect(()=>{i.current&&i.current.scrollTo(0)},[e.length]);const o=cB(e,t,r,n);return w.jsx("div",{className:"token-list",children:w.jsx(nB,{ref:i,style:{overflowY:"scroll",scrollbarWidth:"none",msOverflowStyle:"none",padding:"8px"},height:360,itemCount:e.length,itemData:o,itemSize:72,width:"100%",children:aB})})}function uB({data:e,showCollect:t,showDelete:r,onHandleTokenAction:n}){const{isCollectToken:i}=Jw(),{getExplorerUrl:o}=As();return $a(),w.jsxs("div",{className:"token-list-item",onClick:s=>{t&&(s.stopPropagation(),n(e,"select_token"))},children:[w.jsx(Gr,{className:"token-img",src:e==null?void 0:e.logo_url,showWarn:!t}),w.jsxs("div",{className:"token-info",children:[w.jsx("h4",{className:"token-symbol",children:w.jsx("span",{children:dn(e.symbol)})}),w.jsx("p",{className:"token-name",children:dn(e==null?void 0:e.name,20)}),w.jsxs("div",{className:"copy",children:[w.jsx("a",{onClick:Rl,href:o(e==null?void 0:e.coin_type,"coin"),target:"_blank",style:{fontSize:"12px"},children:Po(e==null?void 0:e.coin_type)}),w.jsx(ou,{text:e==null?void 0:e.coin_type})]})]}),w.jsxs("div",{className:"token-balance",children:[w.jsxs("div",{className:"balance",children:[w.jsx("h4",{children:e==null?void 0:e.balance}),w.jsx("p",{children:e!=null&&e.rate?pb(e==null?void 0:e.rate,2):""})]}),r&&w.jsx("div",{className:"collect-button",onClick:s=>{s.stopPropagation(),n(e,"delete_import")},children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_del"})})}),t&&w.jsx("div",{className:"collect-button",onClick:s=>{s.stopPropagation(),n(e,"collect_token")},children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:i(e)?"#icon-star_sel":"#icon-star"})})})]})]},e==null?void 0:e.coin_type)}function fB({currentType:e,changeTab:t}){const r=["Default","Imported"];return w.jsx("div",{className:"type-tabs",children:r.map(n=>w.jsx("div",{className:e===n?"type-tab-item active":"type-tab-item",onClick:()=>t(n),children:n},n))})}function dB({backClick:e,onSelectToken:t,currToken:r}){const{showTokenList:n,isNoData:i,handleSearch:o,handleChangePlatform:s,handleChangeType:a,handleImportClick:c,handleDeleteImportClick:l}=UL(r==null?void 0:r.coin_type),{importTokenList:u,currentTypeTab:d,setCurrentTypeTab:p,currentPlatformTab:y,setCurrentPlatformTab:x,platformList:b,isOpenImportDialog:M,setIsOpenImportDialog:O,setSearchInput:P,searchInput:k,importTokenIsLoading:F,currentImportTokenData:B,setCurrentImportTokenData:W}=qa();ie.useEffect(()=>()=>{P(""),x("All"),p("Default"),W(void 0)},[]);const{handleCollectToken:z,collectTokenMap:G}=Jw(),re=m=>{p(m),a(m)},oe=m=>{x(m),s(m)},se=()=>{c(),O(!1)},q=m=>{let S=m.replace(/[^a-zA-Z0-9\s]+$/g,"").trim();P(S),S?L(S):(L(""),re("Default"))},L=z0(m=>{gb(m)?o(Ti(m,!0)):o(m)},300),h=(m,S)=>{if(S==="delete_import"){l(m);return}if(S==="collect_token"||S==="un_collect"){z(m);return}S==="select_token"&&(t(m),e())},f=ie.useMemo(()=>Array.from(G.values()),[G]);return w.jsxs("div",{className:"token-select-modal",children:[w.jsx(H0,{backClick:e,title:"Select Token"}),w.jsxs("div",{className:"token-select-content",style:{position:"relative"},children:[w.jsxs("div",{className:"center-content",children:[w.jsxs("div",{className:"search-input",style:{position:"relative"},children:[w.jsx("input",{className:"token-search-input",placeholder:"Search by token or address",value:k,onChange:m=>q(m.target.value),style:{paddingRight:"40px"}}),k.length>0&&w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{width:"20px",height:"20px",cursor:"pointer",position:"absolute",top:"50%",transform:"translateY(-50%)",right:"12px"},onClick:m=>{q("")},children:w.jsx("use",{xlinkHref:"#icon-close"})})]}),f.length>0&&w.jsx(FL,{tokenList:f,onHandleTokenAction:h}),k.length===0&&w.jsx(fB,{currentType:d,changeTab:re}),k.length===0&&d==="Default"&&w.jsx(qL,{tabList:b,currentTab:y,changeTab:oe})]}),i&&w.jsx(hB,{showTooltip:k.length>0,text:k.length>0||B===void 0?"No tokens found":"No Imported Tokens"}),F&&w.jsx(aw,{}),B&&w.jsx("div",{style:{width:"93%",marginLeft:"16px",backgroundColor:"var(--cs-warning-10)",borderRadius:"12px",padding:"16px",fontSize:"12px",marginTop:"16px",color:" var(--cs-warning)"},children:"The token is not on the Frequently Traded List. Please note that anyone can create a token on Sui blockchain with any name, including creating fake versions of existing tokens or tokens that claim to represent projects that do not have a token. Always conduct your own research before trading."}),n.length>0&&w.jsxs("div",{style:{position:"relative"},children:[w.jsx(lB,{showTokenList:n,showCollect:!B,showDelete:!B&&d==="Imported",onHandleTokenAction:h}),B&&w.jsx("div",{className:"center",style:{position:"absolute",top:"100px",left:"50%",transform:"translateX(-50%)"},children:w.jsx("button",{className:"cs-solid-btn swap-btn",style:{height:"32px",width:"140px",fontSize:"14px",borderRadius:"8px",fontFamily:"Inter, Inter",fontWeight:500},onClick:()=>{se(),h(B,"select_token")},children:"Import"})})]})]})]})}function hB({showTooltip:e,text:t}){return w.jsx("div",{style:{height:"360px"},children:w.jsx(zL,{text:t,subItem:e?w.jsx("div",{children:w.jsx(Jl,{position:"bottom",content:w.jsx("div",{children:"The unique id of coin"}),children:w.jsxs("div",{style:{fontSize:"12px",color:"var(--cs-text-con)",display:"flex",flexDirection:"row"},children:["Or you can enter Coin Type",w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{cursor:"pointer",width:"20px",height:"20px"},children:w.jsx("use",{xlinkHref:"#icon-tips"})})]})})}):void 0})})}function pB({onClose:e,tokenList:t,onSureClick:r}){const[n,i]=ie.useState(!1),{setIgnoreWarnToken:o}=$r();return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"dialog-mask",onClick:e}),w.jsxs("div",{className:"import-dialog",children:[w.jsxs("div",{className:"cs-dialog-header",children:[w.jsx("div",{className:"title",children:"Tips"}),w.jsx("svg",{className:"cs-icon","aria-hidden":"true",onClick:e,children:w.jsx("use",{xlinkHref:"#icon-close"})})]}),w.jsxs("div",{className:"import-content",children:[w.jsx("div",{className:"tip-text-box",children:w.jsx("p",{className:"tips-text",children:"The default trading pair given in this swap widget contains a community imported token that is imported by the integrator. Please acknowledge the risk and conduct your own research before interacting."})}),t.map(s=>w.jsxs("div",{className:"import-token-info",children:[w.jsx(Gr,{style:{marginRight:"4px",width:"30px",height:"30px",borderRadius:"36px"},src:s.logo_url}),w.jsxs("div",{className:"info",children:[w.jsx("div",{className:"name",children:w.jsxs("span",{children:[" ",s.symbol," "]})}),w.jsxs("div",{className:"address",children:[w.jsx("span",{children:Po(s.coin_type)}),w.jsx(ou,{text:s.coin_type})]})]})]},s.coin_type)),w.jsxs("div",{className:"risk-checkbox",children:[w.jsx(zl,{color:"indigo",checked:n,variant:"soft",className:"cs-checkbox",onClick:()=>{i(!n)}}),w.jsx("span",{children:"I acknowledge the risk"})]}),w.jsxs("div",{className:"button-block",children:[w.jsx("button",{className:"cs-outline-btn",onClick:e,children:"Cancel"}),w.jsx("button",{className:"cs-solid-btn",disabled:!n,onClick:()=>{r(),t.forEach(s=>{o(s.coin_type)})},children:"Confirm"})]})]})]})]})}function Zw(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}var Ea;(function(e){e.event="event",e.props="prop"})(Ea||(Ea={}));function zi(){}function mB(e){var t,r=void 0;return function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return t&&n.length===t.length&&n.every(function(o,s){return o===t[s]})||(t=n,r=e.apply(void 0,n)),r}}function Ca(e){return!!(e||"").match(/\d/)}function ds(e){return e==null}function gB(e){return typeof e=="number"&&isNaN(e)}function Qw(e){return ds(e)||gB(e)||typeof e=="number"&&!isFinite(e)}function e6(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function vB(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function bB(e,t,r){var n=vB(r),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(n,"$1"+t)}function yB(e){var t=ie.useRef(e);t.current=e;var r=ie.useRef(function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return t.current.apply(t,n)});return r.current}function th(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var i=e.split("."),o=i[0],s=i[1]||"";return{beforeDecimal:o,afterDecimal:s,hasNegation:r,addNegation:n}}function wB(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var r=e.split("."),n=r[0].replace(/^0+/,"")||"0",i=r[1]||"";return(t?"-":"")+n+(i?"."+i:"")}function t6(e,t,r){for(var n="",i=r?"0":"",o=0;o<=t-1;o++)n+=e[o]||i;return n}function Pm(e,t){return Array(t+1).join(e)}function r6(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),i=n[0],o=n[1];if(o=Number(o),!o)return r+i;i=i.replace(".","");var s=1+o,a=i.length;return s<0?i="0."+Pm("0",Math.abs(s))+i:s>=a?i=i+Pm("0",s-a):i=(i.substring(0,s)||"0")+"."+i.substring(s),r+i}function Nm(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,i=th(e),o=i.beforeDecimal,s=i.afterDecimal,a=i.hasNegation,c=parseFloat("0."+(s||"0")),l=s.length<=t?"0."+s:c.toFixed(t),u=l.split("."),d=o;o&&Number(u[0])&&(d=o.split("").reverse().reduce(function(b,M,O){return b.length>O?(Number(b[0])+Number(M)).toString()+b.substring(1,b.length):M+b},u[0]));var p=t6(u[1]||"",t,r),y=a?"-":"",x=n?".":"";return""+y+d+x+p}function So(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var r=e.createTextRange();return r.move("character",t),r.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var n6=mB(function(e,t){for(var r=0,n=0,i=e.length,o=t.length;e[r]===t[r]&&r<i;)r++;for(;e[i-1-n]===t[o-1-n]&&o-n>r&&i-n>r;)n++;return{from:{start:r,end:i-n},to:{start:r,end:o-n}}}),xB=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function SB(e,t,r){return Math.min(Math.max(e,t),r)}function af(e){return Math.max(e.selectionStart,e.selectionEnd)}function _B(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function EB(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function CB(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,i=e.formattedValueIndex;return t[n]===r[i]}function TB(e,t,r,n,i,o,s){s===void 0&&(s=CB);var a=i.findIndex(function(F){return F}),c=e.slice(0,a);!t&&!r.startsWith(c)&&(t=c,r=c+r,n=n+c.length);for(var l=r.length,u=e.length,d={},p=new Array(l),y=0;y<l;y++){p[y]=-1;for(var x=0,b=u;x<b;x++){var M=s({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:y,formattedValueIndex:x});if(M&&d[x]!==!0){p[y]=x,d[x]=!0;break}}}for(var O=n;O<l&&(p[O]===-1||!o(r[O]));)O++;var P=O===l||p[O]===-1?u:p[O];for(O=n-1;O>0&&p[O]===-1;)O--;var k=O===-1||p[O]===-1?0:p[O]+1;return k>P?P:n-k<P-n?k:P}function km(e,t,r,n){var i=e.length;if(t=SB(t,0,i),n==="left"){for(;t>=0&&!r[t];)t--;t===-1&&(t=r.indexOf(!0))}else{for(;t<=i&&!r[t];)t++;t>i&&(t=r.lastIndexOf(!0))}return t===-1&&(t=i),t}function AB(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(Ca(e[r])||Ca(e[r-1]));return t}function i6(e,t,r,n,i,o){o===void 0&&(o=zi);var s=yB(function(x,b){var M,O;return Qw(x)?(O="",M=""):typeof x=="number"||b?(O=typeof x=="number"?r6(x):x,M=n(O)):(O=i(x,void 0),M=n(O)),{formattedValue:M,numAsString:O}}),a=ie.useState(function(){return s(ds(e)?t:e,r)}),c=a[0],l=a[1],u=function(x,b){x.formattedValue!==c.formattedValue&&l({formattedValue:x.formattedValue,numAsString:x.value}),o(x,b)},d=e,p=r;ds(e)&&(d=c.numAsString,p=!0);var y=s(d,p);return ie.useMemo(function(){l(y)},[y.formattedValue]),[c,u]}function MB(e){return e.replace(/[^0-9]/g,"")}function IB(e){return e}function OB(e){var t=e.type;t===void 0&&(t="text");var r=e.displayType;r===void 0&&(r="input");var n=e.customInput,i=e.renderText,o=e.getInputRef,s=e.format;s===void 0&&(s=IB);var a=e.removeFormatting;a===void 0&&(a=MB);var c=e.defaultValue,l=e.valueIsNumericString,u=e.onValueChange,d=e.isAllowed,p=e.onChange;p===void 0&&(p=zi);var y=e.onKeyDown;y===void 0&&(y=zi);var x=e.onMouseUp;x===void 0&&(x=zi);var b=e.onFocus;b===void 0&&(b=zi);var M=e.onBlur;M===void 0&&(M=zi);var O=e.value,P=e.getCaretBoundary;P===void 0&&(P=AB);var k=e.isValidInputCharacter;k===void 0&&(k=Ca);var F=e.isCharacterSame,B=Zw(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),W=i6(O,c,!!l,s,a,u),z=W[0],G=z.formattedValue,re=z.numAsString,oe=W[1],se=ie.useRef(),q=ie.useRef({formattedValue:G,numAsString:re}),L=function(we,he){q.current={formattedValue:we.formattedValue,numAsString:we.value},oe(we,he)},h=ie.useState(!1),f=h[0],m=h[1],S=ie.useRef(null),T=ie.useRef({setCaretTimeout:null,focusTimeout:null});ie.useEffect(function(){return m(!0),function(){clearTimeout(T.current.setCaretTimeout),clearTimeout(T.current.focusTimeout)}},[]);var E=s,I=function(we,he){var Ce=parseFloat(he);return{formattedValue:we,value:he,floatValue:isNaN(Ce)?void 0:Ce}},C=function(we,he,Ce){we.selectionStart===0&&we.selectionEnd===we.value.length||(So(we,he),T.current.setCaretTimeout=setTimeout(function(){we.value===Ce&&we.selectionStart!==he&&So(we,he)},0))},g=function(we,he,Ce){return km(we,he,P(we),Ce)},v=function(we,he,Ce){var Ve=P(he),ke=TB(he,G,we,Ce,Ve,k,F);return ke=km(he,ke,Ve),ke},j=function(we){var he=we.formattedValue;he===void 0&&(he="");var Ce=we.input,Ve=we.source,ke=we.event,Te=we.numAsString,Me;if(Ce){var Ue=we.inputValue||Ce.value,ut=af(Ce);Ce.value=he,Me=v(Ue,he,ut),Me!==void 0&&C(Ce,Me,he)}he!==G&&L(I(he,Te),{event:ke,source:Ve})};ie.useEffect(function(){var we=q.current,he=we.formattedValue,Ce=we.numAsString;(G!==he||re!==Ce)&&L(I(G,re),{event:void 0,source:Ea.props})},[G,re]);var Q=S.current?af(S.current):void 0,Z=typeof window<"u"?ie.useLayoutEffect:ie.useEffect;Z(function(){var we=S.current;if(G!==q.current.formattedValue&&we){var he=v(q.current.formattedValue,G,Q);we.value=G,C(we,he,G)}},[G]);var ce=function(we,he,Ce){var Ve=he.target,ke=se.current?xB(se.current,Ve.selectionEnd):n6(G,we),Te=Object.assign(Object.assign({},ke),{lastValue:G}),Me=a(we,Te),Ue=E(Me);if(Me=a(Ue,void 0),d&&!d(I(Ue,Me))){var ut=he.target,ft=af(ut),ze=v(we,G,ft);return ut.value=G,C(ut,ze,G),!1}return j({formattedValue:Ue,numAsString:Me,inputValue:we,event:he,source:Ce,input:he.target}),!0},be=function(we,he){he===void 0&&(he=0);var Ce=we.selectionStart,Ve=we.selectionEnd;se.current={selectionStart:Ce,selectionEnd:Ve+he}},xe=function(we){var he=we.target,Ce=he.value,Ve=ce(Ce,we,Ea.event);Ve&&p(we),se.current=void 0},pe=function(we){var he=we.target,Ce=we.key,Ve=he.selectionStart,ke=he.selectionEnd,Te=he.value;Te===void 0&&(Te="");var Me;Ce==="ArrowLeft"||Ce==="Backspace"?Me=Math.max(Ve-1,0):Ce==="ArrowRight"?Me=Math.min(Ve+1,Te.length):Ce==="Delete"&&(Me=Ve);var Ue=0;Ce==="Delete"&&Ve===ke&&(Ue=1);var ut=Ce==="ArrowLeft"||Ce==="ArrowRight";if(Me===void 0||Ve!==ke&&!ut){y(we),be(he,Ue);return}var ft=Me;if(ut){var ze=Ce==="ArrowLeft"?"left":"right";ft=g(Te,Me,ze),ft!==Me&&we.preventDefault()}else Ce==="Delete"&&!k(Te[Me])?ft=g(Te,Me,"right"):Ce==="Backspace"&&!k(Te[Me])&&(ft=g(Te,Me,"left"));ft!==Me&&C(he,ft,Te),y(we),be(he,Ue)},Le=function(we){var he=we.target,Ce=function(){var Ve=he.selectionStart,ke=he.selectionEnd,Te=he.value;if(Te===void 0&&(Te=""),Ve===ke){var Me=g(Te,Ve);Me!==Ve&&C(he,Me,Te)}};Ce(),requestAnimationFrame(function(){Ce()}),x(we),be(he)},Ae=function(we){we.persist&&we.persist();var he=we.target,Ce=we.currentTarget;S.current=he,T.current.focusTimeout=setTimeout(function(){var Ve=he.selectionStart,ke=he.selectionEnd,Te=he.value;Te===void 0&&(Te="");var Me=g(Te,Ve);Me!==Ve&&!(Ve===0&&ke===Te.length)&&C(he,Me,Te),b(Object.assign(Object.assign({},we),{currentTarget:Ce}))},0)},Je=function(we){S.current=null,clearTimeout(T.current.focusTimeout),clearTimeout(T.current.setCaretTimeout),M(we)},dt=f&&_B()?"numeric":void 0,je=Object.assign({inputMode:dt},B,{type:t,value:G,onChange:xe,onKeyDown:pe,onMouseUp:Le,onFocus:Ae,onBlur:Je});if(r==="text")return i?ie.createElement(ie.Fragment,null,i(G,B)||null):ie.createElement("span",Object.assign({},B,{ref:o}),G);if(n){var pt=n;return ie.createElement(pt,Object.assign({},je,{ref:o}))}return ie.createElement("input",Object.assign({},je,{ref:o}))}function jm(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var o=t.suffix;o===void 0&&(o="");var s=t.allowNegative,a=t.thousandsGroupStyle;if(a===void 0&&(a="thousand"),e===""||e==="-")return e;var c=su(t),l=c.thousandSeparator,u=c.decimalSeparator,d=r!==0&&e.indexOf(".")!==-1||r&&n,p=th(e,s),y=p.beforeDecimal,x=p.afterDecimal,b=p.addNegation;return r!==void 0&&(x=t6(x,r,!!n)),l&&(y=bB(y,l,a)),i&&(y=i+y),o&&(x=x+o),b&&(y="-"+y),e=y+(d&&u||"")+x,e}function su(e){var t=e.decimalSeparator;t===void 0&&(t=".");var r=e.thousandSeparator,n=e.allowedDecimalSeparators;return r===!0&&(r=","),n||(n=[t,"."]),{decimalSeparator:t,thousandSeparator:r,allowedDecimalSeparators:n}}function RB(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),i=r.test(e),o=n.test(e);return e=e.replace(/-/g,""),i&&!o&&t&&(e="-"+e),e}function PB(e,t){return new RegExp("(^-)|[0-9]|"+e6(e),t?"g":void 0)}function NB(e,t,r){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(r!=null&&r.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function kB(e,t,r){var n;t===void 0&&(t=EB(e));var i=r.allowNegative,o=r.prefix;o===void 0&&(o="");var s=r.suffix;s===void 0&&(s="");var a=r.decimalScale,c=t.from,l=t.to,u=l.start,d=l.end,p=su(r),y=p.allowedDecimalSeparators,x=p.decimalSeparator,b=e[d]===x;if(Ca(e)&&(e===o||e===s)&&t.lastValue==="")return e;if(d-u===1&&y.indexOf(e[u])!==-1){var M=a===0?"":x;e=e.substring(0,u)+M+e.substring(u+1,e.length)}var O=function(S,T,E){var I=!1,C=!1;o.startsWith("-")?I=!1:S.startsWith("--")?(I=!1,C=!0):s.startsWith("-")&&S.length===s.length?I=!1:S[0]==="-"&&(I=!0);var g=I?1:0;return C&&(g=2),g&&(S=S.substring(g),T-=g,E-=g),{value:S,start:T,end:E,hasNegation:I}},P=O(e,u,d),k=P.hasNegation;n=P,e=n.value,u=n.start,d=n.end;var F=O(t.lastValue,c.start,c.end),B=F.start,W=F.end,z=F.value,G=e.substring(u,d);e.length&&z.length&&(B>z.length-s.length||W<o.length)&&!(G&&s.startsWith(G))&&(e=z);var re=0;e.startsWith(o)?re+=o.length:u<o.length&&(re=u),e=e.substring(re),d-=re;var oe=e.length,se=e.length-s.length;e.endsWith(s)?oe=se:(d>se||d>e.length-s.length)&&(oe=d),e=e.substring(0,oe),e=RB(k?"-"+e:e,i),e=(e.match(PB(x,!0))||[]).join("");var q=e.indexOf(x);e=e.replace(new RegExp(e6(x),"g"),function(S,T){return T===q?".":""});var L=th(e,i),h=L.beforeDecimal,f=L.afterDecimal,m=L.addNegation;return l.end-l.start<c.end-c.start&&h===""&&b&&!parseFloat(f)&&(e=m?"-":""),e}function jB(e,t){var r=t.prefix;r===void 0&&(r="");var n=t.suffix;n===void 0&&(n="");var i=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";i.fill(!1,0,r.length+(o?1:0));var s=e.length;return i.fill(!1,s-n.length+1,s+1),i}function DB(e){var t=su(e),r=t.thousandSeparator,n=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var o=e.allowNegative;if(o===void 0&&(o=!0),r===n)throw new Error(`
|
|
103
103
|
Decimal separator can't be same as thousand separator.
|
|
104
104
|
thousandSeparator: `+r+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
105
105
|
decimalSeparator: `+n+` (default value for decimalSeparator is .)
|
|
@@ -107,4 +107,4 @@ body { background-color: var(--color-page-background); }
|
|
|
107
107
|
Prefix can't start with '-' when allowNegative is true.
|
|
108
108
|
prefix: `+i+`
|
|
109
109
|
allowNegative: `+o+`
|
|
110
|
-
`),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function OB(e){e=RB(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,r=e.allowNegative,n=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=zi);var o=e.onBlur;o===void 0&&(o=zi);var s=e.thousandSeparator,a=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l="");var u=e.defaultValue,d=e.value,p=e.valueIsNumericString,y=e.onValueChange,x=Xw(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),b=su(e),M=b.decimalSeparator,R=b.allowedDecimalSeparators,P=function(m){return Nm(m,e)},k=function(m,S){return MB(m,S,e)},F=ds(d)?u:d,B=p??AB(F,l,t);ds(d)?ds(u)||(B=B||typeof u=="number"):B=B||typeof d=="number";var W=function(m){return Jw(m)?m:(typeof m=="number"&&(m=e6(m)),B&&typeof a=="number"?Om(m,a,!!c):m)},z=r6(W(d),W(u),!!B,P,k,y),G=z[0],re=G.numAsString,oe=G.formattedValue,se=z[1],q=function(m){var S=m.target,T=m.key,E=S.selectionStart,I=S.selectionEnd,C=S.value;if(C===void 0&&(C=""),(T==="Backspace"||T==="Delete")&&I<l.length){m.preventDefault();return}if(E!==I){i(m);return}T==="Backspace"&&C[0]==="-"&&E===l.length+1&&r&&So(S,1),a&&c&&(T==="Backspace"&&C[E-1]===M?(So(S,E-1),m.preventDefault()):T==="Delete"&&C[E]===M&&m.preventDefault()),R!=null&&R.includes(T)&&C[E]===M&&So(S,E+1);var g=s===!0?",":s;T==="Backspace"&&C[E-1]===g&&So(S,E-1),T==="Delete"&&C[E]===g&&So(S,E+1),i(m)},L=function(m){var S=re;if(S.match(/\d/g)||(S=""),n||(S=pB(S)),c&&a&&(S=Om(S,a,c)),S!==re){var T=Nm(S,e);se({formattedValue:T,value:S,floatValue:parseFloat(S)},{event:m,source:Ea.event})}o(m)},h=function(m){return m===M?!0:Ca(m)},f=function(m){var S=m.currentValue,T=m.lastValue,E=m.formattedValue,I=m.currentValueIndex,C=m.formattedValueIndex,g=S[I],v=E[C],j=t6(T,S),Q=j.to,Z=function(ce){return k(ce).indexOf(".")+l.length};return d===0&&c&&a&&S[Q.start]===M&&Z(S)<I&&Z(E)>C?!1:I>=Q.start&&I<Q.end&&R&&R.includes(g)&&v===M?!0:g===v};return Object.assign(Object.assign({},x),{value:oe,valueIsNumericString:!1,isValidInputCharacter:h,isCharacterSame:f,onValueChange:se,format:P,removeFormatting:k,getCaretBoundary:function(m){return IB(m,e)},onKeyDown:q,onBlur:L})}function PB(e){var t=OB(e);return ie.createElement(EB,Object.assign({},t))}function NB(e){const{className:t,value:r,decimals:n,placeholder:i,style:o,onChange:s,maxValue:a,minValue:c=0,inputAllowed:l=!0,prefix:u,...d}=e,p=y=>{var M;const x=((M=y==null?void 0:y.target)==null?void 0:M.value)||"";let b=x;if(x.startsWith("0")&&x!=="0"&&!x.startsWith("0.")&&(b=x.replace(/^0+/,"")),b){if(b.startsWith(".")){s(b.slice(1,b.length));return}let R=String(b).replace(/,/g,"");if(R.startsWith("-")){s("");return}u&&(R=R.replace(u,"")),a!==void 0&&Be(R).gt(a)?R=a.toString():c!==void 0&&Be(R).lt(c)&&(R=c.toString()),s(String(R))}else s("")};return w.jsx(PB,{className:t,value:r,disabled:!l,placeholder:i,decimalScale:n,prefix:u,allowLeadingZeros:!0,thousandSeparator:",",isAllowed:y=>!y.value.startsWith("-"),onChange:p,...d,style:{...o,cursor:l?"pointer":"not-allowed",fontFamily:"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",fontFeatureSettings:"tnum",fontVariant:"tabular-nums"}})}function kB(e){const{token:t,handleTokenSelectClick:r}=e;return w.jsxs("div",{className:"token-select-block",onClick:()=>{r&&r()},children:[w.jsx("div",{className:"token-img-box",children:w.jsx(Gr,{src:t==null?void 0:t.logo_url})},t==null?void 0:t.coin_type),w.jsx("div",{className:"name",children:w.jsxs("h4",{className:"truncate-text",children:[" ",(t==null?void 0:t.symbol)||"Select"]})}),w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-arrow"})})]})}function km({label:e,amount:t,amountValue:r,balance:n,onInputChange:i,handleTokenSelectClick:o,token:s,loading:a=!1,showMax:c=!0,showHalf:l=!0,inputAllowed:u=!0,marginTop:d}){const[p,y]=ie.useState(!1),{currentAccount:x}=Yr(),b=()=>{const R=Be((n==null?void 0:n.totalBalanceFormat)||"0").div(2),P=Pr(R.toString(),s==null?void 0:s.decimals,!0).toString();t&&Be(P).eq(t)||i(P)},M=()=>{const R=Be((n==null?void 0:n.totalBalanceFormat)||0),P=Nr((s==null?void 0:s.coin_type)||"").full_address===ul,k=.05;let F=R;P&&Be(R).gt(k)&&(F=F.sub(k)),!(t&&Be(F).eq(t))&&Be(F).gte(0)&&i(F.toString())};return w.jsxs("div",{className:p?"active trade-input-box":"trade-input-box",style:{backgroundColor:u?"#121719":"#161a1e",marginTop:d},children:[w.jsxs("div",{className:"title",children:[" ",e," "]}),w.jsxs("div",{className:"token-input",children:[a?w.jsxs("div",{style:{flex:1},children:[" ",w.jsx(Ns,{style:{width:"200px",height:"28px",flex:1}})," "]}):w.jsx(NB,{inputAllowed:u,value:t,decimals:(s==null?void 0:s.decimals)||9,placeholder:"0.0",className:"input",onChange:i,onFocus:()=>y(!0),onBlur:()=>y(!1)}),w.jsx(kB,{token:s,handleTokenSelectClick:o})]}),w.jsxs("div",{className:"info-box",children:[!a&&r&&Be(r).gt(0)?w.jsx("div",{className:"input-rate",style:{marginTop:"8px"},children:db(r,2)}):w.jsx("div",{}),x&&s&&w.jsxs("div",{style:{display:"flex",flexDirection:"row",marginTop:"8px"},children:[w.jsxs("div",{className:"token-balance",children:[w.jsx("svg",{className:"icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-wallet"})}),w.jsx("span",{children:(n==null?void 0:n.displayBalance)||0})]}),w.jsxs("div",{className:"btn-box",children:[l&&w.jsx("button",{className:"cs-outline-btn",onClick:b,children:"HALF"}),c&&w.jsx("button",{className:"cs-outline-btn",onClick:M,children:"MAX"})]})]})]})]})}function jB({refreshCount:e,customWallet:t,initProps:r}){const{currentAccount:n,onWalletModal:i}=Yr(),{getOwnerCoinBalances:o}=tl(),{fromCoin:s,toCoin:a,fromAmount:c,toAmount:l,findRouterLoading:u,byAmountIn:d,routerData:p,isOpenSecondary:y,setIsOpenSecondary:x,isOpenTokensDialog:b,setIsOpenTokensDialog:M}=nn(),{handleAmountChange:R,handleSelectToken:P,fromBalanceInfo:k,toBalanceInfo:F,fromAmountValue:B,toAmountValue:W,doSwapAction:z,reCalculateRouteData:G,refreshMarketPrice:re,scamsText:oe}=uP(),{slippage:se}=Fr(),{isCustomMode:q,customWarnTokenList:L}=XO(s==null?void 0:s.coin_type,a==null?void 0:a.coin_type),{amountLimit:h}=lw(se,p),{formatSwapRouter:f}=KO(p),[m,S]=ie.useState(!1),{btnText:T,btnDisabled:E}=fP(k==null?void 0:k.totalBalanceFormat),[I,C]=ie.useState(!1),[g,v]=ie.useState(!1);ie.useEffect(()=>{y?e>=5&&j():e>=20&&j()},[e]);const j=()=>{G(),n&&o(),re()},Q=()=>({...p}),Z=async()=>{a&&P(a,!0)};return w.jsxs("div",{className:"swap-trade-box",children:[w.jsxs("div",{className:"trade-form",style:{flexDirection:"column"},children:[w.jsx(km,{loading:!d&&u,balance:k,amountValue:B,handleTokenSelectClick:()=>{C(!0),M(!0)},onInputChange:ce=>{R(ce,!0)},amount:c,token:s}),w.jsx("div",{onClick:Z,className:"swap-icon",onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),style:{cursor:"pointer"},children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{transform:m?"rotate(90deg)":"none",width:m?"16px":"14px",height:m?"16px":"14px"},children:w.jsx("use",{xlinkHref:m?"#icon-swap":"#icon-trade"})})}),w.jsx(km,{marginTop:"-20px",loading:d&&u,balance:F,showHalf:!1,showMax:!1,amountValue:W,handleTokenSelectClick:()=>{C(!1),M(!0)},onInputChange:ce=>{R(ce,!1)},inputAllowed:!1,amount:l,token:a})]}),oe&&w.jsx(hP,{scamsText:oe}),w.jsxs("div",{className:"swap-bottom-block",style:{border:E?"0px solid #2a3238":"1px solid #2a3238"},children:[w.jsx("button",{className:"cs-solid-btn swap-btn",style:{marginTop:"0px"},disabled:E||u,onClick:()=>{n?q&&L.length>0?v(!0):x(!0):t!=null&&t.connect?t.connect():i(!0)},children:u?w.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:w.jsx(dw,{})}):T}),c&&l&&Be(c).gt(0)&&Be(l).gt(0)&&w.jsxs("div",{className:"content",children:[w.jsxs("div",{className:"price-related-info",children:[p&&!(p!=null&&p.errorCode)&&w.jsx(V0,{baseToken:s,quoteToken:a,baseAmount:p.fromAmountUi||"",quoteAmount:p.toAmountUi||"",loading:u}),w.jsx(mw,{isLoading:u,routerData:p})]}),w.jsx(gw,{isLoading:u,amountLimit:h}),w.jsx(Kw,{hasSubMenu:!0,formatSwapRouter:f,isLoading:u})]})]}),y&&w.jsx(IL,{data:Q(),toBack:()=>x(!1),onSubmitClick:async ce=>{try{await z(ce,r==null?void 0:r.partner)}finally{x(!1)}}}),b&&w.jsx(sB,{currToken:I?s:a,backClick:()=>M(!1),onSelectToken:ce=>{P(ce,I),M(!1)}}),g&&L.length>0&&w.jsx(cB,{onClose:()=>{v(!1)},tokenList:L,onSureClick:()=>{v(!1),x(!0)}})]})}function DB({initProps:e={},customWallet:t}){kO();const{ToastContainer:r}=ks(),{fetchRouterConfig:n}=SO(),{getTrustTokens:i}=ao(),{transactionData:o,setTransactionData:s}=U0(),{isOpenSecondary:a,fromCoin:c,toAmount:l,toCoin:u,fromAmount:d}=nn(),[p,y]=ie.useState(0),x=ie.useRef(p);NO(e),ie.useEffect(()=>{i(),n()},[]),ie.useEffect(()=>{x.current=0},[c==null?void 0:c.coin_type,u==null?void 0:u.coin_type,d,l]),_O({interval:1e3,callback:()=>{x.current=x.current+1,a?x.current>=5&&b():x.current>=20&&b()}});const b=()=>{x.current=20,y(20),setTimeout(()=>{x.current=0,y(0)},20)};return w.jsx(w.Fragment,{children:w.jsxs("div",{className:"cs-swap-container",id:"cs-swap-widget",children:[w.jsx(bO,{independentWallet:!!(e!=null&&e.independentWallet),customWallet:t}),w.jsx(nO,{handleRefresh:b}),w.jsx(jB,{refreshCount:p,customWallet:t,initProps:e}),o&&w.jsx(yO,{transactionData:o,onClose:()=>{s(void 0)}}),w.jsx(r,{})]})})}function eh({initProps:e={},customWallet:t}){var s;AO();const{getOwnerCoinBalances:r}=tl(),n=Vr.useCurrentAccount(),{saveCurrentAccount:i}=Yr(),{mutate:o}=Vr.useConnectWallet();return ie.useEffect(()=>{i(n||void 0),r(n==null?void 0:n.address)},[n]),ie.useEffect(()=>{var a;t&&((a=t==null?void 0:t.currentAccount)==null?void 0:a.address)!==(n==null?void 0:n.address)&&o({wallet:t==null?void 0:t.currentWallet},{onSuccess:()=>{}})},[(s=t==null?void 0:t.currentAccount)==null?void 0:s.address,n==null?void 0:n.address]),w.jsx(DB,{initProps:e,customWallet:t})}function LB({initProps:e,customWallet:t}){const[r,n]=ie.useState(!0);return w.jsxs("div",{className:r?"export-modal-container":"export-modal-container none",children:[r&&w.jsx("div",{className:"swap-modal-box",children:w.jsx(eh,{initProps:e,customWallet:t})}),w.jsx("div",{className:"swap-modal-mask",onClick:()=>n(!1)})]})}function BB({size:e,direction:t,initProps:r,customWallet:n}){const[i,o]=ie.useState(!1),s=()=>{o(!i)};return w.jsxs("div",{className:"widget-btn-box",children:[w.jsx("div",{className:`img-btn ${e} ${t}`,onClick:s,children:i?w.jsx("svg",{className:"icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-unfold"})}):w.jsx("img",{src:Ot("/images/img-logo@2x.png")})}),i&&w.jsx("div",{className:`widget-modal ${t} ${e}`,children:w.jsx(eh,{initProps:r,customWallet:n})})]})}function UB({initProps:e={},customWallet:t}){const{displayMode:r,widgetBtnDirection:n,widgetBtnSize:i}=e;return w.jsxs(Fl,{appearance:"dark",children:[r==="Integrated"&&w.jsx(eh,{initProps:e,customWallet:t}),r==="Widget"&&w.jsx(BB,{initProps:e,customWallet:t,direction:n||"right-bottom",size:i||"Default"}),(!r||r==="Modal")&&w.jsx(LB,{initProps:e,customWallet:t})]})}const FB=UB;exports.CetusSwap=FB;
|
|
110
|
+
`),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function LB(e){e=DB(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,r=e.allowNegative,n=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=zi);var o=e.onBlur;o===void 0&&(o=zi);var s=e.thousandSeparator,a=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l="");var u=e.defaultValue,d=e.value,p=e.valueIsNumericString,y=e.onValueChange,x=Zw(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),b=su(e),M=b.decimalSeparator,O=b.allowedDecimalSeparators,P=function(m){return jm(m,e)},k=function(m,S){return kB(m,S,e)},F=ds(d)?u:d,B=p??NB(F,l,t);ds(d)?ds(u)||(B=B||typeof u=="number"):B=B||typeof d=="number";var W=function(m){return Qw(m)?m:(typeof m=="number"&&(m=r6(m)),B&&typeof a=="number"?Nm(m,a,!!c):m)},z=i6(W(d),W(u),!!B,P,k,y),G=z[0],re=G.numAsString,oe=G.formattedValue,se=z[1],q=function(m){var S=m.target,T=m.key,E=S.selectionStart,I=S.selectionEnd,C=S.value;if(C===void 0&&(C=""),(T==="Backspace"||T==="Delete")&&I<l.length){m.preventDefault();return}if(E!==I){i(m);return}T==="Backspace"&&C[0]==="-"&&E===l.length+1&&r&&So(S,1),a&&c&&(T==="Backspace"&&C[E-1]===M?(So(S,E-1),m.preventDefault()):T==="Delete"&&C[E]===M&&m.preventDefault()),O!=null&&O.includes(T)&&C[E]===M&&So(S,E+1);var g=s===!0?",":s;T==="Backspace"&&C[E-1]===g&&So(S,E-1),T==="Delete"&&C[E]===g&&So(S,E+1),i(m)},L=function(m){var S=re;if(S.match(/\d/g)||(S=""),n||(S=wB(S)),c&&a&&(S=Nm(S,a,c)),S!==re){var T=jm(S,e);se({formattedValue:T,value:S,floatValue:parseFloat(S)},{event:m,source:Ea.event})}o(m)},h=function(m){return m===M?!0:Ca(m)},f=function(m){var S=m.currentValue,T=m.lastValue,E=m.formattedValue,I=m.currentValueIndex,C=m.formattedValueIndex,g=S[I],v=E[C],j=n6(T,S),Q=j.to,Z=function(ce){return k(ce).indexOf(".")+l.length};return d===0&&c&&a&&S[Q.start]===M&&Z(S)<I&&Z(E)>C?!1:I>=Q.start&&I<Q.end&&O&&O.includes(g)&&v===M?!0:g===v};return Object.assign(Object.assign({},x),{value:oe,valueIsNumericString:!1,isValidInputCharacter:h,isCharacterSame:f,onValueChange:se,format:P,removeFormatting:k,getCaretBoundary:function(m){return jB(m,e)},onKeyDown:q,onBlur:L})}function BB(e){var t=LB(e);return ie.createElement(OB,Object.assign({},t))}function UB(e){const{className:t,value:r,decimals:n,placeholder:i,style:o,onChange:s,maxValue:a,minValue:c=0,inputAllowed:l=!0,prefix:u,...d}=e,p=y=>{var M;const x=((M=y==null?void 0:y.target)==null?void 0:M.value)||"";let b=x;if(x.startsWith("0")&&x!=="0"&&!x.startsWith("0.")&&(b=x.replace(/^0+/,"")),b){if(b.startsWith(".")){s(b.slice(1,b.length));return}let O=String(b).replace(/,/g,"");if(O.startsWith("-")){s("");return}u&&(O=O.replace(u,"")),a!==void 0&&Be(O).gt(a)?O=a.toString():c!==void 0&&Be(O).lt(c)&&(O=c.toString()),s(String(O))}else s("")};return w.jsx(BB,{className:t,value:r,disabled:!l,placeholder:i,decimalScale:n,prefix:u,allowLeadingZeros:!0,thousandSeparator:",",isAllowed:y=>!y.value.startsWith("-"),onChange:p,...d,style:{...o,cursor:l?"pointer":"not-allowed",fontFamily:"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",fontFeatureSettings:"tnum",fontVariant:"tabular-nums"}})}function FB(e){const{token:t,handleTokenSelectClick:r}=e;return w.jsxs("div",{className:"token-select-block",onClick:()=>{r&&r()},children:[w.jsx("div",{className:"token-img-box",children:w.jsx(Gr,{src:t==null?void 0:t.logo_url})},t==null?void 0:t.coin_type),w.jsx("div",{className:"name",children:w.jsxs("h4",{className:"truncate-text",children:[" ",(t==null?void 0:t.symbol)||"Select"]})}),w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-arrow"})})]})}function Dm({label:e,amount:t,amountValue:r,balance:n,onInputChange:i,handleTokenSelectClick:o,token:s,loading:a=!1,showMax:c=!0,showHalf:l=!0,inputAllowed:u=!0,marginTop:d}){const[p,y]=ie.useState(!1),{currentAccount:x}=Yr(),b=()=>{const O=Be((n==null?void 0:n.totalBalanceFormat)||"0").div(2),P=Nr(O.toString(),s==null?void 0:s.decimals,!0).toString();t&&Be(P).eq(t)||i(P)},M=()=>{const O=Be((n==null?void 0:n.totalBalanceFormat)||0),P=kr((s==null?void 0:s.coin_type)||"").full_address===ul,k=.05;let F=O;P&&Be(O).gt(k)&&(F=F.sub(k)),!(t&&Be(F).eq(t))&&Be(F).gte(0)&&i(F.toString())};return w.jsxs("div",{className:p?"active trade-input-box":"trade-input-box",style:{backgroundColor:u?"#121719":"#161a1e",marginTop:d},children:[w.jsxs("div",{className:"title",children:[" ",e," "]}),w.jsxs("div",{className:"token-input",children:[a?w.jsxs("div",{style:{flex:1},children:[" ",w.jsx(Ns,{style:{width:"200px",height:"28px",flex:1}})," "]}):w.jsx(UB,{inputAllowed:u,value:t,decimals:(s==null?void 0:s.decimals)||9,placeholder:"0.0",className:"input",onChange:i,onFocus:()=>y(!0),onBlur:()=>y(!1)}),w.jsx(FB,{token:s,handleTokenSelectClick:o})]}),w.jsxs("div",{className:"info-box",children:[!a&&r&&Be(r).gt(0)?w.jsx("div",{className:"input-rate",style:{marginTop:"8px"},children:pb(r,2)}):w.jsx("div",{}),x&&s&&w.jsxs("div",{style:{display:"flex",flexDirection:"row",marginTop:"8px"},children:[w.jsxs("div",{className:"token-balance",children:[w.jsx("svg",{className:"icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-wallet"})}),w.jsx("span",{children:(n==null?void 0:n.displayBalance)||0})]}),w.jsxs("div",{className:"btn-box",children:[l&&w.jsx("button",{className:"cs-outline-btn",onClick:b,children:"HALF"}),c&&w.jsx("button",{className:"cs-outline-btn",onClick:M,children:"MAX"})]})]})]})]})}function $B({refreshCount:e,customWallet:t,initProps:r}){const{currentAccount:n,onWalletModal:i}=Yr(),{getOwnerCoinBalances:o}=tl(),{fromCoin:s,toCoin:a,fromAmount:c,toAmount:l,findRouterLoading:u,byAmountIn:d,routerData:p,isOpenSecondary:y,setIsOpenSecondary:x,isOpenTokensDialog:b,setIsOpenTokensDialog:M}=nn(),{handleAmountChange:O,handleSelectToken:P,fromBalanceInfo:k,toBalanceInfo:F,fromAmountValue:B,toAmountValue:W,doSwapAction:z,reCalculateRouteData:G,refreshMarketPrice:re,scamsText:oe}=gP(),{slippage:se}=$r(),{isCustomMode:q,customWarnTokenList:L}=rP(s==null?void 0:s.coin_type,a==null?void 0:a.coin_type),{amountLimit:h}=fw(se,p),{formatSwapRouter:f}=eP(p),[m,S]=ie.useState(!1),{btnText:T,btnDisabled:E}=vP(k==null?void 0:k.totalBalanceFormat),[I,C]=ie.useState(!1),[g,v]=ie.useState(!1);ie.useEffect(()=>{y?e>=5&&j():e>=20&&j()},[e]);const j=()=>{G(),n&&o(),re()},Q=()=>({...p}),Z=async()=>{a&&P(a,!0)};return w.jsxs("div",{className:"swap-trade-box",children:[w.jsxs("div",{className:"trade-form",style:{flexDirection:"column"},children:[w.jsx(Dm,{loading:!d&&u,balance:k,amountValue:B,handleTokenSelectClick:()=>{C(!0),M(!0)},onInputChange:ce=>{O(ce,!0)},amount:c,token:s}),w.jsx("div",{onClick:Z,className:"swap-icon",onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),style:{cursor:"pointer"},children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{transform:m?"rotate(90deg)":"none",width:m?"16px":"14px",height:m?"16px":"14px"},children:w.jsx("use",{xlinkHref:m?"#icon-swap":"#icon-trade"})})}),w.jsx(Dm,{marginTop:"-20px",loading:d&&u,balance:F,showHalf:!1,showMax:!1,amountValue:W,handleTokenSelectClick:()=>{C(!1),M(!0)},onInputChange:ce=>{O(ce,!1)},inputAllowed:!1,amount:l,token:a})]}),oe&&w.jsx(yP,{scamsText:oe}),w.jsxs("div",{className:"swap-bottom-block",style:{border:E?"0px solid #2a3238":"1px solid #2a3238"},children:[w.jsx("button",{className:"cs-solid-btn swap-btn",style:{marginTop:"0px"},disabled:E||u,onClick:()=>{n?q&&L.length>0?v(!0):x(!0):t!=null&&t.connect?t.connect():i(!0)},children:u?w.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:w.jsx(pw,{})}):T}),c&&l&&Be(c).gt(0)&&Be(l).gt(0)&&w.jsxs("div",{className:"content",children:[w.jsxs("div",{className:"price-related-info",children:[p&&!(p!=null&&p.errorCode)&&w.jsx(q0,{baseToken:s,quoteToken:a,baseAmount:p.fromAmountUi||"",quoteAmount:p.toAmountUi||"",loading:u}),w.jsx(vw,{isLoading:u,routerData:p})]}),w.jsx(bw,{isLoading:u,amountLimit:h}),w.jsx(Xw,{hasSubMenu:!0,formatSwapRouter:f,isLoading:u})]})]}),y&&w.jsx(jL,{data:Q(),toBack:()=>x(!1),onSubmitClick:async ce=>{try{await z(ce,r==null?void 0:r.partner)}finally{x(!1)}}}),b&&w.jsx(dB,{currToken:I?s:a,backClick:()=>M(!1),onSelectToken:ce=>{P(ce,I),M(!1)}}),g&&L.length>0&&w.jsx(pB,{onClose:()=>{v(!1)},tokenList:L,onSureClick:()=>{v(!1),x(!0)}})]})}function VB({initProps:e={},customWallet:t}){FR();const{ToastContainer:r}=ks(),{fetchRouterConfig:n}=MR(),{getTrustTokens:i}=ao(),{transactionData:o,setTransactionData:s}=$0(),{isOpenSecondary:a,fromCoin:c,toAmount:l,toCoin:u,fromAmount:d}=nn(),[p,y]=ie.useState(0),x=ie.useRef(p);UR(e),ie.useEffect(()=>{i(),n()},[]),ie.useEffect(()=>{x.current=0},[c==null?void 0:c.coin_type,u==null?void 0:u.coin_type,d,l]),IR({interval:1e3,callback:()=>{x.current=x.current+1,a?x.current>=5&&b():x.current>=20&&b()}});const b=()=>{x.current=20,y(20),setTimeout(()=>{x.current=0,y(0)},20)};return w.jsx(w.Fragment,{children:w.jsxs("div",{className:"cs-swap-container",id:"cs-swap-widget",children:[w.jsx(ER,{independentWallet:!!(e!=null&&e.independentWallet),customWallet:t}),w.jsx(lR,{handleRefresh:b}),w.jsx($B,{refreshCount:p,customWallet:t,initProps:e}),o&&w.jsx(CR,{transactionData:o,onClose:()=>{s(void 0)}}),w.jsx(r,{})]})})}function rh({initProps:e={},customWallet:t}){var s;NR();const{getOwnerCoinBalances:r}=tl(),n=zr.useCurrentAccount(),{saveCurrentAccount:i}=Yr(),{mutate:o}=zr.useConnectWallet();return ie.useEffect(()=>{i(n||void 0),r(n==null?void 0:n.address)},[n]),ie.useEffect(()=>{var a;t&&((a=t==null?void 0:t.currentAccount)==null?void 0:a.address)!==(n==null?void 0:n.address)&&o({wallet:t==null?void 0:t.currentWallet},{onSuccess:()=>{}})},[(s=t==null?void 0:t.currentAccount)==null?void 0:s.address,n==null?void 0:n.address]),w.jsx(VB,{initProps:e,customWallet:t})}function zB({initProps:e,customWallet:t}){const[r,n]=ie.useState(!0);return w.jsxs("div",{className:r?"export-modal-container":"export-modal-container none",children:[r&&w.jsx("div",{className:"swap-modal-box",children:w.jsx(rh,{initProps:e,customWallet:t})}),w.jsx("div",{className:"swap-modal-mask",onClick:()=>n(!1)})]})}function qB({size:e,direction:t,initProps:r,customWallet:n}){const[i,o]=ie.useState(!1),s=()=>{o(!i)};return w.jsxs("div",{className:"widget-btn-box",children:[w.jsx("div",{className:`img-btn ${e} ${t}`,onClick:s,children:i?w.jsx("svg",{className:"icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-unfold"})}):w.jsx("img",{src:At("/images/img-logo@2x.png")})}),i&&w.jsx("div",{className:`widget-modal ${t} ${e}`,children:w.jsx(rh,{initProps:r,customWallet:n})})]})}function HB({initProps:e={},customWallet:t}){const{displayMode:r,widgetBtnDirection:n,widgetBtnSize:i}=e;return w.jsxs(Fl,{appearance:"dark",children:[r==="Integrated"&&w.jsx(rh,{initProps:e,customWallet:t}),r==="Widget"&&w.jsx(qB,{initProps:e,customWallet:t,direction:n||"right-bottom",size:i||"Default"}),(!r||r==="Modal")&&w.jsx(zB,{initProps:e,customWallet:t})]})}const WB=HB;exports.CetusSwap=WB;
|