@cetusprotocol/terminal 1.2.2 → 1.2.3
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 +25 -25
- package/dist/cetus-swap.cjs.js.gz +0 -0
- package/dist/cetus-swap.es.js +4615 -4608
- 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/style.css +1 -1
- package/dist/style.css.gz +0 -0
- package/dist/utils/formatter.d.ts +2 -0
- package/package.json +1 -1
package/dist/cetus-swap.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Wt,le){typeof exports=="object"&&typeof module<"u"?le(exports,require("react"),require("react-dom"),require("@mysten/dapp-kit")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@mysten/dapp-kit"],le):(Wt=typeof globalThis<"u"?globalThis:Wt||self,le(Wt.CetusSwap={},Wt.React,Wt.ReactDOM,Wt.dappKit))})(this,function(Wt,le,zn,Wr){"use strict";var
|
|
1
|
+
(function(Wt,le){typeof exports=="object"&&typeof module<"u"?le(exports,require("react"),require("react-dom"),require("@mysten/dapp-kit")):typeof define=="function"&&define.amd?define(["exports","react","react-dom","@mysten/dapp-kit"],le):(Wt=typeof globalThis<"u"?globalThis:Wt||self,le(Wt.CetusSwap={},Wt.React,Wt.ReactDOM,Wt.dappKit))})(this,function(Wt,le,zn,Wr){"use strict";var SU=Object.defineProperty;var _U=(Wt,le,zn)=>le in Wt?SU(Wt,le,{enumerable:!0,configurable:!0,writable:!0,value:zn}):Wt[le]=zn;var Et=(Wt,le,zn)=>(_U(Wt,typeof le!="symbol"?le+"":le,zn),zn);function Ch(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 P=Ch(le),Ah=Ch(zn);function s4(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Th={exports:{}},hr=Th.exports={},qn,Hn;function Tu(){throw new Error("setTimeout has not been defined")}function Mu(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?qn=setTimeout:qn=Tu}catch{qn=Tu}try{typeof clearTimeout=="function"?Hn=clearTimeout:Hn=Mu}catch{Hn=Mu}})();function Mh(e){if(qn===setTimeout)return setTimeout(e,0);if((qn===Tu||!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 o4(e){if(Hn===clearTimeout)return clearTimeout(e);if((Hn===Mu||!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 mi=[],no=!1,_s,oc=-1;function a4(){!no||!_s||(no=!1,_s.length?mi=_s.concat(mi):oc=-1,mi.length&&Ih())}function Ih(){if(!no){var e=Mh(a4);no=!0;for(var t=mi.length;t;){for(_s=mi,mi=[];++oc<t;)_s&&_s[oc].run();oc=-1,t=mi.length}_s=null,no=!1,o4(e)}}hr.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];mi.push(new Oh(e,t)),mi.length===1&&!no&&Mh(Ih)};function Oh(e,t){this.fun=e,this.array=t}Oh.prototype.run=function(){this.fun.apply(null,this.array)},hr.title="browser",hr.browser=!0,hr.env={},hr.argv=[],hr.version="",hr.versions={};function gi(){}hr.on=gi,hr.addListener=gi,hr.once=gi,hr.off=gi,hr.removeListener=gi,hr.removeAllListeners=gi,hr.emit=gi,hr.prependListener=gi,hr.prependOnceListener=gi,hr.listeners=function(e){return[]},hr.binding=function(e){throw new Error("process.binding is not supported")},hr.cwd=function(){return"/"},hr.chdir=function(e){throw new Error("process.chdir is not supported")},hr.umask=function(){return 0};var c4=Th.exports;const _n=s4(c4);var Cr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function io(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ph(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 Iu={exports:{}},Ko={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Rh;function l4(){if(Rh)return Ko;Rh=1;var e=le,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,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var u,f={},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)&&!s.hasOwnProperty(u)&&(f[u]=c[u]);if(a&&a.defaultProps)for(u in c=a.defaultProps,c)f[u]===void 0&&(f[u]=c[u]);return{$$typeof:t,type:a,key:p,ref:y,props:f,_owner:i.current}}return Ko.Fragment=r,Ko.jsx=o,Ko.jsxs=o,Ko}var Yo={},jh;function u4(){return jh||(jh=1,_n.env.NODE_ENV!=="production"&&function(){var e=le,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=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"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),x=Symbol.iterator,v="@@iterator";function _(J){if(J===null||typeof J!="object")return null;var ye=x&&J[x]||J[v];return typeof ye=="function"?ye:null}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(J){{for(var ye=arguments.length,Ce=new Array(ye>1?ye-1:0),Ve=1;Ve<ye;Ve++)Ce[Ve-1]=arguments[Ve];R("error",J,Ce)}}function R(J,ye,Ce){{var Ve=T.ReactDebugCurrentFrame,et=Ve.getStackAddendum();et!==""&&(ye+="%s",Ce=Ce.concat([et]));var ze=Ce.map(function(Je){return String(Je)});ze.unshift("Warning: "+ye),Function.prototype.apply.call(console[J],console,ze)}}var F=!1,B=!1,H=!1,$=!1,Z=!1,ce;ce=Symbol.for("react.module.reference");function ne(J){return!!(typeof J=="string"||typeof J=="function"||J===n||J===s||Z||J===i||J===l||J===u||$||J===y||F||B||H||typeof J=="object"&&J!==null&&(J.$$typeof===p||J.$$typeof===f||J.$$typeof===o||J.$$typeof===a||J.$$typeof===c||J.$$typeof===ce||J.getModuleId!==void 0))}function de(J,ye,Ce){var Ve=J.displayName;if(Ve)return Ve;var et=ye.displayName||ye.name||"";return et!==""?Ce+"("+et+")":Ce}function q(J){return J.displayName||"Context"}function N(J){if(J==null)return null;if(typeof J.tag=="number"&&O("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof J=="function")return J.displayName||J.name||null;if(typeof J=="string")return J;switch(J){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case i:return"StrictMode";case l:return"Suspense";case u:return"SuspenseList"}if(typeof J=="object")switch(J.$$typeof){case a:var ye=J;return q(ye)+".Consumer";case o:var Ce=J;return q(Ce._context)+".Provider";case c:return de(J,J.render,"ForwardRef");case f:var Ve=J.displayName||null;return Ve!==null?Ve:N(J.type)||"Memo";case p:{var et=J,ze=et._payload,Je=et._init;try{return N(Je(ze))}catch{return null}}}return null}var h=Object.assign,d=0,m,S,E,M,j,I,g;function b(){}b.__reactDisabledLog=!0;function k(){{if(d===0){m=console.log,S=console.info,E=console.warn,M=console.error,j=console.group,I=console.groupCollapsed,g=console.groupEnd;var J={configurable:!0,enumerable:!0,value:b,writable:!0};Object.defineProperties(console,{info:J,log:J,warn:J,error:J,group:J,groupCollapsed:J,groupEnd:J})}d++}}function ve(){{if(d--,d===0){var J={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:h({},J,{value:m}),info:h({},J,{value:S}),warn:h({},J,{value:E}),error:h({},J,{value:M}),group:h({},J,{value:j}),groupCollapsed:h({},J,{value:I}),groupEnd:h({},J,{value:g})})}d<0&&O("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var he=T.ReactCurrentDispatcher,we;function Oe(J,ye,Ce){{if(we===void 0)try{throw Error()}catch(et){var Ve=et.stack.trim().match(/\n( *(at )?)/);we=Ve&&Ve[1]||""}return`
|
|
10
10
|
`+we+J}}var je=!1,L;{var z=typeof WeakMap=="function"?WeakMap:Map;L=new z}function G(J,ye){if(!J||je)return"";{var Ce=L.get(J);if(Ce!==void 0)return Ce}var Ve;je=!0;var et=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ze;ze=he.current,he.current=null,k();try{if(ye){var Je=function(){throw Error()};if(Object.defineProperty(Je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Je,[])}catch(nr){Ve=nr}Reflect.construct(J,[],Je)}else{try{Je.call()}catch(nr){Ve=nr}J.call(Je.prototype)}}else{try{throw Error()}catch(nr){Ve=nr}J()}}catch(nr){if(nr&&Ve&&typeof nr.stack=="string"){for(var bt=nr.stack.split(`
|
|
11
11
|
`),rr=Ve.stack.split(`
|
|
12
12
|
`),Bt=bt.length-1,Vt=rr.length-1;Bt>=1&&Vt>=0&&bt[Bt]!==rr[Vt];)Vt--;for(;Bt>=1&&Vt>=0;Bt--,Vt--)if(bt[Bt]!==rr[Vt]){if(Bt!==1||Vt!==1)do if(Bt--,Vt--,Vt<0||bt[Bt]!==rr[Vt]){var fr=`
|
|
@@ -21,35 +21,35 @@ Check the top-level render call using <`+Ce+">.")}return ye}}function D(J,ye){{i
|
|
|
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} />`,Ar,mr,Fn,mr),se[mr+Ar]=!0}}return J===n?V(Vt):A(Vt),Vt}}function be(J,ye,Ce){return me(J,ye,Ce,!0)}function We(J,ye,Ce){return me(J,ye,Ce,!1)}var ut=We,qe=be;Yo.Fragment=n,Yo.jsx=ut,Yo.jsxs=qe}()),Yo}_n.env.NODE_ENV==="production"?Iu.exports=l4():Iu.exports=u4();var w=Iu.exports;const CU="",AU="",TU="";window._iconfont_svg_string_4776227='<svg><symbol id="icon-icon_mev" viewBox="0 0 1024 1024"><path d="M651.1616 95.488c53.4016 56.4224 131.84 113.8176 235.2128 171.6736a38.4 38.4 0 0 1 19.456 29.9008c12.032 129.024-12.544 251.7504-73.6256 367.1552-60.2112 113.8176-158.976 226.4576-295.936 338.3296a38.4 38.4 0 0 1-48.5888 0c-131.072-107.1104-228.352-220.3648-291.6352-339.8656-64.1024-121.1904-90.2656-243.4048-77.824-365.8752a38.4 38.4 0 0 1 20.5312-30.2592c101.1712-52.224 181.0944-109.568 239.872-171.6224 104.96-110.9504 169.3696-108.4416 272.5376 0.512z m126.464 196.5056l-1.1776 0.8192a41.9328 41.9328 0 0 1-10.0352 3.84c-4.2496 1.024-5.4272 1.28-14.6944 3.328a122.368 122.368 0 0 0-16.896 4.4032c-43.8784 16.384-71.168 47.4112-83.0976 96.6656-2.304 9.6256-3.328 20.8384-3.6864 38.4l-0.2048 13.5168v15.872l0.0512 9.728v2.048l0.0512 3.4816c0.256 35.328 0.1536 51.2-1.024 71.424-4.5056 79.36-42.2912 140.3904-108.9536 178.4832-29.5424 16.896-61.9008 23.9616-99.328 23.9104h-8.704a9243.136 9243.136 0 0 0-29.2864-0.1536h-17.4592l-10.0352-0.0512H350.208c40.448 50.8416 88.3712 100.7104 143.7696 149.504l17.9712 15.5136 17.5104-14.8992c101.0176-88.064 176.0768-175.5136 225.28-262.144l9.5232-17.408c50.8928-96.2048 73.0624-197.2736 66.56-303.9744l-3.584-2.4064c-17.2544-9.9328-33.792-19.9168-49.664-29.9008z m-171.52 5.12h-1.1264c-15.1552 0.1024-30.0544 3.584-45.1072 10.5984-46.2848 21.504-77.056 71.3728-76.3904 128.0512 0.3072 25.7024 0.256 51.3536 0 87.6032l-0.1024 10.4448c-0.1024 14.4896-0.512 24.3712-1.7408 34.816-4.864 42.8032-19.6608 79.7696-43.6736 110.2848l-1.792 2.1504 1.3312 0.0512h1.3312c24.832 0 44.288-4.1984 61.0304-13.824 44.032-25.1904 67.3792-62.72 70.4-116.1216 1.024-18.0224 1.1264-32.768 0.8704-66.56V479.1296l-0.0512-5.2224v-21.504c0-5.12 0.0512-9.728 0.1536-14.4896 0.512-22.6816 1.8944-38.6048 5.8368-54.9376a225.0752 225.0752 0 0 1 35.6864-79.5136l4.7104-6.2464h-11.3664z m1.4848-136.2944l-12.2368-12.544c-73.728-77.9264-87.2448-78.4384-160.9728-0.5632C373.9136 211.6096 294.7072 269.824 196.9152 322.6624l-3.9424 2.048-0.768 17.5616c-2.4064 88.064 18.176 176.384 61.952 265.4208l9.7792 19.0464c9.2672 17.5104 19.3536 34.9184 30.2592 52.224l-0.8704 0.1536c2.4064-0.512 2.4064-0.512 6.144-0.9728 15.104-1.536 29.5936-6.8608 43.776-15.9744 36.4544-23.552 56.8832-56.576 62.1056-102.2464 0.8192-7.168 1.1264-14.848 1.2288-26.7264l0.1024-10.3424c0.256-35.84 0.3072-61.1328 0-86.2208-1.024-86.5792 46.8992-164.1984 120.7808-198.5536a183.552 183.552 0 0 1 77.312-17.7664h1.536l53.0432 0.256h16.0768a775.1168 775.1168 0 0 1-67.84-59.7504z" ></path></symbol><symbol id="icon-icon_mode" viewBox="0 0 1024 1024"><path d="M854.8352 357.80266667v203.6736H921.6a38.4 38.4 0 0 1 33.7408 56.832l-2.9696 4.608-222.8736 298.1376c-22.1184 29.5424-69.1712 13.9264-69.1712-23.04v-185.0368h-75.6736c-37.7344-21.1968-40.0896-22.528-38.4-40.0384l0.3584-3.7376c1.7408-7.68 1.7408-7.68 2.9184-10.24l2.2016-4.2496 1.1776-1.8944 1.536-2.304 2.048-2.9696 10.9568-15.2576c9.5744-13.2608 24.064-33.1264 43.4176-59.5968 38.656-52.7872 96.8704-132.0448 174.592-237.6704 22.016-29.8496 69.376-14.336 69.376 22.784zM485.2736 93.86666667c97.792 0 190.6176 33.4848 265.0624 93.7984a38.4 38.4 0 1 1-48.3328 59.6992 344.4736 344.4736 0 1 0-216.6784 612.3008 38.4 38.4 0 1 1 0 76.8 421.2736 421.2736 0 0 1 0-842.5984z m292.7104 380.8768l-5.632 7.7312a73697.1776 73697.1776 0 0 0-106.496 145.152l-6.3488 8.5504h39.2192a38.4 38.4 0 0 1 38.0416 33.1776l0.3584 5.2224V782.50666667l107.776-144.2304h-28.4672a38.4 38.4 0 0 1-38.0416-33.1776l-0.3584-5.1712V474.74346667z m-422.912-144.0768l92.9792 92.8768A98.816 98.816 0 1 1 393.728 477.86666667L300.7488 384.98986667a38.4 38.4 0 1 1 54.272-54.272z" ></path></symbol><symbol id="icon-icon_flash" viewBox="0 0 1024 1024"><path d="M776.448 0L192 579.456h222.016L242.048 1024 832 439.104H617.472L776.448 0z" ></path></symbol><symbol id="icon-token_nor" viewBox="0 0 1024 1024"><path d="M512 0c282.784 0 512 229.216 512 512s-229.216 512-512 512S0 794.784 0 512 229.216 0 512 0z m0 64C264.608 64 64 264.544 64 512s200.608 448 448 448 448-200.544 448-448S759.392 64 512 64z m51.808 596.256v107.872H446.72v-107.84h117.088z m-26.304-414.72c98.816 4.736 152.16 48.416 160.096 131.296 3.136 47.808-22.944 91.328-78.24 130.56l-7.712 5.312c-44.672 29.696-64.576 58.56-59.776 86.688v18.784h-95.68v-25.792c-1.6-48.384 19.2-87.488 62.144-117.184 39.744-31.2 58.944-59.392 57.408-84.384-3.168-32.768-21.536-50.784-54.976-53.888-44.672 0-72.512 28.896-83.616 86.72l-107.584-23.424c19.168-106.176 88.416-157.76 207.936-154.656z" ></path></symbol><symbol id="icon-icon_resrt" viewBox="0 0 1024 1024"><path d="M700.16 173.2608l150.5792 150.528a140.8 140.8 0 0 1 0 199.168l-250.0096 249.9072H844.8a38.4 38.4 0 0 1 0 76.8h-409.6a38.4 38.4 0 0 1-11.7248-1.792 246.528 246.528 0 0 1-174.9504-72.3968l-75.264-75.264a140.8 140.8 0 0 1 0-199.168l327.7824-327.7824a140.8 140.8 0 0 1 199.168 0z m-438.272 347.6992l-34.304 34.4064a64 64 0 0 0 0 90.5216l75.264 75.264a170.496 170.496 0 0 0 193.024 33.792l-233.984-233.984z m293.4784-293.376l-239.2064 239.104 241.152 241.152 239.104-239.2064a64 64 0 0 0 0-90.5216l-150.528-150.528a64 64 0 0 0-90.5216 0zM667.136 305.664l102.4 102.4a38.4 38.4 0 0 1-54.272 54.272l-102.4-102.4a38.4 38.4 0 1 1 54.272-54.272z" ></path></symbol><symbol id="icon-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-icon_disconnect" viewBox="0 0 1024 1024"><path d="M580.7104 694.6304a38.4 38.4 0 0 1 0 54.272l-60.3136 60.416a209.0496 209.0496 0 0 1-295.68-295.68l60.3648-60.3648a38.4 38.4 0 1 1 54.272 54.272l-60.3136 60.416a132.2496 132.2496 0 0 0 187.0336 187.0336l60.3648-60.3648a38.4 38.4 0 0 1 54.272 0z m-125.5424-113.664a38.4 38.4 0 0 1-0.7168 54.272L399.36 689.0496a38.4 38.4 0 0 1-53.6064-55.04l55.1424-53.7088a38.4 38.4 0 0 1 54.272 0.7168z m276.4288 83.456a38.4 38.4 0 1 1-54.3232 54.3744L315.2384 356.7104a38.4 38.4 0 0 1 54.272-54.272l362.0864 361.984z m90.4704-452.5056a209.0496 209.0496 0 0 1 0 295.68l-60.3136 60.3136a38.4 38.4 0 1 1-54.272-54.272l60.3136-60.3648A132.2496 132.2496 0 0 0 580.7104 266.24l-60.3136 60.3136a38.4 38.4 0 0 1-54.272-54.272l60.3136-60.3648a209.0496 209.0496 0 0 1 295.6288 0z m-122.368 119.04l3.584 3.7376a38.4 38.4 0 0 1-3.9424 54.1184l-63.1296 54.4768a38.4 38.4 0 0 1-50.176-58.1632l63.1296-54.4768a38.4 38.4 0 0 1 46.4384-2.816l4.096 3.1232z" ></path></symbol><symbol id="icon-icon_del1" viewBox="0 0 1024 1024"><path d="M705.024 294.4a140.8 140.8 0 0 1 139.9808 156.0576l-39.1168 358.4a140.8 140.8 0 0 1-139.9808 125.5424H358.0928a140.8 140.8 0 0 1-139.9808-125.5424l-39.1168-358.4A140.8 140.8 0 0 1 318.976 294.4h386.048z m0 76.8H318.976a64 64 0 0 0-63.6416 70.9632l39.1168 358.4a64 64 0 0 0 63.6416 57.0368h307.8144a64 64 0 0 0 63.6416-57.0368l39.1168-358.4A64 64 0 0 0 705.024 371.2z m-102.5024 126.464a38.4 38.4 0 0 1 38.4 38.4v184.32a38.4 38.4 0 1 1-76.8 0v-184.32a38.4 38.4 0 0 1 38.4-38.4z m-184.32 0a38.4 38.4 0 0 1 38.4 38.4v184.32a38.4 38.4 0 1 1-76.8 0v-184.32a38.4 38.4 0 0 1 38.4-38.4z m276.1728-377.344a38.4 38.4 0 1 1 0 76.8H327.3728a38.4 38.4 0 1 1 0-76.8h367.0016z" ></path></symbol><symbol id="icon-icon_copy" viewBox="0 0 1024 1024"><path d="M742.4 373.76a140.8 140.8 0 0 1 140.8 140.8v227.84a140.8 140.8 0 0 1-140.8 140.8h-227.84A140.8 140.8 0 0 1 373.76 742.4v-227.84a140.8 140.8 0 0 1 140.8-140.8h227.84z m0 76.8h-227.84c-35.328 0-64 28.672-64 64v227.84c0 35.328 28.672 64 64 64h227.84c35.328 0 64-28.672 64-64v-227.84c0-35.328-28.672-64-64-64z m-197.12-309.76A104.96 104.96 0 0 1 650.24 245.76v33.28a38.4 38.4 0 0 1-76.8 0V245.76a28.16 28.16 0 0 0-28.16-28.16H245.76a28.16 28.16 0 0 0-28.16 28.16v299.52c0 15.5648 12.5952 28.16 28.16 28.16h33.28a38.4 38.4 0 0 1 0 76.8H245.76a104.96 104.96 0 0 1-104.96-104.96V245.76A104.96 104.96 0 0 1 245.76 140.8h299.52z" ></path></symbol><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-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-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,s,o,a,c=function(f,p){p.parentNode.insertBefore(f,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 f,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,(f=document.body).firstChild?c(p,f.firstChild):f.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&&(s=n,o=e.document,a=!1,u(),o.onreadystatechange=function(){o.readyState=="complete"&&(o.onreadystatechange=null,l())})}function l(){a||(a=!0,s())}function u(){try{o.documentElement.doScroll("left")}catch{return void setTimeout(u,50)}l()}})(window);const MU="",IU="",OU="",PU="",d4="1.29.1",f4="1.49.0",h4={"-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 kh extends Error{}class Dh extends kh{constructor(t,r){super(t),this.code=r,this.type=h4[r]??"ServerError"}}class p4 extends kh{constructor(t,r,n){super(t),this.status=r,this.statusText=n}}var Lh=e=>{throw TypeError(e)},Ou=(e,t,r)=>t.has(e)||Lh("Cannot "+r),ir=(e,t,r)=>(Ou(e,t,"read from private field"),r?r.call(e):t.get(e)),_s=(e,t,r)=>t.has(e)?Lh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),so=(e,t,r,n)=>(Ou(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Bh=(e,t,r)=>(Ou(e,t,"access private method"),r),m4=(e,t,r,n)=>({set _(i){so(e,t,i,r)},get _(){return ir(e,t,n)}}),Ki,Jo,vi,Es,Xo,Cs,oc,Uh,Fh;function g4(e){const t=new URL(e);return t.protocol=t.protocol.replace("http","ws"),t.toString()}const v4={WebSocketConstructor:typeof WebSocket<"u"?WebSocket:void 0,callTimeout:3e4,reconnectTimeout:3e3,maxReconnects:5};class b4{constructor(t,r={}){if(_s(this,oc),_s(this,Ki,0),_s(this,Jo,0),_s(this,vi,null),_s(this,Es,null),_s(this,Xo,new Set),_s(this,Cs,new Map),this.endpoint=t,this.options={...v4,...r},!this.options.WebSocketConstructor)throw new Error("Missing WebSocket constructor");this.endpoint.startsWith("http")&&(this.endpoint=g4(this.endpoint))}async makeRequest(t,r,n){const i=await Bh(this,oc,Uh).call(this);return new Promise((s,o)=>{so(this,Ki,ir(this,Ki)+1),ir(this,Cs).set(ir(this,Ki),{resolve:s,reject:o,timeout:setTimeout(()=>{ir(this,Cs).delete(ir(this,Ki)),o(new Error(`Request timeout: ${t}`))},this.options.callTimeout)}),n==null||n.addEventListener("abort",()=>{ir(this,Cs).delete(ir(this,Ki)),o(n.reason)}),i.send(JSON.stringify({jsonrpc:"2.0",id:ir(this,Ki),method:t,params:r}))}).then(({error:s,result:o})=>{if(s)throw new Dh(s.message,s.code);return o})}async subscribe(t){const r=new y4(t);return ir(this,Xo).add(r),await r.subscribe(this),()=>r.unsubscribe(this)}}Ki=new WeakMap,Jo=new WeakMap,vi=new WeakMap,Es=new WeakMap,Xo=new WeakMap,Cs=new WeakMap,oc=new WeakSet,Uh=function(){return ir(this,Es)?ir(this,Es):(so(this,Es,new Promise(e=>{var t;(t=ir(this,vi))==null||t.close(),so(this,vi,new this.options.WebSocketConstructor(this.endpoint)),ir(this,vi).addEventListener("open",()=>{so(this,Jo,0),e(ir(this,vi))}),ir(this,vi).addEventListener("close",()=>{m4(this,Jo)._++,ir(this,Jo)<=this.options.maxReconnects&&setTimeout(()=>{Bh(this,oc,Fh).call(this)},this.options.reconnectTimeout)}),ir(this,vi).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&&ir(this,Cs).has(n.id)){const{resolve:i,timeout:s}=ir(this,Cs).get(n.id);clearTimeout(s),i(n)}else if("params"in n){const{params:i}=n;ir(this,Xo).forEach(s=>{s.subscriptionId===i.subscription&&i.subscription===s.subscriptionId&&s.onMessage(i.result)})}})})),ir(this,Es))},Fh=async function(){var e;return(e=ir(this,vi))==null||e.close(),so(this,Es,null),Promise.allSettled([...ir(this,Xo)].map(t=>t.subscribe(this)))};class y4{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.input.signal);this.subscribed&&(this.subscriptionId=r)}}var $h=e=>{throw TypeError(e)},Pu=(e,t,r)=>t.has(e)||$h("Cannot "+r),dn=(e,t,r)=>(Pu(e,t,"read from private field"),r?r.call(e):t.get(e)),ac=(e,t,r)=>t.has(e)?$h("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ru=(e,t,r,n)=>(Pu(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),w4=(e,t,r)=>(Pu(e,t,"access private method"),r),Zo,En,Qo,ju,Vh;class x4{constructor(t){ac(this,ju),ac(this,Zo,0),ac(this,En),ac(this,Qo),Ru(this,En,t)}fetch(t,r){const n=dn(this,En).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,s;Ru(this,Zo,dn(this,Zo)+1);const r=await this.fetch(((i=dn(this,En).rpc)==null?void 0:i.url)??dn(this,En).url,{method:"POST",signal:t.signal,headers:{"Content-Type":"application/json","Client-Sdk-Type":"typescript","Client-Sdk-Version":d4,"Client-Target-Api-Version":f4,"Client-Request-Method":t.method,...(s=dn(this,En).rpc)==null?void 0:s.headers},body:JSON.stringify({jsonrpc:"2.0",id:dn(this,Zo),method:t.method,params:t.params})});if(!r.ok)throw new p4(`Unexpected status code: ${r.status}`,r.status,r.statusText);const n=await r.json();if("error"in n&&n.error!=null)throw new Dh(n.error.message,n.error.code);return n.result}async subscribe(t){const r=await w4(this,ju,Vh).call(this).subscribe(t);return t.signal&&(t.signal.throwIfAborted(),t.signal.addEventListener("abort",()=>{r()})),async()=>!!await r()}}Zo=new WeakMap,En=new WeakMap,Qo=new WeakMap,ju=new WeakSet,Vh=function(){var e;if(!dn(this,Qo)){const t=dn(this,En).WebSocketConstructor??WebSocket;if(!t)throw new Error("The current environment does not support WebSocket, you can provide a WebSocketConstructor in the options for SuiHTTPTransport.");Ru(this,Qo,new b4(((e=dn(this,En).websocket)==null?void 0:e.url)??dn(this,En).url,{WebSocketConstructor:t,...dn(this,En).websocket}))}return dn(this,Qo)};function zh(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 S4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function qh(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 Nu(e,t){if(typeof t!="string")throw new Error(`${e}: string expected`);return!0}function Hh(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function ku(e){if(!Array.isArray(e))throw new Error("array expected")}function Wh(e,t){if(!qh(!0,t))throw new Error(`${e}: array of strings expected`)}function _4(e,t){if(!qh(!1,t))throw new Error(`${e}: array of numbers expected`)}function E4(...e){const t=s=>s,r=(s,o)=>a=>s(o(a)),n=e.map(s=>s.encode).reduceRight(r,t),i=e.map(s=>s.decode).reduce(r,t);return{encode:n,decode:i}}function C4(e){const t=typeof e=="string"?e.split(""):e,r=t.length;Wh("alphabet",t);const n=new Map(t.map((i,s)=>[i,s]));return{encode:i=>(ku(i),i.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return t[s]})),decode:i=>(ku(i),i.map(s=>{Nu("alphabet.decode",s);const o=n.get(s);if(o===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return o}))}}function A4(e=""){return Nu("join",e),{encode:t=>(Wh("join.decode",t),t.join(e)),decode:t=>(Nu("join.decode",t),t.split(e))}}function Gh(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(ku(e),!e.length)return[];let n=0;const i=[],s=Array.from(e,a=>{if(Hh(a),a<0||a>=t)throw new Error(`invalid integer: ${a}`);return a}),o=s.length;for(;;){let a=0,c=!0;for(let l=n;l<o;l++){const u=s[l],f=t*a,p=f+u;if(!Number.isSafeInteger(p)||f/t!==a||p-u!==f)throw new Error("convertRadix: carry overflow");const y=p/r;a=p%r;const x=Math.floor(y);if(s[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 T4(e){Hh(e);const t=2**8;return{encode:r=>{if(!S4(r))throw new Error("radix.encode input should be Uint8Array");return Gh(Array.from(r),t,e)},decode:r=>(_4("radix.decode",r),Uint8Array.from(Gh(r,e,t)))}}const Kh=(e=>E4(T4(58),C4(e),A4("")))("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),As=e=>Kh.encode(e),bi=e=>Kh.decode(e);function yr(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const Du=8192;function wr(e){if(e.length<Du)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=Du){const n=e.slice(r,r+Du);t+=String.fromCharCode(...n)}return btoa(t)}function oo(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(s=>parseInt(s,16)))??[];if(n.length!==r.length/2)throw new Error(`Invalid hex string ${e}`);return Uint8Array.from(n)}function yi(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function M4(e,t){return Array.from({length:Math.ceil(e.length/t)},(r,n)=>e.slice(n*t,(n+1)*t))}function cc(e){const t=[];let r=0;if(e===0)return[0];for(;e>0;)t[r]=e&127,(e>>=7)&&(t[r]|=128),r+=1;return t}function I4(e){let t=0,r=0,n=0;for(;;){const i=e[n];if(n+=1,t|=(i&127)<<r,!(i&128))break;r+=7}return{value:t,length:n}}class Yh{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength)}shift(t){return this.bytePosition+=t,this}read8(){const t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){const t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){const t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){const t=this.read32(),n=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){const t=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){const t=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(t){const r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,t);return this.shift(t),n}readULEB(){const t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t),{value:n,length:i}=I4(r);return this.shift(i),n}readVec(t){const r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(t(this,i,r));return n}}function Jh(e,t){switch(t){case"base58":return As(e);case"base64":return wr(e);case"hex":return yi(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function O4(e,t){switch(t){case"base58":return bi(e);case"base64":return yr(e);case"hex":return oo(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function Lu(e,t=["<",">"]){const[r,n]=t,i=[];let s="",o=0;for(let a=0;a<e.length;a++){const c=e[a];if(c===r&&o++,c===n&&o--,o===0&&c===","){i.push(s.trim()),s="";continue}s+=c}return i.push(s.trim()),i}class Xh{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 Bu(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return Bu(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return Bu(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return cc(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 Jh(this.toBytes(),t)}}function Bu(e,t){const r=new Uint8Array(t);let n=0;for(;e>0;)r[n]=Number(e%BigInt(256)),e=e/BigInt(256),n+=1;return r}var Zh=e=>{throw TypeError(e)},Qh=(e,t,r)=>t.has(e)||Zh("Cannot "+r),Cn=(e,t,r)=>(Qh(e,t,"read from private field"),r?r.call(e):t.get(e)),lc=(e,t,r)=>t.has(e)?Zh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),uc=(e,t,r,n)=>(Qh(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ao,ea,dc,Yi;const P4=class t4{constructor(t){lc(this,ao),lc(this,ea),this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),uc(this,ao,t.write),uc(this,ea,t.serialize??((r,n)=>{const i=new Xh({initialSize:this.serializedSize(r)??void 0,...n});return Cn(this,ao).call(this,r,i),i.toBytes()})),this.validate=t.validate??(()=>{})}write(t,r){this.validate(t),Cn(this,ao).call(this,t,r)}serialize(t,r){return this.validate(t),new tp(this,Cn(this,ea).call(this,t,r))}parse(t){const r=new Yh(t);return this.read(r)}fromHex(t){return this.parse(oo(t))}fromBase58(t){return this.parse(bi(t))}fromBase64(t){return this.parse(yr(t))}transform({name:t,input:r,output:n,validate:i}){return new t4({name:t??this.name,read:s=>n?n(this.read(s)):this.read(s),write:(s,o)=>Cn(this,ao).call(this,r?r(s):s,o),serializedSize:s=>this.serializedSize(r?r(s):s),serialize:(s,o)=>Cn(this,ea).call(this,r?r(s):s,o),validate:s=>{i==null||i(s),this.validate(r?r(s):s)}})}};ao=new WeakMap,ea=new WeakMap;let An=P4;const ep=Symbol.for("@mysten/serialized-bcs");function fc(e){return!!e&&typeof e=="object"&&e[ep]===!0}class tp{constructor(t,r){lc(this,dc),lc(this,Yi),uc(this,dc,t),uc(this,Yi,r)}get[ep](){return!0}toBytes(){return Cn(this,Yi)}toHex(){return yi(Cn(this,Yi))}toBase64(){return wr(Cn(this,Yi))}toBase58(){return As(Cn(this,Yi))}parse(){return Cn(this,dc).parse(Cn(this,Yi))}}dc=new WeakMap,Yi=new WeakMap;function hc({size:e,...t}){return new An({...t,serializedSize:()=>e})}function Uu({readMethod:e,writeMethod:t,...r}){return hc({...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 Fu({readMethod:e,writeMethod:t,...r}){return hc({...r,read:n=>n[e](),write:(n,i)=>i[t](BigInt(n)),validate:n=>{var s;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}`);(s=r.validate)==null||s.call(r,i)}})}function R4({serialize:e,...t}){const r=new An({...t,serialize:e,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function j4({toBytes:e,fromBytes:t,...r}){return new An({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return t(s)},write:(n,i)=>{const s=e(n);i.writeULEB(s.length);for(let o=0;o<s.length;o++)i.write8(s[o])},serialize:n=>{const i=e(n),s=cc(i.length),o=new Uint8Array(s.length+i.length);return o.set(s,0),o.set(i,s.length),o},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 N4(e){let t=null;function r(){return t||(t=e()),t}return new An({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 X={u8(e){return Uu({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return Uu({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return Uu({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return Fu({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return Fu({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return Fu({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return hc({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 R4({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(cc(t)),...e})},bytes(e,t){return hc({name:`bytes[${e}]`,size:e,read:r=>r.readBytes(e),write:(r,n)=>{const i=new Uint8Array(r);for(let s=0;s<e;s++)n.write8(i[s]??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 An({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:cc(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 j4({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new An({name:`${t.name}[${e}]`,read:n=>{const i=new Array(e);for(let s=0;s<e;s++)i[s]=t.read(n);return i},write:(n,i)=>{for(const s of n)t.write(s,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 X.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 An({name:`vector<${e.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=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 An({name:`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<e.length;i++){const s=e[i].serializedSize(r[i]);if(s==null)return null;n+=s}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 An({name:e,serializedSize:i=>{let s=0;for(const[o,a]of n){const c=a.serializedSize(i[o]);if(c==null)return null;s+=c}return s},read:i=>{const s={};for(const[o,a]of n)s[o]=a.read(i);return s},write:(i,s)=>{for(const[o,a]of n)a.write(i[o],s)},...r,validate:i=>{var s;if((s=r==null?void 0:r.validate)==null||s.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 An({name:e,read:i=>{const s=i.readULEB(),o=n[s];if(!o)throw new TypeError(`Unknown value ${s} for enum ${e}`);const[a,c]=o;return{[a]:(c==null?void 0:c.read(i))??!0,$kind:a}},write:(i,s)=>{const[o,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===o){s.writeULEB(c),u==null||u.write(a,s);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 s=Object.keys(i).filter(c=>i[c]!==void 0&&Object.hasOwn(t,c));if(s.length!==1)throw new TypeError(`Expected object with one key, but found ${s.length} for type ${e}}`);const[o]=s;if(!Object.hasOwn(t,o))throw new TypeError(`Invalid enum variant ${o}`)}})},map(e,t){return X.vector(X.tuple([e,t])).transform({name:`Map<${e.name}, ${t.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},lazy(e){return N4(e)}},k4=As,D4=bi,rp=wr,np=yr,ip=yi,sp=oo,L4=Object.freeze(Object.defineProperty({__proto__:null,BcsReader:Yh,BcsType:An,BcsWriter:Xh,SerializedBcs:tp,bcs:X,decodeStr:O4,encodeStr:Jh,fromB58:D4,fromB64:np,fromBase58:bi,fromBase64:yr,fromHEX:sp,fromHex:oo,isSerializedBcs:fc,splitGenericParameters:Lu,toB58:k4,toB64:rp,toBase58:As,toBase64:wr,toHEX:ip,toHex:yi},Symbol.toStringTag,{value:"Module"}));var op=e=>{throw TypeError(e)},ap=(e,t,r)=>t.has(e)||op("Cannot "+r),fn=(e,t,r)=>(ap(e,t,"read from private field"),r?r.call(e):t.get(e)),cp=(e,t,r)=>t.has(e)?op("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),lp=(e,t,r,n)=>(ap(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),co,hn;const B4=class r4{constructor({prefix:t,cache:r}={}){cp(this,co),cp(this,hn),lp(this,co,t??[]),lp(this,hn,r??new Map)}read(t,r){const n=[fn(this,co),...t].join(":");if(fn(this,hn).has(n))return fn(this,hn).get(n);const i=r();return fn(this,hn).set(n,i),typeof i=="object"&&i!==null&&"then"in i?Promise.resolve(i).then(s=>(fn(this,hn).set(n,s),s)).catch(s=>{throw fn(this,hn).delete(n),s}):i}clear(t){const r=[...fn(this,co),...t??[]].join(":");if(!r){fn(this,hn).clear();return}for(const n of fn(this,hn).keys())n.startsWith(r)&&fn(this,hn).delete(n)}scope(t){return new r4({prefix:[...fn(this,co),...Array.isArray(t)?t:[t]],cache:fn(this,hn)})}};co=new WeakMap,hn=new WeakMap;let U4=B4;class up{constructor({network:t}){this.cache=new U4,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 dp=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,fp=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,F4=235;function hp(e){return e.length>F4?!1:e.includes("@")?dp.test(e):fp.test(e)}function pp(e,t="at"){const r=e.toLowerCase();let n;if(r.includes("@")){if(!dp.test(r))throw new Error(`Invalid SuiNS name ${e}`);const[i,s]=r.split("@");n=[...i?i.split("."):[],s]}else{if(!fp.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 $4=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,V4=/^\d+$/,z4=64,mp="/",$u=e=>{const t=e.split(mp);if(t.length<2||t.length>3)return!1;const[r,n,i]=t;return i!==void 0&&!V4.test(i)||!hp(r)?!1:$4.test(n)&&n.length<z4},q4=e=>{const t=e.split(/::|<|>|,/);for(const r of t)if(r.includes(mp)&&!$u(r))return!1;return!0},H4=32;function Vu(e){try{return bi(e).length===H4}catch{return!1}}const ta=32;function Wn(e){return G4(e)&&K4(e)===ta}function ra(e){return Wn(e)}function W4(e){return e.includes("::")?pc(e):e}function pc(e){const[t,r]=e.split("::"),n=$u(t),i=e.slice(t.length+r.length+4),s=i.includes("<")?i.slice(0,i.indexOf("<")):i,o=i.includes("<")?Lu(i.slice(i.indexOf("<")+1,i.lastIndexOf(">"))).map(a=>W4(a.trim())):[];return{address:n?t:Dt(t),module:r,name:s,typeParams:o}}function na(e){const{address:t,module:r,name:n,typeParams:i}=typeof e=="string"?pc(e):e,s=(i==null?void 0:i.length)>0?`<${i.map(o=>typeof o=="string"?o:na(o)).join(",")}>`:"";return`${t}::${r}::${n}${s}`}function Dt(e,t=!1){let r=e.toLowerCase();return!t&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(ta*2,"0")}`}function rn(e,t=!1){return Dt(e,t)}function G4(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function K4(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}const Y4=/^vector<(.+)>$/,J4=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;let ia=class Go{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(Y4);if(n)return{vector:Go.parseFromStr(n[1],r)};const i=t.match(J4);if(i)return{struct:{address:r?Dt(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:Go.parseStructTypeArgs(i[5],r)}};throw new Error(`Encountered unexpected token when parsing type args for ${t}`)}static parseStructTypeArgs(t,r=!1){return Lu(t).map(n=>Go.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<${Go.tagToString(t.vector)}>`;if("struct"in t){const r=t.struct,n=r.typeParams.map(Go.tagToString).join(", ");return`${r.address}::${r.module}::${r.name}${n?`<${n}>`:""}`}throw new Error("Invalid TypeTag")}};function X4(e){return X.u64({name:"unsafe_u64",...e}).transform({input:t=>t,output:t=>Number(t)})}function Z4(e){return X.enum("Option",{None:null,Some:e})}const er=X.bytes(ta).transform({validate:e=>{const t=typeof e=="string"?e:yi(e);if(!t||!Wn(Dt(t)))throw new Error(`Invalid Sui address ${t}`)},input:e=>typeof e=="string"?oo(Dt(e)):e,output:e=>Dt(yi(e))}),Tn=X.vector(X.u8()).transform({name:"ObjectDigest",input:e=>bi(e),output:e=>As(new Uint8Array(e)),validate:e=>{if(bi(e).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),pn=X.struct("SuiObjectRef",{objectId:er,version:X.u64(),digest:Tn}),gp=X.struct("SharedObjectRef",{objectId:er,initialSharedVersion:X.u64(),mutable:X.bool()}),vp=X.enum("ObjectArg",{ImmOrOwnedObject:pn,SharedObject:gp,Receiving:pn}),Ts=X.enum("Owner",{AddressOwner:er,ObjectOwner:er,Shared:X.struct("Shared",{initialSharedVersion:X.u64()}),Immutable:null,ConsensusV2:X.struct("ConsensusV2",{authenticator:X.enum("Authenticator",{SingleOwner:er}),startVersion:X.u64()})}),bp=X.enum("CallArg",{Pure:X.struct("Pure",{bytes:X.vector(X.u8()).transform({input:e=>typeof e=="string"?yr(e):e,output:e=>wr(new Uint8Array(e))})}),Object:vp}),zu=X.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:X.lazy(()=>zu),struct:X.lazy(()=>Ep),u16:null,u32:null,u256:null}),qu=zu.transform({input:e=>typeof e=="string"?ia.parseFromStr(e,!0):e,output:e=>ia.tagToString(e)}),Gn=X.enum("Argument",{GasCoin:null,Input:X.u16(),Result:X.u16(),NestedResult:X.tuple([X.u16(),X.u16()])}),yp=X.struct("ProgrammableMoveCall",{package:er,module:X.string(),function:X.string(),typeArguments:X.vector(qu),arguments:X.vector(Gn)}),wp=X.enum("Command",{MoveCall:yp,TransferObjects:X.struct("TransferObjects",{objects:X.vector(Gn),address:Gn}),SplitCoins:X.struct("SplitCoins",{coin:Gn,amounts:X.vector(Gn)}),MergeCoins:X.struct("MergeCoins",{destination:Gn,sources:X.vector(Gn)}),Publish:X.struct("Publish",{modules:X.vector(X.vector(X.u8()).transform({input:e=>typeof e=="string"?yr(e):e,output:e=>wr(new Uint8Array(e))})),dependencies:X.vector(er)}),MakeMoveVec:X.struct("MakeMoveVec",{type:Z4(qu).transform({input:e=>e===null?{None:!0}:{Some:e},output:e=>e.Some??null}),elements:X.vector(Gn)}),Upgrade:X.struct("Upgrade",{modules:X.vector(X.vector(X.u8()).transform({input:e=>typeof e=="string"?yr(e):e,output:e=>wr(new Uint8Array(e))})),dependencies:X.vector(er),package:er,ticket:Gn})}),xp=X.struct("ProgrammableTransaction",{inputs:X.vector(bp),commands:X.vector(wp)}),Sp=X.enum("TransactionKind",{ProgrammableTransaction:xp,ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null}),_p=X.enum("TransactionExpiration",{None:null,Epoch:X4()}),Ep=X.struct("StructTag",{address:er,module:X.string(),name:X.string(),typeParams:X.vector(zu)}),Cp=X.struct("GasData",{payment:X.vector(pn),owner:er,price:X.u64(),budget:X.u64()}),Ap=X.struct("TransactionDataV1",{kind:Sp,sender:er,gasData:Cp,expiration:_p}),Tp=X.enum("TransactionData",{V1:Ap}),Mp=X.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),Ip=X.enum("IntentVersion",{V0:null}),Op=X.enum("AppId",{Sui:null}),Pp=X.struct("Intent",{scope:Mp,version:Ip,appId:Op});function Rp(e){return X.struct(`IntentMessage<${e.name}>`,{intent:Pp,value:e})}const jp=X.enum("CompressedSignature",{ED25519:X.fixedArray(64,X.u8()),Secp256k1:X.fixedArray(64,X.u8()),Secp256r1:X.fixedArray(64,X.u8()),ZkLogin:X.vector(X.u8())}),Np=X.enum("PublicKey",{ED25519:X.fixedArray(32,X.u8()),Secp256k1:X.fixedArray(33,X.u8()),Secp256r1:X.fixedArray(33,X.u8()),ZkLogin:X.vector(X.u8())}),kp=X.struct("MultiSigPkMap",{pubKey:Np,weight:X.u8()}),Dp=X.struct("MultiSigPublicKey",{pk_map:X.vector(kp),threshold:X.u16()}),Q4=X.struct("MultiSig",{sigs:X.vector(jp),bitmap:X.u16(),multisig_pk:Dp}),e8=X.vector(X.u8()).transform({input:e=>typeof e=="string"?yr(e):e,output:e=>wr(new Uint8Array(e))}),Lp=X.struct("SenderSignedTransaction",{intentMessage:Rp(Tp),txSignatures:X.vector(e8)}),t8=X.vector(Lp,{name:"SenderSignedData"}),r8=X.struct("PasskeyAuthenticator",{authenticatorData:X.vector(X.u8()),clientDataJson:X.string(),userSignature:X.vector(X.u8())}),n8=X.enum("PackageUpgradeError",{UnableToFetchPackage:X.struct("UnableToFetchPackage",{packageId:er}),NotAPackage:X.struct("NotAPackage",{objectId:er}),IncompatibleUpgrade:null,DigestDoesNotMatch:X.struct("DigestDoesNotMatch",{digest:X.vector(X.u8())}),UnknownUpgradePolicy:X.struct("UnknownUpgradePolicy",{policy:X.u8()}),PackageIDDoesNotMatch:X.struct("PackageIDDoesNotMatch",{packageId:er,ticketId:er})}),i8=X.struct("ModuleId",{address:er,name:X.string()}),Bp=X.struct("MoveLocation",{module:i8,function:X.u16(),instruction:X.u16(),functionName:X.option(X.string())}),s8=X.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:X.struct("IndexOutOfBounds",{idx:X.u16()}),SecondaryIndexOutOfBounds:X.struct("SecondaryIndexOutOfBounds",{resultIdx:X.u16(),secondaryIdx:X.u16()}),InvalidResultArity:X.struct("InvalidResultArity",{resultIdx:X.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null}),o8=X.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),a8=X.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:X.struct("MoveObjectTooBig",{objectSize:X.u64(),maxObjectSize:X.u64()}),MovePackageTooBig:X.struct("MovePackageTooBig",{objectSize:X.u64(),maxObjectSize:X.u64()}),CircularObjectOwnership:X.struct("CircularObjectOwnership",{object:er}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:X.option(Bp),MoveAbort:X.tuple([Bp,X.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:X.struct("CommandArgumentError",{argIdx:X.u16(),kind:s8}),TypeArgumentError:X.struct("TypeArgumentError",{argumentIdx:X.u16(),kind:o8}),UnusedValueWithoutDrop:X.struct("UnusedValueWithoutDrop",{resultIdx:X.u16(),secondaryIdx:X.u16()}),InvalidPublicFunctionReturnType:X.struct("InvalidPublicFunctionReturnType",{idx:X.u16()}),InvalidTransferObject:null,EffectsTooLarge:X.struct("EffectsTooLarge",{currentSize:X.u64(),maxSize:X.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:X.struct("PackageUpgradeError",{upgradeError:n8}),WrittenObjectsTooLarge:X.struct("WrittenObjectsTooLarge",{currentSize:X.u64(),maxSize:X.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:X.struct("ExecutionCancelledDueToSharedObjectCongestion",{congestedObjects:X.vector(er)}),AddressDeniedForCoin:X.struct("AddressDeniedForCoin",{address:er,coinType:X.string()}),CoinTypeGlobalPause:X.struct("CoinTypeGlobalPause",{coinType:X.string()}),ExecutionCancelledDueToRandomnessUnavailable:null}),Up=X.enum("ExecutionStatus",{Success:null,Failed:X.struct("ExecutionFailed",{error:a8,command:X.option(X.u64())})}),Fp=X.struct("GasCostSummary",{computationCost:X.u64(),storageCost:X.u64(),storageRebate:X.u64(),nonRefundableStorageFee:X.u64()}),c8=X.struct("TransactionEffectsV1",{status:Up,executedEpoch:X.u64(),gasUsed:Fp,modifiedAtVersions:X.vector(X.tuple([er,X.u64()])),sharedObjects:X.vector(pn),transactionDigest:Tn,created:X.vector(X.tuple([pn,Ts])),mutated:X.vector(X.tuple([pn,Ts])),unwrapped:X.vector(X.tuple([pn,Ts])),deleted:X.vector(pn),unwrappedThenDeleted:X.vector(pn),wrapped:X.vector(pn),gasObject:X.tuple([pn,Ts]),eventsDigest:X.option(Tn),dependencies:X.vector(Tn)}),Hu=X.tuple([X.u64(),Tn]),l8=X.enum("ObjectIn",{NotExist:null,Exist:X.tuple([Hu,Ts])}),u8=X.enum("ObjectOut",{NotExist:null,ObjectWrite:X.tuple([Tn,Ts]),PackageWrite:Hu}),d8=X.enum("IDOperation",{None:null,Created:null,Deleted:null}),f8=X.struct("EffectsObjectChange",{inputState:l8,outputState:u8,idOperation:d8}),h8=X.enum("UnchangedSharedKind",{ReadOnlyRoot:Hu,MutateDeleted:X.u64(),ReadDeleted:X.u64(),Cancelled:X.u64(),PerEpochConfig:null}),p8=X.struct("TransactionEffectsV2",{status:Up,executedEpoch:X.u64(),gasUsed:Fp,transactionDigest:Tn,gasObjectIndex:X.option(X.u32()),eventsDigest:X.option(Tn),dependencies:X.vector(Tn),lamportVersion:X.u64(),changedObjects:X.vector(X.tuple([er,f8])),unchangedSharedObjects:X.vector(X.tuple([er,h8])),auxDataDigest:X.option(Tn)}),m8=X.enum("TransactionEffects",{V1:c8,V2:p8});function sa(e){switch(e){case"u8":return X.u8();case"u16":return X.u16();case"u32":return X.u32();case"u64":return X.u64();case"u128":return X.u128();case"u256":return X.u256();case"bool":return X.bool();case"string":return X.string();case"id":case"address":return er}const t=e.match(/^(vector|option)<(.+)>$/);if(t){const[r,n]=t.slice(1);return r==="vector"?X.vector(sa(n)):X.option(sa(n))}throw new Error(`Invalid Pure type name: ${e}`)}const wt={...X,U8:X.u8(),U16:X.u16(),U32:X.u32(),U64:X.u64(),U128:X.u128(),U256:X.u256(),ULEB128:X.uleb128(),Bool:X.bool(),String:X.string(),Address:er,AppId:Op,Argument:Gn,CallArg:bp,Command:wp,CompressedSignature:jp,GasData:Cp,Intent:Pp,IntentMessage:Rp,IntentScope:Mp,IntentVersion:Ip,MultiSig:Q4,MultiSigPkMap:kp,MultiSigPublicKey:Dp,ObjectArg:vp,ObjectDigest:Tn,Owner:Ts,PasskeyAuthenticator:r8,ProgrammableMoveCall:yp,ProgrammableTransaction:xp,PublicKey:Np,SenderSignedData:t8,SenderSignedTransaction:Lp,SharedObjectRef:gp,StructTag:Ep,SuiObjectRef:pn,TransactionData:Tp,TransactionDataV1:Ap,TransactionEffects:m8,TransactionExpiration:_p,TransactionKind:Sp,TypeTag:qu};function g8(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}var wi;function v8(e){return{lang:(e==null?void 0:e.lang)??(wi==null?void 0:wi.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(wi==null?void 0:wi.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(wi==null?void 0:wi.abortPipeEarly)}}var Wu;function b8(e){return Wu==null?void 0:Wu.get(e)}var Gu;function y8(e){return Gu==null?void 0:Gu.get(e)}var Ku;function w8(e,t){var r;return(r=Ku==null?void 0:Ku.get(e))==null?void 0:r.get(t)}function $p(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 nn(e,t,r,n,i){const s=i&&"input"in i?i.input:r.value,o=(i==null?void 0:i.expected)??e.expects??null,a=(i==null?void 0:i.received)??$p(s),c={kind:e.kind,type:e.type,input:s,expected:o,received:a,message:`Invalid ${t}: ${o?`Expected ${o} 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??w8(e.reference,c.lang)??(l?y8(c.lang):null)??n.message??b8(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 x8(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}var S8=class extends Error{constructor(t){super(t[0].message);Et(this,"issues");this.name="ValiError",this.issues=t}};function oa(e,t){return{kind:"validation",type:"check",reference:oa,async:!1,expects:null,requirement:e,message:t,_run(r,n){return r.typed&&!this.requirement(r.value)&&nn(this,"input",r,n),r}}}function ur(e){return{kind:"validation",type:"integer",reference:ur,async:!1,expects:null,requirement:Number.isInteger,message:e,_run(t,r){return t.typed&&!this.requirement(t.value)&&nn(this,"integer",t,r),t}}}function mc(e){return{kind:"transformation",type:"transform",reference:mc,async:!1,operation:e,_run(t){return t.value=this.operation(t.value),t}}}function Yu(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function Ju(e,t){return!e._run({typed:!1,value:t},{abortEarly:!0}).issues}function ht(e,t){return{kind:"schema",type:"array",reference:ht,expects:"Array",async:!1,item:e,message:t,_run(r,n){var s;const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let o=0;o<i.length;o++){const a=i[o],c=this.item._run({typed:!1,value:a},n);if(c.issues){const l={type:"array",origin:"value",input:i,key:o,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(s=r.issues)==null||s.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 nn(this,"type",r,n);return r}}}function gc(e){return{kind:"schema",type:"bigint",reference:gc,expects:"bigint",async:!1,message:e,_run(t,r){return typeof t.value=="bigint"?t.typed=!0:nn(this,"type",t,r),t}}}function vc(e){return{kind:"schema",type:"boolean",reference:vc,expects:"boolean",async:!1,message:e,_run(t,r){return typeof t.value=="boolean"?t.typed=!0:nn(this,"type",t,r),t}}}function aa(e){return{kind:"schema",type:"lazy",reference:aa,expects:"unknown",async:!1,getter:e,_run(t,r){return this.getter(t.value)._run(t,r)}}}function yt(e,t){return{kind:"schema",type:"literal",reference:yt,expects:$p(e),async:!1,literal:e,message:t,_run(r,n){return r.value===this.literal?r.typed=!0:nn(this,"type",r,n),r}}}function Ut(e,...t){const r={kind:"schema",type:"nullable",reference:Ut,expects:`${e.expects} | null`,async:!1,wrapped:e,_run(n,i){return n.value===null&&("default"in this&&(n.value=Yu(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 lo(e,...t){const r={kind:"schema",type:"nullish",reference:lo,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=Yu(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 ar(e){return{kind:"schema",type:"number",reference:ar,expects:"number",async:!1,message:e,_run(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:nn(this,"type",t,r),t}}}function Fe(e,t){return{kind:"schema",type:"object",reference:Fe,expects:"Object",async:!1,entries:e,message:t,_run(r,n){var s;const i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(const o in this.entries){const a=i[o],c=this.entries[o]._run({typed:!1,value:a},n);if(c.issues){const l={type:"object",origin:"value",input:i,key:o,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(s=r.issues)==null||s.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),(c.value!==void 0||o in i)&&(r.value[o]=c.value)}}else nn(this,"type",r,n);return r}}}function kr(e,...t){const r={kind:"schema",type:"optional",reference:kr,expects:`${e.expects} | undefined`,async:!1,wrapped:e,_run(n,i){return n.value===void 0&&("default"in this&&(n.value=Yu(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 ca(e,t,r){return{kind:"schema",type:"record",reference:ca,expects:"Object",async:!1,key:e,value:t,message:r,_run(n,i){var o,a;const s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(const c in s)if(x8(s,c)){const l=s[c],u=this.key._run({typed:!1,value:c},i);if(u.issues){const p={type:"object",origin:"key",input:s,key:c,value:l};for(const y of u.issues)y.path=[p],(o=n.issues)==null||o.push(y);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}const f=this.value._run({typed:!1,value:l},i);if(f.issues){const p={type:"object",origin:"value",input:s,key:c,value:l};for(const y of f.issues)y.path?y.path.unshift(p):y.path=[p],(a=n.issues)==null||a.push(y);if(n.issues||(n.issues=f.issues),i.abortEarly){n.typed=!1;break}}(!u.typed||!f.typed)&&(n.typed=!1),u.typed&&(n.value[u.value]=f.value)}}else nn(this,"type",n,i);return n}}}function At(e){return{kind:"schema",type:"string",reference:At,expects:"string",async:!1,message:e,_run(t,r){return typeof t.value=="string"?t.typed=!0:nn(this,"type",t,r),t}}}function Xu(e,t){return{kind:"schema",type:"tuple",reference:Xu,expects:"Array",async:!1,items:e,message:t,_run(r,n){var s;const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let o=0;o<this.items.length;o++){const a=i[o],c=this.items[o]._run({typed:!1,value:a},n);if(c.issues){const l={type:"array",origin:"value",input:i,key:o,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(s=r.issues)==null||s.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 nn(this,"type",r,n);return r}}}function Vp(e){let t;if(e)for(const r of e)t?t.push(...r.issues):t=r.issues;return t}function Tr(e,t){return{kind:"schema",type:"union",reference:Tr,expects:[...new Set(e.map(r=>r.expects))].join(" | ")||"never",async:!1,options:e,message:t,_run(r,n){let i,s,o;for(const a of this.options){const c=a._run({typed:!1,value:r.value},n);if(c.typed)if(c.issues)s?s.push(c):s=[c];else{i=c;break}else o?o.push(c):o=[c]}if(i)return i;if(s){if(s.length===1)return s[0];nn(this,"type",r,n,{issues:Vp(s)}),r.typed=!0}else{if((o==null?void 0:o.length)===1)return o[0];nn(this,"type",r,n,{issues:Vp(o)})}return r}}}function Ms(){return{kind:"schema",type:"unknown",reference:Ms,expects:"unknown",async:!1,_run(e){return e.typed=!0,e}}}function cr(e,t,r){const n=e._run({typed:!1,value:t},v8(r));if(n.issues)throw new S8(n.issues);return n.value}function Gt(...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 Is(e){const t=Object.entries(e).map(([r,n])=>Fe({[r]:n}));return Gt(Tr(t),mc(r=>({...r,$kind:Object.keys(r)[0]})))}const uo=Gt(At(),mc(e=>Dt(e)),oa(Wn)),sn=uo,Os=At(),Gr=Gt(Tr([At(),Gt(ar(),ur())]),oa(e=>{try{return BigInt(e),BigInt(e)>=0&&BigInt(e)<=18446744073709551615n}catch{return!1}},"Invalid u64")),Ji=Fe({objectId:uo,version:Gr,digest:At()}),sr=Gt(Tr([Fe({GasCoin:yt(!0)}),Fe({Input:Gt(ar(),ur()),type:kr(yt("pure"))}),Fe({Input:Gt(ar(),ur()),type:kr(yt("object"))}),Fe({Result:Gt(ar(),ur())}),Fe({NestedResult:Xu([Gt(ar(),ur()),Gt(ar(),ur())])})]),mc(e=>({...e,$kind:Object.keys(e)[0]}))),_8=Fe({budget:Ut(Gr),price:Ut(Gr),owner:Ut(uo),payment:Ut(ht(Ji))}),Zu=Tr([yt("address"),yt("bool"),yt("u8"),yt("u16"),yt("u32"),yt("u64"),yt("u128"),yt("u256"),Fe({vector:aa(()=>Zu)}),Fe({datatype:Fe({package:At(),module:At(),type:At(),typeParameters:ht(aa(()=>Zu))})}),Fe({typeParameter:Gt(ar(),ur())})]),E8=Fe({ref:Ut(Tr([yt("&"),yt("&mut")])),body:Zu}),C8=Fe({package:sn,module:At(),function:At(),typeArguments:ht(At()),arguments:ht(sr),_argumentTypes:kr(Ut(ht(E8)))}),A8=Fe({name:At(),inputs:ca(At(),Tr([sr,ht(sr)])),data:ca(At(),Ms())}),T8=Is({MoveCall:C8,TransferObjects:Fe({objects:ht(sr),address:sr}),SplitCoins:Fe({coin:sr,amounts:ht(sr)}),MergeCoins:Fe({destination:sr,sources:ht(sr)}),Publish:Fe({modules:ht(Os),dependencies:ht(sn)}),MakeMoveVec:Fe({type:Ut(At()),elements:ht(sr)}),Upgrade:Fe({modules:ht(Os),dependencies:ht(sn),package:sn,ticket:sr}),$Intent:A8}),zp=Is({ImmOrOwnedObject:Ji,SharedObject:Fe({objectId:sn,initialSharedVersion:Gr,mutable:vc()}),Receiving:Ji}),M8=Is({Object:zp,Pure:Fe({bytes:Os}),UnresolvedPure:Fe({value:Ms()}),UnresolvedObject:Fe({objectId:sn,version:kr(Ut(Gr)),digest:kr(Ut(At())),initialSharedVersion:kr(Ut(Gr))})}),qp=Is({Object:zp,Pure:Fe({bytes:Os})}),Hp=Is({None:yt(!0),Epoch:Gr}),bc=Fe({version:yt(2),sender:lo(uo),expiration:lo(Hp),gasData:_8,inputs:ht(M8),commands:ht(T8)}),Kn={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(sr,r)),address:cr(sr,t)}}},SplitCoins(e,t){return{$kind:"SplitCoins",SplitCoins:{coin:cr(sr,e),amounts:t.map(r=>cr(sr,r))}}},MergeCoins(e,t){return{$kind:"MergeCoins",MergeCoins:{destination:cr(sr,e),sources:t.map(r=>cr(sr,r))}}},Publish({modules:e,dependencies:t}){return{$kind:"Publish",Publish:{modules:e.map(r=>typeof r=="string"?r:wr(new Uint8Array(r))),dependencies:t.map(r=>rn(r))}}},Upgrade({modules:e,dependencies:t,package:r,ticket:n}){return{$kind:"Upgrade",Upgrade:{modules:e.map(i=>typeof i=="string"?i:wr(new Uint8Array(i))),dependencies:t.map(i=>rn(i)),package:r,ticket:cr(sr,n)}}},MakeMoveVec({type:e,elements:t}){return{$kind:"MakeMoveVec",MakeMoveVec:{type:e??null,elements:t.map(r=>cr(sr,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(s=>cr(sr,s)):cr(sr,i)])),data:r}}}},Qu=Fe({digest:At(),objectId:At(),version:Tr([Gt(ar(),ur()),At(),gc()])}),I8=Is({ImmOrOwned:Qu,Shared:Fe({objectId:sn,initialSharedVersion:Gr,mutable:vc()}),Receiving:Qu}),Wp=Is({Object:I8,Pure:ht(Gt(ar(),ur()))}),Gp=Tr([Fe({kind:yt("Input"),index:Gt(ar(),ur()),value:Ms(),type:kr(yt("object"))}),Fe({kind:yt("Input"),index:Gt(ar(),ur()),value:Ms(),type:yt("pure")})]),O8=Tr([Fe({Epoch:Gt(ar(),ur())}),Fe({None:Ut(yt(!0))})]),Kp=Gt(Tr([ar(),At(),gc()]),oa(e=>{if(!["string","number","bigint"].includes(typeof e))return!1;try{return BigInt(e),!0}catch{return!1}})),ed=Tr([Fe({bool:Ut(yt(!0))}),Fe({u8:Ut(yt(!0))}),Fe({u64:Ut(yt(!0))}),Fe({u128:Ut(yt(!0))}),Fe({address:Ut(yt(!0))}),Fe({signer:Ut(yt(!0))}),Fe({vector:aa(()=>ed)}),Fe({struct:aa(()=>P8)}),Fe({u16:Ut(yt(!0))}),Fe({u32:Ut(yt(!0))}),Fe({u256:Ut(yt(!0))})]),P8=Fe({address:At(),module:At(),name:At(),typeParams:ht(ed)}),R8=Fe({budget:kr(Kp),price:kr(Kp),payment:kr(ht(Qu)),owner:kr(At())}),j8=[Gp,Fe({kind:yt("GasCoin")}),Fe({kind:yt("Result"),index:Gt(ar(),ur())}),Fe({kind:yt("NestedResult"),index:Gt(ar(),ur()),resultIndex:Gt(ar(),ur())})],xi=Tr([...j8]),N8=Fe({kind:yt("MoveCall"),target:Gt(At(),oa(e=>e.split("::").length===3)),typeArguments:ht(At()),arguments:ht(xi)}),k8=Fe({kind:yt("TransferObjects"),objects:ht(xi),address:xi}),D8=Fe({kind:yt("SplitCoins"),coin:xi,amounts:ht(xi)}),L8=Fe({kind:yt("MergeCoins"),destination:xi,sources:ht(xi)}),B8=Fe({kind:yt("MakeMoveVec"),type:Tr([Fe({Some:ed}),Fe({None:Ut(yt(!0))})]),objects:ht(xi)}),U8=Fe({kind:yt("Publish"),modules:ht(ht(Gt(ar(),ur()))),dependencies:ht(At())}),F8=Fe({kind:yt("Upgrade"),modules:ht(ht(Gt(ar(),ur()))),dependencies:ht(At()),packageId:At(),ticket:xi}),$8=Tr([...[N8,k8,D8,L8,U8,F8,B8]]);Fe({version:yt(1),sender:kr(At()),expiration:lo(O8),gasConfig:R8,inputs:ht(Gp),transactions:ht($8)});function Yp(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(yr(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:ia.parseFromStr(n.MakeMoveVec.type)},objects:n.MakeMoveVec.elements.map(i=>Si(i,t))};if(n.MergeCoins)return{kind:"MergeCoins",destination:Si(n.MergeCoins.destination,t),sources:n.MergeCoins.sources.map(i=>Si(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=>Si(i,t))};if(n.Publish)return{kind:"Publish",modules:n.Publish.modules.map(i=>Array.from(yr(i))),dependencies:n.Publish.dependencies};if(n.SplitCoins)return{kind:"SplitCoins",coin:Si(n.SplitCoins.coin,t),amounts:n.SplitCoins.amounts.map(i=>Si(i,t))};if(n.TransferObjects)return{kind:"TransferObjects",objects:n.TransferObjects.objects.map(i=>Si(i,t)),address:Si(n.TransferObjects.address,t)};if(n.Upgrade)return{kind:"Upgrade",modules:n.Upgrade.modules.map(i=>Array.from(yr(i))),dependencies:n.Upgrade.dependencies,packageId:n.Upgrade.package,ticket:Si(n.Upgrade.ticket,t)};throw new Error(`Unknown transaction ${Object.keys(n)}`)})}}function Si(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 V8(e){var t,r,n;return cr(bc,{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(Ju(Wp,i.value)){const s=cr(Wp,i.value);if(s.Object){if(s.Object.ImmOrOwned)return{Object:{ImmOrOwnedObject:{objectId:s.Object.ImmOrOwned.objectId,version:String(s.Object.ImmOrOwned.version),digest:s.Object.ImmOrOwned.digest}}};if(s.Object.Shared)return{Object:{SharedObject:{mutable:s.Object.Shared.mutable??null,initialSharedVersion:s.Object.Shared.initialSharedVersion,objectId:s.Object.Shared.objectId}}};if(s.Object.Receiving)return{Object:{Receiving:{digest:s.Object.Receiving.digest,version:String(s.Object.Receiving.version),objectId:s.Object.Receiving.objectId}}};throw new Error("Invalid object input")}return{Pure:{bytes:wr(new Uint8Array(s.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?ia.tagToString(i.type.Some):null,elements:i.objects.map(s=>_i(s))}};case"MergeCoins":return{MergeCoins:{destination:_i(i.destination),sources:i.sources.map(s=>_i(s))}};case"MoveCall":{const[s,o,a]=i.target.split("::");return{MoveCall:{package:s,module:o,function:a,typeArguments:i.typeArguments,arguments:i.arguments.map(c=>_i(c))}}}case"Publish":return{Publish:{modules:i.modules.map(s=>wr(Uint8Array.from(s))),dependencies:i.dependencies}};case"SplitCoins":return{SplitCoins:{coin:_i(i.coin),amounts:i.amounts.map(s=>_i(s))}};case"TransferObjects":return{TransferObjects:{objects:i.objects.map(s=>_i(s)),address:_i(i.address)}};case"Upgrade":return{Upgrade:{modules:i.modules.map(s=>wr(Uint8Array.from(s))),dependencies:i.dependencies,package:i.packageId,ticket:_i(i.ticket)}}}throw new Error(`Unknown transaction ${Object.keys(i)}`)})})}function _i(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 la(e){return Tr(Object.entries(e).map(([t,r])=>Fe({[t]:r})))}const Mn=la({GasCoin:yt(!0),Input:Gt(ar(),ur()),Result:Gt(ar(),ur()),NestedResult:Xu([Gt(ar(),ur()),Gt(ar(),ur())])}),z8=Fe({budget:Ut(Gr),price:Ut(Gr),owner:Ut(uo),payment:Ut(ht(Ji))}),q8=Fe({package:sn,module:At(),function:At(),typeArguments:ht(At()),arguments:ht(Mn)}),H8=Fe({name:At(),inputs:ca(At(),Tr([Mn,ht(Mn)])),data:ca(At(),Ms())}),W8=la({MoveCall:q8,TransferObjects:Fe({objects:ht(Mn),address:Mn}),SplitCoins:Fe({coin:Mn,amounts:ht(Mn)}),MergeCoins:Fe({destination:Mn,sources:ht(Mn)}),Publish:Fe({modules:ht(Os),dependencies:ht(sn)}),MakeMoveVec:Fe({type:Ut(At()),elements:ht(Mn)}),Upgrade:Fe({modules:ht(Os),dependencies:ht(sn),package:sn,ticket:Mn}),$Intent:H8}),G8=la({ImmOrOwnedObject:Ji,SharedObject:Fe({objectId:sn,initialSharedVersion:Gr,mutable:vc()}),Receiving:Ji}),K8=la({Object:G8,Pure:Fe({bytes:Os}),UnresolvedPure:Fe({value:Ms()}),UnresolvedObject:Fe({objectId:sn,version:kr(Ut(Gr)),digest:kr(Ut(At())),initialSharedVersion:kr(Ut(Gr))})}),Y8=la({None:yt(!0),Epoch:Gr}),J8=Fe({version:yt(2),sender:lo(uo),expiration:lo(Y8),gasData:z8,inputs:ht(K8),commands:ht(W8)});function X8(e){return{$kind:"Pure",Pure:{bytes:e instanceof Uint8Array?wr(e):e.toBase64()}}}const In={Pure:X8,ObjectRef({objectId:e,digest:t,version:r}){return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{digest:t,version:r,objectId:Dt(e)}}}},SharedObjectRef({objectId:e,mutable:t,initialSharedVersion:r}){return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{mutable:t,initialSharedVersion:r,objectId:Dt(e)}}}},ReceivingRef({objectId:e,digest:t,version:r}){return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{digest:t,version:r,objectId:Dt(e)}}}}},Jp="…";function Z8(e){if(e.length<=6)return e;const t=e.startsWith("0x")?2:0;return`0x${e.slice(t,t+4)}${Jp}${e.slice(-4)}`}function Q8(e){return`${e.slice(0,10)}${Jp}`}const e3=9,t3=BigInt(1e9),Xp="0x1",ua="0x2",r3="0x3",Zp=rn("0x6"),n3="sui_system",yc=`${ua}::sui::SUI`,i3=rn("0x5");/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function s3(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function td(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function rd(e,...t){if(!s3(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 Qp(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 o3(e,t){rd(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function wc(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function nd(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const em=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function tm(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Ei=em?e=>e:e=>tm(e);function a3(e){for(let t=0;t<e.length;t++)e[t]=tm(e[t]);return e}const fo=em?e=>e:a3;function c3(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function da(e){return typeof e=="string"&&(e=c3(e)),rd(e),e}let l3=class{};function u3(e){const t=(n,i)=>e(i).update(da(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}const d3=Uint8Array.from([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]),xc=BigInt(2**32-1),rm=BigInt(32);function f3(e,t=!1){return t?{h:Number(e&xc),l:Number(e>>rm&xc)}:{h:Number(e>>rm&xc)|0,l:Number(e&xc)|0}}const nm=(e,t,r)=>e>>>r|t<<32-r,im=(e,t,r)=>e<<32-r|t>>>r,h3=(e,t,r)=>e<<64-r|t>>>r-32,p3=(e,t,r)=>e>>>r-32|t<<64-r,m3=(e,t)=>t,g3=(e,t)=>e;function sm(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}const om=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),am=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,xr=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),$e=new Uint32Array(32);function Xi(e,t,r,n,i,s){const o=i[s],a=i[s+1];let c=$e[2*e],l=$e[2*e+1],u=$e[2*t],f=$e[2*t+1],p=$e[2*r],y=$e[2*r+1],x=$e[2*n],v=$e[2*n+1],_=om(c,u,o);l=am(_,l,f,a),c=_|0,{Dh:v,Dl:x}={Dh:v^l,Dl:x^c},{Dh:v,Dl:x}={Dh:m3(v,x),Dl:g3(v)},{h:y,l:p}=sm(y,p,v,x),{Bh:f,Bl:u}={Bh:f^y,Bl:u^p},{Bh:f,Bl:u}={Bh:nm(f,u,24),Bl:im(f,u,24)},$e[2*e]=c,$e[2*e+1]=l,$e[2*t]=u,$e[2*t+1]=f,$e[2*r]=p,$e[2*r+1]=y,$e[2*n]=x,$e[2*n+1]=v}function Zi(e,t,r,n,i,s){const o=i[s],a=i[s+1];let c=$e[2*e],l=$e[2*e+1],u=$e[2*t],f=$e[2*t+1],p=$e[2*r],y=$e[2*r+1],x=$e[2*n],v=$e[2*n+1],_=om(c,u,o);l=am(_,l,f,a),c=_|0,{Dh:v,Dl:x}={Dh:v^l,Dl:x^c},{Dh:v,Dl:x}={Dh:nm(v,x,16),Dl:im(v,x,16)},{h:y,l:p}=sm(y,p,v,x),{Bh:f,Bl:u}={Bh:f^y,Bl:u^p},{Bh:f,Bl:u}={Bh:h3(f,u,63),Bl:p3(f,u,63)},$e[2*e]=c,$e[2*e+1]=l,$e[2*t]=u,$e[2*t+1]=f,$e[2*r]=p,$e[2*r+1]=y,$e[2*n]=x,$e[2*n+1]=v}function v3(e,t={},r,n,i){if(td(r),e<0||e>r)throw new Error("outputLen bigger than keyLen");const{key:s,salt:o,personalization:a}=t;if(s!==void 0&&(s.length<1||s.length>r))throw new Error("key length must be undefined or 1.."+r);if(o!==void 0&&o.length!==n)throw new Error("salt must be undefined or "+n);if(a!==void 0&&a.length!==i)throw new Error("personalization must be undefined or "+i)}class b3 extends l3{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,td(t),td(r),this.blockLen=t,this.outputLen=r,this.buffer=new Uint8Array(t),this.buffer32=wc(this.buffer)}update(t){Qp(this),t=da(t),rd(t);const{blockLen:r,buffer:n,buffer32:i}=this,s=t.length,o=t.byteOffset,a=t.buffer;for(let c=0;c<s;){this.pos===r&&(fo(i),this.compress(i,0,!1),fo(i),this.pos=0);const l=Math.min(r-this.pos,s-c),u=o+c;if(l===r&&!(u%4)&&c+l<s){const f=new Uint32Array(a,u,Math.floor((s-c)/4));fo(f);for(let p=0;c+r<s;p+=i.length,c+=r)this.length+=r,this.compress(f,p,!1);fo(f);continue}n.set(t.subarray(c,c+l),this.pos),this.pos+=l,this.length+=l,c+=l}return this}digestInto(t){Qp(this),o3(t,this);const{pos:r,buffer32:n}=this;this.finished=!0,nd(this.buffer.subarray(r)),fo(n),this.compress(n,0,!0),fo(n);const i=wc(t);this.get().forEach((s,o)=>i[o]=Ei(s))}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:s,outputLen:o,pos:a}=this;return t||(t=new this.constructor({dkLen:o})),t.set(...this.get()),t.buffer.set(r),t.destroyed=s,t.finished=i,t.length=n,t.pos=a,t.outputLen=o,t}clone(){return this._cloneInto()}}class y3 extends b3{constructor(t={}){const r=t.dkLen===void 0?64:t.dkLen;super(128,r),this.v0l=xr[0]|0,this.v0h=xr[1]|0,this.v1l=xr[2]|0,this.v1h=xr[3]|0,this.v2l=xr[4]|0,this.v2h=xr[5]|0,this.v3l=xr[6]|0,this.v3h=xr[7]|0,this.v4l=xr[8]|0,this.v4h=xr[9]|0,this.v5l=xr[10]|0,this.v5h=xr[11]|0,this.v6l=xr[12]|0,this.v6h=xr[13]|0,this.v7l=xr[14]|0,this.v7h=xr[15]|0,v3(r,t,64,16,16);let{key:n,personalization:i,salt:s}=t,o=0;if(n!==void 0&&(n=da(n),o=n.length),this.v0l^=this.outputLen|o<<8|65536|1<<24,s!==void 0){s=da(s);const a=wc(s);this.v4l^=Ei(a[0]),this.v4h^=Ei(a[1]),this.v5l^=Ei(a[2]),this.v5h^=Ei(a[3])}if(i!==void 0){i=da(i);const a=wc(i);this.v6l^=Ei(a[0]),this.v6h^=Ei(a[1]),this.v7l^=Ei(a[2]),this.v7h^=Ei(a[3])}if(n!==void 0){const a=new Uint8Array(this.blockLen);a.set(n),this.update(a)}}get(){let{v0l:t,v0h:r,v1l:n,v1h:i,v2l:s,v2h:o,v3l:a,v3h:c,v4l:l,v4h:u,v5l:f,v5h:p,v6l:y,v6h:x,v7l:v,v7h:_}=this;return[t,r,n,i,s,o,a,c,l,u,f,p,y,x,v,_]}set(t,r,n,i,s,o,a,c,l,u,f,p,y,x,v,_){this.v0l=t|0,this.v0h=r|0,this.v1l=n|0,this.v1h=i|0,this.v2l=s|0,this.v2h=o|0,this.v3l=a|0,this.v3h=c|0,this.v4l=l|0,this.v4h=u|0,this.v5l=f|0,this.v5h=p|0,this.v6l=y|0,this.v6h=x|0,this.v7l=v|0,this.v7h=_|0}compress(t,r,n){this.get().forEach((c,l)=>$e[l]=c),$e.set(xr,16);let{h:i,l:s}=f3(BigInt(this.length));$e[24]=xr[8]^s,$e[25]=xr[9]^i,n&&($e[28]=~$e[28],$e[29]=~$e[29]);let o=0;const a=d3;for(let c=0;c<12;c++)Xi(0,4,8,12,t,r+2*a[o++]),Zi(0,4,8,12,t,r+2*a[o++]),Xi(1,5,9,13,t,r+2*a[o++]),Zi(1,5,9,13,t,r+2*a[o++]),Xi(2,6,10,14,t,r+2*a[o++]),Zi(2,6,10,14,t,r+2*a[o++]),Xi(3,7,11,15,t,r+2*a[o++]),Zi(3,7,11,15,t,r+2*a[o++]),Xi(0,5,10,15,t,r+2*a[o++]),Zi(0,5,10,15,t,r+2*a[o++]),Xi(1,6,11,12,t,r+2*a[o++]),Zi(1,6,11,12,t,r+2*a[o++]),Xi(2,7,8,13,t,r+2*a[o++]),Zi(2,7,8,13,t,r+2*a[o++]),Xi(3,4,9,14,t,r+2*a[o++]),Zi(3,4,9,14,t,r+2*a[o++]);this.v0l^=$e[0]^$e[16],this.v0h^=$e[1]^$e[17],this.v1l^=$e[2]^$e[18],this.v1h^=$e[3]^$e[19],this.v2l^=$e[4]^$e[20],this.v2h^=$e[5]^$e[21],this.v3l^=$e[6]^$e[22],this.v3h^=$e[7]^$e[23],this.v4l^=$e[8]^$e[24],this.v4h^=$e[9]^$e[25],this.v5l^=$e[10]^$e[26],this.v5h^=$e[11]^$e[27],this.v6l^=$e[12]^$e[28],this.v6h^=$e[13]^$e[29],this.v7l^=$e[14]^$e[30],this.v7h^=$e[15]^$e[31],nd($e)}destroy(){this.destroyed=!0,nd(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const cm=u3(e=>new y3(e));function lm(e,t,r){const n=wt.Address.serialize(e).toBytes(),i=wt.TypeTag.serialize(t).toBytes(),s=wt.u64().serialize(r.length).toBytes(),o=cm.create({dkLen:32});return o.update(new Uint8Array([240])),o.update(n),o.update(s),o.update(r),o.update(i),`0x${yi(o.digest().slice(0,32))}`}const w3=Object.freeze(Object.defineProperty({__proto__:null,MIST_PER_SUI:t3,MOVE_STDLIB_ADDRESS:Xp,SUI_ADDRESS_LENGTH:ta,SUI_CLOCK_OBJECT_ID:Zp,SUI_DECIMALS:e3,SUI_FRAMEWORK_ADDRESS:ua,SUI_SYSTEM_ADDRESS:r3,SUI_SYSTEM_MODULE_NAME:n3,SUI_SYSTEM_STATE_OBJECT_ID:i3,SUI_TYPE_ARG:yc,deriveDynamicFieldID:lm,formatAddress:Z8,formatDigest:Q8,fromB64:np,fromBase58:bi,fromBase64:yr,fromHEX:sp,fromHex:oo,isValidNamedPackage:$u,isValidNamedType:q4,isValidSuiAddress:Wn,isValidSuiNSName:hp,isValidSuiObjectId:ra,isValidTransactionDigest:Vu,normalizeStructTag:na,normalizeSuiAddress:Dt,normalizeSuiNSName:pp,normalizeSuiObjectId:rn,parseStructTag:pc,toB64:rp,toBase58:As,toBase64:wr,toHEX:ip,toHex:yi},Symbol.toStringTag,{value:"Module"})),x3="object",S3="ID",_3="ascii",E3="String",C3="string",A3="String",T3="option",M3="Option";function I3(e){const t=typeof e.body=="object"&&"datatype"in e.body?e.body.datatype:null;return!!t&&Dt(t.package)===Dt("0x2")&&t.module==="tx_context"&&t.type==="TxContext"}function id(e){if(typeof e=="string")switch(e){case"address":return wt.Address;case"bool":return wt.Bool;case"u8":return wt.U8;case"u16":return wt.U16;case"u32":return wt.U32;case"u64":return wt.U64;case"u128":return wt.U128;case"u256":return wt.U256;default:throw new Error(`Unknown type signature ${e}`)}if("vector"in e){if(e.vector==="u8")return wt.vector(wt.U8).transform({input:r=>typeof r=="string"?new TextEncoder().encode(r):r,output:r=>r});const t=id(e.vector);return t?wt.vector(t):null}if("datatype"in e){const t=Dt(e.datatype.package);if(t===Dt(Xp)){if(e.datatype.module===_3&&e.datatype.type===E3||e.datatype.module===C3&&e.datatype.type===A3)return wt.String;if(e.datatype.module===T3&&e.datatype.type===M3){const r=id(e.datatype.typeParameters[0]);return r?wt.vector(r):null}}if(t===Dt(ua)&&e.datatype.module===x3&&e.datatype.type===S3)return wt.Address}return null}function O3(e){return typeof e=="object"&&"Reference"in e?{ref:"&",body:fa(e.Reference)}:typeof e=="object"&&"MutableReference"in e?{ref:"&mut",body:fa(e.MutableReference)}:{ref:null,body:fa(e)}}function fa(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:fa(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(fa)}};if("TypeParameter"in e)return{typeParameter:e.TypeParameter};throw new Error(`Unexpected type ${JSON.stringify(e)}`)}const P3=50,R3=1000n,j3=5e10;async function N3(e,t,r){return await U3(e,t),await B3(e,t),t.onlyTransactionKind||(await k3(e,t),await D3(e,t),await L3(e,t)),await F3(e),await r()}async function k3(e,t){e.gasConfig.price||(e.gasConfig.price=String(await ha(t).getReferenceGasPrice()))}async function D3(e,t){if(e.gasConfig.budget)return;const r=await ha(t).dryRunTransactionBlock({transactionBlock:e.build({overrides:{gasData:{budget:String(j3),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=R3*BigInt(e.gasConfig.price||1n),i=BigInt(r.effects.gasUsed.computationCost)+n,s=i+BigInt(r.effects.gasUsed.storageCost)-BigInt(r.effects.gasUsed.storageRebate);e.gasConfig.budget=String(s>i?s:i)}async function L3(e,t){if(!e.gasConfig.payment){const n=(await ha(t).getCoins({owner:e.gasConfig.owner||e.sender,coinType:yc})).data.filter(i=>!e.inputs.find(o=>{var a;return(a=o.Object)!=null&&a.ImmOrOwnedObject?i.coinObjectId===o.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(Ji,i))}}async function B3(e,t){const r=e.inputs.filter(u=>{var f;return u.UnresolvedObject&&!(u.UnresolvedObject.version||(f=u.UnresolvedObject)!=null&&f.initialSharedVersion)}),n=[...new Set(r.map(u=>rn(u.UnresolvedObject.objectId)))],i=n.length?M4(n,P3):[],s=(await Promise.all(i.map(u=>ha(t).multiGetObjects({ids:u,options:{showOwner:!0}})))).flat(),o=new Map(n.map((u,f)=>[u,s[f]])),a=Array.from(o).filter(([u,f])=>f.error).map(([u,f])=>JSON.stringify(f.error));if(a.length)throw new Error(`The following input objects are invalid: ${a.join(", ")}`);const c=s.map(u=>{if(u.error||!u.data)throw new Error(`Failed to fetch object: ${u.error}`);const f=u.data.owner,p=f&&typeof f=="object"&&"Shared"in f?f.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,f)=>[u,c[f]]));for(const[u,f]of e.inputs.entries()){if(!f.UnresolvedObject)continue;let p;const y=Dt(f.UnresolvedObject.objectId),x=l.get(y);f.UnresolvedObject.initialSharedVersion??(x==null?void 0:x.initialSharedVersion)?p=In.SharedObjectRef({objectId:y,initialSharedVersion:f.UnresolvedObject.initialSharedVersion||(x==null?void 0:x.initialSharedVersion),mutable:$3(e,u)}):V3(e,u)&&(p=In.ReceivingRef({objectId:y,digest:f.UnresolvedObject.digest??(x==null?void 0:x.digest),version:f.UnresolvedObject.version??(x==null?void 0:x.version)})),e.inputs[e.inputs.indexOf(f)]=p??In.ObjectRef({objectId:y,digest:f.UnresolvedObject.digest??(x==null?void 0:x.digest),version:f.UnresolvedObject.version??(x==null?void 0:x.version)})}}async function U3(e,t){const{inputs:r,commands:n}=e,i=[],s=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}`;s.add(u),i.push(a.MoveCall)}}switch(a.$kind){case"SplitCoins":a.SplitCoins.amounts.forEach(c=>{um(c,wt.U64,e)});break;case"TransferObjects":um(a.TransferObjects.address,wt.Address,e);break}});const o=new Map;if(s.size>0){const a=ha(t);await Promise.all([...s].map(async c=>{const[l,u,f]=c.split("::"),p=await a.getNormalizedMoveFunction({package:l,module:u,function:f});o.set(c,p.parameters.map(y=>O3(y)))}))}i.length&&await Promise.all(i.map(async a=>{const c=o.get(`${a.package}::${a.module}::${a.function}`);if(!c)return;const u=c.length>0&&I3(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((f,p)=>{var O,R;const y=c.arguments[p];if(y.$kind!=="Input")return;const x=r[y.Input];if(!x.UnresolvedPure&&!x.UnresolvedObject)return;const v=((O=x.UnresolvedPure)==null?void 0:O.value)??((R=x.UnresolvedObject)==null?void 0:R.objectId),_=id(f.body);if(_){y.type="pure",r[r.indexOf(x)]=In.Pure(_.serialize(v));return}if(typeof v!="string")throw new Error(`Expect the argument to be an object id string, got ${JSON.stringify(v,null,2)}`);y.type="object";const T=x.UnresolvedPure?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:v}}:x;r[y.Input]=T})}})}function F3(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 um(e,t,r){if(e.$kind!=="Input")return;const n=r.inputs[e.Input];n.$kind==="UnresolvedPure"&&(r.inputs[e.Input]=In.Pure(t.serialize(n.UnresolvedPure.value)))}function $3(e,t){let r=!1;return e.getInputUses(t,(n,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const s=i.MoveCall.arguments.indexOf(n);r=i.MoveCall._argumentTypes[s].ref!=="&"||r}(i.$kind==="MakeMoveVec"||i.$kind==="MergeCoins"||i.$kind==="SplitCoins")&&(r=!0)}),r}function V3(e,t){let r=!1;return e.getInputUses(t,(n,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const s=i.MoveCall.arguments.indexOf(n);r=z3(i.MoveCall._argumentTypes[s])||r}}),r}function z3(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 ha(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 q3(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 H3(e){function t(r,n){if(typeof r=="string")return e(sa(r).serialize(n));if(r instanceof Uint8Array||fc(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(wt.U8.serialize(r)),t.u16=r=>e(wt.U16.serialize(r)),t.u32=r=>e(wt.U32.serialize(r)),t.u64=r=>e(wt.U64.serialize(r)),t.u128=r=>e(wt.U128.serialize(r)),t.u256=r=>e(wt.U256.serialize(r)),t.bool=r=>e(wt.Bool.serialize(r)),t.string=r=>e(wt.String.serialize(r)),t.address=r=>e(wt.Address.serialize(r)),t.id=t.address,t.vector=(r,n)=>e(wt.vector(sa(r)).serialize(n)),t.option=(r,n)=>e(wt.option(sa(r)).serialize(n)),t}function W3(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),cm(n,{dkLen:32})}function dm(e){return Dt(e).replace("0x","")}class mn{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=wt.TransactionKind.parse(t).ProgrammableTransaction;if(!n)throw new Error("Unable to deserialize from bytes.");return mn.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=wt.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 mn.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 mn(cr(bc,t)):new mn(cr(bc,V8(t)))}static getDigestFromBytes(t){const r=W3("TransactionData",t);return As(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,s=this.commands,o={ProgrammableTransaction:{inputs:i,commands:s}};if(n)return wt.TransactionKind.serialize(o,{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:dm(c),expiration:a||{None:!0},gasData:{payment:l.payment,owner:dm(this.gasData.owner??c),price:BigInt(l.price),budget:BigInt(l.budget)},kind:{ProgrammableTransaction:{inputs:i,commands:s}}};return wt.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))}mapCommandArguments(t,r){const n=this.commands[t];switch(n.$kind){case"MoveCall":n.MoveCall.arguments=n.MoveCall.arguments.map(s=>r(s,n,t));break;case"TransferObjects":n.TransferObjects.objects=n.TransferObjects.objects.map(s=>r(s,n,t)),n.TransferObjects.address=r(n.TransferObjects.address,n,t);break;case"SplitCoins":n.SplitCoins.coin=r(n.SplitCoins.coin,n,t),n.SplitCoins.amounts=n.SplitCoins.amounts.map(s=>r(s,n,t));break;case"MergeCoins":n.MergeCoins.destination=r(n.MergeCoins.destination,n,t),n.MergeCoins.sources=n.MergeCoins.sources.map(s=>r(s,n,t));break;case"MakeMoveVec":n.MakeMoveVec.elements=n.MakeMoveVec.elements.map(s=>r(s,n,t));break;case"Upgrade":n.Upgrade.ticket=r(n.Upgrade.ticket,n,t);break;case"$Intent":const i=n.$Intent.inputs;n.$Intent.inputs={};for(const[s,o]of Object.entries(i))n.$Intent.inputs[s]=Array.isArray(o)?o.map(a=>r(a,n,t)):r(o,n,t);break;case"Publish":break;default:throw new Error(`Unexpected transaction kind: ${n.$kind}`)}}mapArguments(t){for(const r of this.commands.keys())this.mapCommandArguments(r,t)}replaceCommand(t,r,n=t){if(!Array.isArray(r)){this.commands[t]=r;return}const i=r.length-1;this.commands.splice(t,1,...r),i!==0&&this.mapArguments((s,o,a)=>{if(a<t+r.length)return s;switch(s.$kind){case"Result":s.Result===t&&(s.Result=n),s.Result>t&&(s.Result+=i);break;case"NestedResult":s.NestedResult[0]===t&&(s.NestedResult[0]=n),s.NestedResult[0]>t&&(s.NestedResult[0]+=i);break}return s})}getDigest(){const t=this.build({onlyTransactionKind:!1});return mn.getDigestFromBytes(t)}snapshot(){return cr(bc,this)}shallowClone(){return new mn({version:this.version,sender:this.sender,expiration:this.expiration,gasData:{...this.gasData},inputs:[...this.inputs],commands:[...this.commands]})}}function fm(e){if(typeof e=="string")return Dt(e);if(e.Object)return e.Object.ImmOrOwnedObject?Dt(e.Object.ImmOrOwnedObject.objectId):e.Object.Receiving?Dt(e.Object.Receiving.objectId):Dt(e.Object.SharedObject.objectId);if(e.UnresolvedObject)return Dt(e.UnresolvedObject.objectId)}var hm=e=>{throw TypeError(e)},sd=(e,t,r)=>t.has(e)||hm("Cannot "+r),Be=(e,t,r)=>(sd(e,t,"read from private field"),r?r.call(e):t.get(e)),Yn=(e,t,r)=>t.has(e)?hm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),lr=(e,t,r,n)=>(sd(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Sr=(e,t,r)=>(sd(e,t,"access private method"),r),Ps,Rs,Ci,Jn,Xn,Ai,Zn,Qi,dt,pr,pm,Sc,_c,Ec,Cc,od,ad,mm,gm;function cd(e,t=1/0){const r={$kind:"Result",Result:e},n=[],i=s=>n[s]??(n[s]={$kind:"NestedResult",NestedResult:[e,s]});return new Proxy(r,{set(){throw new Error("The transaction result is a proxy, and does not support setting properties directly")},get(s,o){if(o in s)return Reflect.get(s,o);if(o===Symbol.iterator)return function*(){let c=0;for(;c<t;)yield i(c),c++};if(typeof o=="symbol")return;const a=parseInt(o,10);if(!(Number.isNaN(a)||a<0))return i(a)}})}const vm=Symbol.for("@mysten/transaction");function bm(e){return!!e&&typeof e=="object"&&e[vm]===!0}const ym={buildPlugins:new Map,serializationPlugins:new Map},ld=Symbol.for("@mysten/transaction/registry");function pa(){try{const e=globalThis;return e[ld]||(e[ld]=ym),e[ld]}catch{return ym}}const wm=class Ch{constructor(){Yn(this,pr),Yn(this,Ps),Yn(this,Rs),Yn(this,Ci,new Map),Yn(this,Jn,[]),Yn(this,Xn,[]),Yn(this,Ai,new Set),Yn(this,Zn,new Set),Yn(this,Qi,new Map),Yn(this,dt),this.object=q3(r=>{var s,o;if(typeof r=="function")return this.object(this.add(r));if(typeof r=="object"&&Ju(sr,r))return r;const n=fm(r),i=Be(this,dt).inputs.find(a=>n===fm(a));return(s=i==null?void 0:i.Object)!=null&&s.SharedObject&&typeof r=="object"&&((o=r.Object)!=null&&o.SharedObject)&&(i.Object.SharedObject.mutable=i.Object.SharedObject.mutable||r.Object.SharedObject.mutable),i?{$kind:"Input",Input:Be(this,dt).inputs.indexOf(i),type:"object"}:Sr(this,pr,_c).call(this,"object",typeof r=="string"?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:Dt(r)}}:r)});const t=pa();lr(this,dt,new mn),lr(this,Rs,[...t.buildPlugins.values()]),lr(this,Ps,[...t.serializationPlugins.values()])}static fromKind(t){const r=new Ch;return lr(r,dt,mn.fromKindBytes(typeof t=="string"?yr(t):t)),lr(r,Jn,Be(r,dt).inputs),lr(r,Xn,Be(r,dt).commands),r}static from(t){const r=new Ch;return bm(t)?lr(r,dt,new mn(t.getData())):typeof t!="string"||!t.startsWith("{")?lr(r,dt,mn.fromBytes(typeof t=="string"?yr(t):t)):lr(r,dt,mn.restore(JSON.parse(t))),lr(r,Jn,Be(r,dt).inputs),lr(r,Xn,Be(r,dt).commands),r}static registerGlobalSerializationPlugin(t,r){pa().serializationPlugins.set(t,r??t)}static unregisterGlobalSerializationPlugin(t){pa().serializationPlugins.delete(t)}static registerGlobalBuildPlugin(t,r){pa().buildPlugins.set(t,r??t)}static unregisterGlobalBuildPlugin(t){pa().buildPlugins.delete(t)}addSerializationPlugin(t){Be(this,Ps).push(t)}addBuildPlugin(t){Be(this,Rs).push(t)}addIntentResolver(t,r){if(Be(this,Ci).has(t)&&Be(this,Ci).get(t)!==r)throw new Error(`Intent resolver for ${t} already exists`);Be(this,Ci).set(t,r)}setSender(t){Be(this,dt).sender=t}setSenderIfNotSet(t){Be(this,dt).sender||(Be(this,dt).sender=t)}setExpiration(t){Be(this,dt).expiration=t?cr(Hp,t):null}setGasPrice(t){Be(this,dt).gasConfig.price=String(t)}setGasBudget(t){Be(this,dt).gasConfig.budget=String(t)}setGasBudgetIfNotSet(t){Be(this,dt).gasData.budget==null&&(Be(this,dt).gasConfig.budget=String(t))}setGasOwner(t){Be(this,dt).gasConfig.owner=t}setGasPayment(t){Be(this,dt).gasConfig.payment=t.map(r=>cr(Ji,r))}get blockData(){return Yp(Be(this,dt).snapshot())}getData(){return Be(this,dt).snapshot()}get[vm](){return!0}get pure(){return Object.defineProperty(this,"pure",{enumerable:!1,value:H3(t=>fc(t)?Sr(this,pr,_c).call(this,"pure",{$kind:"Pure",Pure:{bytes:t.toBase64()}}):Sr(this,pr,_c).call(this,"pure",Ju(qp,t)?cr(qp,t):t instanceof Uint8Array?In.Pure(t):{$kind:"UnresolvedPure",UnresolvedPure:{value:t}}))}),this.pure}get gas(){return{$kind:"GasCoin",GasCoin:!0}}objectRef(...t){return this.object(In.ObjectRef(...t))}receivingRef(...t){return this.object(In.ReceivingRef(...t))}sharedObjectRef(...t){return this.object(In.SharedObjectRef(...t))}add(t){if(typeof t=="function"){if(Be(this,Qi).has(t))return Be(this,Qi).get(t);const r=Sr(this,pr,pm).call(this),n=t(r);if(!(n&&typeof n=="object"&&"then"in n))return lr(this,Ai,Be(r,Ai)),Be(this,Qi).set(t,n),n;const i=Sr(this,pr,Sc).call(this,{$kind:"$Intent",$Intent:{name:"AsyncTransactionThunk",inputs:{},data:{result:null}}});Be(this,Zn).add(Promise.resolve(n).then(o=>{i.$Intent.data.result=o}));const s=cd(Be(this,dt).commands.length-1);return Be(this,Qi).set(t,s),s}else Sr(this,pr,Sc).call(this,t);return cd(Be(this,dt).commands.length-1)}splitCoins(t,r){const n=Kn.SplitCoins(typeof t=="string"?this.object(t):Sr(this,pr,Cc).call(this,t),r.map(i=>typeof i=="number"||typeof i=="bigint"||typeof i=="string"?this.pure.u64(i):Sr(this,pr,Ec).call(this,i)));return Sr(this,pr,Sc).call(this,n),cd(Be(this,dt).commands.length-1,r.length)}mergeCoins(t,r){return this.add(Kn.MergeCoins(this.object(t),r.map(n=>this.object(n))))}publish({modules:t,dependencies:r}){return this.add(Kn.Publish({modules:t,dependencies:r}))}upgrade({modules:t,dependencies:r,package:n,ticket:i}){return this.add(Kn.Upgrade({modules:t,dependencies:r,package:n,ticket:this.object(i)}))}moveCall({arguments:t,...r}){return this.add(Kn.MoveCall({...r,arguments:t==null?void 0:t.map(n=>Sr(this,pr,Ec).call(this,n))}))}transferObjects(t,r){return this.add(Kn.TransferObjects(t.map(n=>this.object(n)),typeof r=="string"?this.pure.address(r):Sr(this,pr,Ec).call(this,r)))}makeMoveVec({type:t,elements:r}){return this.add(Kn.MakeMoveVec({type:t,elements:r.map(n=>this.object(n))}))}serialize(){return JSON.stringify(Yp(Be(this,dt).snapshot()))}async toJSON(t={}){return await this.prepareForSerialization(t),JSON.stringify(cr(J8,Be(this,dt).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 Sr(this,pr,od).call(this,t),Be(this,dt).build({onlyTransactionKind:t.onlyTransactionKind})}async getDigest(t={}){return await Sr(this,pr,od).call(this,t),Be(this,dt).getDigest()}async prepareForSerialization(t){var i;await Sr(this,pr,mm).call(this),Sr(this,pr,gm).call(this);const r=new Set;for(const s of Be(this,dt).commands)s.$Intent&&r.add(s.$Intent.name);const n=[...Be(this,Ps)];for(const s of r)if(!((i=t.supportedIntents)!=null&&i.includes(s))){if(!Be(this,Ci).has(s))throw new Error(`Missing intent resolver for ${s}`);n.push(Be(this,Ci).get(s))}await Sr(this,pr,ad).call(this,n,t)}};Ps=new WeakMap,Rs=new WeakMap,Ci=new WeakMap,Jn=new WeakMap,Xn=new WeakMap,Ai=new WeakMap,Zn=new WeakMap,Qi=new WeakMap,dt=new WeakMap,pr=new WeakSet,pm=function(){const e=new wm;return lr(e,dt,Be(this,dt)),lr(e,Ps,Be(this,Ps)),lr(e,Rs,Be(this,Rs)),lr(e,Ci,Be(this,Ci)),lr(e,Zn,Be(this,Zn)),lr(e,Ai,new Set(Be(this,Ai))),lr(e,Qi,Be(this,Qi)),Be(this,Jn).push(Be(e,Jn)),Be(this,Xn).push(Be(e,Xn)),e},Sc=function(e){const t=Be(this,dt).commands.length;return Be(this,Xn).push(e),Be(this,Ai).add(t),Be(this,dt).commands.push(e),Be(this,dt).mapCommandArguments(t,r=>{if(r.$kind==="Result"&&!Be(this,Ai).has(r.Result))throw new Error(`Result { Result: ${r.Result} } is not available to use the current transaction`);if(r.$kind==="NestedResult"&&!Be(this,Ai).has(r.NestedResult[0]))throw new Error(`Result { NestedResult: [${r.NestedResult[0]}, ${r.NestedResult[1]}] } is not available to use the current transaction`);if(r.$kind==="Input"&&r.Input>=Be(this,dt).inputs.length)throw new Error(`Input { Input: ${r.Input} } references an input that does not exist in the current transaction`);return r}),e},_c=function(e,t){return Be(this,Jn).push(t),Be(this,dt).addInput(e,t)},Ec=function(e){return fc(e)?this.pure(e):Sr(this,pr,Cc).call(this,e)},Cc=function(e){if(typeof e=="function"){const t=this.add(e);return typeof t=="function"?Sr(this,pr,Cc).call(this,t):cr(sr,t)}return cr(sr,e)},od=async function(e){if(!e.onlyTransactionKind&&!Be(this,dt).sender)throw new Error("Missing transaction sender");await Sr(this,pr,ad).call(this,[...Be(this,Rs),N3],e)},ad=async function(e,t){const r=n=>{if(n>=e.length)return()=>{};const i=e[n];return async()=>{const s=r(n+1);let o=!1,a=!1;if(await i(Be(this,dt),t,async()=>{if(o)throw new Error(`next() was call multiple times in TransactionPlugin ${n}`);o=!0,await s(),a=!0}),!o)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)(),lr(this,Jn,Be(this,dt).inputs),lr(this,Xn,Be(this,dt).commands)},mm=async function(){for(;Be(this,Zn).size>0;){const e=Promise.all(Be(this,Zn));Be(this,Zn).clear(),Be(this,Zn).add(e),await e,Be(this,Zn).delete(e)}},gm=function(){const e=Be(this,dt).commands,t=Be(this,dt).inputs,r=Be(this,Xn).flat(1/0),n=Be(this,Jn).flat(1/0);if(r.length!==e.length)throw new Error("Unexpected number of commands found in transaction data");if(n.length!==t.length)throw new Error("Unexpected number of inputs found in transaction data");const i=r.filter(o=>{var a;return((a=o.$Intent)==null?void 0:a.name)!=="AsyncTransactionThunk"});Be(this,dt).commands=i,Be(this,dt).inputs=n,lr(this,Xn,i),lr(this,Jn,n);function s(o){var l;const a=e[o];if(((l=a.$Intent)==null?void 0:l.name)==="AsyncTransactionThunk"){const u=a.$Intent.data.result;if(u==null)throw new Error("AsyncTransactionThunk has not been resolved");return s(u.Result)}const c=i.indexOf(a);if(c===-1)throw new Error("Unable to find original index for command");return c}Be(this,dt).mapArguments(o=>{if(o.$kind==="Input"){const a=n.indexOf(t[o.Input]);if(a===-1)throw new Error("Input has not been resolved");return{...o,Input:a}}else if(o.$kind==="Result"){const a=s(o.Result);return{...o,Result:a}}else if(o.$kind==="NestedResult"){const a=s(o.NestedResult[0]);return{...o,NestedResult:[a,o.NestedResult[1]]}}return o})};let es=wm;class G3 extends up{constructor(){super(...arguments),this.core=this}async getObject(t){const{objectId:r}=t,{objects:[n]}=await this.getObjects({objectIds:[r],signal:t.signal});if(n instanceof Error)throw n;return{object:n}}async getDynamicField(t){const r=lm(t.parentId,ia.parseFromStr(t.name.type),t.name.bcs),{objects:[n]}=await this.getObjects({objectIds:[r],signal:t.signal});if(n instanceof Error)throw n;const i=pc(n.type);return{dynamicField:{id:n.id,digest:n.digest,version:n.version,type:n.type,name:{type:typeof i.typeParams[0]=="string"?i.typeParams[0]:na(i.typeParams[0]),bcs:t.name.bcs},value:{type:typeof i.typeParams[1]=="string"?i.typeParams[1]:na(i.typeParams[1]),bcs:n.content.slice(ta+t.name.bcs.length)}}}}async waitForTransaction({signal:t,timeout:r=60*1e3,...n}){const i=t?AbortSignal.any([AbortSignal.timeout(r),t]):AbortSignal.timeout(r),s=new Promise((o,a)=>{i.addEventListener("abort",()=>a(i.reason))});for(s.catch(()=>{});;){i.throwIfAborted();try{return await this.getTransaction({...n,signal:i})}catch{await Promise.race([new Promise(a=>setTimeout(a,2e3)),s])}}}}class K3 extends Error{}class ts extends K3{constructor(t,r){super(r),this.code=t}static fromResponse(t,r){switch(t.code){case"notExists":return new ts(t.code,`Object ${t.object_id} does not exist`);case"dynamicFieldNotFound":return new ts(t.code,`Dynamic field not found for object ${t.parent_object_id}`);case"deleted":return new ts(t.code,`Object ${t.object_id} has been deleted`);case"displayError":return new ts(t.code,`Display error: ${t.error}`);case"unknown":default:return new ts(t.code,`Unknown error while loading object${r?` ${r}`:""}`)}}}function Y3({effects:e,epoch:t,objectTypes:r}){const n=wt.TransactionEffects.parse(e);switch(n.$kind){case"V1":return J3({bytes:e,effects:n.V1,epoch:t,objectTypes:r});case"V2":return X3({bytes:e,effects:n.V2,epoch:t,objectTypes:r});default:throw new Error(`Unknown transaction effects version: ${n.$kind}`)}}function J3(e){throw new Error("V1 effects are not supported yet")}function X3({bytes:e,effects:t,epoch:r,objectTypes:n}){const i=t.changedObjects.map(([s,o])=>{var a,c,l,u,f,p;return{id:s,inputState:o.inputState.$kind==="Exist"?"Exists":"DoesNotExist",inputVersion:((a=o.inputState.Exist)==null?void 0:a[0][0])??null,inputDigest:((c=o.inputState.Exist)==null?void 0:c[0][1])??null,inputOwner:((l=o.inputState.Exist)==null?void 0:l[1])??null,outputState:o.outputState.$kind==="NotExist"?"DoesNotExist":o.outputState.$kind,outputVersion:o.outputState.$kind==="PackageWrite"?(u=o.outputState.PackageWrite)==null?void 0:u[0]:o.outputState.ObjectWrite?t.lamportVersion:null,outputDigest:o.outputState.$kind==="PackageWrite"?(f=o.outputState.PackageWrite)==null?void 0:f[1]:((p=o.outputState.ObjectWrite)==null?void 0:p[0])??null,outputOwner:o.outputState.ObjectWrite?o.outputState.ObjectWrite[1]:null,idOperation:o.idOperation.$kind,objectType:n[s]??null}});return{bcs:e,digest:t.transactionDigest,version:2,status:t.status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:t.status.Failed.error.$kind},epoch:r??null,gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:t.gasObjectIndex===null?null:i[t.gasObjectIndex]??null,eventsDigest:t.eventsDigest,dependencies:t.dependencies,lamportVersion:t.lamportVersion,changedObjects:i,unchangedSharedObjects:t.unchangedSharedObjects.map(([s,o])=>({kind:o.$kind,objectId:s,version:o.$kind==="ReadOnlyRoot"?o.ReadOnlyRoot[0]:o[o.$kind],digest:o.$kind==="ReadOnlyRoot"?o.ReadOnlyRoot[1]:null,objectType:n[s]??null})),auxiliaryDataDigest:t.auxDataDigest}}var xm=e=>{throw TypeError(e)},Sm=(e,t,r)=>t.has(e)||xm("Cannot "+r),On=(e,t,r)=>(Sm(e,t,"read from private field"),r?r.call(e):t.get(e)),Z3=(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),Q3=(e,t,r,n)=>(Sm(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Kr;class ex extends G3{constructor(t){super({network:t.network}),Z3(this,Kr),Q3(this,Kr,t)}async getObjects(t){const r=g8(t.objectIds,50),n=[];for(const i of r){const s=await On(this,Kr).multiGetObjects({ids:i,options:{showOwner:!0,showType:!0,showBcs:!0},signal:t.signal});for(const[o,a]of s.entries())a.error?n.push(ts.fromResponse(a.error,i[o])):n.push(_m(a.data))}return{objects:n}}async getOwnedObjects(t){const r=await On(this,Kr).getOwnedObjects({owner:t.address,limit:t.limit,cursor:t.cursor,options:{showOwner:!0,showType:!0,showBcs:!0},signal:t.signal});return{objects:r.data.map(n=>{if(n.error)throw ts.fromResponse(n.error);return _m(n.data)}),hasNextPage:r.hasNextPage,cursor:r.nextCursor??null}}async getCoins(t){const r=await On(this,Kr).getCoins({owner:t.address,coinType:t.coinType,limit:t.limit,cursor:t.cursor,signal:t.signal});return{objects:r.data.map(n=>({id:n.coinObjectId,version:n.version,digest:n.digest,balance:n.balance,type:`0x2::coin::Coin<${n.coinType}>`,content:nx.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 On(this,Kr).getBalance({owner:t.address,coinType:t.coinType,signal:t.signal});return{balance:{coinType:r.coinType,balance:r.totalBalance}}}async getAllBalances(t){return{balances:(await On(this,Kr).getAllBalances({owner:t.address,signal:t.signal})).map(n=>({coinType:n.coinType,balance:n.totalBalance})),hasNextPage:!1,cursor:null}}async getTransaction(t){const r=await On(this,Kr).getTransactionBlock({digest:t.digest,options:{showRawInput:!0,showObjectChanges:!0,showRawEffects:!0,showEvents:!0},signal:t.signal});return{transaction:Em(r)}}async executeTransaction(t){const r=await On(this,Kr).executeTransactionBlock({transactionBlock:t.transaction,signature:t.signatures,options:{showRawEffects:!0,showEvents:!0,showObjectChanges:!0,showRawInput:!0},signal:t.signal});return{transaction:Em(r)}}async dryRunTransaction(t){const r=es.from(t.transaction),n=await On(this,Kr).dryRunTransactionBlock({transactionBlock:t.transaction,signal:t.signal});return{transaction:{digest:await r.getDigest(),effects:tx({effects:n.effects,objectChanges:n.objectChanges}),signatures:[],bcs:t.transaction}}}async getReferenceGasPrice(t){const r=await On(this,Kr).getReferenceGasPrice({signal:t==null?void 0:t.signal});return{referenceGasPrice:String(r)}}async getDynamicFields(t){const r=await On(this,Kr).getDynamicFields({parentId:t.parentId,limit:t.limit,cursor:t.cursor});return{dynamicFields:r.data.map(n=>({id:n.objectId,type:n.objectType,name:{type:n.name.type,bcs:yr(n.bcsName)}})),hasNextPage:r.hasNextPage,cursor:r.nextCursor}}async verifyZkLoginSignature(t){const r=await On(this,Kr).verifyZkLoginSignature({bytes:t.bytes,signature:t.signature,intentScope:t.intentScope,author:t.author});return{success:r.success,errors:r.errors}}}Kr=new WeakMap;function _m(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"?yr(e.bcs.bcsBytes):new Uint8Array,owner:ho(e.owner)}}function ho(e){if(e==="Immutable")return{$kind:"Immutable",Immutable:!0};if("ConsensusV2"in e)return{$kind:"ConsensusV2",ConsensusV2:{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 Em(e){var n;const t=wt.SenderSignedData.parse(yr(e.rawTransaction))[0],r={};return(n=e.objectChanges)==null||n.forEach(i=>{i.type!=="published"&&(r[i.objectId]=i.objectType)}),{digest:e.digest,effects:Y3({effects:new Uint8Array(e.rawEffects),objectTypes:r}),bcs:wt.TransactionData.serialize(t.intentMessage.value).toBytes(),signatures:t.txSignatures}}function tx({bytes:e,effects:t,epoch:r,objectChanges:n}){var o;const i=[],s=[];return n==null||n.forEach(a=>{var c,l,u,f;switch(a.type){case"published":i.push({id:a.packageId,inputState:"DoesNotExist",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"PackageWrite",outputVersion:a.version,outputDigest:a.digest,outputOwner:null,idOperation:"Created",objectType:null});break;case"transferred":i.push({id:a.objectId,inputState:"Exists",inputVersion:a.version,inputDigest:a.digest,inputOwner:{$kind:"AddressOwner",AddressOwner:a.sender},outputState:"ObjectWrite",outputVersion:a.version,outputDigest:a.digest,outputOwner:ho(a.recipient),idOperation:"None",objectType:a.objectType});break;case"mutated":i.push({id:a.objectId,inputState:"Exists",inputVersion:a.previousVersion,inputDigest:null,inputOwner:ho(a.owner),outputState:"ObjectWrite",outputVersion:a.version,outputDigest:a.digest,outputOwner:ho(a.owner),idOperation:"None",objectType:a.objectType});break;case"deleted":i.push({id:a.objectId,inputState:"Exists",inputVersion:a.version,inputDigest:((l=(c=t.deleted)==null?void 0:c.find(p=>p.objectId===a.objectId))==null?void 0:l.digest)??null,inputOwner:null,outputState:"DoesNotExist",outputVersion:null,outputDigest:null,outputOwner:null,idOperation:"Deleted",objectType:a.objectType});break;case"wrapped":i.push({id:a.objectId,inputState:"Exists",inputVersion:a.version,inputDigest:null,inputOwner:{$kind:"AddressOwner",AddressOwner:a.sender},outputState:"ObjectWrite",outputVersion:a.version,outputDigest:((f=(u=t.wrapped)==null?void 0:u.find(p=>p.objectId===a.objectId))==null?void 0:f.digest)??null,outputOwner:{$kind:"ObjectOwner",ObjectOwner:a.sender},idOperation:"None",objectType:a.objectType});break;case"created":i.push({id:a.objectId,inputState:"DoesNotExist",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"ObjectWrite",outputVersion:a.version,outputDigest:a.digest,outputOwner:ho(a.owner),idOperation:"Created",objectType:a.objectType});break}}),{bcs:e??null,digest:t.transactionDigest,version:2,status:t.status.status==="success"?{success:!0,error:null}:{success:!1,error:t.status.error},epoch:r??null,gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:{id:(o=t.gasObject)==null?void 0:o.reference.objectId,inputState:"Exists",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"ObjectWrite",outputVersion:t.gasObject.reference.version,outputDigest:t.gasObject.reference.digest,outputOwner:ho(t.gasObject.owner),idOperation:"None",objectType:na("0x2::coin::Coin<0x2::sui::SUI>")},eventsDigest:t.eventsDigest??null,dependencies:t.dependencies??[],lamportVersion:t.gasObject.reference.version,changedObjects:i,unchangedSharedObjects:s,auxiliaryDataDigest:null}}const rx=wt.struct("Balance",{value:wt.u64()}),nx=wt.struct("Coin",{id:wt.Address,balance:rx}),ix=Symbol.for("@mysten/SuiClient");class js extends up{constructor(t){super({network:t.network??"unknown"}),this.core=new ex(this),this.jsonRpc=this,this.transport=t.transport??new x4({url:t.url})}get[ix](){return!0}async getRpcApiVersion({signal:t}={}){return(await this.transport.request({method:"rpc.discover",params:[],signal:t})).info.version}async getCoins(t){if(!t.owner||!Wn(Dt(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],signal:t.signal})}async getAllCoins(t){if(!t.owner||!Wn(Dt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getAllCoins",params:[t.owner,t.cursor,t.limit],signal:t.signal})}async getBalance(t){if(!t.owner||!Wn(Dt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getBalance",params:[t.owner,t.coinType],signal:t.signal})}async getAllBalances(t){if(!t.owner||!Wn(Dt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getAllBalances",params:[t.owner],signal:t.signal})}async getCoinMetadata(t){return await this.transport.request({method:"suix_getCoinMetadata",params:[t.coinType],signal:t.signal})}async getTotalSupply(t){return await this.transport.request({method:"suix_getTotalSupply",params:[t.coinType],signal:t.signal})}async call(t,r,{signal:n}={}){return await this.transport.request({method:t,params:r,signal:n})}async getMoveFunctionArgTypes(t){return await this.transport.request({method:"sui_getMoveFunctionArgTypes",params:[t.package,t.module,t.function],signal:t.signal})}async getNormalizedMoveModulesByPackage(t){return await this.transport.request({method:"sui_getNormalizedMoveModulesByPackage",params:[t.package],signal:t.signal})}async getNormalizedMoveModule(t){return await this.transport.request({method:"sui_getNormalizedMoveModule",params:[t.package,t.module],signal:t.signal})}async getNormalizedMoveFunction(t){return await this.transport.request({method:"sui_getNormalizedMoveFunction",params:[t.package,t.module,t.function],signal:t.signal})}async getNormalizedMoveStruct(t){return await this.transport.request({method:"sui_getNormalizedMoveStruct",params:[t.package,t.module,t.struct],signal:t.signal})}async getOwnedObjects(t){if(!t.owner||!Wn(Dt(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],signal:t.signal})}async getObject(t){if(!t.id||!ra(rn(t.id)))throw new Error("Invalid Sui Object id");return await this.transport.request({method:"sui_getObject",params:[t.id,t.options],signal:t.signal})}async tryGetPastObject(t){return await this.transport.request({method:"sui_tryGetPastObject",params:[t.id,t.version,t.options],signal:t.signal})}async multiGetObjects(t){if(t.ids.forEach(n=>{if(!n||!ra(rn(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],signal:t.signal})}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"],signal:t.signal})}async getTransactionBlock(t){if(!Vu(t.digest))throw new Error("Invalid Transaction digest");return await this.transport.request({method:"sui_getTransactionBlock",params:[t.digest,t.options],signal:t.signal})}async multiGetTransactionBlocks(t){if(t.digests.forEach(n=>{if(!Vu(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],signal:t.signal})}async executeTransactionBlock({transactionBlock:t,signature:r,options:n,requestType:i,signal:s}){const o=await this.transport.request({method:"sui_executeTransactionBlock",params:[typeof t=="string"?t:wr(t),Array.isArray(r)?r:[r],n],signal:s});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:s,bytes:o}=await r.signTransaction(i);return this.executeTransactionBlock({transactionBlock:o,signature:s,...n})}async getTotalTransactionBlocks({signal:t}={}){const r=await this.transport.request({method:"sui_getTotalTransactionBlocks",params:[],signal:t});return BigInt(r)}async getReferenceGasPrice({signal:t}={}){const r=await this.transport.request({method:"suix_getReferenceGasPrice",params:[],signal:t});return BigInt(r)}async getStakes(t){if(!t.owner||!Wn(Dt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getStakes",params:[t.owner],signal:t.signal})}async getStakesByIds(t){return t.stakedSuiIds.forEach(r=>{if(!r||!ra(rn(r)))throw new Error(`Invalid Sui Stake id ${r}`)}),await this.transport.request({method:"suix_getStakesByIds",params:[t.stakedSuiIds],signal:t.signal})}async getLatestSuiSystemState({signal:t}={}){return await this.transport.request({method:"suix_getLatestSuiSystemState",params:[],signal:t})}async queryEvents(t){return await this.transport.request({method:"suix_queryEvents",params:[t.query,t.cursor,t.limit,(t.order||"descending")==="descending"],signal:t.signal})}async subscribeEvent(t){return this.transport.subscribe({method:"suix_subscribeEvent",unsubscribe:"suix_unsubscribeEvent",params:[t.filter],onMessage:t.onMessage,signal:t.signal})}async subscribeTransaction(t){return this.transport.subscribe({method:"suix_subscribeTransaction",unsubscribe:"suix_unsubscribeTransaction",params:[t.filter],onMessage:t.onMessage,signal:t.signal})}async devInspectTransactionBlock(t){var n,i;let r;if(bm(t.transactionBlock))t.transactionBlock.setSenderIfNotSet(t.sender),r=wr(await t.transactionBlock.build({client:this,onlyTransactionKind:!0}));else if(typeof t.transactionBlock=="string")r=t.transactionBlock;else if(t.transactionBlock instanceof Uint8Array)r=wr(t.transactionBlock);else throw new Error("Unknown transaction block format.");return(n=t.signal)==null||n.throwIfAborted(),await this.transport.request({method:"sui_devInspectTransactionBlock",params:[t.sender,r,(i=t.gasPrice)==null?void 0:i.toString(),t.epoch],signal:t.signal})}async dryRunTransactionBlock(t){return await this.transport.request({method:"sui_dryRunTransactionBlock",params:[typeof t.transactionBlock=="string"?t.transactionBlock:wr(t.transactionBlock)]})}async getDynamicFields(t){if(!t.parentId||!ra(rn(t.parentId)))throw new Error("Invalid Sui Object id");return await this.transport.request({method:"suix_getDynamicFields",params:[t.parentId,t.cursor,t.limit],signal:t.signal})}async getDynamicFieldObject(t){return await this.transport.request({method:"suix_getDynamicFieldObject",params:[t.parentId,t.name],signal:t.signal})}async getLatestCheckpointSequenceNumber({signal:t}={}){const r=await this.transport.request({method:"sui_getLatestCheckpointSequenceNumber",params:[],signal:t});return String(r)}async getCheckpoint(t){return await this.transport.request({method:"sui_getCheckpoint",params:[t.id],signal:t.signal})}async getCheckpoints(t){return await this.transport.request({method:"sui_getCheckpoints",params:[t.cursor,t==null?void 0:t.limit,t.descendingOrder],signal:t.signal})}async getCommitteeInfo(t){return await this.transport.request({method:"suix_getCommitteeInfo",params:[t==null?void 0:t.epoch],signal:t==null?void 0:t.signal})}async getNetworkMetrics({signal:t}={}){return await this.transport.request({method:"suix_getNetworkMetrics",params:[],signal:t})}async getAddressMetrics({signal:t}={}){return await this.transport.request({method:"suix_getLatestAddressMetrics",params:[],signal:t})}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],signal:t==null?void 0:t.signal})}async getAllEpochAddressMetrics(t){return await this.transport.request({method:"suix_getAllEpochAddressMetrics",params:[t==null?void 0:t.descendingOrder],signal:t==null?void 0:t.signal})}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],signal:t==null?void 0:t.signal})}async getMoveCallMetrics({signal:t}={}){return await this.transport.request({method:"suix_getMoveCallMetrics",params:[],signal:t})}async getCurrentEpoch({signal:t}={}){return await this.transport.request({method:"suix_getCurrentEpoch",params:[],signal:t})}async getValidatorsApy({signal:t}={}){return await this.transport.request({method:"suix_getValidatorsApy",params:[],signal:t})}async getChainIdentifier({signal:t}={}){const r=await this.getCheckpoint({id:"0",signal:t}),n=bi(r.digest);return yi(n.slice(0,4))}async resolveNameServiceAddress(t){return await this.transport.request({method:"suix_resolveNameServiceAddress",params:[t.name],signal:t.signal})}async resolveNameServiceNames({format:t="dot",...r}){const{nextCursor:n,hasNextPage:i,data:s}=await this.transport.request({method:"suix_resolveNameServiceNames",params:[r.address,r.cursor,r.limit],signal:r.signal});return{hasNextPage:i,nextCursor:n,data:s.map(o=>pp(o,t))}}async getProtocolConfig(t){return await this.transport.request({method:"sui_getProtocolConfig",params:[t==null?void 0:t.version],signal:t==null?void 0:t.signal})}async verifyZkLoginSignature(t){return await this.transport.request({method:"sui_verifyZkLoginSignature",params:[t.bytes,t.signature,t.intentScope,t.author],signal:t.signal})}async waitForTransaction({signal:t,timeout:r=60*1e3,pollInterval:n=2*1e3,...i}){const s=AbortSignal.timeout(r),o=new Promise((a,c)=>{s.addEventListener("abort",()=>c(s.reason))});for(o.catch(()=>{});!s.aborted;){t==null||t.throwIfAborted();try{return await this.getTransactionBlock(i)}catch{await Promise.race([new Promise(c=>setTimeout(c,n)),o])}}throw s.throwIfAborted(),new Error("Unexpected error while waiting for transaction block.")}experimental_asClientExtension(){return{name:"jsonRPC",register:()=>this}}}var ud={},Ac={},dd={},Tc={},fd={},Mc={};Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.Convert=void 0;class sx{static toPriceFeed(t){return hd(t,Mi("PriceFeed"))}static priceFeedToJson(t){return pd(t,Mi("PriceFeed"))}static toPrice(t){return hd(t,Mi("Price"))}static priceToJson(t){return pd(t,Mi("Price"))}static toPriceFeedMetadata(t){return hd(t,Mi("PriceFeedMetadata"))}static priceFeedMetadataToJson(t){return pd(t,Mi("PriceFeedMetadata"))}}Mc.Convert=sx;function Ti(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 ox(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 ax(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 po(e,t,r,n=""){function i(u,f){return typeof u==typeof f?f:Ti(u,f,n)}function s(u,f){const p=u.length;for(let y=0;y<p;y++){const x=u[y];try{return po(f,x,r)}catch{}}return Ti(u,f)}function o(u,f){return u.indexOf(f)!==-1?f:Ti(u,f)}function a(u,f){return Array.isArray(f)?f.map(p=>po(p,u,r)):Ti("array",f)}function c(u){if(u===null)return null;const f=new Date(u);return isNaN(f.valueOf())?Ti("Date",u):f}function l(u,f,p){if(p===null||typeof p!="object"||Array.isArray(p))return Ti("object",p);const y={};return Object.getOwnPropertyNames(u).forEach(x=>{const v=u[x],_=Object.prototype.hasOwnProperty.call(p,x)?p[x]:void 0;y[v.key]=po(_,v.typ,r,v.key)}),Object.getOwnPropertyNames(p).forEach(x=>{Object.prototype.hasOwnProperty.call(u,x)||(y[x]=po(p[x],f,r,x))}),y}if(t==="any")return e;if(t===null)return e===null?e:Ti(t,e);if(t===!1)return Ti(t,e);for(;typeof t=="object"&&t.ref!==void 0;)t=cx[t.ref];return Array.isArray(t)?o(t,e):typeof t=="object"?t.hasOwnProperty("unionMembers")?s(t.unionMembers,e):t.hasOwnProperty("arrayItems")?a(t.arrayItems,e):t.hasOwnProperty("props")?l(r(t),t.additional,e):Ti(t,e):t===Date&&typeof e!="number"?c(e):i(t,e)}function hd(e,t){return po(e,t,ox)}function pd(e,t){return po(e,t,ax)}function Ns(...e){return{unionMembers:e}}function md(e,t){return{props:e,additional:t}}function Mi(e){return{ref:e}}const cx={PriceFeed:md([{json:"ema_price",js:"ema_price",typ:Mi("Price")},{json:"id",js:"id",typ:""},{json:"metadata",js:"metadata",typ:Ns(void 0,Mi("PriceFeedMetadata"))},{json:"price",js:"price",typ:Mi("Price")},{json:"vaa",js:"vaa",typ:Ns(void 0,"")}],"any"),Price:md([{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:md([{json:"attestation_time",js:"attestation_time",typ:Ns(void 0,0)},{json:"emitter_chain",js:"emitter_chain",typ:0},{json:"prev_publish_time",js:"prev_publish_time",typ:Ns(void 0,0)},{json:"price_service_receive_time",js:"price_service_receive_time",typ:Ns(void 0,0)},{json:"sequence_number",js:"sequence_number",typ:Ns(void 0,0)},{json:"slot",js:"slot",typ:Ns(void 0,0)}],"any")};var gd={},Cm;function Ic(){return Cm||(Cm=1,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},r={};r.byteLength=u,r.toByteArray=p,r.fromByteArray=v;for(var n=[],i=[],s=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=o.length;a<c;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63;function l(O){var R=O.length;if(R%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var F=O.indexOf("=");F===-1&&(F=R);var B=F===R?0:4-F%4;return[F,B]}function u(O){var R=l(O),F=R[0],B=R[1];return(F+B)*3/4-B}function f(O,R,F){return(R+F)*3/4-F}function p(O){var R,F=l(O),B=F[0],H=F[1],$=new s(f(O,B,H)),Z=0,ce=H>0?B-4:B,ne;for(ne=0;ne<ce;ne+=4)R=i[O.charCodeAt(ne)]<<18|i[O.charCodeAt(ne+1)]<<12|i[O.charCodeAt(ne+2)]<<6|i[O.charCodeAt(ne+3)],$[Z++]=R>>16&255,$[Z++]=R>>8&255,$[Z++]=R&255;return H===2&&(R=i[O.charCodeAt(ne)]<<2|i[O.charCodeAt(ne+1)]>>4,$[Z++]=R&255),H===1&&(R=i[O.charCodeAt(ne)]<<10|i[O.charCodeAt(ne+1)]<<4|i[O.charCodeAt(ne+2)]>>2,$[Z++]=R>>8&255,$[Z++]=R&255),$}function y(O){return n[O>>18&63]+n[O>>12&63]+n[O>>6&63]+n[O&63]}function x(O,R,F){for(var B,H=[],$=R;$<F;$+=3)B=(O[$]<<16&16711680)+(O[$+1]<<8&65280)+(O[$+2]&255),H.push(y(B));return H.join("")}function v(O){for(var R,F=O.length,B=F%3,H=[],$=16383,Z=0,ce=F-B;Z<ce;Z+=$)H.push(x(O,Z,Z+$>ce?ce:Z+$));return B===1?(R=O[F-1],H.push(n[R>>2]+n[R<<4&63]+"==")):B===2&&(R=(O[F-2]<<8)+O[F-1],H.push(n[R>>10]+n[R>>4&63]+n[R<<2&63]+"=")),H.join("")}var _={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */_.read=function(O,R,F,B,H){var $,Z,ce=H*8-B-1,ne=(1<<ce)-1,de=ne>>1,q=-7,N=F?H-1:0,h=F?-1:1,d=O[R+N];for(N+=h,$=d&(1<<-q)-1,d>>=-q,q+=ce;q>0;$=$*256+O[R+N],N+=h,q-=8);for(Z=$&(1<<-q)-1,$>>=-q,q+=B;q>0;Z=Z*256+O[R+N],N+=h,q-=8);if($===0)$=1-de;else{if($===ne)return Z?NaN:(d?-1:1)*(1/0);Z=Z+Math.pow(2,B),$=$-de}return(d?-1:1)*Z*Math.pow(2,$-B)},_.write=function(O,R,F,B,H,$){var Z,ce,ne,de=$*8-H-1,q=(1<<de)-1,N=q>>1,h=H===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=B?0:$-1,m=B?1:-1,S=R<0||R===0&&1/R<0?1:0;for(R=Math.abs(R),isNaN(R)||R===1/0?(ce=isNaN(R)?1:0,Z=q):(Z=Math.floor(Math.log(R)/Math.LN2),R*(ne=Math.pow(2,-Z))<1&&(Z--,ne*=2),Z+N>=1?R+=h/ne:R+=h*Math.pow(2,1-N),R*ne>=2&&(Z++,ne/=2),Z+N>=q?(ce=0,Z=q):Z+N>=1?(ce=(R*ne-1)*Math.pow(2,H),Z=Z+N):(ce=R*Math.pow(2,N-1)*Math.pow(2,H),Z=0));H>=8;O[F+d]=ce&255,d+=m,ce/=256,H-=8);for(Z=Z<<H|ce,de+=H;de>0;O[F+d]=Z&255,d+=m,Z/=256,de-=8);O[F+d-m]|=S*128};/*!
|
|
24
|
+
<%s key={someKey} {...props} />`,Ar,mr,Fn,mr),se[mr+Ar]=!0}}return J===n?V(Vt):A(Vt),Vt}}function be(J,ye,Ce){return me(J,ye,Ce,!0)}function We(J,ye,Ce){return me(J,ye,Ce,!1)}var ut=We,qe=be;Yo.Fragment=n,Yo.jsx=ut,Yo.jsxs=qe}()),Yo}_n.env.NODE_ENV==="production"?Iu.exports=l4():Iu.exports=u4();var w=Iu.exports;const EU="",CU="",AU="";window._iconfont_svg_string_4776227='<svg><symbol id="icon-icon_mev" viewBox="0 0 1024 1024"><path d="M651.1616 95.488c53.4016 56.4224 131.84 113.8176 235.2128 171.6736a38.4 38.4 0 0 1 19.456 29.9008c12.032 129.024-12.544 251.7504-73.6256 367.1552-60.2112 113.8176-158.976 226.4576-295.936 338.3296a38.4 38.4 0 0 1-48.5888 0c-131.072-107.1104-228.352-220.3648-291.6352-339.8656-64.1024-121.1904-90.2656-243.4048-77.824-365.8752a38.4 38.4 0 0 1 20.5312-30.2592c101.1712-52.224 181.0944-109.568 239.872-171.6224 104.96-110.9504 169.3696-108.4416 272.5376 0.512z m126.464 196.5056l-1.1776 0.8192a41.9328 41.9328 0 0 1-10.0352 3.84c-4.2496 1.024-5.4272 1.28-14.6944 3.328a122.368 122.368 0 0 0-16.896 4.4032c-43.8784 16.384-71.168 47.4112-83.0976 96.6656-2.304 9.6256-3.328 20.8384-3.6864 38.4l-0.2048 13.5168v15.872l0.0512 9.728v2.048l0.0512 3.4816c0.256 35.328 0.1536 51.2-1.024 71.424-4.5056 79.36-42.2912 140.3904-108.9536 178.4832-29.5424 16.896-61.9008 23.9616-99.328 23.9104h-8.704a9243.136 9243.136 0 0 0-29.2864-0.1536h-17.4592l-10.0352-0.0512H350.208c40.448 50.8416 88.3712 100.7104 143.7696 149.504l17.9712 15.5136 17.5104-14.8992c101.0176-88.064 176.0768-175.5136 225.28-262.144l9.5232-17.408c50.8928-96.2048 73.0624-197.2736 66.56-303.9744l-3.584-2.4064c-17.2544-9.9328-33.792-19.9168-49.664-29.9008z m-171.52 5.12h-1.1264c-15.1552 0.1024-30.0544 3.584-45.1072 10.5984-46.2848 21.504-77.056 71.3728-76.3904 128.0512 0.3072 25.7024 0.256 51.3536 0 87.6032l-0.1024 10.4448c-0.1024 14.4896-0.512 24.3712-1.7408 34.816-4.864 42.8032-19.6608 79.7696-43.6736 110.2848l-1.792 2.1504 1.3312 0.0512h1.3312c24.832 0 44.288-4.1984 61.0304-13.824 44.032-25.1904 67.3792-62.72 70.4-116.1216 1.024-18.0224 1.1264-32.768 0.8704-66.56V479.1296l-0.0512-5.2224v-21.504c0-5.12 0.0512-9.728 0.1536-14.4896 0.512-22.6816 1.8944-38.6048 5.8368-54.9376a225.0752 225.0752 0 0 1 35.6864-79.5136l4.7104-6.2464h-11.3664z m1.4848-136.2944l-12.2368-12.544c-73.728-77.9264-87.2448-78.4384-160.9728-0.5632C373.9136 211.6096 294.7072 269.824 196.9152 322.6624l-3.9424 2.048-0.768 17.5616c-2.4064 88.064 18.176 176.384 61.952 265.4208l9.7792 19.0464c9.2672 17.5104 19.3536 34.9184 30.2592 52.224l-0.8704 0.1536c2.4064-0.512 2.4064-0.512 6.144-0.9728 15.104-1.536 29.5936-6.8608 43.776-15.9744 36.4544-23.552 56.8832-56.576 62.1056-102.2464 0.8192-7.168 1.1264-14.848 1.2288-26.7264l0.1024-10.3424c0.256-35.84 0.3072-61.1328 0-86.2208-1.024-86.5792 46.8992-164.1984 120.7808-198.5536a183.552 183.552 0 0 1 77.312-17.7664h1.536l53.0432 0.256h16.0768a775.1168 775.1168 0 0 1-67.84-59.7504z" ></path></symbol><symbol id="icon-icon_mode" viewBox="0 0 1024 1024"><path d="M854.8352 357.80266667v203.6736H921.6a38.4 38.4 0 0 1 33.7408 56.832l-2.9696 4.608-222.8736 298.1376c-22.1184 29.5424-69.1712 13.9264-69.1712-23.04v-185.0368h-75.6736c-37.7344-21.1968-40.0896-22.528-38.4-40.0384l0.3584-3.7376c1.7408-7.68 1.7408-7.68 2.9184-10.24l2.2016-4.2496 1.1776-1.8944 1.536-2.304 2.048-2.9696 10.9568-15.2576c9.5744-13.2608 24.064-33.1264 43.4176-59.5968 38.656-52.7872 96.8704-132.0448 174.592-237.6704 22.016-29.8496 69.376-14.336 69.376 22.784zM485.2736 93.86666667c97.792 0 190.6176 33.4848 265.0624 93.7984a38.4 38.4 0 1 1-48.3328 59.6992 344.4736 344.4736 0 1 0-216.6784 612.3008 38.4 38.4 0 1 1 0 76.8 421.2736 421.2736 0 0 1 0-842.5984z m292.7104 380.8768l-5.632 7.7312a73697.1776 73697.1776 0 0 0-106.496 145.152l-6.3488 8.5504h39.2192a38.4 38.4 0 0 1 38.0416 33.1776l0.3584 5.2224V782.50666667l107.776-144.2304h-28.4672a38.4 38.4 0 0 1-38.0416-33.1776l-0.3584-5.1712V474.74346667z m-422.912-144.0768l92.9792 92.8768A98.816 98.816 0 1 1 393.728 477.86666667L300.7488 384.98986667a38.4 38.4 0 1 1 54.272-54.272z" ></path></symbol><symbol id="icon-icon_flash" viewBox="0 0 1024 1024"><path d="M776.448 0L192 579.456h222.016L242.048 1024 832 439.104H617.472L776.448 0z" ></path></symbol><symbol id="icon-token_nor" viewBox="0 0 1024 1024"><path d="M512 0c282.784 0 512 229.216 512 512s-229.216 512-512 512S0 794.784 0 512 229.216 0 512 0z m0 64C264.608 64 64 264.544 64 512s200.608 448 448 448 448-200.544 448-448S759.392 64 512 64z m51.808 596.256v107.872H446.72v-107.84h117.088z m-26.304-414.72c98.816 4.736 152.16 48.416 160.096 131.296 3.136 47.808-22.944 91.328-78.24 130.56l-7.712 5.312c-44.672 29.696-64.576 58.56-59.776 86.688v18.784h-95.68v-25.792c-1.6-48.384 19.2-87.488 62.144-117.184 39.744-31.2 58.944-59.392 57.408-84.384-3.168-32.768-21.536-50.784-54.976-53.888-44.672 0-72.512 28.896-83.616 86.72l-107.584-23.424c19.168-106.176 88.416-157.76 207.936-154.656z" ></path></symbol><symbol id="icon-icon_resrt" viewBox="0 0 1024 1024"><path d="M700.16 173.2608l150.5792 150.528a140.8 140.8 0 0 1 0 199.168l-250.0096 249.9072H844.8a38.4 38.4 0 0 1 0 76.8h-409.6a38.4 38.4 0 0 1-11.7248-1.792 246.528 246.528 0 0 1-174.9504-72.3968l-75.264-75.264a140.8 140.8 0 0 1 0-199.168l327.7824-327.7824a140.8 140.8 0 0 1 199.168 0z m-438.272 347.6992l-34.304 34.4064a64 64 0 0 0 0 90.5216l75.264 75.264a170.496 170.496 0 0 0 193.024 33.792l-233.984-233.984z m293.4784-293.376l-239.2064 239.104 241.152 241.152 239.104-239.2064a64 64 0 0 0 0-90.5216l-150.528-150.528a64 64 0 0 0-90.5216 0zM667.136 305.664l102.4 102.4a38.4 38.4 0 0 1-54.272 54.272l-102.4-102.4a38.4 38.4 0 1 1 54.272-54.272z" ></path></symbol><symbol id="icon-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-icon_disconnect" viewBox="0 0 1024 1024"><path d="M580.7104 694.6304a38.4 38.4 0 0 1 0 54.272l-60.3136 60.416a209.0496 209.0496 0 0 1-295.68-295.68l60.3648-60.3648a38.4 38.4 0 1 1 54.272 54.272l-60.3136 60.416a132.2496 132.2496 0 0 0 187.0336 187.0336l60.3648-60.3648a38.4 38.4 0 0 1 54.272 0z m-125.5424-113.664a38.4 38.4 0 0 1-0.7168 54.272L399.36 689.0496a38.4 38.4 0 0 1-53.6064-55.04l55.1424-53.7088a38.4 38.4 0 0 1 54.272 0.7168z m276.4288 83.456a38.4 38.4 0 1 1-54.3232 54.3744L315.2384 356.7104a38.4 38.4 0 0 1 54.272-54.272l362.0864 361.984z m90.4704-452.5056a209.0496 209.0496 0 0 1 0 295.68l-60.3136 60.3136a38.4 38.4 0 1 1-54.272-54.272l60.3136-60.3648A132.2496 132.2496 0 0 0 580.7104 266.24l-60.3136 60.3136a38.4 38.4 0 0 1-54.272-54.272l60.3136-60.3648a209.0496 209.0496 0 0 1 295.6288 0z m-122.368 119.04l3.584 3.7376a38.4 38.4 0 0 1-3.9424 54.1184l-63.1296 54.4768a38.4 38.4 0 0 1-50.176-58.1632l63.1296-54.4768a38.4 38.4 0 0 1 46.4384-2.816l4.096 3.1232z" ></path></symbol><symbol id="icon-icon_del1" viewBox="0 0 1024 1024"><path d="M705.024 294.4a140.8 140.8 0 0 1 139.9808 156.0576l-39.1168 358.4a140.8 140.8 0 0 1-139.9808 125.5424H358.0928a140.8 140.8 0 0 1-139.9808-125.5424l-39.1168-358.4A140.8 140.8 0 0 1 318.976 294.4h386.048z m0 76.8H318.976a64 64 0 0 0-63.6416 70.9632l39.1168 358.4a64 64 0 0 0 63.6416 57.0368h307.8144a64 64 0 0 0 63.6416-57.0368l39.1168-358.4A64 64 0 0 0 705.024 371.2z m-102.5024 126.464a38.4 38.4 0 0 1 38.4 38.4v184.32a38.4 38.4 0 1 1-76.8 0v-184.32a38.4 38.4 0 0 1 38.4-38.4z m-184.32 0a38.4 38.4 0 0 1 38.4 38.4v184.32a38.4 38.4 0 1 1-76.8 0v-184.32a38.4 38.4 0 0 1 38.4-38.4z m276.1728-377.344a38.4 38.4 0 1 1 0 76.8H327.3728a38.4 38.4 0 1 1 0-76.8h367.0016z" ></path></symbol><symbol id="icon-icon_copy" viewBox="0 0 1024 1024"><path d="M742.4 373.76a140.8 140.8 0 0 1 140.8 140.8v227.84a140.8 140.8 0 0 1-140.8 140.8h-227.84A140.8 140.8 0 0 1 373.76 742.4v-227.84a140.8 140.8 0 0 1 140.8-140.8h227.84z m0 76.8h-227.84c-35.328 0-64 28.672-64 64v227.84c0 35.328 28.672 64 64 64h227.84c35.328 0 64-28.672 64-64v-227.84c0-35.328-28.672-64-64-64z m-197.12-309.76A104.96 104.96 0 0 1 650.24 245.76v33.28a38.4 38.4 0 0 1-76.8 0V245.76a28.16 28.16 0 0 0-28.16-28.16H245.76a28.16 28.16 0 0 0-28.16 28.16v299.52c0 15.5648 12.5952 28.16 28.16 28.16h33.28a38.4 38.4 0 0 1 0 76.8H245.76a104.96 104.96 0 0 1-104.96-104.96V245.76A104.96 104.96 0 0 1 245.76 140.8h299.52z" ></path></symbol><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-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-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,s,o,a,c=function(f,p){p.parentNode.insertBefore(f,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 f,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,(f=document.body).firstChild?c(p,f.firstChild):f.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&&(s=n,o=e.document,a=!1,u(),o.onreadystatechange=function(){o.readyState=="complete"&&(o.onreadystatechange=null,l())})}function l(){a||(a=!0,s())}function u(){try{o.documentElement.doScroll("left")}catch{return void setTimeout(u,50)}l()}})(window);const TU="",MU="",IU="",OU="",d4="1.29.1",f4="1.49.0",h4={"-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 Nh extends Error{}class kh extends Nh{constructor(t,r){super(t),this.code=r,this.type=h4[r]??"ServerError"}}class p4 extends Nh{constructor(t,r,n){super(t),this.status=r,this.statusText=n}}var Dh=e=>{throw TypeError(e)},Ou=(e,t,r)=>t.has(e)||Dh("Cannot "+r),ir=(e,t,r)=>(Ou(e,t,"read from private field"),r?r.call(e):t.get(e)),Es=(e,t,r)=>t.has(e)?Dh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),so=(e,t,r,n)=>(Ou(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Lh=(e,t,r)=>(Ou(e,t,"access private method"),r),m4=(e,t,r,n)=>({set _(i){so(e,t,i,r)},get _(){return ir(e,t,n)}}),Ki,Jo,vi,Cs,Xo,As,ac,Bh,Uh;function g4(e){const t=new URL(e);return t.protocol=t.protocol.replace("http","ws"),t.toString()}const v4={WebSocketConstructor:typeof WebSocket<"u"?WebSocket:void 0,callTimeout:3e4,reconnectTimeout:3e3,maxReconnects:5};class b4{constructor(t,r={}){if(Es(this,ac),Es(this,Ki,0),Es(this,Jo,0),Es(this,vi,null),Es(this,Cs,null),Es(this,Xo,new Set),Es(this,As,new Map),this.endpoint=t,this.options={...v4,...r},!this.options.WebSocketConstructor)throw new Error("Missing WebSocket constructor");this.endpoint.startsWith("http")&&(this.endpoint=g4(this.endpoint))}async makeRequest(t,r,n){const i=await Lh(this,ac,Bh).call(this);return new Promise((s,o)=>{so(this,Ki,ir(this,Ki)+1),ir(this,As).set(ir(this,Ki),{resolve:s,reject:o,timeout:setTimeout(()=>{ir(this,As).delete(ir(this,Ki)),o(new Error(`Request timeout: ${t}`))},this.options.callTimeout)}),n==null||n.addEventListener("abort",()=>{ir(this,As).delete(ir(this,Ki)),o(n.reason)}),i.send(JSON.stringify({jsonrpc:"2.0",id:ir(this,Ki),method:t,params:r}))}).then(({error:s,result:o})=>{if(s)throw new kh(s.message,s.code);return o})}async subscribe(t){const r=new y4(t);return ir(this,Xo).add(r),await r.subscribe(this),()=>r.unsubscribe(this)}}Ki=new WeakMap,Jo=new WeakMap,vi=new WeakMap,Cs=new WeakMap,Xo=new WeakMap,As=new WeakMap,ac=new WeakSet,Bh=function(){return ir(this,Cs)?ir(this,Cs):(so(this,Cs,new Promise(e=>{var t;(t=ir(this,vi))==null||t.close(),so(this,vi,new this.options.WebSocketConstructor(this.endpoint)),ir(this,vi).addEventListener("open",()=>{so(this,Jo,0),e(ir(this,vi))}),ir(this,vi).addEventListener("close",()=>{m4(this,Jo)._++,ir(this,Jo)<=this.options.maxReconnects&&setTimeout(()=>{Lh(this,ac,Uh).call(this)},this.options.reconnectTimeout)}),ir(this,vi).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&&ir(this,As).has(n.id)){const{resolve:i,timeout:s}=ir(this,As).get(n.id);clearTimeout(s),i(n)}else if("params"in n){const{params:i}=n;ir(this,Xo).forEach(s=>{s.subscriptionId===i.subscription&&i.subscription===s.subscriptionId&&s.onMessage(i.result)})}})})),ir(this,Cs))},Uh=async function(){var e;return(e=ir(this,vi))==null||e.close(),so(this,Cs,null),Promise.allSettled([...ir(this,Xo)].map(t=>t.subscribe(this)))};class y4{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.input.signal);this.subscribed&&(this.subscriptionId=r)}}var Fh=e=>{throw TypeError(e)},Pu=(e,t,r)=>t.has(e)||Fh("Cannot "+r),dn=(e,t,r)=>(Pu(e,t,"read from private field"),r?r.call(e):t.get(e)),cc=(e,t,r)=>t.has(e)?Fh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ru=(e,t,r,n)=>(Pu(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),w4=(e,t,r)=>(Pu(e,t,"access private method"),r),Zo,En,Qo,ju,$h;class x4{constructor(t){cc(this,ju),cc(this,Zo,0),cc(this,En),cc(this,Qo),Ru(this,En,t)}fetch(t,r){const n=dn(this,En).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,s;Ru(this,Zo,dn(this,Zo)+1);const r=await this.fetch(((i=dn(this,En).rpc)==null?void 0:i.url)??dn(this,En).url,{method:"POST",signal:t.signal,headers:{"Content-Type":"application/json","Client-Sdk-Type":"typescript","Client-Sdk-Version":d4,"Client-Target-Api-Version":f4,"Client-Request-Method":t.method,...(s=dn(this,En).rpc)==null?void 0:s.headers},body:JSON.stringify({jsonrpc:"2.0",id:dn(this,Zo),method:t.method,params:t.params})});if(!r.ok)throw new p4(`Unexpected status code: ${r.status}`,r.status,r.statusText);const n=await r.json();if("error"in n&&n.error!=null)throw new kh(n.error.message,n.error.code);return n.result}async subscribe(t){const r=await w4(this,ju,$h).call(this).subscribe(t);return t.signal&&(t.signal.throwIfAborted(),t.signal.addEventListener("abort",()=>{r()})),async()=>!!await r()}}Zo=new WeakMap,En=new WeakMap,Qo=new WeakMap,ju=new WeakSet,$h=function(){var e;if(!dn(this,Qo)){const t=dn(this,En).WebSocketConstructor??WebSocket;if(!t)throw new Error("The current environment does not support WebSocket, you can provide a WebSocketConstructor in the options for SuiHTTPTransport.");Ru(this,Qo,new b4(((e=dn(this,En).websocket)==null?void 0:e.url)??dn(this,En).url,{WebSocketConstructor:t,...dn(this,En).websocket}))}return dn(this,Qo)};function Vh(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 S4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function zh(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 Nu(e,t){if(typeof t!="string")throw new Error(`${e}: string expected`);return!0}function qh(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function ku(e){if(!Array.isArray(e))throw new Error("array expected")}function Hh(e,t){if(!zh(!0,t))throw new Error(`${e}: array of strings expected`)}function _4(e,t){if(!zh(!1,t))throw new Error(`${e}: array of numbers expected`)}function E4(...e){const t=s=>s,r=(s,o)=>a=>s(o(a)),n=e.map(s=>s.encode).reduceRight(r,t),i=e.map(s=>s.decode).reduce(r,t);return{encode:n,decode:i}}function C4(e){const t=typeof e=="string"?e.split(""):e,r=t.length;Hh("alphabet",t);const n=new Map(t.map((i,s)=>[i,s]));return{encode:i=>(ku(i),i.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return t[s]})),decode:i=>(ku(i),i.map(s=>{Nu("alphabet.decode",s);const o=n.get(s);if(o===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return o}))}}function A4(e=""){return Nu("join",e),{encode:t=>(Hh("join.decode",t),t.join(e)),decode:t=>(Nu("join.decode",t),t.split(e))}}function Wh(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(ku(e),!e.length)return[];let n=0;const i=[],s=Array.from(e,a=>{if(qh(a),a<0||a>=t)throw new Error(`invalid integer: ${a}`);return a}),o=s.length;for(;;){let a=0,c=!0;for(let l=n;l<o;l++){const u=s[l],f=t*a,p=f+u;if(!Number.isSafeInteger(p)||f/t!==a||p-u!==f)throw new Error("convertRadix: carry overflow");const y=p/r;a=p%r;const x=Math.floor(y);if(s[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 T4(e){qh(e);const t=2**8;return{encode:r=>{if(!S4(r))throw new Error("radix.encode input should be Uint8Array");return Wh(Array.from(r),t,e)},decode:r=>(_4("radix.decode",r),Uint8Array.from(Wh(r,e,t)))}}const Gh=(e=>E4(T4(58),C4(e),A4("")))("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),Ts=e=>Gh.encode(e),bi=e=>Gh.decode(e);function yr(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const Du=8192;function wr(e){if(e.length<Du)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=Du){const n=e.slice(r,r+Du);t+=String.fromCharCode(...n)}return btoa(t)}function oo(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(s=>parseInt(s,16)))??[];if(n.length!==r.length/2)throw new Error(`Invalid hex string ${e}`);return Uint8Array.from(n)}function yi(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function M4(e,t){return Array.from({length:Math.ceil(e.length/t)},(r,n)=>e.slice(n*t,(n+1)*t))}function lc(e){const t=[];let r=0;if(e===0)return[0];for(;e>0;)t[r]=e&127,(e>>=7)&&(t[r]|=128),r+=1;return t}function I4(e){let t=0,r=0,n=0;for(;;){const i=e[n];if(n+=1,t|=(i&127)<<r,!(i&128))break;r+=7}return{value:t,length:n}}class Kh{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength)}shift(t){return this.bytePosition+=t,this}read8(){const t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){const t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){const t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){const t=this.read32(),n=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){const t=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){const t=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(t){const r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,t);return this.shift(t),n}readULEB(){const t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t),{value:n,length:i}=I4(r);return this.shift(i),n}readVec(t){const r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(t(this,i,r));return n}}function Yh(e,t){switch(t){case"base58":return Ts(e);case"base64":return wr(e);case"hex":return yi(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function O4(e,t){switch(t){case"base58":return bi(e);case"base64":return yr(e);case"hex":return oo(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function Lu(e,t=["<",">"]){const[r,n]=t,i=[];let s="",o=0;for(let a=0;a<e.length;a++){const c=e[a];if(c===r&&o++,c===n&&o--,o===0&&c===","){i.push(s.trim()),s="";continue}s+=c}return i.push(s.trim()),i}class Jh{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 Bu(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return Bu(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return Bu(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return lc(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 Yh(this.toBytes(),t)}}function Bu(e,t){const r=new Uint8Array(t);let n=0;for(;e>0;)r[n]=Number(e%BigInt(256)),e=e/BigInt(256),n+=1;return r}var Xh=e=>{throw TypeError(e)},Zh=(e,t,r)=>t.has(e)||Xh("Cannot "+r),Cn=(e,t,r)=>(Zh(e,t,"read from private field"),r?r.call(e):t.get(e)),uc=(e,t,r)=>t.has(e)?Xh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),dc=(e,t,r,n)=>(Zh(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ao,ea,fc,Yi;const P4=class t4{constructor(t){uc(this,ao),uc(this,ea),this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),dc(this,ao,t.write),dc(this,ea,t.serialize??((r,n)=>{const i=new Jh({initialSize:this.serializedSize(r)??void 0,...n});return Cn(this,ao).call(this,r,i),i.toBytes()})),this.validate=t.validate??(()=>{})}write(t,r){this.validate(t),Cn(this,ao).call(this,t,r)}serialize(t,r){return this.validate(t),new ep(this,Cn(this,ea).call(this,t,r))}parse(t){const r=new Kh(t);return this.read(r)}fromHex(t){return this.parse(oo(t))}fromBase58(t){return this.parse(bi(t))}fromBase64(t){return this.parse(yr(t))}transform({name:t,input:r,output:n,validate:i}){return new t4({name:t??this.name,read:s=>n?n(this.read(s)):this.read(s),write:(s,o)=>Cn(this,ao).call(this,r?r(s):s,o),serializedSize:s=>this.serializedSize(r?r(s):s),serialize:(s,o)=>Cn(this,ea).call(this,r?r(s):s,o),validate:s=>{i==null||i(s),this.validate(r?r(s):s)}})}};ao=new WeakMap,ea=new WeakMap;let An=P4;const Qh=Symbol.for("@mysten/serialized-bcs");function hc(e){return!!e&&typeof e=="object"&&e[Qh]===!0}class ep{constructor(t,r){uc(this,fc),uc(this,Yi),dc(this,fc,t),dc(this,Yi,r)}get[Qh](){return!0}toBytes(){return Cn(this,Yi)}toHex(){return yi(Cn(this,Yi))}toBase64(){return wr(Cn(this,Yi))}toBase58(){return Ts(Cn(this,Yi))}parse(){return Cn(this,fc).parse(Cn(this,Yi))}}fc=new WeakMap,Yi=new WeakMap;function pc({size:e,...t}){return new An({...t,serializedSize:()=>e})}function Uu({readMethod:e,writeMethod:t,...r}){return pc({...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 Fu({readMethod:e,writeMethod:t,...r}){return pc({...r,read:n=>n[e](),write:(n,i)=>i[t](BigInt(n)),validate:n=>{var s;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}`);(s=r.validate)==null||s.call(r,i)}})}function R4({serialize:e,...t}){const r=new An({...t,serialize:e,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function j4({toBytes:e,fromBytes:t,...r}){return new An({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return t(s)},write:(n,i)=>{const s=e(n);i.writeULEB(s.length);for(let o=0;o<s.length;o++)i.write8(s[o])},serialize:n=>{const i=e(n),s=lc(i.length),o=new Uint8Array(s.length+i.length);return o.set(s,0),o.set(i,s.length),o},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 N4(e){let t=null;function r(){return t||(t=e()),t}return new An({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 X={u8(e){return Uu({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return Uu({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return Uu({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return Fu({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return Fu({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return Fu({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return pc({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 R4({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(lc(t)),...e})},bytes(e,t){return pc({name:`bytes[${e}]`,size:e,read:r=>r.readBytes(e),write:(r,n)=>{const i=new Uint8Array(r);for(let s=0;s<e;s++)n.write8(i[s]??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 An({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:lc(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 j4({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new An({name:`${t.name}[${e}]`,read:n=>{const i=new Array(e);for(let s=0;s<e;s++)i[s]=t.read(n);return i},write:(n,i)=>{for(const s of n)t.write(s,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 X.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 An({name:`vector<${e.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=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 An({name:`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<e.length;i++){const s=e[i].serializedSize(r[i]);if(s==null)return null;n+=s}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 An({name:e,serializedSize:i=>{let s=0;for(const[o,a]of n){const c=a.serializedSize(i[o]);if(c==null)return null;s+=c}return s},read:i=>{const s={};for(const[o,a]of n)s[o]=a.read(i);return s},write:(i,s)=>{for(const[o,a]of n)a.write(i[o],s)},...r,validate:i=>{var s;if((s=r==null?void 0:r.validate)==null||s.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 An({name:e,read:i=>{const s=i.readULEB(),o=n[s];if(!o)throw new TypeError(`Unknown value ${s} for enum ${e}`);const[a,c]=o;return{[a]:(c==null?void 0:c.read(i))??!0,$kind:a}},write:(i,s)=>{const[o,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===o){s.writeULEB(c),u==null||u.write(a,s);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 s=Object.keys(i).filter(c=>i[c]!==void 0&&Object.hasOwn(t,c));if(s.length!==1)throw new TypeError(`Expected object with one key, but found ${s.length} for type ${e}}`);const[o]=s;if(!Object.hasOwn(t,o))throw new TypeError(`Invalid enum variant ${o}`)}})},map(e,t){return X.vector(X.tuple([e,t])).transform({name:`Map<${e.name}, ${t.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},lazy(e){return N4(e)}},k4=Ts,D4=bi,tp=wr,rp=yr,np=yi,ip=oo,L4=Object.freeze(Object.defineProperty({__proto__:null,BcsReader:Kh,BcsType:An,BcsWriter:Jh,SerializedBcs:ep,bcs:X,decodeStr:O4,encodeStr:Yh,fromB58:D4,fromB64:rp,fromBase58:bi,fromBase64:yr,fromHEX:ip,fromHex:oo,isSerializedBcs:hc,splitGenericParameters:Lu,toB58:k4,toB64:tp,toBase58:Ts,toBase64:wr,toHEX:np,toHex:yi},Symbol.toStringTag,{value:"Module"}));var sp=e=>{throw TypeError(e)},op=(e,t,r)=>t.has(e)||sp("Cannot "+r),fn=(e,t,r)=>(op(e,t,"read from private field"),r?r.call(e):t.get(e)),ap=(e,t,r)=>t.has(e)?sp("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),cp=(e,t,r,n)=>(op(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),co,hn;const B4=class r4{constructor({prefix:t,cache:r}={}){ap(this,co),ap(this,hn),cp(this,co,t??[]),cp(this,hn,r??new Map)}read(t,r){const n=[fn(this,co),...t].join(":");if(fn(this,hn).has(n))return fn(this,hn).get(n);const i=r();return fn(this,hn).set(n,i),typeof i=="object"&&i!==null&&"then"in i?Promise.resolve(i).then(s=>(fn(this,hn).set(n,s),s)).catch(s=>{throw fn(this,hn).delete(n),s}):i}clear(t){const r=[...fn(this,co),...t??[]].join(":");if(!r){fn(this,hn).clear();return}for(const n of fn(this,hn).keys())n.startsWith(r)&&fn(this,hn).delete(n)}scope(t){return new r4({prefix:[...fn(this,co),...Array.isArray(t)?t:[t]],cache:fn(this,hn)})}};co=new WeakMap,hn=new WeakMap;let U4=B4;class lp{constructor({network:t}){this.cache=new U4,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 up=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,dp=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,F4=235;function fp(e){return e.length>F4?!1:e.includes("@")?up.test(e):dp.test(e)}function hp(e,t="at"){const r=e.toLowerCase();let n;if(r.includes("@")){if(!up.test(r))throw new Error(`Invalid SuiNS name ${e}`);const[i,s]=r.split("@");n=[...i?i.split("."):[],s]}else{if(!dp.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 $4=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,V4=/^\d+$/,z4=64,pp="/",$u=e=>{const t=e.split(pp);if(t.length<2||t.length>3)return!1;const[r,n,i]=t;return i!==void 0&&!V4.test(i)||!fp(r)?!1:$4.test(n)&&n.length<z4},q4=e=>{const t=e.split(/::|<|>|,/);for(const r of t)if(r.includes(pp)&&!$u(r))return!1;return!0},H4=32;function Vu(e){try{return bi(e).length===H4}catch{return!1}}const ta=32;function Wn(e){return G4(e)&&K4(e)===ta}function ra(e){return Wn(e)}function W4(e){return e.includes("::")?mc(e):e}function mc(e){const[t,r]=e.split("::"),n=$u(t),i=e.slice(t.length+r.length+4),s=i.includes("<")?i.slice(0,i.indexOf("<")):i,o=i.includes("<")?Lu(i.slice(i.indexOf("<")+1,i.lastIndexOf(">"))).map(a=>W4(a.trim())):[];return{address:n?t:Dt(t),module:r,name:s,typeParams:o}}function na(e){const{address:t,module:r,name:n,typeParams:i}=typeof e=="string"?mc(e):e,s=(i==null?void 0:i.length)>0?`<${i.map(o=>typeof o=="string"?o:na(o)).join(",")}>`:"";return`${t}::${r}::${n}${s}`}function Dt(e,t=!1){let r=e.toLowerCase();return!t&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(ta*2,"0")}`}function rn(e,t=!1){return Dt(e,t)}function G4(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function K4(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}const Y4=/^vector<(.+)>$/,J4=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;let ia=class Go{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(Y4);if(n)return{vector:Go.parseFromStr(n[1],r)};const i=t.match(J4);if(i)return{struct:{address:r?Dt(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:Go.parseStructTypeArgs(i[5],r)}};throw new Error(`Encountered unexpected token when parsing type args for ${t}`)}static parseStructTypeArgs(t,r=!1){return Lu(t).map(n=>Go.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<${Go.tagToString(t.vector)}>`;if("struct"in t){const r=t.struct,n=r.typeParams.map(Go.tagToString).join(", ");return`${r.address}::${r.module}::${r.name}${n?`<${n}>`:""}`}throw new Error("Invalid TypeTag")}};function X4(e){return X.u64({name:"unsafe_u64",...e}).transform({input:t=>t,output:t=>Number(t)})}function Z4(e){return X.enum("Option",{None:null,Some:e})}const er=X.bytes(ta).transform({validate:e=>{const t=typeof e=="string"?e:yi(e);if(!t||!Wn(Dt(t)))throw new Error(`Invalid Sui address ${t}`)},input:e=>typeof e=="string"?oo(Dt(e)):e,output:e=>Dt(yi(e))}),Tn=X.vector(X.u8()).transform({name:"ObjectDigest",input:e=>bi(e),output:e=>Ts(new Uint8Array(e)),validate:e=>{if(bi(e).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),pn=X.struct("SuiObjectRef",{objectId:er,version:X.u64(),digest:Tn}),mp=X.struct("SharedObjectRef",{objectId:er,initialSharedVersion:X.u64(),mutable:X.bool()}),gp=X.enum("ObjectArg",{ImmOrOwnedObject:pn,SharedObject:mp,Receiving:pn}),Ms=X.enum("Owner",{AddressOwner:er,ObjectOwner:er,Shared:X.struct("Shared",{initialSharedVersion:X.u64()}),Immutable:null,ConsensusV2:X.struct("ConsensusV2",{authenticator:X.enum("Authenticator",{SingleOwner:er}),startVersion:X.u64()})}),vp=X.enum("CallArg",{Pure:X.struct("Pure",{bytes:X.vector(X.u8()).transform({input:e=>typeof e=="string"?yr(e):e,output:e=>wr(new Uint8Array(e))})}),Object:gp}),zu=X.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:X.lazy(()=>zu),struct:X.lazy(()=>_p),u16:null,u32:null,u256:null}),qu=zu.transform({input:e=>typeof e=="string"?ia.parseFromStr(e,!0):e,output:e=>ia.tagToString(e)}),Gn=X.enum("Argument",{GasCoin:null,Input:X.u16(),Result:X.u16(),NestedResult:X.tuple([X.u16(),X.u16()])}),bp=X.struct("ProgrammableMoveCall",{package:er,module:X.string(),function:X.string(),typeArguments:X.vector(qu),arguments:X.vector(Gn)}),yp=X.enum("Command",{MoveCall:bp,TransferObjects:X.struct("TransferObjects",{objects:X.vector(Gn),address:Gn}),SplitCoins:X.struct("SplitCoins",{coin:Gn,amounts:X.vector(Gn)}),MergeCoins:X.struct("MergeCoins",{destination:Gn,sources:X.vector(Gn)}),Publish:X.struct("Publish",{modules:X.vector(X.vector(X.u8()).transform({input:e=>typeof e=="string"?yr(e):e,output:e=>wr(new Uint8Array(e))})),dependencies:X.vector(er)}),MakeMoveVec:X.struct("MakeMoveVec",{type:Z4(qu).transform({input:e=>e===null?{None:!0}:{Some:e},output:e=>e.Some??null}),elements:X.vector(Gn)}),Upgrade:X.struct("Upgrade",{modules:X.vector(X.vector(X.u8()).transform({input:e=>typeof e=="string"?yr(e):e,output:e=>wr(new Uint8Array(e))})),dependencies:X.vector(er),package:er,ticket:Gn})}),wp=X.struct("ProgrammableTransaction",{inputs:X.vector(vp),commands:X.vector(yp)}),xp=X.enum("TransactionKind",{ProgrammableTransaction:wp,ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null}),Sp=X.enum("TransactionExpiration",{None:null,Epoch:X4()}),_p=X.struct("StructTag",{address:er,module:X.string(),name:X.string(),typeParams:X.vector(zu)}),Ep=X.struct("GasData",{payment:X.vector(pn),owner:er,price:X.u64(),budget:X.u64()}),Cp=X.struct("TransactionDataV1",{kind:xp,sender:er,gasData:Ep,expiration:Sp}),Ap=X.enum("TransactionData",{V1:Cp}),Tp=X.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),Mp=X.enum("IntentVersion",{V0:null}),Ip=X.enum("AppId",{Sui:null}),Op=X.struct("Intent",{scope:Tp,version:Mp,appId:Ip});function Pp(e){return X.struct(`IntentMessage<${e.name}>`,{intent:Op,value:e})}const Rp=X.enum("CompressedSignature",{ED25519:X.fixedArray(64,X.u8()),Secp256k1:X.fixedArray(64,X.u8()),Secp256r1:X.fixedArray(64,X.u8()),ZkLogin:X.vector(X.u8())}),jp=X.enum("PublicKey",{ED25519:X.fixedArray(32,X.u8()),Secp256k1:X.fixedArray(33,X.u8()),Secp256r1:X.fixedArray(33,X.u8()),ZkLogin:X.vector(X.u8())}),Np=X.struct("MultiSigPkMap",{pubKey:jp,weight:X.u8()}),kp=X.struct("MultiSigPublicKey",{pk_map:X.vector(Np),threshold:X.u16()}),Q4=X.struct("MultiSig",{sigs:X.vector(Rp),bitmap:X.u16(),multisig_pk:kp}),e8=X.vector(X.u8()).transform({input:e=>typeof e=="string"?yr(e):e,output:e=>wr(new Uint8Array(e))}),Dp=X.struct("SenderSignedTransaction",{intentMessage:Pp(Ap),txSignatures:X.vector(e8)}),t8=X.vector(Dp,{name:"SenderSignedData"}),r8=X.struct("PasskeyAuthenticator",{authenticatorData:X.vector(X.u8()),clientDataJson:X.string(),userSignature:X.vector(X.u8())}),n8=X.enum("PackageUpgradeError",{UnableToFetchPackage:X.struct("UnableToFetchPackage",{packageId:er}),NotAPackage:X.struct("NotAPackage",{objectId:er}),IncompatibleUpgrade:null,DigestDoesNotMatch:X.struct("DigestDoesNotMatch",{digest:X.vector(X.u8())}),UnknownUpgradePolicy:X.struct("UnknownUpgradePolicy",{policy:X.u8()}),PackageIDDoesNotMatch:X.struct("PackageIDDoesNotMatch",{packageId:er,ticketId:er})}),i8=X.struct("ModuleId",{address:er,name:X.string()}),Lp=X.struct("MoveLocation",{module:i8,function:X.u16(),instruction:X.u16(),functionName:X.option(X.string())}),s8=X.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:X.struct("IndexOutOfBounds",{idx:X.u16()}),SecondaryIndexOutOfBounds:X.struct("SecondaryIndexOutOfBounds",{resultIdx:X.u16(),secondaryIdx:X.u16()}),InvalidResultArity:X.struct("InvalidResultArity",{resultIdx:X.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null}),o8=X.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),a8=X.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:X.struct("MoveObjectTooBig",{objectSize:X.u64(),maxObjectSize:X.u64()}),MovePackageTooBig:X.struct("MovePackageTooBig",{objectSize:X.u64(),maxObjectSize:X.u64()}),CircularObjectOwnership:X.struct("CircularObjectOwnership",{object:er}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:X.option(Lp),MoveAbort:X.tuple([Lp,X.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:X.struct("CommandArgumentError",{argIdx:X.u16(),kind:s8}),TypeArgumentError:X.struct("TypeArgumentError",{argumentIdx:X.u16(),kind:o8}),UnusedValueWithoutDrop:X.struct("UnusedValueWithoutDrop",{resultIdx:X.u16(),secondaryIdx:X.u16()}),InvalidPublicFunctionReturnType:X.struct("InvalidPublicFunctionReturnType",{idx:X.u16()}),InvalidTransferObject:null,EffectsTooLarge:X.struct("EffectsTooLarge",{currentSize:X.u64(),maxSize:X.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:X.struct("PackageUpgradeError",{upgradeError:n8}),WrittenObjectsTooLarge:X.struct("WrittenObjectsTooLarge",{currentSize:X.u64(),maxSize:X.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:X.struct("ExecutionCancelledDueToSharedObjectCongestion",{congestedObjects:X.vector(er)}),AddressDeniedForCoin:X.struct("AddressDeniedForCoin",{address:er,coinType:X.string()}),CoinTypeGlobalPause:X.struct("CoinTypeGlobalPause",{coinType:X.string()}),ExecutionCancelledDueToRandomnessUnavailable:null}),Bp=X.enum("ExecutionStatus",{Success:null,Failed:X.struct("ExecutionFailed",{error:a8,command:X.option(X.u64())})}),Up=X.struct("GasCostSummary",{computationCost:X.u64(),storageCost:X.u64(),storageRebate:X.u64(),nonRefundableStorageFee:X.u64()}),c8=X.struct("TransactionEffectsV1",{status:Bp,executedEpoch:X.u64(),gasUsed:Up,modifiedAtVersions:X.vector(X.tuple([er,X.u64()])),sharedObjects:X.vector(pn),transactionDigest:Tn,created:X.vector(X.tuple([pn,Ms])),mutated:X.vector(X.tuple([pn,Ms])),unwrapped:X.vector(X.tuple([pn,Ms])),deleted:X.vector(pn),unwrappedThenDeleted:X.vector(pn),wrapped:X.vector(pn),gasObject:X.tuple([pn,Ms]),eventsDigest:X.option(Tn),dependencies:X.vector(Tn)}),Hu=X.tuple([X.u64(),Tn]),l8=X.enum("ObjectIn",{NotExist:null,Exist:X.tuple([Hu,Ms])}),u8=X.enum("ObjectOut",{NotExist:null,ObjectWrite:X.tuple([Tn,Ms]),PackageWrite:Hu}),d8=X.enum("IDOperation",{None:null,Created:null,Deleted:null}),f8=X.struct("EffectsObjectChange",{inputState:l8,outputState:u8,idOperation:d8}),h8=X.enum("UnchangedSharedKind",{ReadOnlyRoot:Hu,MutateDeleted:X.u64(),ReadDeleted:X.u64(),Cancelled:X.u64(),PerEpochConfig:null}),p8=X.struct("TransactionEffectsV2",{status:Bp,executedEpoch:X.u64(),gasUsed:Up,transactionDigest:Tn,gasObjectIndex:X.option(X.u32()),eventsDigest:X.option(Tn),dependencies:X.vector(Tn),lamportVersion:X.u64(),changedObjects:X.vector(X.tuple([er,f8])),unchangedSharedObjects:X.vector(X.tuple([er,h8])),auxDataDigest:X.option(Tn)}),m8=X.enum("TransactionEffects",{V1:c8,V2:p8});function sa(e){switch(e){case"u8":return X.u8();case"u16":return X.u16();case"u32":return X.u32();case"u64":return X.u64();case"u128":return X.u128();case"u256":return X.u256();case"bool":return X.bool();case"string":return X.string();case"id":case"address":return er}const t=e.match(/^(vector|option)<(.+)>$/);if(t){const[r,n]=t.slice(1);return r==="vector"?X.vector(sa(n)):X.option(sa(n))}throw new Error(`Invalid Pure type name: ${e}`)}const wt={...X,U8:X.u8(),U16:X.u16(),U32:X.u32(),U64:X.u64(),U128:X.u128(),U256:X.u256(),ULEB128:X.uleb128(),Bool:X.bool(),String:X.string(),Address:er,AppId:Ip,Argument:Gn,CallArg:vp,Command:yp,CompressedSignature:Rp,GasData:Ep,Intent:Op,IntentMessage:Pp,IntentScope:Tp,IntentVersion:Mp,MultiSig:Q4,MultiSigPkMap:Np,MultiSigPublicKey:kp,ObjectArg:gp,ObjectDigest:Tn,Owner:Ms,PasskeyAuthenticator:r8,ProgrammableMoveCall:bp,ProgrammableTransaction:wp,PublicKey:jp,SenderSignedData:t8,SenderSignedTransaction:Dp,SharedObjectRef:mp,StructTag:_p,SuiObjectRef:pn,TransactionData:Ap,TransactionDataV1:Cp,TransactionEffects:m8,TransactionExpiration:Sp,TransactionKind:xp,TypeTag:qu};function g8(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}var wi;function v8(e){return{lang:(e==null?void 0:e.lang)??(wi==null?void 0:wi.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(wi==null?void 0:wi.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(wi==null?void 0:wi.abortPipeEarly)}}var Wu;function b8(e){return Wu==null?void 0:Wu.get(e)}var Gu;function y8(e){return Gu==null?void 0:Gu.get(e)}var Ku;function w8(e,t){var r;return(r=Ku==null?void 0:Ku.get(e))==null?void 0:r.get(t)}function Fp(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 nn(e,t,r,n,i){const s=i&&"input"in i?i.input:r.value,o=(i==null?void 0:i.expected)??e.expects??null,a=(i==null?void 0:i.received)??Fp(s),c={kind:e.kind,type:e.type,input:s,expected:o,received:a,message:`Invalid ${t}: ${o?`Expected ${o} 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??w8(e.reference,c.lang)??(l?y8(c.lang):null)??n.message??b8(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 x8(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}var S8=class extends Error{constructor(t){super(t[0].message);Et(this,"issues");this.name="ValiError",this.issues=t}};function oa(e,t){return{kind:"validation",type:"check",reference:oa,async:!1,expects:null,requirement:e,message:t,_run(r,n){return r.typed&&!this.requirement(r.value)&&nn(this,"input",r,n),r}}}function ur(e){return{kind:"validation",type:"integer",reference:ur,async:!1,expects:null,requirement:Number.isInteger,message:e,_run(t,r){return t.typed&&!this.requirement(t.value)&&nn(this,"integer",t,r),t}}}function gc(e){return{kind:"transformation",type:"transform",reference:gc,async:!1,operation:e,_run(t){return t.value=this.operation(t.value),t}}}function Yu(e,t,r){return typeof e.default=="function"?e.default(t,r):e.default}function Ju(e,t){return!e._run({typed:!1,value:t},{abortEarly:!0}).issues}function ht(e,t){return{kind:"schema",type:"array",reference:ht,expects:"Array",async:!1,item:e,message:t,_run(r,n){var s;const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let o=0;o<i.length;o++){const a=i[o],c=this.item._run({typed:!1,value:a},n);if(c.issues){const l={type:"array",origin:"value",input:i,key:o,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(s=r.issues)==null||s.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 nn(this,"type",r,n);return r}}}function vc(e){return{kind:"schema",type:"bigint",reference:vc,expects:"bigint",async:!1,message:e,_run(t,r){return typeof t.value=="bigint"?t.typed=!0:nn(this,"type",t,r),t}}}function bc(e){return{kind:"schema",type:"boolean",reference:bc,expects:"boolean",async:!1,message:e,_run(t,r){return typeof t.value=="boolean"?t.typed=!0:nn(this,"type",t,r),t}}}function aa(e){return{kind:"schema",type:"lazy",reference:aa,expects:"unknown",async:!1,getter:e,_run(t,r){return this.getter(t.value)._run(t,r)}}}function yt(e,t){return{kind:"schema",type:"literal",reference:yt,expects:Fp(e),async:!1,literal:e,message:t,_run(r,n){return r.value===this.literal?r.typed=!0:nn(this,"type",r,n),r}}}function Ut(e,...t){const r={kind:"schema",type:"nullable",reference:Ut,expects:`${e.expects} | null`,async:!1,wrapped:e,_run(n,i){return n.value===null&&("default"in this&&(n.value=Yu(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 lo(e,...t){const r={kind:"schema",type:"nullish",reference:lo,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=Yu(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 ar(e){return{kind:"schema",type:"number",reference:ar,expects:"number",async:!1,message:e,_run(t,r){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:nn(this,"type",t,r),t}}}function Fe(e,t){return{kind:"schema",type:"object",reference:Fe,expects:"Object",async:!1,entries:e,message:t,_run(r,n){var s;const i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(const o in this.entries){const a=i[o],c=this.entries[o]._run({typed:!1,value:a},n);if(c.issues){const l={type:"object",origin:"value",input:i,key:o,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(s=r.issues)==null||s.push(u);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),(c.value!==void 0||o in i)&&(r.value[o]=c.value)}}else nn(this,"type",r,n);return r}}}function kr(e,...t){const r={kind:"schema",type:"optional",reference:kr,expects:`${e.expects} | undefined`,async:!1,wrapped:e,_run(n,i){return n.value===void 0&&("default"in this&&(n.value=Yu(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 ca(e,t,r){return{kind:"schema",type:"record",reference:ca,expects:"Object",async:!1,key:e,value:t,message:r,_run(n,i){var o,a;const s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(const c in s)if(x8(s,c)){const l=s[c],u=this.key._run({typed:!1,value:c},i);if(u.issues){const p={type:"object",origin:"key",input:s,key:c,value:l};for(const y of u.issues)y.path=[p],(o=n.issues)==null||o.push(y);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}const f=this.value._run({typed:!1,value:l},i);if(f.issues){const p={type:"object",origin:"value",input:s,key:c,value:l};for(const y of f.issues)y.path?y.path.unshift(p):y.path=[p],(a=n.issues)==null||a.push(y);if(n.issues||(n.issues=f.issues),i.abortEarly){n.typed=!1;break}}(!u.typed||!f.typed)&&(n.typed=!1),u.typed&&(n.value[u.value]=f.value)}}else nn(this,"type",n,i);return n}}}function At(e){return{kind:"schema",type:"string",reference:At,expects:"string",async:!1,message:e,_run(t,r){return typeof t.value=="string"?t.typed=!0:nn(this,"type",t,r),t}}}function Xu(e,t){return{kind:"schema",type:"tuple",reference:Xu,expects:"Array",async:!1,items:e,message:t,_run(r,n){var s;const i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let o=0;o<this.items.length;o++){const a=i[o],c=this.items[o]._run({typed:!1,value:a},n);if(c.issues){const l={type:"array",origin:"value",input:i,key:o,value:a};for(const u of c.issues)u.path?u.path.unshift(l):u.path=[l],(s=r.issues)==null||s.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 nn(this,"type",r,n);return r}}}function $p(e){let t;if(e)for(const r of e)t?t.push(...r.issues):t=r.issues;return t}function Tr(e,t){return{kind:"schema",type:"union",reference:Tr,expects:[...new Set(e.map(r=>r.expects))].join(" | ")||"never",async:!1,options:e,message:t,_run(r,n){let i,s,o;for(const a of this.options){const c=a._run({typed:!1,value:r.value},n);if(c.typed)if(c.issues)s?s.push(c):s=[c];else{i=c;break}else o?o.push(c):o=[c]}if(i)return i;if(s){if(s.length===1)return s[0];nn(this,"type",r,n,{issues:$p(s)}),r.typed=!0}else{if((o==null?void 0:o.length)===1)return o[0];nn(this,"type",r,n,{issues:$p(o)})}return r}}}function Is(){return{kind:"schema",type:"unknown",reference:Is,expects:"unknown",async:!1,_run(e){return e.typed=!0,e}}}function cr(e,t,r){const n=e._run({typed:!1,value:t},v8(r));if(n.issues)throw new S8(n.issues);return n.value}function Gt(...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 Os(e){const t=Object.entries(e).map(([r,n])=>Fe({[r]:n}));return Gt(Tr(t),gc(r=>({...r,$kind:Object.keys(r)[0]})))}const uo=Gt(At(),gc(e=>Dt(e)),oa(Wn)),sn=uo,Ps=At(),Gr=Gt(Tr([At(),Gt(ar(),ur())]),oa(e=>{try{return BigInt(e),BigInt(e)>=0&&BigInt(e)<=18446744073709551615n}catch{return!1}},"Invalid u64")),Ji=Fe({objectId:uo,version:Gr,digest:At()}),sr=Gt(Tr([Fe({GasCoin:yt(!0)}),Fe({Input:Gt(ar(),ur()),type:kr(yt("pure"))}),Fe({Input:Gt(ar(),ur()),type:kr(yt("object"))}),Fe({Result:Gt(ar(),ur())}),Fe({NestedResult:Xu([Gt(ar(),ur()),Gt(ar(),ur())])})]),gc(e=>({...e,$kind:Object.keys(e)[0]}))),_8=Fe({budget:Ut(Gr),price:Ut(Gr),owner:Ut(uo),payment:Ut(ht(Ji))}),Zu=Tr([yt("address"),yt("bool"),yt("u8"),yt("u16"),yt("u32"),yt("u64"),yt("u128"),yt("u256"),Fe({vector:aa(()=>Zu)}),Fe({datatype:Fe({package:At(),module:At(),type:At(),typeParameters:ht(aa(()=>Zu))})}),Fe({typeParameter:Gt(ar(),ur())})]),E8=Fe({ref:Ut(Tr([yt("&"),yt("&mut")])),body:Zu}),C8=Fe({package:sn,module:At(),function:At(),typeArguments:ht(At()),arguments:ht(sr),_argumentTypes:kr(Ut(ht(E8)))}),A8=Fe({name:At(),inputs:ca(At(),Tr([sr,ht(sr)])),data:ca(At(),Is())}),T8=Os({MoveCall:C8,TransferObjects:Fe({objects:ht(sr),address:sr}),SplitCoins:Fe({coin:sr,amounts:ht(sr)}),MergeCoins:Fe({destination:sr,sources:ht(sr)}),Publish:Fe({modules:ht(Ps),dependencies:ht(sn)}),MakeMoveVec:Fe({type:Ut(At()),elements:ht(sr)}),Upgrade:Fe({modules:ht(Ps),dependencies:ht(sn),package:sn,ticket:sr}),$Intent:A8}),Vp=Os({ImmOrOwnedObject:Ji,SharedObject:Fe({objectId:sn,initialSharedVersion:Gr,mutable:bc()}),Receiving:Ji}),M8=Os({Object:Vp,Pure:Fe({bytes:Ps}),UnresolvedPure:Fe({value:Is()}),UnresolvedObject:Fe({objectId:sn,version:kr(Ut(Gr)),digest:kr(Ut(At())),initialSharedVersion:kr(Ut(Gr))})}),zp=Os({Object:Vp,Pure:Fe({bytes:Ps})}),qp=Os({None:yt(!0),Epoch:Gr}),yc=Fe({version:yt(2),sender:lo(uo),expiration:lo(qp),gasData:_8,inputs:ht(M8),commands:ht(T8)}),Kn={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(sr,r)),address:cr(sr,t)}}},SplitCoins(e,t){return{$kind:"SplitCoins",SplitCoins:{coin:cr(sr,e),amounts:t.map(r=>cr(sr,r))}}},MergeCoins(e,t){return{$kind:"MergeCoins",MergeCoins:{destination:cr(sr,e),sources:t.map(r=>cr(sr,r))}}},Publish({modules:e,dependencies:t}){return{$kind:"Publish",Publish:{modules:e.map(r=>typeof r=="string"?r:wr(new Uint8Array(r))),dependencies:t.map(r=>rn(r))}}},Upgrade({modules:e,dependencies:t,package:r,ticket:n}){return{$kind:"Upgrade",Upgrade:{modules:e.map(i=>typeof i=="string"?i:wr(new Uint8Array(i))),dependencies:t.map(i=>rn(i)),package:r,ticket:cr(sr,n)}}},MakeMoveVec({type:e,elements:t}){return{$kind:"MakeMoveVec",MakeMoveVec:{type:e??null,elements:t.map(r=>cr(sr,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(s=>cr(sr,s)):cr(sr,i)])),data:r}}}},Qu=Fe({digest:At(),objectId:At(),version:Tr([Gt(ar(),ur()),At(),vc()])}),I8=Os({ImmOrOwned:Qu,Shared:Fe({objectId:sn,initialSharedVersion:Gr,mutable:bc()}),Receiving:Qu}),Hp=Os({Object:I8,Pure:ht(Gt(ar(),ur()))}),Wp=Tr([Fe({kind:yt("Input"),index:Gt(ar(),ur()),value:Is(),type:kr(yt("object"))}),Fe({kind:yt("Input"),index:Gt(ar(),ur()),value:Is(),type:yt("pure")})]),O8=Tr([Fe({Epoch:Gt(ar(),ur())}),Fe({None:Ut(yt(!0))})]),Gp=Gt(Tr([ar(),At(),vc()]),oa(e=>{if(!["string","number","bigint"].includes(typeof e))return!1;try{return BigInt(e),!0}catch{return!1}})),ed=Tr([Fe({bool:Ut(yt(!0))}),Fe({u8:Ut(yt(!0))}),Fe({u64:Ut(yt(!0))}),Fe({u128:Ut(yt(!0))}),Fe({address:Ut(yt(!0))}),Fe({signer:Ut(yt(!0))}),Fe({vector:aa(()=>ed)}),Fe({struct:aa(()=>P8)}),Fe({u16:Ut(yt(!0))}),Fe({u32:Ut(yt(!0))}),Fe({u256:Ut(yt(!0))})]),P8=Fe({address:At(),module:At(),name:At(),typeParams:ht(ed)}),R8=Fe({budget:kr(Gp),price:kr(Gp),payment:kr(ht(Qu)),owner:kr(At())}),j8=[Wp,Fe({kind:yt("GasCoin")}),Fe({kind:yt("Result"),index:Gt(ar(),ur())}),Fe({kind:yt("NestedResult"),index:Gt(ar(),ur()),resultIndex:Gt(ar(),ur())})],xi=Tr([...j8]),N8=Fe({kind:yt("MoveCall"),target:Gt(At(),oa(e=>e.split("::").length===3)),typeArguments:ht(At()),arguments:ht(xi)}),k8=Fe({kind:yt("TransferObjects"),objects:ht(xi),address:xi}),D8=Fe({kind:yt("SplitCoins"),coin:xi,amounts:ht(xi)}),L8=Fe({kind:yt("MergeCoins"),destination:xi,sources:ht(xi)}),B8=Fe({kind:yt("MakeMoveVec"),type:Tr([Fe({Some:ed}),Fe({None:Ut(yt(!0))})]),objects:ht(xi)}),U8=Fe({kind:yt("Publish"),modules:ht(ht(Gt(ar(),ur()))),dependencies:ht(At())}),F8=Fe({kind:yt("Upgrade"),modules:ht(ht(Gt(ar(),ur()))),dependencies:ht(At()),packageId:At(),ticket:xi}),$8=Tr([...[N8,k8,D8,L8,U8,F8,B8]]);Fe({version:yt(1),sender:kr(At()),expiration:lo(O8),gasConfig:R8,inputs:ht(Wp),transactions:ht($8)});function Kp(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(yr(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:ia.parseFromStr(n.MakeMoveVec.type)},objects:n.MakeMoveVec.elements.map(i=>Si(i,t))};if(n.MergeCoins)return{kind:"MergeCoins",destination:Si(n.MergeCoins.destination,t),sources:n.MergeCoins.sources.map(i=>Si(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=>Si(i,t))};if(n.Publish)return{kind:"Publish",modules:n.Publish.modules.map(i=>Array.from(yr(i))),dependencies:n.Publish.dependencies};if(n.SplitCoins)return{kind:"SplitCoins",coin:Si(n.SplitCoins.coin,t),amounts:n.SplitCoins.amounts.map(i=>Si(i,t))};if(n.TransferObjects)return{kind:"TransferObjects",objects:n.TransferObjects.objects.map(i=>Si(i,t)),address:Si(n.TransferObjects.address,t)};if(n.Upgrade)return{kind:"Upgrade",modules:n.Upgrade.modules.map(i=>Array.from(yr(i))),dependencies:n.Upgrade.dependencies,packageId:n.Upgrade.package,ticket:Si(n.Upgrade.ticket,t)};throw new Error(`Unknown transaction ${Object.keys(n)}`)})}}function Si(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 V8(e){var t,r,n;return cr(yc,{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(Ju(Hp,i.value)){const s=cr(Hp,i.value);if(s.Object){if(s.Object.ImmOrOwned)return{Object:{ImmOrOwnedObject:{objectId:s.Object.ImmOrOwned.objectId,version:String(s.Object.ImmOrOwned.version),digest:s.Object.ImmOrOwned.digest}}};if(s.Object.Shared)return{Object:{SharedObject:{mutable:s.Object.Shared.mutable??null,initialSharedVersion:s.Object.Shared.initialSharedVersion,objectId:s.Object.Shared.objectId}}};if(s.Object.Receiving)return{Object:{Receiving:{digest:s.Object.Receiving.digest,version:String(s.Object.Receiving.version),objectId:s.Object.Receiving.objectId}}};throw new Error("Invalid object input")}return{Pure:{bytes:wr(new Uint8Array(s.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?ia.tagToString(i.type.Some):null,elements:i.objects.map(s=>_i(s))}};case"MergeCoins":return{MergeCoins:{destination:_i(i.destination),sources:i.sources.map(s=>_i(s))}};case"MoveCall":{const[s,o,a]=i.target.split("::");return{MoveCall:{package:s,module:o,function:a,typeArguments:i.typeArguments,arguments:i.arguments.map(c=>_i(c))}}}case"Publish":return{Publish:{modules:i.modules.map(s=>wr(Uint8Array.from(s))),dependencies:i.dependencies}};case"SplitCoins":return{SplitCoins:{coin:_i(i.coin),amounts:i.amounts.map(s=>_i(s))}};case"TransferObjects":return{TransferObjects:{objects:i.objects.map(s=>_i(s)),address:_i(i.address)}};case"Upgrade":return{Upgrade:{modules:i.modules.map(s=>wr(Uint8Array.from(s))),dependencies:i.dependencies,package:i.packageId,ticket:_i(i.ticket)}}}throw new Error(`Unknown transaction ${Object.keys(i)}`)})})}function _i(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 la(e){return Tr(Object.entries(e).map(([t,r])=>Fe({[t]:r})))}const Mn=la({GasCoin:yt(!0),Input:Gt(ar(),ur()),Result:Gt(ar(),ur()),NestedResult:Xu([Gt(ar(),ur()),Gt(ar(),ur())])}),z8=Fe({budget:Ut(Gr),price:Ut(Gr),owner:Ut(uo),payment:Ut(ht(Ji))}),q8=Fe({package:sn,module:At(),function:At(),typeArguments:ht(At()),arguments:ht(Mn)}),H8=Fe({name:At(),inputs:ca(At(),Tr([Mn,ht(Mn)])),data:ca(At(),Is())}),W8=la({MoveCall:q8,TransferObjects:Fe({objects:ht(Mn),address:Mn}),SplitCoins:Fe({coin:Mn,amounts:ht(Mn)}),MergeCoins:Fe({destination:Mn,sources:ht(Mn)}),Publish:Fe({modules:ht(Ps),dependencies:ht(sn)}),MakeMoveVec:Fe({type:Ut(At()),elements:ht(Mn)}),Upgrade:Fe({modules:ht(Ps),dependencies:ht(sn),package:sn,ticket:Mn}),$Intent:H8}),G8=la({ImmOrOwnedObject:Ji,SharedObject:Fe({objectId:sn,initialSharedVersion:Gr,mutable:bc()}),Receiving:Ji}),K8=la({Object:G8,Pure:Fe({bytes:Ps}),UnresolvedPure:Fe({value:Is()}),UnresolvedObject:Fe({objectId:sn,version:kr(Ut(Gr)),digest:kr(Ut(At())),initialSharedVersion:kr(Ut(Gr))})}),Y8=la({None:yt(!0),Epoch:Gr}),J8=Fe({version:yt(2),sender:lo(uo),expiration:lo(Y8),gasData:z8,inputs:ht(K8),commands:ht(W8)});function X8(e){return{$kind:"Pure",Pure:{bytes:e instanceof Uint8Array?wr(e):e.toBase64()}}}const In={Pure:X8,ObjectRef({objectId:e,digest:t,version:r}){return{$kind:"Object",Object:{$kind:"ImmOrOwnedObject",ImmOrOwnedObject:{digest:t,version:r,objectId:Dt(e)}}}},SharedObjectRef({objectId:e,mutable:t,initialSharedVersion:r}){return{$kind:"Object",Object:{$kind:"SharedObject",SharedObject:{mutable:t,initialSharedVersion:r,objectId:Dt(e)}}}},ReceivingRef({objectId:e,digest:t,version:r}){return{$kind:"Object",Object:{$kind:"Receiving",Receiving:{digest:t,version:r,objectId:Dt(e)}}}}},Yp="…";function Z8(e){if(e.length<=6)return e;const t=e.startsWith("0x")?2:0;return`0x${e.slice(t,t+4)}${Yp}${e.slice(-4)}`}function Q8(e){return`${e.slice(0,10)}${Yp}`}const e3=9,t3=BigInt(1e9),Jp="0x1",ua="0x2",r3="0x3",Xp=rn("0x6"),n3="sui_system",wc=`${ua}::sui::SUI`,i3=rn("0x5");/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function s3(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function td(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function rd(e,...t){if(!s3(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 Zp(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 o3(e,t){rd(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function xc(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function nd(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}const Qp=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function em(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Ei=Qp?e=>e:e=>em(e);function a3(e){for(let t=0;t<e.length;t++)e[t]=em(e[t]);return e}const fo=Qp?e=>e:a3;function c3(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function da(e){return typeof e=="string"&&(e=c3(e)),rd(e),e}let l3=class{};function u3(e){const t=(n,i)=>e(i).update(da(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}const d3=Uint8Array.from([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]),Sc=BigInt(2**32-1),tm=BigInt(32);function f3(e,t=!1){return t?{h:Number(e&Sc),l:Number(e>>tm&Sc)}:{h:Number(e>>tm&Sc)|0,l:Number(e&Sc)|0}}const rm=(e,t,r)=>e>>>r|t<<32-r,nm=(e,t,r)=>e<<32-r|t>>>r,h3=(e,t,r)=>e<<64-r|t>>>r-32,p3=(e,t,r)=>e>>>r-32|t<<64-r,m3=(e,t)=>t,g3=(e,t)=>e;function im(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}const sm=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),om=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,xr=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),$e=new Uint32Array(32);function Xi(e,t,r,n,i,s){const o=i[s],a=i[s+1];let c=$e[2*e],l=$e[2*e+1],u=$e[2*t],f=$e[2*t+1],p=$e[2*r],y=$e[2*r+1],x=$e[2*n],v=$e[2*n+1],_=sm(c,u,o);l=om(_,l,f,a),c=_|0,{Dh:v,Dl:x}={Dh:v^l,Dl:x^c},{Dh:v,Dl:x}={Dh:m3(v,x),Dl:g3(v)},{h:y,l:p}=im(y,p,v,x),{Bh:f,Bl:u}={Bh:f^y,Bl:u^p},{Bh:f,Bl:u}={Bh:rm(f,u,24),Bl:nm(f,u,24)},$e[2*e]=c,$e[2*e+1]=l,$e[2*t]=u,$e[2*t+1]=f,$e[2*r]=p,$e[2*r+1]=y,$e[2*n]=x,$e[2*n+1]=v}function Zi(e,t,r,n,i,s){const o=i[s],a=i[s+1];let c=$e[2*e],l=$e[2*e+1],u=$e[2*t],f=$e[2*t+1],p=$e[2*r],y=$e[2*r+1],x=$e[2*n],v=$e[2*n+1],_=sm(c,u,o);l=om(_,l,f,a),c=_|0,{Dh:v,Dl:x}={Dh:v^l,Dl:x^c},{Dh:v,Dl:x}={Dh:rm(v,x,16),Dl:nm(v,x,16)},{h:y,l:p}=im(y,p,v,x),{Bh:f,Bl:u}={Bh:f^y,Bl:u^p},{Bh:f,Bl:u}={Bh:h3(f,u,63),Bl:p3(f,u,63)},$e[2*e]=c,$e[2*e+1]=l,$e[2*t]=u,$e[2*t+1]=f,$e[2*r]=p,$e[2*r+1]=y,$e[2*n]=x,$e[2*n+1]=v}function v3(e,t={},r,n,i){if(td(r),e<0||e>r)throw new Error("outputLen bigger than keyLen");const{key:s,salt:o,personalization:a}=t;if(s!==void 0&&(s.length<1||s.length>r))throw new Error("key length must be undefined or 1.."+r);if(o!==void 0&&o.length!==n)throw new Error("salt must be undefined or "+n);if(a!==void 0&&a.length!==i)throw new Error("personalization must be undefined or "+i)}class b3 extends l3{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,td(t),td(r),this.blockLen=t,this.outputLen=r,this.buffer=new Uint8Array(t),this.buffer32=xc(this.buffer)}update(t){Zp(this),t=da(t),rd(t);const{blockLen:r,buffer:n,buffer32:i}=this,s=t.length,o=t.byteOffset,a=t.buffer;for(let c=0;c<s;){this.pos===r&&(fo(i),this.compress(i,0,!1),fo(i),this.pos=0);const l=Math.min(r-this.pos,s-c),u=o+c;if(l===r&&!(u%4)&&c+l<s){const f=new Uint32Array(a,u,Math.floor((s-c)/4));fo(f);for(let p=0;c+r<s;p+=i.length,c+=r)this.length+=r,this.compress(f,p,!1);fo(f);continue}n.set(t.subarray(c,c+l),this.pos),this.pos+=l,this.length+=l,c+=l}return this}digestInto(t){Zp(this),o3(t,this);const{pos:r,buffer32:n}=this;this.finished=!0,nd(this.buffer.subarray(r)),fo(n),this.compress(n,0,!0),fo(n);const i=xc(t);this.get().forEach((s,o)=>i[o]=Ei(s))}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:s,outputLen:o,pos:a}=this;return t||(t=new this.constructor({dkLen:o})),t.set(...this.get()),t.buffer.set(r),t.destroyed=s,t.finished=i,t.length=n,t.pos=a,t.outputLen=o,t}clone(){return this._cloneInto()}}class y3 extends b3{constructor(t={}){const r=t.dkLen===void 0?64:t.dkLen;super(128,r),this.v0l=xr[0]|0,this.v0h=xr[1]|0,this.v1l=xr[2]|0,this.v1h=xr[3]|0,this.v2l=xr[4]|0,this.v2h=xr[5]|0,this.v3l=xr[6]|0,this.v3h=xr[7]|0,this.v4l=xr[8]|0,this.v4h=xr[9]|0,this.v5l=xr[10]|0,this.v5h=xr[11]|0,this.v6l=xr[12]|0,this.v6h=xr[13]|0,this.v7l=xr[14]|0,this.v7h=xr[15]|0,v3(r,t,64,16,16);let{key:n,personalization:i,salt:s}=t,o=0;if(n!==void 0&&(n=da(n),o=n.length),this.v0l^=this.outputLen|o<<8|65536|1<<24,s!==void 0){s=da(s);const a=xc(s);this.v4l^=Ei(a[0]),this.v4h^=Ei(a[1]),this.v5l^=Ei(a[2]),this.v5h^=Ei(a[3])}if(i!==void 0){i=da(i);const a=xc(i);this.v6l^=Ei(a[0]),this.v6h^=Ei(a[1]),this.v7l^=Ei(a[2]),this.v7h^=Ei(a[3])}if(n!==void 0){const a=new Uint8Array(this.blockLen);a.set(n),this.update(a)}}get(){let{v0l:t,v0h:r,v1l:n,v1h:i,v2l:s,v2h:o,v3l:a,v3h:c,v4l:l,v4h:u,v5l:f,v5h:p,v6l:y,v6h:x,v7l:v,v7h:_}=this;return[t,r,n,i,s,o,a,c,l,u,f,p,y,x,v,_]}set(t,r,n,i,s,o,a,c,l,u,f,p,y,x,v,_){this.v0l=t|0,this.v0h=r|0,this.v1l=n|0,this.v1h=i|0,this.v2l=s|0,this.v2h=o|0,this.v3l=a|0,this.v3h=c|0,this.v4l=l|0,this.v4h=u|0,this.v5l=f|0,this.v5h=p|0,this.v6l=y|0,this.v6h=x|0,this.v7l=v|0,this.v7h=_|0}compress(t,r,n){this.get().forEach((c,l)=>$e[l]=c),$e.set(xr,16);let{h:i,l:s}=f3(BigInt(this.length));$e[24]=xr[8]^s,$e[25]=xr[9]^i,n&&($e[28]=~$e[28],$e[29]=~$e[29]);let o=0;const a=d3;for(let c=0;c<12;c++)Xi(0,4,8,12,t,r+2*a[o++]),Zi(0,4,8,12,t,r+2*a[o++]),Xi(1,5,9,13,t,r+2*a[o++]),Zi(1,5,9,13,t,r+2*a[o++]),Xi(2,6,10,14,t,r+2*a[o++]),Zi(2,6,10,14,t,r+2*a[o++]),Xi(3,7,11,15,t,r+2*a[o++]),Zi(3,7,11,15,t,r+2*a[o++]),Xi(0,5,10,15,t,r+2*a[o++]),Zi(0,5,10,15,t,r+2*a[o++]),Xi(1,6,11,12,t,r+2*a[o++]),Zi(1,6,11,12,t,r+2*a[o++]),Xi(2,7,8,13,t,r+2*a[o++]),Zi(2,7,8,13,t,r+2*a[o++]),Xi(3,4,9,14,t,r+2*a[o++]),Zi(3,4,9,14,t,r+2*a[o++]);this.v0l^=$e[0]^$e[16],this.v0h^=$e[1]^$e[17],this.v1l^=$e[2]^$e[18],this.v1h^=$e[3]^$e[19],this.v2l^=$e[4]^$e[20],this.v2h^=$e[5]^$e[21],this.v3l^=$e[6]^$e[22],this.v3h^=$e[7]^$e[23],this.v4l^=$e[8]^$e[24],this.v4h^=$e[9]^$e[25],this.v5l^=$e[10]^$e[26],this.v5h^=$e[11]^$e[27],this.v6l^=$e[12]^$e[28],this.v6h^=$e[13]^$e[29],this.v7l^=$e[14]^$e[30],this.v7h^=$e[15]^$e[31],nd($e)}destroy(){this.destroyed=!0,nd(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const am=u3(e=>new y3(e));function cm(e,t,r){const n=wt.Address.serialize(e).toBytes(),i=wt.TypeTag.serialize(t).toBytes(),s=wt.u64().serialize(r.length).toBytes(),o=am.create({dkLen:32});return o.update(new Uint8Array([240])),o.update(n),o.update(s),o.update(r),o.update(i),`0x${yi(o.digest().slice(0,32))}`}const w3=Object.freeze(Object.defineProperty({__proto__:null,MIST_PER_SUI:t3,MOVE_STDLIB_ADDRESS:Jp,SUI_ADDRESS_LENGTH:ta,SUI_CLOCK_OBJECT_ID:Xp,SUI_DECIMALS:e3,SUI_FRAMEWORK_ADDRESS:ua,SUI_SYSTEM_ADDRESS:r3,SUI_SYSTEM_MODULE_NAME:n3,SUI_SYSTEM_STATE_OBJECT_ID:i3,SUI_TYPE_ARG:wc,deriveDynamicFieldID:cm,formatAddress:Z8,formatDigest:Q8,fromB64:rp,fromBase58:bi,fromBase64:yr,fromHEX:ip,fromHex:oo,isValidNamedPackage:$u,isValidNamedType:q4,isValidSuiAddress:Wn,isValidSuiNSName:fp,isValidSuiObjectId:ra,isValidTransactionDigest:Vu,normalizeStructTag:na,normalizeSuiAddress:Dt,normalizeSuiNSName:hp,normalizeSuiObjectId:rn,parseStructTag:mc,toB64:tp,toBase58:Ts,toBase64:wr,toHEX:np,toHex:yi},Symbol.toStringTag,{value:"Module"})),x3="object",S3="ID",_3="ascii",E3="String",C3="string",A3="String",T3="option",M3="Option";function I3(e){const t=typeof e.body=="object"&&"datatype"in e.body?e.body.datatype:null;return!!t&&Dt(t.package)===Dt("0x2")&&t.module==="tx_context"&&t.type==="TxContext"}function id(e){if(typeof e=="string")switch(e){case"address":return wt.Address;case"bool":return wt.Bool;case"u8":return wt.U8;case"u16":return wt.U16;case"u32":return wt.U32;case"u64":return wt.U64;case"u128":return wt.U128;case"u256":return wt.U256;default:throw new Error(`Unknown type signature ${e}`)}if("vector"in e){if(e.vector==="u8")return wt.vector(wt.U8).transform({input:r=>typeof r=="string"?new TextEncoder().encode(r):r,output:r=>r});const t=id(e.vector);return t?wt.vector(t):null}if("datatype"in e){const t=Dt(e.datatype.package);if(t===Dt(Jp)){if(e.datatype.module===_3&&e.datatype.type===E3||e.datatype.module===C3&&e.datatype.type===A3)return wt.String;if(e.datatype.module===T3&&e.datatype.type===M3){const r=id(e.datatype.typeParameters[0]);return r?wt.vector(r):null}}if(t===Dt(ua)&&e.datatype.module===x3&&e.datatype.type===S3)return wt.Address}return null}function O3(e){return typeof e=="object"&&"Reference"in e?{ref:"&",body:fa(e.Reference)}:typeof e=="object"&&"MutableReference"in e?{ref:"&mut",body:fa(e.MutableReference)}:{ref:null,body:fa(e)}}function fa(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:fa(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(fa)}};if("TypeParameter"in e)return{typeParameter:e.TypeParameter};throw new Error(`Unexpected type ${JSON.stringify(e)}`)}const P3=50,R3=1000n,j3=5e10;async function N3(e,t,r){return await U3(e,t),await B3(e,t),t.onlyTransactionKind||(await k3(e,t),await D3(e,t),await L3(e,t)),await F3(e),await r()}async function k3(e,t){e.gasConfig.price||(e.gasConfig.price=String(await ha(t).getReferenceGasPrice()))}async function D3(e,t){if(e.gasConfig.budget)return;const r=await ha(t).dryRunTransactionBlock({transactionBlock:e.build({overrides:{gasData:{budget:String(j3),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=R3*BigInt(e.gasConfig.price||1n),i=BigInt(r.effects.gasUsed.computationCost)+n,s=i+BigInt(r.effects.gasUsed.storageCost)-BigInt(r.effects.gasUsed.storageRebate);e.gasConfig.budget=String(s>i?s:i)}async function L3(e,t){if(!e.gasConfig.payment){const n=(await ha(t).getCoins({owner:e.gasConfig.owner||e.sender,coinType:wc})).data.filter(i=>!e.inputs.find(o=>{var a;return(a=o.Object)!=null&&a.ImmOrOwnedObject?i.coinObjectId===o.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(Ji,i))}}async function B3(e,t){const r=e.inputs.filter(u=>{var f;return u.UnresolvedObject&&!(u.UnresolvedObject.version||(f=u.UnresolvedObject)!=null&&f.initialSharedVersion)}),n=[...new Set(r.map(u=>rn(u.UnresolvedObject.objectId)))],i=n.length?M4(n,P3):[],s=(await Promise.all(i.map(u=>ha(t).multiGetObjects({ids:u,options:{showOwner:!0}})))).flat(),o=new Map(n.map((u,f)=>[u,s[f]])),a=Array.from(o).filter(([u,f])=>f.error).map(([u,f])=>JSON.stringify(f.error));if(a.length)throw new Error(`The following input objects are invalid: ${a.join(", ")}`);const c=s.map(u=>{if(u.error||!u.data)throw new Error(`Failed to fetch object: ${u.error}`);const f=u.data.owner,p=f&&typeof f=="object"&&"Shared"in f?f.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,f)=>[u,c[f]]));for(const[u,f]of e.inputs.entries()){if(!f.UnresolvedObject)continue;let p;const y=Dt(f.UnresolvedObject.objectId),x=l.get(y);f.UnresolvedObject.initialSharedVersion??(x==null?void 0:x.initialSharedVersion)?p=In.SharedObjectRef({objectId:y,initialSharedVersion:f.UnresolvedObject.initialSharedVersion||(x==null?void 0:x.initialSharedVersion),mutable:$3(e,u)}):V3(e,u)&&(p=In.ReceivingRef({objectId:y,digest:f.UnresolvedObject.digest??(x==null?void 0:x.digest),version:f.UnresolvedObject.version??(x==null?void 0:x.version)})),e.inputs[e.inputs.indexOf(f)]=p??In.ObjectRef({objectId:y,digest:f.UnresolvedObject.digest??(x==null?void 0:x.digest),version:f.UnresolvedObject.version??(x==null?void 0:x.version)})}}async function U3(e,t){const{inputs:r,commands:n}=e,i=[],s=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}`;s.add(u),i.push(a.MoveCall)}}switch(a.$kind){case"SplitCoins":a.SplitCoins.amounts.forEach(c=>{lm(c,wt.U64,e)});break;case"TransferObjects":lm(a.TransferObjects.address,wt.Address,e);break}});const o=new Map;if(s.size>0){const a=ha(t);await Promise.all([...s].map(async c=>{const[l,u,f]=c.split("::"),p=await a.getNormalizedMoveFunction({package:l,module:u,function:f});o.set(c,p.parameters.map(y=>O3(y)))}))}i.length&&await Promise.all(i.map(async a=>{const c=o.get(`${a.package}::${a.module}::${a.function}`);if(!c)return;const u=c.length>0&&I3(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((f,p)=>{var O,R;const y=c.arguments[p];if(y.$kind!=="Input")return;const x=r[y.Input];if(!x.UnresolvedPure&&!x.UnresolvedObject)return;const v=((O=x.UnresolvedPure)==null?void 0:O.value)??((R=x.UnresolvedObject)==null?void 0:R.objectId),_=id(f.body);if(_){y.type="pure",r[r.indexOf(x)]=In.Pure(_.serialize(v));return}if(typeof v!="string")throw new Error(`Expect the argument to be an object id string, got ${JSON.stringify(v,null,2)}`);y.type="object";const T=x.UnresolvedPure?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:v}}:x;r[y.Input]=T})}})}function F3(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 lm(e,t,r){if(e.$kind!=="Input")return;const n=r.inputs[e.Input];n.$kind==="UnresolvedPure"&&(r.inputs[e.Input]=In.Pure(t.serialize(n.UnresolvedPure.value)))}function $3(e,t){let r=!1;return e.getInputUses(t,(n,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const s=i.MoveCall.arguments.indexOf(n);r=i.MoveCall._argumentTypes[s].ref!=="&"||r}(i.$kind==="MakeMoveVec"||i.$kind==="MergeCoins"||i.$kind==="SplitCoins")&&(r=!0)}),r}function V3(e,t){let r=!1;return e.getInputUses(t,(n,i)=>{if(i.MoveCall&&i.MoveCall._argumentTypes){const s=i.MoveCall.arguments.indexOf(n);r=z3(i.MoveCall._argumentTypes[s])||r}}),r}function z3(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 ha(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 q3(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 H3(e){function t(r,n){if(typeof r=="string")return e(sa(r).serialize(n));if(r instanceof Uint8Array||hc(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(wt.U8.serialize(r)),t.u16=r=>e(wt.U16.serialize(r)),t.u32=r=>e(wt.U32.serialize(r)),t.u64=r=>e(wt.U64.serialize(r)),t.u128=r=>e(wt.U128.serialize(r)),t.u256=r=>e(wt.U256.serialize(r)),t.bool=r=>e(wt.Bool.serialize(r)),t.string=r=>e(wt.String.serialize(r)),t.address=r=>e(wt.Address.serialize(r)),t.id=t.address,t.vector=(r,n)=>e(wt.vector(sa(r)).serialize(n)),t.option=(r,n)=>e(wt.option(sa(r)).serialize(n)),t}function W3(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),am(n,{dkLen:32})}function um(e){return Dt(e).replace("0x","")}class mn{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=wt.TransactionKind.parse(t).ProgrammableTransaction;if(!n)throw new Error("Unable to deserialize from bytes.");return mn.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=wt.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 mn.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 mn(cr(yc,t)):new mn(cr(yc,V8(t)))}static getDigestFromBytes(t){const r=W3("TransactionData",t);return Ts(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,s=this.commands,o={ProgrammableTransaction:{inputs:i,commands:s}};if(n)return wt.TransactionKind.serialize(o,{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:um(c),expiration:a||{None:!0},gasData:{payment:l.payment,owner:um(this.gasData.owner??c),price:BigInt(l.price),budget:BigInt(l.budget)},kind:{ProgrammableTransaction:{inputs:i,commands:s}}};return wt.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))}mapCommandArguments(t,r){const n=this.commands[t];switch(n.$kind){case"MoveCall":n.MoveCall.arguments=n.MoveCall.arguments.map(s=>r(s,n,t));break;case"TransferObjects":n.TransferObjects.objects=n.TransferObjects.objects.map(s=>r(s,n,t)),n.TransferObjects.address=r(n.TransferObjects.address,n,t);break;case"SplitCoins":n.SplitCoins.coin=r(n.SplitCoins.coin,n,t),n.SplitCoins.amounts=n.SplitCoins.amounts.map(s=>r(s,n,t));break;case"MergeCoins":n.MergeCoins.destination=r(n.MergeCoins.destination,n,t),n.MergeCoins.sources=n.MergeCoins.sources.map(s=>r(s,n,t));break;case"MakeMoveVec":n.MakeMoveVec.elements=n.MakeMoveVec.elements.map(s=>r(s,n,t));break;case"Upgrade":n.Upgrade.ticket=r(n.Upgrade.ticket,n,t);break;case"$Intent":const i=n.$Intent.inputs;n.$Intent.inputs={};for(const[s,o]of Object.entries(i))n.$Intent.inputs[s]=Array.isArray(o)?o.map(a=>r(a,n,t)):r(o,n,t);break;case"Publish":break;default:throw new Error(`Unexpected transaction kind: ${n.$kind}`)}}mapArguments(t){for(const r of this.commands.keys())this.mapCommandArguments(r,t)}replaceCommand(t,r,n=t){if(!Array.isArray(r)){this.commands[t]=r;return}const i=r.length-1;this.commands.splice(t,1,...r),i!==0&&this.mapArguments((s,o,a)=>{if(a<t+r.length)return s;switch(s.$kind){case"Result":s.Result===t&&(s.Result=n),s.Result>t&&(s.Result+=i);break;case"NestedResult":s.NestedResult[0]===t&&(s.NestedResult[0]=n),s.NestedResult[0]>t&&(s.NestedResult[0]+=i);break}return s})}getDigest(){const t=this.build({onlyTransactionKind:!1});return mn.getDigestFromBytes(t)}snapshot(){return cr(yc,this)}shallowClone(){return new mn({version:this.version,sender:this.sender,expiration:this.expiration,gasData:{...this.gasData},inputs:[...this.inputs],commands:[...this.commands]})}}function dm(e){if(typeof e=="string")return Dt(e);if(e.Object)return e.Object.ImmOrOwnedObject?Dt(e.Object.ImmOrOwnedObject.objectId):e.Object.Receiving?Dt(e.Object.Receiving.objectId):Dt(e.Object.SharedObject.objectId);if(e.UnresolvedObject)return Dt(e.UnresolvedObject.objectId)}var fm=e=>{throw TypeError(e)},sd=(e,t,r)=>t.has(e)||fm("Cannot "+r),Ue=(e,t,r)=>(sd(e,t,"read from private field"),r?r.call(e):t.get(e)),Yn=(e,t,r)=>t.has(e)?fm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),lr=(e,t,r,n)=>(sd(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Sr=(e,t,r)=>(sd(e,t,"access private method"),r),Rs,js,Ci,Jn,Xn,Ai,Zn,Qi,dt,pr,hm,_c,Ec,Cc,Ac,od,ad,pm,mm;function cd(e,t=1/0){const r={$kind:"Result",Result:e},n=[],i=s=>n[s]??(n[s]={$kind:"NestedResult",NestedResult:[e,s]});return new Proxy(r,{set(){throw new Error("The transaction result is a proxy, and does not support setting properties directly")},get(s,o){if(o in s)return Reflect.get(s,o);if(o===Symbol.iterator)return function*(){let c=0;for(;c<t;)yield i(c),c++};if(typeof o=="symbol")return;const a=parseInt(o,10);if(!(Number.isNaN(a)||a<0))return i(a)}})}const gm=Symbol.for("@mysten/transaction");function vm(e){return!!e&&typeof e=="object"&&e[gm]===!0}const bm={buildPlugins:new Map,serializationPlugins:new Map},ld=Symbol.for("@mysten/transaction/registry");function pa(){try{const e=globalThis;return e[ld]||(e[ld]=bm),e[ld]}catch{return bm}}const ym=class Eh{constructor(){Yn(this,pr),Yn(this,Rs),Yn(this,js),Yn(this,Ci,new Map),Yn(this,Jn,[]),Yn(this,Xn,[]),Yn(this,Ai,new Set),Yn(this,Zn,new Set),Yn(this,Qi,new Map),Yn(this,dt),this.object=q3(r=>{var s,o;if(typeof r=="function")return this.object(this.add(r));if(typeof r=="object"&&Ju(sr,r))return r;const n=dm(r),i=Ue(this,dt).inputs.find(a=>n===dm(a));return(s=i==null?void 0:i.Object)!=null&&s.SharedObject&&typeof r=="object"&&((o=r.Object)!=null&&o.SharedObject)&&(i.Object.SharedObject.mutable=i.Object.SharedObject.mutable||r.Object.SharedObject.mutable),i?{$kind:"Input",Input:Ue(this,dt).inputs.indexOf(i),type:"object"}:Sr(this,pr,Ec).call(this,"object",typeof r=="string"?{$kind:"UnresolvedObject",UnresolvedObject:{objectId:Dt(r)}}:r)});const t=pa();lr(this,dt,new mn),lr(this,js,[...t.buildPlugins.values()]),lr(this,Rs,[...t.serializationPlugins.values()])}static fromKind(t){const r=new Eh;return lr(r,dt,mn.fromKindBytes(typeof t=="string"?yr(t):t)),lr(r,Jn,Ue(r,dt).inputs),lr(r,Xn,Ue(r,dt).commands),r}static from(t){const r=new Eh;return vm(t)?lr(r,dt,new mn(t.getData())):typeof t!="string"||!t.startsWith("{")?lr(r,dt,mn.fromBytes(typeof t=="string"?yr(t):t)):lr(r,dt,mn.restore(JSON.parse(t))),lr(r,Jn,Ue(r,dt).inputs),lr(r,Xn,Ue(r,dt).commands),r}static registerGlobalSerializationPlugin(t,r){pa().serializationPlugins.set(t,r??t)}static unregisterGlobalSerializationPlugin(t){pa().serializationPlugins.delete(t)}static registerGlobalBuildPlugin(t,r){pa().buildPlugins.set(t,r??t)}static unregisterGlobalBuildPlugin(t){pa().buildPlugins.delete(t)}addSerializationPlugin(t){Ue(this,Rs).push(t)}addBuildPlugin(t){Ue(this,js).push(t)}addIntentResolver(t,r){if(Ue(this,Ci).has(t)&&Ue(this,Ci).get(t)!==r)throw new Error(`Intent resolver for ${t} already exists`);Ue(this,Ci).set(t,r)}setSender(t){Ue(this,dt).sender=t}setSenderIfNotSet(t){Ue(this,dt).sender||(Ue(this,dt).sender=t)}setExpiration(t){Ue(this,dt).expiration=t?cr(qp,t):null}setGasPrice(t){Ue(this,dt).gasConfig.price=String(t)}setGasBudget(t){Ue(this,dt).gasConfig.budget=String(t)}setGasBudgetIfNotSet(t){Ue(this,dt).gasData.budget==null&&(Ue(this,dt).gasConfig.budget=String(t))}setGasOwner(t){Ue(this,dt).gasConfig.owner=t}setGasPayment(t){Ue(this,dt).gasConfig.payment=t.map(r=>cr(Ji,r))}get blockData(){return Kp(Ue(this,dt).snapshot())}getData(){return Ue(this,dt).snapshot()}get[gm](){return!0}get pure(){return Object.defineProperty(this,"pure",{enumerable:!1,value:H3(t=>hc(t)?Sr(this,pr,Ec).call(this,"pure",{$kind:"Pure",Pure:{bytes:t.toBase64()}}):Sr(this,pr,Ec).call(this,"pure",Ju(zp,t)?cr(zp,t):t instanceof Uint8Array?In.Pure(t):{$kind:"UnresolvedPure",UnresolvedPure:{value:t}}))}),this.pure}get gas(){return{$kind:"GasCoin",GasCoin:!0}}objectRef(...t){return this.object(In.ObjectRef(...t))}receivingRef(...t){return this.object(In.ReceivingRef(...t))}sharedObjectRef(...t){return this.object(In.SharedObjectRef(...t))}add(t){if(typeof t=="function"){if(Ue(this,Qi).has(t))return Ue(this,Qi).get(t);const r=Sr(this,pr,hm).call(this),n=t(r);if(!(n&&typeof n=="object"&&"then"in n))return lr(this,Ai,Ue(r,Ai)),Ue(this,Qi).set(t,n),n;const i=Sr(this,pr,_c).call(this,{$kind:"$Intent",$Intent:{name:"AsyncTransactionThunk",inputs:{},data:{result:null}}});Ue(this,Zn).add(Promise.resolve(n).then(o=>{i.$Intent.data.result=o}));const s=cd(Ue(this,dt).commands.length-1);return Ue(this,Qi).set(t,s),s}else Sr(this,pr,_c).call(this,t);return cd(Ue(this,dt).commands.length-1)}splitCoins(t,r){const n=Kn.SplitCoins(typeof t=="string"?this.object(t):Sr(this,pr,Ac).call(this,t),r.map(i=>typeof i=="number"||typeof i=="bigint"||typeof i=="string"?this.pure.u64(i):Sr(this,pr,Cc).call(this,i)));return Sr(this,pr,_c).call(this,n),cd(Ue(this,dt).commands.length-1,r.length)}mergeCoins(t,r){return this.add(Kn.MergeCoins(this.object(t),r.map(n=>this.object(n))))}publish({modules:t,dependencies:r}){return this.add(Kn.Publish({modules:t,dependencies:r}))}upgrade({modules:t,dependencies:r,package:n,ticket:i}){return this.add(Kn.Upgrade({modules:t,dependencies:r,package:n,ticket:this.object(i)}))}moveCall({arguments:t,...r}){return this.add(Kn.MoveCall({...r,arguments:t==null?void 0:t.map(n=>Sr(this,pr,Cc).call(this,n))}))}transferObjects(t,r){return this.add(Kn.TransferObjects(t.map(n=>this.object(n)),typeof r=="string"?this.pure.address(r):Sr(this,pr,Cc).call(this,r)))}makeMoveVec({type:t,elements:r}){return this.add(Kn.MakeMoveVec({type:t,elements:r.map(n=>this.object(n))}))}serialize(){return JSON.stringify(Kp(Ue(this,dt).snapshot()))}async toJSON(t={}){return await this.prepareForSerialization(t),JSON.stringify(cr(J8,Ue(this,dt).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 Sr(this,pr,od).call(this,t),Ue(this,dt).build({onlyTransactionKind:t.onlyTransactionKind})}async getDigest(t={}){return await Sr(this,pr,od).call(this,t),Ue(this,dt).getDigest()}async prepareForSerialization(t){var i;await Sr(this,pr,pm).call(this),Sr(this,pr,mm).call(this);const r=new Set;for(const s of Ue(this,dt).commands)s.$Intent&&r.add(s.$Intent.name);const n=[...Ue(this,Rs)];for(const s of r)if(!((i=t.supportedIntents)!=null&&i.includes(s))){if(!Ue(this,Ci).has(s))throw new Error(`Missing intent resolver for ${s}`);n.push(Ue(this,Ci).get(s))}await Sr(this,pr,ad).call(this,n,t)}};Rs=new WeakMap,js=new WeakMap,Ci=new WeakMap,Jn=new WeakMap,Xn=new WeakMap,Ai=new WeakMap,Zn=new WeakMap,Qi=new WeakMap,dt=new WeakMap,pr=new WeakSet,hm=function(){const e=new ym;return lr(e,dt,Ue(this,dt)),lr(e,Rs,Ue(this,Rs)),lr(e,js,Ue(this,js)),lr(e,Ci,Ue(this,Ci)),lr(e,Zn,Ue(this,Zn)),lr(e,Ai,new Set(Ue(this,Ai))),lr(e,Qi,Ue(this,Qi)),Ue(this,Jn).push(Ue(e,Jn)),Ue(this,Xn).push(Ue(e,Xn)),e},_c=function(e){const t=Ue(this,dt).commands.length;return Ue(this,Xn).push(e),Ue(this,Ai).add(t),Ue(this,dt).commands.push(e),Ue(this,dt).mapCommandArguments(t,r=>{if(r.$kind==="Result"&&!Ue(this,Ai).has(r.Result))throw new Error(`Result { Result: ${r.Result} } is not available to use the current transaction`);if(r.$kind==="NestedResult"&&!Ue(this,Ai).has(r.NestedResult[0]))throw new Error(`Result { NestedResult: [${r.NestedResult[0]}, ${r.NestedResult[1]}] } is not available to use the current transaction`);if(r.$kind==="Input"&&r.Input>=Ue(this,dt).inputs.length)throw new Error(`Input { Input: ${r.Input} } references an input that does not exist in the current transaction`);return r}),e},Ec=function(e,t){return Ue(this,Jn).push(t),Ue(this,dt).addInput(e,t)},Cc=function(e){return hc(e)?this.pure(e):Sr(this,pr,Ac).call(this,e)},Ac=function(e){if(typeof e=="function"){const t=this.add(e);return typeof t=="function"?Sr(this,pr,Ac).call(this,t):cr(sr,t)}return cr(sr,e)},od=async function(e){if(!e.onlyTransactionKind&&!Ue(this,dt).sender)throw new Error("Missing transaction sender");await Sr(this,pr,ad).call(this,[...Ue(this,js),N3],e)},ad=async function(e,t){const r=n=>{if(n>=e.length)return()=>{};const i=e[n];return async()=>{const s=r(n+1);let o=!1,a=!1;if(await i(Ue(this,dt),t,async()=>{if(o)throw new Error(`next() was call multiple times in TransactionPlugin ${n}`);o=!0,await s(),a=!0}),!o)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)(),lr(this,Jn,Ue(this,dt).inputs),lr(this,Xn,Ue(this,dt).commands)},pm=async function(){for(;Ue(this,Zn).size>0;){const e=Promise.all(Ue(this,Zn));Ue(this,Zn).clear(),Ue(this,Zn).add(e),await e,Ue(this,Zn).delete(e)}},mm=function(){const e=Ue(this,dt).commands,t=Ue(this,dt).inputs,r=Ue(this,Xn).flat(1/0),n=Ue(this,Jn).flat(1/0);if(r.length!==e.length)throw new Error("Unexpected number of commands found in transaction data");if(n.length!==t.length)throw new Error("Unexpected number of inputs found in transaction data");const i=r.filter(o=>{var a;return((a=o.$Intent)==null?void 0:a.name)!=="AsyncTransactionThunk"});Ue(this,dt).commands=i,Ue(this,dt).inputs=n,lr(this,Xn,i),lr(this,Jn,n);function s(o){var l;const a=e[o];if(((l=a.$Intent)==null?void 0:l.name)==="AsyncTransactionThunk"){const u=a.$Intent.data.result;if(u==null)throw new Error("AsyncTransactionThunk has not been resolved");return s(u.Result)}const c=i.indexOf(a);if(c===-1)throw new Error("Unable to find original index for command");return c}Ue(this,dt).mapArguments(o=>{if(o.$kind==="Input"){const a=n.indexOf(t[o.Input]);if(a===-1)throw new Error("Input has not been resolved");return{...o,Input:a}}else if(o.$kind==="Result"){const a=s(o.Result);return{...o,Result:a}}else if(o.$kind==="NestedResult"){const a=s(o.NestedResult[0]);return{...o,NestedResult:[a,o.NestedResult[1]]}}return o})};let es=ym;class G3 extends lp{constructor(){super(...arguments),this.core=this}async getObject(t){const{objectId:r}=t,{objects:[n]}=await this.getObjects({objectIds:[r],signal:t.signal});if(n instanceof Error)throw n;return{object:n}}async getDynamicField(t){const r=cm(t.parentId,ia.parseFromStr(t.name.type),t.name.bcs),{objects:[n]}=await this.getObjects({objectIds:[r],signal:t.signal});if(n instanceof Error)throw n;const i=mc(n.type);return{dynamicField:{id:n.id,digest:n.digest,version:n.version,type:n.type,name:{type:typeof i.typeParams[0]=="string"?i.typeParams[0]:na(i.typeParams[0]),bcs:t.name.bcs},value:{type:typeof i.typeParams[1]=="string"?i.typeParams[1]:na(i.typeParams[1]),bcs:n.content.slice(ta+t.name.bcs.length)}}}}async waitForTransaction({signal:t,timeout:r=60*1e3,...n}){const i=t?AbortSignal.any([AbortSignal.timeout(r),t]):AbortSignal.timeout(r),s=new Promise((o,a)=>{i.addEventListener("abort",()=>a(i.reason))});for(s.catch(()=>{});;){i.throwIfAborted();try{return await this.getTransaction({...n,signal:i})}catch{await Promise.race([new Promise(a=>setTimeout(a,2e3)),s])}}}}class K3 extends Error{}class ts extends K3{constructor(t,r){super(r),this.code=t}static fromResponse(t,r){switch(t.code){case"notExists":return new ts(t.code,`Object ${t.object_id} does not exist`);case"dynamicFieldNotFound":return new ts(t.code,`Dynamic field not found for object ${t.parent_object_id}`);case"deleted":return new ts(t.code,`Object ${t.object_id} has been deleted`);case"displayError":return new ts(t.code,`Display error: ${t.error}`);case"unknown":default:return new ts(t.code,`Unknown error while loading object${r?` ${r}`:""}`)}}}function Y3({effects:e,epoch:t,objectTypes:r}){const n=wt.TransactionEffects.parse(e);switch(n.$kind){case"V1":return J3({bytes:e,effects:n.V1,epoch:t,objectTypes:r});case"V2":return X3({bytes:e,effects:n.V2,epoch:t,objectTypes:r});default:throw new Error(`Unknown transaction effects version: ${n.$kind}`)}}function J3(e){throw new Error("V1 effects are not supported yet")}function X3({bytes:e,effects:t,epoch:r,objectTypes:n}){const i=t.changedObjects.map(([s,o])=>{var a,c,l,u,f,p;return{id:s,inputState:o.inputState.$kind==="Exist"?"Exists":"DoesNotExist",inputVersion:((a=o.inputState.Exist)==null?void 0:a[0][0])??null,inputDigest:((c=o.inputState.Exist)==null?void 0:c[0][1])??null,inputOwner:((l=o.inputState.Exist)==null?void 0:l[1])??null,outputState:o.outputState.$kind==="NotExist"?"DoesNotExist":o.outputState.$kind,outputVersion:o.outputState.$kind==="PackageWrite"?(u=o.outputState.PackageWrite)==null?void 0:u[0]:o.outputState.ObjectWrite?t.lamportVersion:null,outputDigest:o.outputState.$kind==="PackageWrite"?(f=o.outputState.PackageWrite)==null?void 0:f[1]:((p=o.outputState.ObjectWrite)==null?void 0:p[0])??null,outputOwner:o.outputState.ObjectWrite?o.outputState.ObjectWrite[1]:null,idOperation:o.idOperation.$kind,objectType:n[s]??null}});return{bcs:e,digest:t.transactionDigest,version:2,status:t.status.$kind==="Success"?{success:!0,error:null}:{success:!1,error:t.status.Failed.error.$kind},epoch:r??null,gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:t.gasObjectIndex===null?null:i[t.gasObjectIndex]??null,eventsDigest:t.eventsDigest,dependencies:t.dependencies,lamportVersion:t.lamportVersion,changedObjects:i,unchangedSharedObjects:t.unchangedSharedObjects.map(([s,o])=>({kind:o.$kind,objectId:s,version:o.$kind==="ReadOnlyRoot"?o.ReadOnlyRoot[0]:o[o.$kind],digest:o.$kind==="ReadOnlyRoot"?o.ReadOnlyRoot[1]:null,objectType:n[s]??null})),auxiliaryDataDigest:t.auxDataDigest}}var wm=e=>{throw TypeError(e)},xm=(e,t,r)=>t.has(e)||wm("Cannot "+r),On=(e,t,r)=>(xm(e,t,"read from private field"),r?r.call(e):t.get(e)),Z3=(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),Q3=(e,t,r,n)=>(xm(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Kr;class ex extends G3{constructor(t){super({network:t.network}),Z3(this,Kr),Q3(this,Kr,t)}async getObjects(t){const r=g8(t.objectIds,50),n=[];for(const i of r){const s=await On(this,Kr).multiGetObjects({ids:i,options:{showOwner:!0,showType:!0,showBcs:!0},signal:t.signal});for(const[o,a]of s.entries())a.error?n.push(ts.fromResponse(a.error,i[o])):n.push(Sm(a.data))}return{objects:n}}async getOwnedObjects(t){const r=await On(this,Kr).getOwnedObjects({owner:t.address,limit:t.limit,cursor:t.cursor,options:{showOwner:!0,showType:!0,showBcs:!0},signal:t.signal});return{objects:r.data.map(n=>{if(n.error)throw ts.fromResponse(n.error);return Sm(n.data)}),hasNextPage:r.hasNextPage,cursor:r.nextCursor??null}}async getCoins(t){const r=await On(this,Kr).getCoins({owner:t.address,coinType:t.coinType,limit:t.limit,cursor:t.cursor,signal:t.signal});return{objects:r.data.map(n=>({id:n.coinObjectId,version:n.version,digest:n.digest,balance:n.balance,type:`0x2::coin::Coin<${n.coinType}>`,content:nx.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 On(this,Kr).getBalance({owner:t.address,coinType:t.coinType,signal:t.signal});return{balance:{coinType:r.coinType,balance:r.totalBalance}}}async getAllBalances(t){return{balances:(await On(this,Kr).getAllBalances({owner:t.address,signal:t.signal})).map(n=>({coinType:n.coinType,balance:n.totalBalance})),hasNextPage:!1,cursor:null}}async getTransaction(t){const r=await On(this,Kr).getTransactionBlock({digest:t.digest,options:{showRawInput:!0,showObjectChanges:!0,showRawEffects:!0,showEvents:!0},signal:t.signal});return{transaction:_m(r)}}async executeTransaction(t){const r=await On(this,Kr).executeTransactionBlock({transactionBlock:t.transaction,signature:t.signatures,options:{showRawEffects:!0,showEvents:!0,showObjectChanges:!0,showRawInput:!0},signal:t.signal});return{transaction:_m(r)}}async dryRunTransaction(t){const r=es.from(t.transaction),n=await On(this,Kr).dryRunTransactionBlock({transactionBlock:t.transaction,signal:t.signal});return{transaction:{digest:await r.getDigest(),effects:tx({effects:n.effects,objectChanges:n.objectChanges}),signatures:[],bcs:t.transaction}}}async getReferenceGasPrice(t){const r=await On(this,Kr).getReferenceGasPrice({signal:t==null?void 0:t.signal});return{referenceGasPrice:String(r)}}async getDynamicFields(t){const r=await On(this,Kr).getDynamicFields({parentId:t.parentId,limit:t.limit,cursor:t.cursor});return{dynamicFields:r.data.map(n=>({id:n.objectId,type:n.objectType,name:{type:n.name.type,bcs:yr(n.bcsName)}})),hasNextPage:r.hasNextPage,cursor:r.nextCursor}}async verifyZkLoginSignature(t){const r=await On(this,Kr).verifyZkLoginSignature({bytes:t.bytes,signature:t.signature,intentScope:t.intentScope,author:t.author});return{success:r.success,errors:r.errors}}}Kr=new WeakMap;function Sm(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"?yr(e.bcs.bcsBytes):new Uint8Array,owner:ho(e.owner)}}function ho(e){if(e==="Immutable")return{$kind:"Immutable",Immutable:!0};if("ConsensusV2"in e)return{$kind:"ConsensusV2",ConsensusV2:{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 _m(e){var n;const t=wt.SenderSignedData.parse(yr(e.rawTransaction))[0],r={};return(n=e.objectChanges)==null||n.forEach(i=>{i.type!=="published"&&(r[i.objectId]=i.objectType)}),{digest:e.digest,effects:Y3({effects:new Uint8Array(e.rawEffects),objectTypes:r}),bcs:wt.TransactionData.serialize(t.intentMessage.value).toBytes(),signatures:t.txSignatures}}function tx({bytes:e,effects:t,epoch:r,objectChanges:n}){var o;const i=[],s=[];return n==null||n.forEach(a=>{var c,l,u,f;switch(a.type){case"published":i.push({id:a.packageId,inputState:"DoesNotExist",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"PackageWrite",outputVersion:a.version,outputDigest:a.digest,outputOwner:null,idOperation:"Created",objectType:null});break;case"transferred":i.push({id:a.objectId,inputState:"Exists",inputVersion:a.version,inputDigest:a.digest,inputOwner:{$kind:"AddressOwner",AddressOwner:a.sender},outputState:"ObjectWrite",outputVersion:a.version,outputDigest:a.digest,outputOwner:ho(a.recipient),idOperation:"None",objectType:a.objectType});break;case"mutated":i.push({id:a.objectId,inputState:"Exists",inputVersion:a.previousVersion,inputDigest:null,inputOwner:ho(a.owner),outputState:"ObjectWrite",outputVersion:a.version,outputDigest:a.digest,outputOwner:ho(a.owner),idOperation:"None",objectType:a.objectType});break;case"deleted":i.push({id:a.objectId,inputState:"Exists",inputVersion:a.version,inputDigest:((l=(c=t.deleted)==null?void 0:c.find(p=>p.objectId===a.objectId))==null?void 0:l.digest)??null,inputOwner:null,outputState:"DoesNotExist",outputVersion:null,outputDigest:null,outputOwner:null,idOperation:"Deleted",objectType:a.objectType});break;case"wrapped":i.push({id:a.objectId,inputState:"Exists",inputVersion:a.version,inputDigest:null,inputOwner:{$kind:"AddressOwner",AddressOwner:a.sender},outputState:"ObjectWrite",outputVersion:a.version,outputDigest:((f=(u=t.wrapped)==null?void 0:u.find(p=>p.objectId===a.objectId))==null?void 0:f.digest)??null,outputOwner:{$kind:"ObjectOwner",ObjectOwner:a.sender},idOperation:"None",objectType:a.objectType});break;case"created":i.push({id:a.objectId,inputState:"DoesNotExist",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"ObjectWrite",outputVersion:a.version,outputDigest:a.digest,outputOwner:ho(a.owner),idOperation:"Created",objectType:a.objectType});break}}),{bcs:e??null,digest:t.transactionDigest,version:2,status:t.status.status==="success"?{success:!0,error:null}:{success:!1,error:t.status.error},epoch:r??null,gasUsed:t.gasUsed,transactionDigest:t.transactionDigest,gasObject:{id:(o=t.gasObject)==null?void 0:o.reference.objectId,inputState:"Exists",inputVersion:null,inputDigest:null,inputOwner:null,outputState:"ObjectWrite",outputVersion:t.gasObject.reference.version,outputDigest:t.gasObject.reference.digest,outputOwner:ho(t.gasObject.owner),idOperation:"None",objectType:na("0x2::coin::Coin<0x2::sui::SUI>")},eventsDigest:t.eventsDigest??null,dependencies:t.dependencies??[],lamportVersion:t.gasObject.reference.version,changedObjects:i,unchangedSharedObjects:s,auxiliaryDataDigest:null}}const rx=wt.struct("Balance",{value:wt.u64()}),nx=wt.struct("Coin",{id:wt.Address,balance:rx}),ix=Symbol.for("@mysten/SuiClient");class Ns extends lp{constructor(t){super({network:t.network??"unknown"}),this.core=new ex(this),this.jsonRpc=this,this.transport=t.transport??new x4({url:t.url})}get[ix](){return!0}async getRpcApiVersion({signal:t}={}){return(await this.transport.request({method:"rpc.discover",params:[],signal:t})).info.version}async getCoins(t){if(!t.owner||!Wn(Dt(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],signal:t.signal})}async getAllCoins(t){if(!t.owner||!Wn(Dt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getAllCoins",params:[t.owner,t.cursor,t.limit],signal:t.signal})}async getBalance(t){if(!t.owner||!Wn(Dt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getBalance",params:[t.owner,t.coinType],signal:t.signal})}async getAllBalances(t){if(!t.owner||!Wn(Dt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getAllBalances",params:[t.owner],signal:t.signal})}async getCoinMetadata(t){return await this.transport.request({method:"suix_getCoinMetadata",params:[t.coinType],signal:t.signal})}async getTotalSupply(t){return await this.transport.request({method:"suix_getTotalSupply",params:[t.coinType],signal:t.signal})}async call(t,r,{signal:n}={}){return await this.transport.request({method:t,params:r,signal:n})}async getMoveFunctionArgTypes(t){return await this.transport.request({method:"sui_getMoveFunctionArgTypes",params:[t.package,t.module,t.function],signal:t.signal})}async getNormalizedMoveModulesByPackage(t){return await this.transport.request({method:"sui_getNormalizedMoveModulesByPackage",params:[t.package],signal:t.signal})}async getNormalizedMoveModule(t){return await this.transport.request({method:"sui_getNormalizedMoveModule",params:[t.package,t.module],signal:t.signal})}async getNormalizedMoveFunction(t){return await this.transport.request({method:"sui_getNormalizedMoveFunction",params:[t.package,t.module,t.function],signal:t.signal})}async getNormalizedMoveStruct(t){return await this.transport.request({method:"sui_getNormalizedMoveStruct",params:[t.package,t.module,t.struct],signal:t.signal})}async getOwnedObjects(t){if(!t.owner||!Wn(Dt(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],signal:t.signal})}async getObject(t){if(!t.id||!ra(rn(t.id)))throw new Error("Invalid Sui Object id");return await this.transport.request({method:"sui_getObject",params:[t.id,t.options],signal:t.signal})}async tryGetPastObject(t){return await this.transport.request({method:"sui_tryGetPastObject",params:[t.id,t.version,t.options],signal:t.signal})}async multiGetObjects(t){if(t.ids.forEach(n=>{if(!n||!ra(rn(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],signal:t.signal})}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"],signal:t.signal})}async getTransactionBlock(t){if(!Vu(t.digest))throw new Error("Invalid Transaction digest");return await this.transport.request({method:"sui_getTransactionBlock",params:[t.digest,t.options],signal:t.signal})}async multiGetTransactionBlocks(t){if(t.digests.forEach(n=>{if(!Vu(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],signal:t.signal})}async executeTransactionBlock({transactionBlock:t,signature:r,options:n,requestType:i,signal:s}){const o=await this.transport.request({method:"sui_executeTransactionBlock",params:[typeof t=="string"?t:wr(t),Array.isArray(r)?r:[r],n],signal:s});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:s,bytes:o}=await r.signTransaction(i);return this.executeTransactionBlock({transactionBlock:o,signature:s,...n})}async getTotalTransactionBlocks({signal:t}={}){const r=await this.transport.request({method:"sui_getTotalTransactionBlocks",params:[],signal:t});return BigInt(r)}async getReferenceGasPrice({signal:t}={}){const r=await this.transport.request({method:"suix_getReferenceGasPrice",params:[],signal:t});return BigInt(r)}async getStakes(t){if(!t.owner||!Wn(Dt(t.owner)))throw new Error("Invalid Sui address");return await this.transport.request({method:"suix_getStakes",params:[t.owner],signal:t.signal})}async getStakesByIds(t){return t.stakedSuiIds.forEach(r=>{if(!r||!ra(rn(r)))throw new Error(`Invalid Sui Stake id ${r}`)}),await this.transport.request({method:"suix_getStakesByIds",params:[t.stakedSuiIds],signal:t.signal})}async getLatestSuiSystemState({signal:t}={}){return await this.transport.request({method:"suix_getLatestSuiSystemState",params:[],signal:t})}async queryEvents(t){return await this.transport.request({method:"suix_queryEvents",params:[t.query,t.cursor,t.limit,(t.order||"descending")==="descending"],signal:t.signal})}async subscribeEvent(t){return this.transport.subscribe({method:"suix_subscribeEvent",unsubscribe:"suix_unsubscribeEvent",params:[t.filter],onMessage:t.onMessage,signal:t.signal})}async subscribeTransaction(t){return this.transport.subscribe({method:"suix_subscribeTransaction",unsubscribe:"suix_unsubscribeTransaction",params:[t.filter],onMessage:t.onMessage,signal:t.signal})}async devInspectTransactionBlock(t){var n,i;let r;if(vm(t.transactionBlock))t.transactionBlock.setSenderIfNotSet(t.sender),r=wr(await t.transactionBlock.build({client:this,onlyTransactionKind:!0}));else if(typeof t.transactionBlock=="string")r=t.transactionBlock;else if(t.transactionBlock instanceof Uint8Array)r=wr(t.transactionBlock);else throw new Error("Unknown transaction block format.");return(n=t.signal)==null||n.throwIfAborted(),await this.transport.request({method:"sui_devInspectTransactionBlock",params:[t.sender,r,(i=t.gasPrice)==null?void 0:i.toString(),t.epoch],signal:t.signal})}async dryRunTransactionBlock(t){return await this.transport.request({method:"sui_dryRunTransactionBlock",params:[typeof t.transactionBlock=="string"?t.transactionBlock:wr(t.transactionBlock)]})}async getDynamicFields(t){if(!t.parentId||!ra(rn(t.parentId)))throw new Error("Invalid Sui Object id");return await this.transport.request({method:"suix_getDynamicFields",params:[t.parentId,t.cursor,t.limit],signal:t.signal})}async getDynamicFieldObject(t){return await this.transport.request({method:"suix_getDynamicFieldObject",params:[t.parentId,t.name],signal:t.signal})}async getLatestCheckpointSequenceNumber({signal:t}={}){const r=await this.transport.request({method:"sui_getLatestCheckpointSequenceNumber",params:[],signal:t});return String(r)}async getCheckpoint(t){return await this.transport.request({method:"sui_getCheckpoint",params:[t.id],signal:t.signal})}async getCheckpoints(t){return await this.transport.request({method:"sui_getCheckpoints",params:[t.cursor,t==null?void 0:t.limit,t.descendingOrder],signal:t.signal})}async getCommitteeInfo(t){return await this.transport.request({method:"suix_getCommitteeInfo",params:[t==null?void 0:t.epoch],signal:t==null?void 0:t.signal})}async getNetworkMetrics({signal:t}={}){return await this.transport.request({method:"suix_getNetworkMetrics",params:[],signal:t})}async getAddressMetrics({signal:t}={}){return await this.transport.request({method:"suix_getLatestAddressMetrics",params:[],signal:t})}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],signal:t==null?void 0:t.signal})}async getAllEpochAddressMetrics(t){return await this.transport.request({method:"suix_getAllEpochAddressMetrics",params:[t==null?void 0:t.descendingOrder],signal:t==null?void 0:t.signal})}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],signal:t==null?void 0:t.signal})}async getMoveCallMetrics({signal:t}={}){return await this.transport.request({method:"suix_getMoveCallMetrics",params:[],signal:t})}async getCurrentEpoch({signal:t}={}){return await this.transport.request({method:"suix_getCurrentEpoch",params:[],signal:t})}async getValidatorsApy({signal:t}={}){return await this.transport.request({method:"suix_getValidatorsApy",params:[],signal:t})}async getChainIdentifier({signal:t}={}){const r=await this.getCheckpoint({id:"0",signal:t}),n=bi(r.digest);return yi(n.slice(0,4))}async resolveNameServiceAddress(t){return await this.transport.request({method:"suix_resolveNameServiceAddress",params:[t.name],signal:t.signal})}async resolveNameServiceNames({format:t="dot",...r}){const{nextCursor:n,hasNextPage:i,data:s}=await this.transport.request({method:"suix_resolveNameServiceNames",params:[r.address,r.cursor,r.limit],signal:r.signal});return{hasNextPage:i,nextCursor:n,data:s.map(o=>hp(o,t))}}async getProtocolConfig(t){return await this.transport.request({method:"sui_getProtocolConfig",params:[t==null?void 0:t.version],signal:t==null?void 0:t.signal})}async verifyZkLoginSignature(t){return await this.transport.request({method:"sui_verifyZkLoginSignature",params:[t.bytes,t.signature,t.intentScope,t.author],signal:t.signal})}async waitForTransaction({signal:t,timeout:r=60*1e3,pollInterval:n=2*1e3,...i}){const s=AbortSignal.timeout(r),o=new Promise((a,c)=>{s.addEventListener("abort",()=>c(s.reason))});for(o.catch(()=>{});!s.aborted;){t==null||t.throwIfAborted();try{return await this.getTransactionBlock(i)}catch{await Promise.race([new Promise(c=>setTimeout(c,n)),o])}}throw s.throwIfAborted(),new Error("Unexpected error while waiting for transaction block.")}experimental_asClientExtension(){return{name:"jsonRPC",register:()=>this}}}var ud={},Tc={},dd={},Mc={},fd={},Ic={};Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.Convert=void 0;class sx{static toPriceFeed(t){return hd(t,Mi("PriceFeed"))}static priceFeedToJson(t){return pd(t,Mi("PriceFeed"))}static toPrice(t){return hd(t,Mi("Price"))}static priceToJson(t){return pd(t,Mi("Price"))}static toPriceFeedMetadata(t){return hd(t,Mi("PriceFeedMetadata"))}static priceFeedMetadataToJson(t){return pd(t,Mi("PriceFeedMetadata"))}}Ic.Convert=sx;function Ti(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 ox(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 ax(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 po(e,t,r,n=""){function i(u,f){return typeof u==typeof f?f:Ti(u,f,n)}function s(u,f){const p=u.length;for(let y=0;y<p;y++){const x=u[y];try{return po(f,x,r)}catch{}}return Ti(u,f)}function o(u,f){return u.indexOf(f)!==-1?f:Ti(u,f)}function a(u,f){return Array.isArray(f)?f.map(p=>po(p,u,r)):Ti("array",f)}function c(u){if(u===null)return null;const f=new Date(u);return isNaN(f.valueOf())?Ti("Date",u):f}function l(u,f,p){if(p===null||typeof p!="object"||Array.isArray(p))return Ti("object",p);const y={};return Object.getOwnPropertyNames(u).forEach(x=>{const v=u[x],_=Object.prototype.hasOwnProperty.call(p,x)?p[x]:void 0;y[v.key]=po(_,v.typ,r,v.key)}),Object.getOwnPropertyNames(p).forEach(x=>{Object.prototype.hasOwnProperty.call(u,x)||(y[x]=po(p[x],f,r,x))}),y}if(t==="any")return e;if(t===null)return e===null?e:Ti(t,e);if(t===!1)return Ti(t,e);for(;typeof t=="object"&&t.ref!==void 0;)t=cx[t.ref];return Array.isArray(t)?o(t,e):typeof t=="object"?t.hasOwnProperty("unionMembers")?s(t.unionMembers,e):t.hasOwnProperty("arrayItems")?a(t.arrayItems,e):t.hasOwnProperty("props")?l(r(t),t.additional,e):Ti(t,e):t===Date&&typeof e!="number"?c(e):i(t,e)}function hd(e,t){return po(e,t,ox)}function pd(e,t){return po(e,t,ax)}function ks(...e){return{unionMembers:e}}function md(e,t){return{props:e,additional:t}}function Mi(e){return{ref:e}}const cx={PriceFeed:md([{json:"ema_price",js:"ema_price",typ:Mi("Price")},{json:"id",js:"id",typ:""},{json:"metadata",js:"metadata",typ:ks(void 0,Mi("PriceFeedMetadata"))},{json:"price",js:"price",typ:Mi("Price")},{json:"vaa",js:"vaa",typ:ks(void 0,"")}],"any"),Price:md([{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:md([{json:"attestation_time",js:"attestation_time",typ:ks(void 0,0)},{json:"emitter_chain",js:"emitter_chain",typ:0},{json:"prev_publish_time",js:"prev_publish_time",typ:ks(void 0,0)},{json:"price_service_receive_time",js:"price_service_receive_time",typ:ks(void 0,0)},{json:"sequence_number",js:"sequence_number",typ:ks(void 0,0)},{json:"slot",js:"slot",typ:ks(void 0,0)}],"any")};var ma={};(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},r={};r.byteLength=u,r.toByteArray=p,r.fromByteArray=v;for(var n=[],i=[],s=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=o.length;a<c;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63;function l(O){var R=O.length;if(R%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var F=O.indexOf("=");F===-1&&(F=R);var B=F===R?0:4-F%4;return[F,B]}function u(O){var R=l(O),F=R[0],B=R[1];return(F+B)*3/4-B}function f(O,R,F){return(R+F)*3/4-F}function p(O){var R,F=l(O),B=F[0],H=F[1],$=new s(f(O,B,H)),Z=0,ce=H>0?B-4:B,ne;for(ne=0;ne<ce;ne+=4)R=i[O.charCodeAt(ne)]<<18|i[O.charCodeAt(ne+1)]<<12|i[O.charCodeAt(ne+2)]<<6|i[O.charCodeAt(ne+3)],$[Z++]=R>>16&255,$[Z++]=R>>8&255,$[Z++]=R&255;return H===2&&(R=i[O.charCodeAt(ne)]<<2|i[O.charCodeAt(ne+1)]>>4,$[Z++]=R&255),H===1&&(R=i[O.charCodeAt(ne)]<<10|i[O.charCodeAt(ne+1)]<<4|i[O.charCodeAt(ne+2)]>>2,$[Z++]=R>>8&255,$[Z++]=R&255),$}function y(O){return n[O>>18&63]+n[O>>12&63]+n[O>>6&63]+n[O&63]}function x(O,R,F){for(var B,H=[],$=R;$<F;$+=3)B=(O[$]<<16&16711680)+(O[$+1]<<8&65280)+(O[$+2]&255),H.push(y(B));return H.join("")}function v(O){for(var R,F=O.length,B=F%3,H=[],$=16383,Z=0,ce=F-B;Z<ce;Z+=$)H.push(x(O,Z,Z+$>ce?ce:Z+$));return B===1?(R=O[F-1],H.push(n[R>>2]+n[R<<4&63]+"==")):B===2&&(R=(O[F-2]<<8)+O[F-1],H.push(n[R>>10]+n[R>>4&63]+n[R<<2&63]+"=")),H.join("")}var _={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */_.read=function(O,R,F,B,H){var $,Z,ce=H*8-B-1,ne=(1<<ce)-1,de=ne>>1,q=-7,N=F?H-1:0,h=F?-1:1,d=O[R+N];for(N+=h,$=d&(1<<-q)-1,d>>=-q,q+=ce;q>0;$=$*256+O[R+N],N+=h,q-=8);for(Z=$&(1<<-q)-1,$>>=-q,q+=B;q>0;Z=Z*256+O[R+N],N+=h,q-=8);if($===0)$=1-de;else{if($===ne)return Z?NaN:(d?-1:1)*(1/0);Z=Z+Math.pow(2,B),$=$-de}return(d?-1:1)*Z*Math.pow(2,$-B)},_.write=function(O,R,F,B,H,$){var Z,ce,ne,de=$*8-H-1,q=(1<<de)-1,N=q>>1,h=H===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=B?0:$-1,m=B?1:-1,S=R<0||R===0&&1/R<0?1:0;for(R=Math.abs(R),isNaN(R)||R===1/0?(ce=isNaN(R)?1:0,Z=q):(Z=Math.floor(Math.log(R)/Math.LN2),R*(ne=Math.pow(2,-Z))<1&&(Z--,ne*=2),Z+N>=1?R+=h/ne:R+=h*Math.pow(2,1-N),R*ne>=2&&(Z++,ne/=2),Z+N>=q?(ce=0,Z=q):Z+N>=1?(ce=(R*ne-1)*Math.pow(2,H),Z=Z+N):(ce=R*Math.pow(2,N-1)*Math.pow(2,H),Z=0));H>=8;O[F+d]=ce&255,d+=m,ce/=256,H-=8);for(Z=Z<<H|ce,de+=H;de>0;O[F+d]=Z&255,d+=m,Z/=256,de-=8);O[F+d-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(O){const R=r,F=_,B=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;O.Buffer=q,O.SlowBuffer=b,O.INSPECT_MAX_BYTES=50;const H=2147483647;O.kMaxLength=H;const{Uint8Array:$,ArrayBuffer:Z,SharedArrayBuffer:ce}=globalThis;q.TYPED_ARRAY_SUPPORT=ne(),!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 ne(){try{const D=new $(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,$.prototype),Object.setPrototypeOf(D,C),D.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 de(D){if(D>H)throw new RangeError('The value "'+D+'" is invalid for option "size"');const C=new $(D);return Object.setPrototypeOf(C,q.prototype),C}function q(D,C,A){if(typeof D=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(D)}return N(D,C,A)}q.poolSize=8192;function N(D,C,A){if(typeof D=="string")return S(D,C);if(Z.isView(D))return M(D);if(D==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof D);if(_t(D,Z)||D&&_t(D.buffer,Z)||typeof ce<"u"&&(_t(D,ce)||D&&_t(D.buffer,ce)))return j(D,C,A);if(typeof D=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const V=D.valueOf&&D.valueOf();if(V!=null&&V!==D)return q.from(V,C,A);const se=I(D);if(se)return se;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof D[Symbol.toPrimitive]=="function")return q.from(D[Symbol.toPrimitive]("string"),C,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof D)}q.from=function(D,C,A){return N(D,C,A)},Object.setPrototypeOf(q.prototype,$.prototype),Object.setPrototypeOf(q,$);function h(D){if(typeof D!="number")throw new TypeError('"size" argument must be of type number');if(D<0)throw new RangeError('The value "'+D+'" is invalid for option "size"')}function d(D,C,A){return h(D),D<=0?de(D):C!==void 0?typeof A=="string"?de(D).fill(C,A):de(D).fill(C):de(D)}q.alloc=function(D,C,A){return d(D,C,A)};function m(D){return h(D),de(D<0?0:g(D)|0)}q.allocUnsafe=function(D){return m(D)},q.allocUnsafeSlow=function(D){return m(D)};function S(D,C){if((typeof C!="string"||C==="")&&(C="utf8"),!q.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const A=k(D,C)|0;let V=de(A);const se=V.write(D,C);return se!==A&&(V=V.slice(0,se)),V}function E(D){const C=D.length<0?0:g(D.length)|0,A=de(C);for(let V=0;V<C;V+=1)A[V]=D[V]&255;return A}function M(D){if(_t(D,$)){const C=new $(D);return j(C.buffer,C.byteOffset,C.byteLength)}return E(D)}function j(D,C,A){if(C<0||D.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(D.byteLength<C+(A||0))throw new RangeError('"length" is outside of buffer bounds');let V;return C===void 0&&A===void 0?V=new $(D):A===void 0?V=new $(D,C):V=new $(D,C,A),Object.setPrototypeOf(V,q.prototype),V}function I(D){if(q.isBuffer(D)){const C=g(D.length)|0,A=de(C);return A.length===0||D.copy(A,0,0,C),A}if(D.length!==void 0)return typeof D.length!="number"||kt(D.length)?de(0):E(D);if(D.type==="Buffer"&&Array.isArray(D.data))return E(D.data)}function g(D){if(D>=H)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+H.toString(16)+" bytes");return D|0}function b(D){return+D!=D&&(D=0),q.alloc(+D)}q.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==q.prototype},q.compare=function(C,A){if(_t(C,$)&&(C=q.from(C,C.offset,C.byteLength)),_t(A,$)&&(A=q.from(A,A.offset,A.byteLength)),!q.isBuffer(C)||!q.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(C===A)return 0;let V=C.length,se=A.length;for(let me=0,be=Math.min(V,se);me<be;++me)if(C[me]!==A[me]){V=C[me],se=A[me];break}return V<se?-1:se<V?1:0},q.isEncoding=function(C){switch(String(C).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(C,A){if(!Array.isArray(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return q.alloc(0);let V;if(A===void 0)for(A=0,V=0;V<C.length;++V)A+=C[V].length;const se=q.allocUnsafe(A);let me=0;for(V=0;V<C.length;++V){let be=C[V];if(_t(be,$))me+be.length>se.length?(q.isBuffer(be)||(be=q.from(be)),be.copy(se,me)):$.prototype.set.call(se,be,me);else if(q.isBuffer(be))be.copy(se,me);else throw new TypeError('"list" argument must be an Array of Buffers');me+=be.length}return se};function k(D,C){if(q.isBuffer(D))return D.length;if(Z.isView(D)||_t(D,Z))return D.byteLength;if(typeof D!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof D);const A=D.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&A===0)return 0;let se=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Nt(D).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return Pt(D).length;default:if(se)return V?-1:Nt(D).length;C=(""+C).toLowerCase(),se=!0}}q.byteLength=k;function ve(D,C,A){let V=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,C>>>=0,A<=C))return"";for(D||(D="utf8");;)switch(D){case"hex":return oe(this,C,A);case"utf8":case"utf-8":return Q(this,C,A);case"ascii":return K(this,C,A);case"latin1":case"binary":return te(this,C,A);case"base64":return ee(this,C,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,C,A);default:if(V)throw new TypeError("Unknown encoding: "+D);D=(D+"").toLowerCase(),V=!0}}q.prototype._isBuffer=!0;function he(D,C,A){const V=D[C];D[C]=D[A],D[A]=V}q.prototype.swap16=function(){const C=this.length;if(C%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;A<C;A+=2)he(this,A,A+1);return this},q.prototype.swap32=function(){const C=this.length;if(C%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<C;A+=4)he(this,A,A+3),he(this,A+1,A+2);return this},q.prototype.swap64=function(){const C=this.length;if(C%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let A=0;A<C;A+=8)he(this,A,A+7),he(this,A+1,A+6),he(this,A+2,A+5),he(this,A+3,A+4);return this},q.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?Q(this,0,C):ve.apply(this,arguments)},q.prototype.toLocaleString=q.prototype.toString,q.prototype.equals=function(C){if(!q.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C?!0:q.compare(this,C)===0},q.prototype.inspect=function(){let C="";const A=O.INSPECT_MAX_BYTES;return C=this.toString("hex",0,A).replace(/(.{2})/g,"$1 ").trim(),this.length>A&&(C+=" ... "),"<Buffer "+C+">"},B&&(q.prototype[B]=q.prototype.inspect),q.prototype.compare=function(C,A,V,se,me){if(_t(C,$)&&(C=q.from(C,C.offset,C.byteLength)),!q.isBuffer(C))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof C);if(A===void 0&&(A=0),V===void 0&&(V=C?C.length:0),se===void 0&&(se=0),me===void 0&&(me=this.length),A<0||V>C.length||se<0||me>this.length)throw new RangeError("out of range index");if(se>=me&&A>=V)return 0;if(se>=me)return-1;if(A>=V)return 1;if(A>>>=0,V>>>=0,se>>>=0,me>>>=0,this===C)return 0;let be=me-se,We=V-A;const ut=Math.min(be,We),qe=this.slice(se,me),J=C.slice(A,V);for(let ye=0;ye<ut;++ye)if(qe[ye]!==J[ye]){be=qe[ye],We=J[ye];break}return be<We?-1:We<be?1:0};function we(D,C,A,V,se){if(D.length===0)return-1;if(typeof A=="string"?(V=A,A=0):A>2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,kt(A)&&(A=se?0:D.length-1),A<0&&(A=D.length+A),A>=D.length){if(se)return-1;A=D.length-1}else if(A<0)if(se)A=0;else return-1;if(typeof C=="string"&&(C=q.from(C,V)),q.isBuffer(C))return C.length===0?-1:Oe(D,C,A,V,se);if(typeof C=="number")return C=C&255,typeof $.prototype.indexOf=="function"?se?$.prototype.indexOf.call(D,C,A):$.prototype.lastIndexOf.call(D,C,A):Oe(D,[C],A,V,se);throw new TypeError("val must be string, number or Buffer")}function Oe(D,C,A,V,se){let me=1,be=D.length,We=C.length;if(V!==void 0&&(V=String(V).toLowerCase(),V==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(D.length<2||C.length<2)return-1;me=2,be/=2,We/=2,A/=2}function ut(J,ye){return me===1?J[ye]:J.readUInt16BE(ye*me)}let qe;if(se){let J=-1;for(qe=A;qe<be;qe++)if(ut(D,qe)===ut(C,J===-1?0:qe-J)){if(J===-1&&(J=qe),qe-J+1===We)return J*me}else J!==-1&&(qe-=qe-J),J=-1}else for(A+We>be&&(A=be-We),qe=A;qe>=0;qe--){let J=!0;for(let ye=0;ye<We;ye++)if(ut(D,qe+ye)!==ut(C,ye)){J=!1;break}if(J)return qe}return-1}q.prototype.includes=function(C,A,V){return this.indexOf(C,A,V)!==-1},q.prototype.indexOf=function(C,A,V){return we(this,C,A,V,!0)},q.prototype.lastIndexOf=function(C,A,V){return we(this,C,A,V,!1)};function je(D,C,A,V){A=Number(A)||0;const se=D.length-A;V?(V=Number(V),V>se&&(V=se)):V=se;const me=C.length;V>me/2&&(V=me/2);let be;for(be=0;be<V;++be){const We=parseInt(C.substr(be*2,2),16);if(kt(We))return be;D[A+be]=We}return be}function L(D,C,A,V){return st(Nt(C,D.length-A),D,A,V)}function z(D,C,A,V){return st(ft(C),D,A,V)}function G(D,C,A,V){return st(Pt(C),D,A,V)}function re(D,C,A,V){return st(It(C,D.length-A),D,A,V)}q.prototype.write=function(C,A,V,se){if(A===void 0)se="utf8",V=this.length,A=0;else if(V===void 0&&typeof A=="string")se=A,V=this.length,A=0;else if(isFinite(A))A=A>>>0,isFinite(V)?(V=V>>>0,se===void 0&&(se="utf8")):(se=V,V=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const me=this.length-A;if((V===void 0||V>me)&&(V=me),C.length>0&&(V<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");se||(se="utf8");let be=!1;for(;;)switch(se){case"hex":return je(this,C,A,V);case"utf8":case"utf-8":return L(this,C,A,V);case"ascii":case"latin1":case"binary":return z(this,C,A,V);case"base64":return G(this,C,A,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,C,A,V);default:if(be)throw new TypeError("Unknown encoding: "+se);se=(""+se).toLowerCase(),be=!0}},q.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(D,C,A){return C===0&&A===D.length?R.fromByteArray(D):R.fromByteArray(D.slice(C,A))}function Q(D,C,A){A=Math.min(D.length,A);const V=[];let se=C;for(;se<A;){const me=D[se];let be=null,We=me>239?4:me>223?3:me>191?2:1;if(se+We<=A){let ut,qe,J,ye;switch(We){case 1:me<128&&(be=me);break;case 2:ut=D[se+1],(ut&192)===128&&(ye=(me&31)<<6|ut&63,ye>127&&(be=ye));break;case 3:ut=D[se+1],qe=D[se+2],(ut&192)===128&&(qe&192)===128&&(ye=(me&15)<<12|(ut&63)<<6|qe&63,ye>2047&&(ye<55296||ye>57343)&&(be=ye));break;case 4:ut=D[se+1],qe=D[se+2],J=D[se+3],(ut&192)===128&&(qe&192)===128&&(J&192)===128&&(ye=(me&15)<<18|(ut&63)<<12|(qe&63)<<6|J&63,ye>65535&&ye<1114112&&(be=ye))}}be===null?(be=65533,We=1):be>65535&&(be-=65536,V.push(be>>>10&1023|55296),be=56320|be&1023),V.push(be),se+=We}return W(V)}const fe=4096;function W(D){const C=D.length;if(C<=fe)return String.fromCharCode.apply(String,D);let A="",V=0;for(;V<C;)A+=String.fromCharCode.apply(String,D.slice(V,V+=fe));return A}function K(D,C,A){let V="";A=Math.min(D.length,A);for(let se=C;se<A;++se)V+=String.fromCharCode(D[se]&127);return V}function te(D,C,A){let V="";A=Math.min(D.length,A);for(let se=C;se<A;++se)V+=String.fromCharCode(D[se]);return V}function oe(D,C,A){const V=D.length;(!C||C<0)&&(C=0),(!A||A<0||A>V)&&(A=V);let se="";for(let me=C;me<A;++me)se+=pt[D[me]];return se}function pe(D,C,A){const V=D.slice(C,A);let se="";for(let me=0;me<V.length-1;me+=2)se+=String.fromCharCode(V[me]+V[me+1]*256);return se}q.prototype.slice=function(C,A){const V=this.length;C=~~C,A=A===void 0?V:~~A,C<0?(C+=V,C<0&&(C=0)):C>V&&(C=V),A<0?(A+=V,A<0&&(A=0)):A>V&&(A=V),A<C&&(A=C);const se=this.subarray(C,A);return Object.setPrototypeOf(se,q.prototype),se};function Se(D,C,A){if(D%1!==0||D<0)throw new RangeError("offset is not uint");if(D+C>A)throw new RangeError("Trying to access beyond buffer length")}q.prototype.readUintLE=q.prototype.readUIntLE=function(C,A,V){C=C>>>0,A=A>>>0,V||Se(C,A,this.length);let se=this[C],me=1,be=0;for(;++be<A&&(me*=256);)se+=this[C+be]*me;return se},q.prototype.readUintBE=q.prototype.readUIntBE=function(C,A,V){C=C>>>0,A=A>>>0,V||Se(C,A,this.length);let se=this[C+--A],me=1;for(;A>0&&(me*=256);)se+=this[C+--A]*me;return se},q.prototype.readUint8=q.prototype.readUInt8=function(C,A){return C=C>>>0,A||Se(C,1,this.length),this[C]},q.prototype.readUint16LE=q.prototype.readUInt16LE=function(C,A){return C=C>>>0,A||Se(C,2,this.length),this[C]|this[C+1]<<8},q.prototype.readUint16BE=q.prototype.readUInt16BE=function(C,A){return C=C>>>0,A||Se(C,2,this.length),this[C]<<8|this[C+1]},q.prototype.readUint32LE=q.prototype.readUInt32LE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+this[C+3]*16777216},q.prototype.readUint32BE=q.prototype.readUInt32BE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},q.prototype.readBigUInt64LE=Ot(function(C){C=C>>>0,St(C,"offset");const A=this[C],V=this[C+7];(A===void 0||V===void 0)&&vt(C,this.length-8);const se=A+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,me=this[++C]+this[++C]*2**8+this[++C]*2**16+V*2**24;return BigInt(se)+(BigInt(me)<<BigInt(32))}),q.prototype.readBigUInt64BE=Ot(function(C){C=C>>>0,St(C,"offset");const A=this[C],V=this[C+7];(A===void 0||V===void 0)&&vt(C,this.length-8);const se=A*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],me=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+V;return(BigInt(se)<<BigInt(32))+BigInt(me)}),q.prototype.readIntLE=function(C,A,V){C=C>>>0,A=A>>>0,V||Se(C,A,this.length);let se=this[C],me=1,be=0;for(;++be<A&&(me*=256);)se+=this[C+be]*me;return me*=128,se>=me&&(se-=Math.pow(2,8*A)),se},q.prototype.readIntBE=function(C,A,V){C=C>>>0,A=A>>>0,V||Se(C,A,this.length);let se=A,me=1,be=this[C+--se];for(;se>0&&(me*=256);)be+=this[C+--se]*me;return me*=128,be>=me&&(be-=Math.pow(2,8*A)),be},q.prototype.readInt8=function(C,A){return C=C>>>0,A||Se(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},q.prototype.readInt16LE=function(C,A){C=C>>>0,A||Se(C,2,this.length);const V=this[C]|this[C+1]<<8;return V&32768?V|4294901760:V},q.prototype.readInt16BE=function(C,A){C=C>>>0,A||Se(C,2,this.length);const V=this[C+1]|this[C]<<8;return V&32768?V|4294901760:V},q.prototype.readInt32LE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},q.prototype.readInt32BE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},q.prototype.readBigInt64LE=Ot(function(C){C=C>>>0,St(C,"offset");const A=this[C],V=this[C+7];(A===void 0||V===void 0)&&vt(C,this.length-8);const se=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(V<<24);return(BigInt(se)<<BigInt(32))+BigInt(A+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),q.prototype.readBigInt64BE=Ot(function(C){C=C>>>0,St(C,"offset");const A=this[C],V=this[C+7];(A===void 0||V===void 0)&&vt(C,this.length-8);const se=(A<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(se)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+V)}),q.prototype.readFloatLE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),F.read(this,C,!0,23,4)},q.prototype.readFloatBE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),F.read(this,C,!1,23,4)},q.prototype.readDoubleLE=function(C,A){return C=C>>>0,A||Se(C,8,this.length),F.read(this,C,!0,52,8)},q.prototype.readDoubleBE=function(C,A){return C=C>>>0,A||Se(C,8,this.length),F.read(this,C,!1,52,8)};function _e(D,C,A,V,se,me){if(!q.isBuffer(D))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>se||C<me)throw new RangeError('"value" argument is out of bounds');if(A+V>D.length)throw new RangeError("Index out of range")}q.prototype.writeUintLE=q.prototype.writeUIntLE=function(C,A,V,se){if(C=+C,A=A>>>0,V=V>>>0,!se){const We=Math.pow(2,8*V)-1;_e(this,C,A,V,We,0)}let me=1,be=0;for(this[A]=C&255;++be<V&&(me*=256);)this[A+be]=C/me&255;return A+V},q.prototype.writeUintBE=q.prototype.writeUIntBE=function(C,A,V,se){if(C=+C,A=A>>>0,V=V>>>0,!se){const We=Math.pow(2,8*V)-1;_e(this,C,A,V,We,0)}let me=V-1,be=1;for(this[A+me]=C&255;--me>=0&&(be*=256);)this[A+me]=C/be&255;return A+V},q.prototype.writeUint8=q.prototype.writeUInt8=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,1,255,0),this[A]=C&255,A+1},q.prototype.writeUint16LE=q.prototype.writeUInt16LE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,2,65535,0),this[A]=C&255,this[A+1]=C>>>8,A+2},q.prototype.writeUint16BE=q.prototype.writeUInt16BE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,2,65535,0),this[A]=C>>>8,this[A+1]=C&255,A+2},q.prototype.writeUint32LE=q.prototype.writeUInt32LE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,4,4294967295,0),this[A+3]=C>>>24,this[A+2]=C>>>16,this[A+1]=C>>>8,this[A]=C&255,A+4},q.prototype.writeUint32BE=q.prototype.writeUInt32BE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,4,4294967295,0),this[A]=C>>>24,this[A+1]=C>>>16,this[A+2]=C>>>8,this[A+3]=C&255,A+4};function Ne(D,C,A,V,se){Xe(C,V,se,D,A,7);let me=Number(C&BigInt(4294967295));D[A++]=me,me=me>>8,D[A++]=me,me=me>>8,D[A++]=me,me=me>>8,D[A++]=me;let be=Number(C>>BigInt(32)&BigInt(4294967295));return D[A++]=be,be=be>>8,D[A++]=be,be=be>>8,D[A++]=be,be=be>>8,D[A++]=be,A}function He(D,C,A,V,se){Xe(C,V,se,D,A,7);let me=Number(C&BigInt(4294967295));D[A+7]=me,me=me>>8,D[A+6]=me,me=me>>8,D[A+5]=me,me=me>>8,D[A+4]=me;let be=Number(C>>BigInt(32)&BigInt(4294967295));return D[A+3]=be,be=be>>8,D[A+2]=be,be=be>>8,D[A+1]=be,be=be>>8,D[A]=be,A+8}q.prototype.writeBigUInt64LE=Ot(function(C,A=0){return Ne(this,C,A,BigInt(0),BigInt("0xffffffffffffffff"))}),q.prototype.writeBigUInt64BE=Ot(function(C,A=0){return He(this,C,A,BigInt(0),BigInt("0xffffffffffffffff"))}),q.prototype.writeIntLE=function(C,A,V,se){if(C=+C,A=A>>>0,!se){const ut=Math.pow(2,8*V-1);_e(this,C,A,V,ut-1,-ut)}let me=0,be=1,We=0;for(this[A]=C&255;++me<V&&(be*=256);)C<0&&We===0&&this[A+me-1]!==0&&(We=1),this[A+me]=(C/be>>0)-We&255;return A+V},q.prototype.writeIntBE=function(C,A,V,se){if(C=+C,A=A>>>0,!se){const ut=Math.pow(2,8*V-1);_e(this,C,A,V,ut-1,-ut)}let me=V-1,be=1,We=0;for(this[A+me]=C&255;--me>=0&&(be*=256);)C<0&&We===0&&this[A+me+1]!==0&&(We=1),this[A+me]=(C/be>>0)-We&255;return A+V},q.prototype.writeInt8=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,1,127,-128),C<0&&(C=255+C+1),this[A]=C&255,A+1},q.prototype.writeInt16LE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,2,32767,-32768),this[A]=C&255,this[A+1]=C>>>8,A+2},q.prototype.writeInt16BE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,2,32767,-32768),this[A]=C>>>8,this[A+1]=C&255,A+2},q.prototype.writeInt32LE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,4,2147483647,-2147483648),this[A]=C&255,this[A+1]=C>>>8,this[A+2]=C>>>16,this[A+3]=C>>>24,A+4},q.prototype.writeInt32BE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),this[A]=C>>>24,this[A+1]=C>>>16,this[A+2]=C>>>8,this[A+3]=C&255,A+4},q.prototype.writeBigInt64LE=Ot(function(C,A=0){return Ne(this,C,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),q.prototype.writeBigInt64BE=Ot(function(C,A=0){return He(this,C,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ge(D,C,A,V,se,me){if(A+V>D.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function Re(D,C,A,V,se){return C=+C,A=A>>>0,se||Ge(D,C,A,4),F.write(D,C,A,V,23,4),A+4}q.prototype.writeFloatLE=function(C,A,V){return Re(this,C,A,!0,V)},q.prototype.writeFloatBE=function(C,A,V){return Re(this,C,A,!1,V)};function Ke(D,C,A,V,se){return C=+C,A=A>>>0,se||Ge(D,C,A,8),F.write(D,C,A,V,52,8),A+8}q.prototype.writeDoubleLE=function(C,A,V){return Ke(this,C,A,!0,V)},q.prototype.writeDoubleBE=function(C,A,V){return Ke(this,C,A,!1,V)},q.prototype.copy=function(C,A,V,se){if(!q.isBuffer(C))throw new TypeError("argument should be a Buffer");if(V||(V=0),!se&&se!==0&&(se=this.length),A>=C.length&&(A=C.length),A||(A=0),se>0&&se<V&&(se=V),se===V||C.length===0||this.length===0)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(V<0||V>=this.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("sourceEnd out of bounds");se>this.length&&(se=this.length),C.length-A<se-V&&(se=C.length-A+V);const me=se-V;return this===C&&typeof $.prototype.copyWithin=="function"?this.copyWithin(A,V,se):$.prototype.set.call(C,this.subarray(V,se),A),me},q.prototype.fill=function(C,A,V,se){if(typeof C=="string"){if(typeof A=="string"?(se=A,A=0,V=this.length):typeof V=="string"&&(se=V,V=this.length),se!==void 0&&typeof se!="string")throw new TypeError("encoding must be a string");if(typeof se=="string"&&!q.isEncoding(se))throw new TypeError("Unknown encoding: "+se);if(C.length===1){const be=C.charCodeAt(0);(se==="utf8"&&be<128||se==="latin1")&&(C=be)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(A<0||this.length<A||this.length<V)throw new RangeError("Out of range index");if(V<=A)return this;A=A>>>0,V=V===void 0?this.length:V>>>0,C||(C=0);let me;if(typeof C=="number")for(me=A;me<V;++me)this[me]=C;else{const be=q.isBuffer(C)?C:q.from(C,se),We=be.length;if(We===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for(me=0;me<V-A;++me)this[me+A]=be[me%We]}return this};const nt={};function Qe(D,C,A){nt[D]=class extends A{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${D}]`,this.stack,delete this.name}get code(){return D}set code(se){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:se,writable:!0})}toString(){return`${this.name} [${D}]: ${this.message}`}}}Qe("ERR_BUFFER_OUT_OF_BOUNDS",function(D){return D?`${D} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Qe("ERR_INVALID_ARG_TYPE",function(D,C){return`The "${D}" argument must be of type number. Received type ${typeof C}`},TypeError),Qe("ERR_OUT_OF_RANGE",function(D,C,A){let V=`The value of "${D}" is out of range.`,se=A;return Number.isInteger(A)&&Math.abs(A)>2**32?se=Mt(String(A)):typeof A=="bigint"&&(se=String(A),(A>BigInt(2)**BigInt(32)||A<-(BigInt(2)**BigInt(32)))&&(se=Mt(se)),se+="n"),V+=` It must be ${C}. Received ${se}`,V},RangeError);function Mt(D){let C="",A=D.length;const V=D[0]==="-"?1:0;for(;A>=V+4;A-=3)C=`_${D.slice(A-3,A)}${C}`;return`${D.slice(0,A)}${C}`}function jt(D,C,A){St(C,"offset"),(D[C]===void 0||D[C+A]===void 0)&&vt(C,D.length-(A+1))}function Xe(D,C,A,V,se,me){if(D>A||D<C){const be=typeof C=="bigint"?"n":"";let We;throw me>3?C===0||C===BigInt(0)?We=`>= 0${be} and < 2${be} ** ${(me+1)*8}${be}`:We=`>= -(2${be} ** ${(me+1)*8-1}${be}) and < 2 ** ${(me+1)*8-1}${be}`:We=`>= ${C}${be} and <= ${A}${be}`,new nt.ERR_OUT_OF_RANGE("value",We,D)}jt(V,se,me)}function St(D,C){if(typeof D!="number")throw new nt.ERR_INVALID_ARG_TYPE(C,"number",D)}function vt(D,C,A){throw Math.floor(D)!==D?(St(D,A),new nt.ERR_OUT_OF_RANGE(A||"offset","an integer",D)):C<0?new nt.ERR_BUFFER_OUT_OF_BOUNDS:new nt.ERR_OUT_OF_RANGE(A||"offset",`>= ${A?1:0} and <= ${C}`,D)}const Ye=/[^+/0-9A-Za-z-_]/g;function it(D){if(D=D.split("=")[0],D=D.trim().replace(Ye,""),D.length<2)return"";for(;D.length%4!==0;)D=D+"=";return D}function Nt(D,C){C=C||1/0;let A;const V=D.length;let se=null;const me=[];for(let be=0;be<V;++be){if(A=D.charCodeAt(be),A>55295&&A<57344){if(!se){if(A>56319){(C-=3)>-1&&me.push(239,191,189);continue}else if(be+1===V){(C-=3)>-1&&me.push(239,191,189);continue}se=A;continue}if(A<56320){(C-=3)>-1&&me.push(239,191,189),se=A;continue}A=(se-55296<<10|A-56320)+65536}else se&&(C-=3)>-1&&me.push(239,191,189);if(se=null,A<128){if((C-=1)<0)break;me.push(A)}else if(A<2048){if((C-=2)<0)break;me.push(A>>6|192,A&63|128)}else if(A<65536){if((C-=3)<0)break;me.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((C-=4)<0)break;me.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return me}function ft(D){const C=[];for(let A=0;A<D.length;++A)C.push(D.charCodeAt(A)&255);return C}function It(D,C){let A,V,se;const me=[];for(let be=0;be<D.length&&!((C-=2)<0);++be)A=D.charCodeAt(be),V=A>>8,se=A%256,me.push(se),me.push(V);return me}function Pt(D){return R.toByteArray(it(D))}function st(D,C,A,V){let se;for(se=0;se<V&&!(se+A>=C.length||se>=D.length);++se)C[se+A]=D[se];return se}function _t(D,C){return D instanceof C||D!=null&&D.constructor!=null&&D.constructor.name!=null&&D.constructor.name===C.name}function kt(D){return D!==D}const pt=function(){const D="0123456789abcdef",C=new Array(256);for(let A=0;A<16;++A){const V=A*16;for(let se=0;se<16;++se)C[V+se]=D[A]+D[se]}return C}();function Ot(D){return typeof BigInt>"u"?qt:D}function qt(){throw new Error("BigInt not supported")}})(t);const T=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=T,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode}(gd)),gd}var lx=Ic();const Oc=io(lx);var gn={},vd={exports:{}};vd.exports,function(e){(function(t,r){function n(N,h){if(!N)throw new Error(h||"Assertion failed")}function i(N,h){N.super_=h;var d=function(){};d.prototype=h.prototype,N.prototype=new d,N.prototype.constructor=N}function s(N,h,d){if(s.isBN(N))return N;this.negative=0,this.words=null,this.length=0,this.red=null,N!==null&&((h==="le"||h==="be")&&(d=h,h=10),this._init(N||0,h||10,d||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Ic().Buffer}catch{}s.isBN=function(h){return h instanceof s?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===s.wordSize&&Array.isArray(h.words)},s.max=function(h,d){return h.cmp(d)>0?h:d},s.min=function(h,d){return h.cmp(d)<0?h:d},s.prototype._init=function(h,d,m){if(typeof h=="number")return this._initNumber(h,d,m);if(typeof h=="object")return this._initArray(h,d,m);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),h=h.toString().replace(/\s+/g,"");var S=0;h[0]==="-"&&(S++,this.negative=1),S<h.length&&(d===16?this._parseHex(h,S,m):(this._parseBase(h,d,S),m==="le"&&this._initArray(this.toArray(),d,m)))},s.prototype._initNumber=function(h,d,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(),d,m)},s.prototype._initArray=function(h,d,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 E,M,j=0;if(m==="be")for(S=h.length-1,E=0;S>=0;S-=3)M=h[S]|h[S-1]<<8|h[S-2]<<16,this.words[E]|=M<<j&67108863,this.words[E+1]=M>>>26-j&67108863,j+=24,j>=26&&(j-=26,E++);else if(m==="le")for(S=0,E=0;S<h.length;S+=3)M=h[S]|h[S+1]<<8|h[S+2]<<16,this.words[E]|=M<<j&67108863,this.words[E+1]=M>>>26-j&67108863,j+=24,j>=26&&(j-=26,E++);return this._strip()};function a(N,h){var d=N.charCodeAt(h);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+N)}function c(N,h,d){var m=a(N,d);return d-1>=h&&(m|=a(N,d-1)<<4),m}s.prototype._parseHex=function(h,d,m){this.length=Math.ceil((h.length-d)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var E=0,M=0,j;if(m==="be")for(S=h.length-1;S>=d;S-=2)j=c(h,d,S)<<E,this.words[M]|=j&67108863,E>=18?(E-=18,M+=1,this.words[M]|=j>>>26):E+=8;else{var I=h.length-d;for(S=I%2===0?d+1:d;S<h.length;S+=2)j=c(h,d,S)<<E,this.words[M]|=j&67108863,E>=18?(E-=18,M+=1,this.words[M]|=j>>>26):E+=8}this._strip()};function l(N,h,d,m){for(var S=0,E=0,M=Math.min(N.length,d),j=h;j<M;j++){var I=N.charCodeAt(j)-48;S*=m,I>=49?E=I-49+10:I>=17?E=I-17+10:E=I,n(I>=0&&E<m,"Invalid character"),S+=E}return S}s.prototype._parseBase=function(h,d,m){this.words=[0],this.length=1;for(var S=0,E=1;E<=67108863;E*=d)S++;S--,E=E/d|0;for(var M=h.length-m,j=M%S,I=Math.min(M,M-j)+m,g=0,b=m;b<I;b+=S)g=l(h,b,b+S,d),this.imuln(E),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(j!==0){var k=1;for(g=l(h,b,h.length,d),b=0;b<j;b++)k*=d;this.imuln(k),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this._strip()},s.prototype.copy=function(h){h.words=new Array(this.length);for(var d=0;d<this.length;d++)h.words[d]=this.words[d];h.length=this.length,h.negative=this.negative,h.red=this.red};function u(N,h){N.words=h.words,N.length=h.length,N.negative=h.negative,N.red=h.red}if(s.prototype._move=function(h){u(h,this)},s.prototype.clone=function(){var h=new s(null);return this.copy(h),h},s.prototype._expand=function(h){for(;this.length<h;)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")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){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];s.prototype.toString=function(h,d){h=h||10,d=d|0||1;var m;if(h===16||h==="hex"){m="";for(var S=0,E=0,M=0;M<this.length;M++){var j=this.words[M],I=((j<<S|E)&16777215).toString(16);E=j>>>24-S&16777215,S+=2,S>=26&&(S-=26,M--),E!==0||M!==this.length-1?m=p[6-I.length]+I+m:m=I+m}for(E!==0&&(m=E.toString(16)+m);m.length%d!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(h===(h|0)&&h>=2&&h<=36){var g=y[h],b=x[h];m="";var k=this.clone();for(k.negative=0;!k.isZero();){var ve=k.modrn(b).toString(h);k=k.idivn(b),k.isZero()?m=ve+m:m=p[g-ve.length]+ve+m}for(this.isZero()&&(m="0"+m);m.length%d!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}n(!1,"Base should be between 2 and 36")},s.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},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(h,d){return this.toArrayLike(o,h,d)}),s.prototype.toArray=function(h,d){return this.toArrayLike(Array,h,d)};var v=function(h,d){return h.allocUnsafe?h.allocUnsafe(d):new h(d)};s.prototype.toArrayLike=function(h,d,m){this._strip();var S=this.byteLength(),E=m||Math.max(1,S);n(S<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var M=v(h,E),j=d==="le"?"LE":"BE";return this["_toArrayLike"+j](M,S),M},s.prototype._toArrayLikeLE=function(h,d){for(var m=0,S=0,E=0,M=0;E<this.length;E++){var j=this.words[E]<<M|S;h[m++]=j&255,m<h.length&&(h[m++]=j>>8&255),m<h.length&&(h[m++]=j>>16&255),M===6?(m<h.length&&(h[m++]=j>>24&255),S=0,M=0):(S=j>>>24,M+=2)}if(m<h.length)for(h[m++]=S;m<h.length;)h[m++]=0},s.prototype._toArrayLikeBE=function(h,d){for(var m=h.length-1,S=0,E=0,M=0;E<this.length;E++){var j=this.words[E]<<M|S;h[m--]=j&255,m>=0&&(h[m--]=j>>8&255),m>=0&&(h[m--]=j>>16&255),M===6?(m>=0&&(h[m--]=j>>24&255),S=0,M=0):(S=j>>>24,M+=2)}if(m>=0)for(h[m--]=S;m>=0;)h[m--]=0},Math.clz32?s.prototype._countBits=function(h){return 32-Math.clz32(h)}:s.prototype._countBits=function(h){var d=h,m=0;return d>=4096&&(m+=13,d>>>=13),d>=64&&(m+=7,d>>>=7),d>=8&&(m+=4,d>>>=4),d>=2&&(m+=2,d>>>=2),m+d},s.prototype._zeroBits=function(h){if(h===0)return 26;var d=h,m=0;return d&8191||(m+=13,d>>>=13),d&127||(m+=7,d>>>=7),d&15||(m+=4,d>>>=4),d&3||(m+=2,d>>>=2),d&1||m++,m},s.prototype.bitLength=function(){var h=this.words[this.length-1],d=this._countBits(h);return(this.length-1)*26+d};function _(N){for(var h=new Array(N.bitLength()),d=0;d<h.length;d++){var m=d/26|0,S=d%26;h[d]=N.words[m]>>>S&1}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,d=0;d<this.length;d++){var m=this._zeroBits(this.words[d]);if(h+=m,m!==26)break}return h},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},s.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).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(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var d=0;d<h.length;d++)this.words[d]=this.words[d]|h.words[d];return this._strip()},s.prototype.ior=function(h){return n((this.negative|h.negative)===0),this.iuor(h)},s.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},s.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},s.prototype.iuand=function(h){var d;this.length>h.length?d=h:d=this;for(var m=0;m<d.length;m++)this.words[m]=this.words[m]&h.words[m];return this.length=d.length,this._strip()},s.prototype.iand=function(h){return n((this.negative|h.negative)===0),this.iuand(h)},s.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},s.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},s.prototype.iuxor=function(h){var d,m;this.length>h.length?(d=this,m=h):(d=h,m=this);for(var S=0;S<m.length;S++)this.words[S]=d.words[S]^m.words[S];if(this!==d)for(;S<d.length;S++)this.words[S]=d.words[S];return this.length=d.length,this._strip()},s.prototype.ixor=function(h){return n((this.negative|h.negative)===0),this.iuxor(h)},s.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},s.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},s.prototype.inotn=function(h){n(typeof h=="number"&&h>=0);var d=Math.ceil(h/26)|0,m=h%26;this._expand(d),m>0&&d--;for(var S=0;S<d;S++)this.words[S]=~this.words[S]&67108863;return m>0&&(this.words[S]=~this.words[S]&67108863>>26-m),this._strip()},s.prototype.notn=function(h){return this.clone().inotn(h)},s.prototype.setn=function(h,d){n(typeof h=="number"&&h>=0);var m=h/26|0,S=h%26;return this._expand(m+1),d?this.words[m]=this.words[m]|1<<S:this.words[m]=this.words[m]&~(1<<S),this._strip()},s.prototype.iadd=function(h){var d;if(this.negative!==0&&h.negative===0)return this.negative=0,d=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,d=this.isub(h),h.negative=1,d._normSign();var m,S;this.length>h.length?(m=this,S=h):(m=h,S=this);for(var E=0,M=0;M<S.length;M++)d=(m.words[M]|0)+(S.words[M]|0)+E,this.words[M]=d&67108863,E=d>>>26;for(;E!==0&&M<m.length;M++)d=(m.words[M]|0)+E,this.words[M]=d&67108863,E=d>>>26;if(this.length=m.length,E!==0)this.words[this.length]=E,this.length++;else if(m!==this)for(;M<m.length;M++)this.words[M]=m.words[M];return this},s.prototype.add=function(h){var d;return h.negative!==0&&this.negative===0?(h.negative=0,d=this.sub(h),h.negative^=1,d):h.negative===0&&this.negative!==0?(this.negative=0,d=h.sub(this),this.negative=1,d):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},s.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var d=this.iadd(h);return h.negative=1,d._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,E;m>0?(S=this,E=h):(S=h,E=this);for(var M=0,j=0;j<E.length;j++)d=(S.words[j]|0)-(E.words[j]|0)+M,M=d>>26,this.words[j]=d&67108863;for(;M!==0&&j<S.length;j++)d=(S.words[j]|0)+M,M=d>>26,this.words[j]=d&67108863;if(M===0&&j<S.length&&S!==this)for(;j<S.length;j++)this.words[j]=S.words[j];return this.length=Math.max(this.length,j),S!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(h){return this.clone().isub(h)};function T(N,h,d){d.negative=h.negative^N.negative;var m=N.length+h.length|0;d.length=m,m=m-1|0;var S=N.words[0]|0,E=h.words[0]|0,M=S*E,j=M&67108863,I=M/67108864|0;d.words[0]=j;for(var g=1;g<m;g++){for(var b=I>>>26,k=I&67108863,ve=Math.min(g,h.length-1),he=Math.max(0,g-N.length+1);he<=ve;he++){var we=g-he|0;S=N.words[we]|0,E=h.words[he]|0,M=S*E+k,b+=M/67108864|0,k=M&67108863}d.words[g]=k|0,I=b|0}return I!==0?d.words[g]=I|0:d.length--,d._strip()}var O=function(h,d,m){var S=h.words,E=d.words,M=m.words,j=0,I,g,b,k=S[0]|0,ve=k&8191,he=k>>>13,we=S[1]|0,Oe=we&8191,je=we>>>13,L=S[2]|0,z=L&8191,G=L>>>13,re=S[3]|0,ee=re&8191,Q=re>>>13,fe=S[4]|0,W=fe&8191,K=fe>>>13,te=S[5]|0,oe=te&8191,pe=te>>>13,Se=S[6]|0,_e=Se&8191,Ne=Se>>>13,He=S[7]|0,Ge=He&8191,Re=He>>>13,Ke=S[8]|0,nt=Ke&8191,Qe=Ke>>>13,Mt=S[9]|0,jt=Mt&8191,Xe=Mt>>>13,St=E[0]|0,vt=St&8191,Ye=St>>>13,it=E[1]|0,Nt=it&8191,ft=it>>>13,It=E[2]|0,Pt=It&8191,st=It>>>13,_t=E[3]|0,kt=_t&8191,pt=_t>>>13,Ot=E[4]|0,qt=Ot&8191,D=Ot>>>13,C=E[5]|0,A=C&8191,V=C>>>13,se=E[6]|0,me=se&8191,be=se>>>13,We=E[7]|0,ut=We&8191,qe=We>>>13,J=E[8]|0,ye=J&8191,Ce=J>>>13,Ve=E[9]|0,et=Ve&8191,ze=Ve>>>13;m.negative=h.negative^d.negative,m.length=19,I=Math.imul(ve,vt),g=Math.imul(ve,Ye),g=g+Math.imul(he,vt)|0,b=Math.imul(he,Ye);var Je=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Je>>>26)|0,Je&=67108863,I=Math.imul(Oe,vt),g=Math.imul(Oe,Ye),g=g+Math.imul(je,vt)|0,b=Math.imul(je,Ye),I=I+Math.imul(ve,Nt)|0,g=g+Math.imul(ve,ft)|0,g=g+Math.imul(he,Nt)|0,b=b+Math.imul(he,ft)|0;var bt=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(bt>>>26)|0,bt&=67108863,I=Math.imul(z,vt),g=Math.imul(z,Ye),g=g+Math.imul(G,vt)|0,b=Math.imul(G,Ye),I=I+Math.imul(Oe,Nt)|0,g=g+Math.imul(Oe,ft)|0,g=g+Math.imul(je,Nt)|0,b=b+Math.imul(je,ft)|0,I=I+Math.imul(ve,Pt)|0,g=g+Math.imul(ve,st)|0,g=g+Math.imul(he,Pt)|0,b=b+Math.imul(he,st)|0;var rr=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(rr>>>26)|0,rr&=67108863,I=Math.imul(ee,vt),g=Math.imul(ee,Ye),g=g+Math.imul(Q,vt)|0,b=Math.imul(Q,Ye),I=I+Math.imul(z,Nt)|0,g=g+Math.imul(z,ft)|0,g=g+Math.imul(G,Nt)|0,b=b+Math.imul(G,ft)|0,I=I+Math.imul(Oe,Pt)|0,g=g+Math.imul(Oe,st)|0,g=g+Math.imul(je,Pt)|0,b=b+Math.imul(je,st)|0,I=I+Math.imul(ve,kt)|0,g=g+Math.imul(ve,pt)|0,g=g+Math.imul(he,kt)|0,b=b+Math.imul(he,pt)|0;var Bt=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,I=Math.imul(W,vt),g=Math.imul(W,Ye),g=g+Math.imul(K,vt)|0,b=Math.imul(K,Ye),I=I+Math.imul(ee,Nt)|0,g=g+Math.imul(ee,ft)|0,g=g+Math.imul(Q,Nt)|0,b=b+Math.imul(Q,ft)|0,I=I+Math.imul(z,Pt)|0,g=g+Math.imul(z,st)|0,g=g+Math.imul(G,Pt)|0,b=b+Math.imul(G,st)|0,I=I+Math.imul(Oe,kt)|0,g=g+Math.imul(Oe,pt)|0,g=g+Math.imul(je,kt)|0,b=b+Math.imul(je,pt)|0,I=I+Math.imul(ve,qt)|0,g=g+Math.imul(ve,D)|0,g=g+Math.imul(he,qt)|0,b=b+Math.imul(he,D)|0;var Vt=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,I=Math.imul(oe,vt),g=Math.imul(oe,Ye),g=g+Math.imul(pe,vt)|0,b=Math.imul(pe,Ye),I=I+Math.imul(W,Nt)|0,g=g+Math.imul(W,ft)|0,g=g+Math.imul(K,Nt)|0,b=b+Math.imul(K,ft)|0,I=I+Math.imul(ee,Pt)|0,g=g+Math.imul(ee,st)|0,g=g+Math.imul(Q,Pt)|0,b=b+Math.imul(Q,st)|0,I=I+Math.imul(z,kt)|0,g=g+Math.imul(z,pt)|0,g=g+Math.imul(G,kt)|0,b=b+Math.imul(G,pt)|0,I=I+Math.imul(Oe,qt)|0,g=g+Math.imul(Oe,D)|0,g=g+Math.imul(je,qt)|0,b=b+Math.imul(je,D)|0,I=I+Math.imul(ve,A)|0,g=g+Math.imul(ve,V)|0,g=g+Math.imul(he,A)|0,b=b+Math.imul(he,V)|0;var fr=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(fr>>>26)|0,fr&=67108863,I=Math.imul(_e,vt),g=Math.imul(_e,Ye),g=g+Math.imul(Ne,vt)|0,b=Math.imul(Ne,Ye),I=I+Math.imul(oe,Nt)|0,g=g+Math.imul(oe,ft)|0,g=g+Math.imul(pe,Nt)|0,b=b+Math.imul(pe,ft)|0,I=I+Math.imul(W,Pt)|0,g=g+Math.imul(W,st)|0,g=g+Math.imul(K,Pt)|0,b=b+Math.imul(K,st)|0,I=I+Math.imul(ee,kt)|0,g=g+Math.imul(ee,pt)|0,g=g+Math.imul(Q,kt)|0,b=b+Math.imul(Q,pt)|0,I=I+Math.imul(z,qt)|0,g=g+Math.imul(z,D)|0,g=g+Math.imul(G,qt)|0,b=b+Math.imul(G,D)|0,I=I+Math.imul(Oe,A)|0,g=g+Math.imul(Oe,V)|0,g=g+Math.imul(je,A)|0,b=b+Math.imul(je,V)|0,I=I+Math.imul(ve,me)|0,g=g+Math.imul(ve,be)|0,g=g+Math.imul(he,me)|0,b=b+Math.imul(he,be)|0;var Nr=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,I=Math.imul(Ge,vt),g=Math.imul(Ge,Ye),g=g+Math.imul(Re,vt)|0,b=Math.imul(Re,Ye),I=I+Math.imul(_e,Nt)|0,g=g+Math.imul(_e,ft)|0,g=g+Math.imul(Ne,Nt)|0,b=b+Math.imul(Ne,ft)|0,I=I+Math.imul(oe,Pt)|0,g=g+Math.imul(oe,st)|0,g=g+Math.imul(pe,Pt)|0,b=b+Math.imul(pe,st)|0,I=I+Math.imul(W,kt)|0,g=g+Math.imul(W,pt)|0,g=g+Math.imul(K,kt)|0,b=b+Math.imul(K,pt)|0,I=I+Math.imul(ee,qt)|0,g=g+Math.imul(ee,D)|0,g=g+Math.imul(Q,qt)|0,b=b+Math.imul(Q,D)|0,I=I+Math.imul(z,A)|0,g=g+Math.imul(z,V)|0,g=g+Math.imul(G,A)|0,b=b+Math.imul(G,V)|0,I=I+Math.imul(Oe,me)|0,g=g+Math.imul(Oe,be)|0,g=g+Math.imul(je,me)|0,b=b+Math.imul(je,be)|0,I=I+Math.imul(ve,ut)|0,g=g+Math.imul(ve,qe)|0,g=g+Math.imul(he,ut)|0,b=b+Math.imul(he,qe)|0;var mr=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(mr>>>26)|0,mr&=67108863,I=Math.imul(nt,vt),g=Math.imul(nt,Ye),g=g+Math.imul(Qe,vt)|0,b=Math.imul(Qe,Ye),I=I+Math.imul(Ge,Nt)|0,g=g+Math.imul(Ge,ft)|0,g=g+Math.imul(Re,Nt)|0,b=b+Math.imul(Re,ft)|0,I=I+Math.imul(_e,Pt)|0,g=g+Math.imul(_e,st)|0,g=g+Math.imul(Ne,Pt)|0,b=b+Math.imul(Ne,st)|0,I=I+Math.imul(oe,kt)|0,g=g+Math.imul(oe,pt)|0,g=g+Math.imul(pe,kt)|0,b=b+Math.imul(pe,pt)|0,I=I+Math.imul(W,qt)|0,g=g+Math.imul(W,D)|0,g=g+Math.imul(K,qt)|0,b=b+Math.imul(K,D)|0,I=I+Math.imul(ee,A)|0,g=g+Math.imul(ee,V)|0,g=g+Math.imul(Q,A)|0,b=b+Math.imul(Q,V)|0,I=I+Math.imul(z,me)|0,g=g+Math.imul(z,be)|0,g=g+Math.imul(G,me)|0,b=b+Math.imul(G,be)|0,I=I+Math.imul(Oe,ut)|0,g=g+Math.imul(Oe,qe)|0,g=g+Math.imul(je,ut)|0,b=b+Math.imul(je,qe)|0,I=I+Math.imul(ve,ye)|0,g=g+Math.imul(ve,Ce)|0,g=g+Math.imul(he,ye)|0,b=b+Math.imul(he,Ce)|0;var nr=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(nr>>>26)|0,nr&=67108863,I=Math.imul(jt,vt),g=Math.imul(jt,Ye),g=g+Math.imul(Xe,vt)|0,b=Math.imul(Xe,Ye),I=I+Math.imul(nt,Nt)|0,g=g+Math.imul(nt,ft)|0,g=g+Math.imul(Qe,Nt)|0,b=b+Math.imul(Qe,ft)|0,I=I+Math.imul(Ge,Pt)|0,g=g+Math.imul(Ge,st)|0,g=g+Math.imul(Re,Pt)|0,b=b+Math.imul(Re,st)|0,I=I+Math.imul(_e,kt)|0,g=g+Math.imul(_e,pt)|0,g=g+Math.imul(Ne,kt)|0,b=b+Math.imul(Ne,pt)|0,I=I+Math.imul(oe,qt)|0,g=g+Math.imul(oe,D)|0,g=g+Math.imul(pe,qt)|0,b=b+Math.imul(pe,D)|0,I=I+Math.imul(W,A)|0,g=g+Math.imul(W,V)|0,g=g+Math.imul(K,A)|0,b=b+Math.imul(K,V)|0,I=I+Math.imul(ee,me)|0,g=g+Math.imul(ee,be)|0,g=g+Math.imul(Q,me)|0,b=b+Math.imul(Q,be)|0,I=I+Math.imul(z,ut)|0,g=g+Math.imul(z,qe)|0,g=g+Math.imul(G,ut)|0,b=b+Math.imul(G,qe)|0,I=I+Math.imul(Oe,ye)|0,g=g+Math.imul(Oe,Ce)|0,g=g+Math.imul(je,ye)|0,b=b+Math.imul(je,Ce)|0,I=I+Math.imul(ve,et)|0,g=g+Math.imul(ve,ze)|0,g=g+Math.imul(he,et)|0,b=b+Math.imul(he,ze)|0;var Ar=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,I=Math.imul(jt,Nt),g=Math.imul(jt,ft),g=g+Math.imul(Xe,Nt)|0,b=Math.imul(Xe,ft),I=I+Math.imul(nt,Pt)|0,g=g+Math.imul(nt,st)|0,g=g+Math.imul(Qe,Pt)|0,b=b+Math.imul(Qe,st)|0,I=I+Math.imul(Ge,kt)|0,g=g+Math.imul(Ge,pt)|0,g=g+Math.imul(Re,kt)|0,b=b+Math.imul(Re,pt)|0,I=I+Math.imul(_e,qt)|0,g=g+Math.imul(_e,D)|0,g=g+Math.imul(Ne,qt)|0,b=b+Math.imul(Ne,D)|0,I=I+Math.imul(oe,A)|0,g=g+Math.imul(oe,V)|0,g=g+Math.imul(pe,A)|0,b=b+Math.imul(pe,V)|0,I=I+Math.imul(W,me)|0,g=g+Math.imul(W,be)|0,g=g+Math.imul(K,me)|0,b=b+Math.imul(K,be)|0,I=I+Math.imul(ee,ut)|0,g=g+Math.imul(ee,qe)|0,g=g+Math.imul(Q,ut)|0,b=b+Math.imul(Q,qe)|0,I=I+Math.imul(z,ye)|0,g=g+Math.imul(z,Ce)|0,g=g+Math.imul(G,ye)|0,b=b+Math.imul(G,Ce)|0,I=I+Math.imul(Oe,et)|0,g=g+Math.imul(Oe,ze)|0,g=g+Math.imul(je,et)|0,b=b+Math.imul(je,ze)|0;var Fn=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,I=Math.imul(jt,Pt),g=Math.imul(jt,st),g=g+Math.imul(Xe,Pt)|0,b=Math.imul(Xe,st),I=I+Math.imul(nt,kt)|0,g=g+Math.imul(nt,pt)|0,g=g+Math.imul(Qe,kt)|0,b=b+Math.imul(Qe,pt)|0,I=I+Math.imul(Ge,qt)|0,g=g+Math.imul(Ge,D)|0,g=g+Math.imul(Re,qt)|0,b=b+Math.imul(Re,D)|0,I=I+Math.imul(_e,A)|0,g=g+Math.imul(_e,V)|0,g=g+Math.imul(Ne,A)|0,b=b+Math.imul(Ne,V)|0,I=I+Math.imul(oe,me)|0,g=g+Math.imul(oe,be)|0,g=g+Math.imul(pe,me)|0,b=b+Math.imul(pe,be)|0,I=I+Math.imul(W,ut)|0,g=g+Math.imul(W,qe)|0,g=g+Math.imul(K,ut)|0,b=b+Math.imul(K,qe)|0,I=I+Math.imul(ee,ye)|0,g=g+Math.imul(ee,Ce)|0,g=g+Math.imul(Q,ye)|0,b=b+Math.imul(Q,Ce)|0,I=I+Math.imul(z,et)|0,g=g+Math.imul(z,ze)|0,g=g+Math.imul(G,et)|0,b=b+Math.imul(G,ze)|0;var tn=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(tn>>>26)|0,tn&=67108863,I=Math.imul(jt,kt),g=Math.imul(jt,pt),g=g+Math.imul(Xe,kt)|0,b=Math.imul(Xe,pt),I=I+Math.imul(nt,qt)|0,g=g+Math.imul(nt,D)|0,g=g+Math.imul(Qe,qt)|0,b=b+Math.imul(Qe,D)|0,I=I+Math.imul(Ge,A)|0,g=g+Math.imul(Ge,V)|0,g=g+Math.imul(Re,A)|0,b=b+Math.imul(Re,V)|0,I=I+Math.imul(_e,me)|0,g=g+Math.imul(_e,be)|0,g=g+Math.imul(Ne,me)|0,b=b+Math.imul(Ne,be)|0,I=I+Math.imul(oe,ut)|0,g=g+Math.imul(oe,qe)|0,g=g+Math.imul(pe,ut)|0,b=b+Math.imul(pe,qe)|0,I=I+Math.imul(W,ye)|0,g=g+Math.imul(W,Ce)|0,g=g+Math.imul(K,ye)|0,b=b+Math.imul(K,Ce)|0,I=I+Math.imul(ee,et)|0,g=g+Math.imul(ee,ze)|0,g=g+Math.imul(Q,et)|0,b=b+Math.imul(Q,ze)|0;var $n=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+($n>>>26)|0,$n&=67108863,I=Math.imul(jt,qt),g=Math.imul(jt,D),g=g+Math.imul(Xe,qt)|0,b=Math.imul(Xe,D),I=I+Math.imul(nt,A)|0,g=g+Math.imul(nt,V)|0,g=g+Math.imul(Qe,A)|0,b=b+Math.imul(Qe,V)|0,I=I+Math.imul(Ge,me)|0,g=g+Math.imul(Ge,be)|0,g=g+Math.imul(Re,me)|0,b=b+Math.imul(Re,be)|0,I=I+Math.imul(_e,ut)|0,g=g+Math.imul(_e,qe)|0,g=g+Math.imul(Ne,ut)|0,b=b+Math.imul(Ne,qe)|0,I=I+Math.imul(oe,ye)|0,g=g+Math.imul(oe,Ce)|0,g=g+Math.imul(pe,ye)|0,b=b+Math.imul(pe,Ce)|0,I=I+Math.imul(W,et)|0,g=g+Math.imul(W,ze)|0,g=g+Math.imul(K,et)|0,b=b+Math.imul(K,ze)|0;var qi=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(qi>>>26)|0,qi&=67108863,I=Math.imul(jt,A),g=Math.imul(jt,V),g=g+Math.imul(Xe,A)|0,b=Math.imul(Xe,V),I=I+Math.imul(nt,me)|0,g=g+Math.imul(nt,be)|0,g=g+Math.imul(Qe,me)|0,b=b+Math.imul(Qe,be)|0,I=I+Math.imul(Ge,ut)|0,g=g+Math.imul(Ge,qe)|0,g=g+Math.imul(Re,ut)|0,b=b+Math.imul(Re,qe)|0,I=I+Math.imul(_e,ye)|0,g=g+Math.imul(_e,Ce)|0,g=g+Math.imul(Ne,ye)|0,b=b+Math.imul(Ne,Ce)|0,I=I+Math.imul(oe,et)|0,g=g+Math.imul(oe,ze)|0,g=g+Math.imul(pe,et)|0,b=b+Math.imul(pe,ze)|0;var Hi=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Hi>>>26)|0,Hi&=67108863,I=Math.imul(jt,me),g=Math.imul(jt,be),g=g+Math.imul(Xe,me)|0,b=Math.imul(Xe,be),I=I+Math.imul(nt,ut)|0,g=g+Math.imul(nt,qe)|0,g=g+Math.imul(Qe,ut)|0,b=b+Math.imul(Qe,qe)|0,I=I+Math.imul(Ge,ye)|0,g=g+Math.imul(Ge,Ce)|0,g=g+Math.imul(Re,ye)|0,b=b+Math.imul(Re,Ce)|0,I=I+Math.imul(_e,et)|0,g=g+Math.imul(_e,ze)|0,g=g+Math.imul(Ne,et)|0,b=b+Math.imul(Ne,ze)|0;var Vn=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,I=Math.imul(jt,ut),g=Math.imul(jt,qe),g=g+Math.imul(Xe,ut)|0,b=Math.imul(Xe,qe),I=I+Math.imul(nt,ye)|0,g=g+Math.imul(nt,Ce)|0,g=g+Math.imul(Qe,ye)|0,b=b+Math.imul(Qe,Ce)|0,I=I+Math.imul(Ge,et)|0,g=g+Math.imul(Ge,ze)|0,g=g+Math.imul(Re,et)|0,b=b+Math.imul(Re,ze)|0;var Wi=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,I=Math.imul(jt,ye),g=Math.imul(jt,Ce),g=g+Math.imul(Xe,ye)|0,b=Math.imul(Xe,Ce),I=I+Math.imul(nt,et)|0,g=g+Math.imul(nt,ze)|0,g=g+Math.imul(Qe,et)|0,b=b+Math.imul(Qe,ze)|0;var Gi=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,I=Math.imul(jt,et),g=Math.imul(jt,ze),g=g+Math.imul(Xe,et)|0,b=Math.imul(Xe,ze);var U=(j+I|0)+((g&8191)<<13)|0;return j=(b+(g>>>13)|0)+(U>>>26)|0,U&=67108863,M[0]=Je,M[1]=bt,M[2]=rr,M[3]=Bt,M[4]=Vt,M[5]=fr,M[6]=Nr,M[7]=mr,M[8]=nr,M[9]=Ar,M[10]=Fn,M[11]=tn,M[12]=$n,M[13]=qi,M[14]=Hi,M[15]=Vn,M[16]=Wi,M[17]=Gi,M[18]=U,j!==0&&(M[19]=j,m.length++),m};Math.imul||(O=T);function R(N,h,d){d.negative=h.negative^N.negative,d.length=N.length+h.length;for(var m=0,S=0,E=0;E<d.length-1;E++){var M=S;S=0;for(var j=m&67108863,I=Math.min(E,h.length-1),g=Math.max(0,E-N.length+1);g<=I;g++){var b=E-g,k=N.words[b]|0,ve=h.words[g]|0,he=k*ve,we=he&67108863;M=M+(he/67108864|0)|0,we=we+j|0,j=we&67108863,M=M+(we>>>26)|0,S+=M>>>26,M&=67108863}d.words[E]=j,m=M,M=S}return m!==0?d.words[E]=m:d.length--,d._strip()}function F(N,h,d){return R(N,h,d)}s.prototype.mulTo=function(h,d){var m,S=this.length+h.length;return this.length===10&&h.length===10?m=O(this,h,d):S<63?m=T(this,h,d):S<1024?m=R(this,h,d):m=F(this,h,d),m},s.prototype.mul=function(h){var d=new s(null);return d.words=new Array(this.length+h.length),this.mulTo(h,d)},s.prototype.mulf=function(h){var d=new s(null);return d.words=new Array(this.length+h.length),F(this,h,d)},s.prototype.imul=function(h){return this.clone().mulTo(h,this)},s.prototype.imuln=function(h){var d=h<0;d&&(h=-h),n(typeof h=="number"),n(h<67108864);for(var m=0,S=0;S<this.length;S++){var E=(this.words[S]|0)*h,M=(E&67108863)+(m&67108863);m>>=26,m+=E/67108864|0,m+=M>>>26,this.words[S]=M&67108863}return m!==0&&(this.words[S]=m,this.length++),this.length=h===0?1:this.length,d?this.ineg():this},s.prototype.muln=function(h){return this.clone().imuln(h)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(h){var d=_(h);if(d.length===0)return new s(1);for(var m=this,S=0;S<d.length&&d[S]===0;S++,m=m.sqr());if(++S<d.length)for(var E=m.sqr();S<d.length;S++,E=E.sqr())d[S]!==0&&(m=m.mul(E));return m},s.prototype.iushln=function(h){n(typeof h=="number"&&h>=0);var d=h%26,m=(h-d)/26,S=67108863>>>26-d<<26-d,E;if(d!==0){var M=0;for(E=0;E<this.length;E++){var j=this.words[E]&S,I=(this.words[E]|0)-j<<d;this.words[E]=I|M,M=j>>>26-d}M&&(this.words[E]=M,this.length++)}if(m!==0){for(E=this.length-1;E>=0;E--)this.words[E+m]=this.words[E];for(E=0;E<m;E++)this.words[E]=0;this.length+=m}return this._strip()},s.prototype.ishln=function(h){return n(this.negative===0),this.iushln(h)},s.prototype.iushrn=function(h,d,m){n(typeof h=="number"&&h>=0);var S;d?S=(d-d%26)/26:S=0;var E=h%26,M=Math.min((h-E)/26,this.length),j=67108863^67108863>>>E<<E,I=m;if(S-=M,S=Math.max(0,S),I){for(var g=0;g<M;g++)I.words[g]=this.words[g];I.length=M}if(M!==0)if(this.length>M)for(this.length-=M,g=0;g<this.length;g++)this.words[g]=this.words[g+M];else this.words[0]=0,this.length=1;var b=0;for(g=this.length-1;g>=0&&(b!==0||g>=S);g--){var k=this.words[g]|0;this.words[g]=b<<26-E|k>>>E,b=k&j}return I&&b!==0&&(I.words[I.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(h,d,m){return n(this.negative===0),this.iushrn(h,d,m)},s.prototype.shln=function(h){return this.clone().ishln(h)},s.prototype.ushln=function(h){return this.clone().iushln(h)},s.prototype.shrn=function(h){return this.clone().ishrn(h)},s.prototype.ushrn=function(h){return this.clone().iushrn(h)},s.prototype.testn=function(h){n(typeof h=="number"&&h>=0);var d=h%26,m=(h-d)/26,S=1<<d;if(this.length<=m)return!1;var E=this.words[m];return!!(E&S)},s.prototype.imaskn=function(h){n(typeof h=="number"&&h>=0);var d=h%26,m=(h-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(d!==0&&m++,this.length=Math.min(m,this.length),d!==0){var S=67108863^67108863>>>d<<d;this.words[this.length-1]&=S}return this._strip()},s.prototype.maskn=function(h){return this.clone().imaskn(h)},s.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)},s.prototype._iaddn=function(h){this.words[0]+=h;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.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 d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},s.prototype.addn=function(h){return this.clone().iaddn(h)},s.prototype.subn=function(h){return this.clone().isubn(h)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(h,d,m){var S=h.length+m,E;this._expand(S);var M,j=0;for(E=0;E<h.length;E++){M=(this.words[E+m]|0)+j;var I=(h.words[E]|0)*d;M-=I&67108863,j=(M>>26)-(I/67108864|0),this.words[E+m]=M&67108863}for(;E<this.length-m;E++)M=(this.words[E+m]|0)+j,j=M>>26,this.words[E+m]=M&67108863;if(j===0)return this._strip();for(n(j===-1),j=0,E=0;E<this.length;E++)M=-(this.words[E]|0)+j,j=M>>26,this.words[E]=M&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(h,d){var m=this.length-h.length,S=this.clone(),E=h,M=E.words[E.length-1]|0,j=this._countBits(M);m=26-j,m!==0&&(E=E.ushln(m),S.iushln(m),M=E.words[E.length-1]|0);var I=S.length-E.length,g;if(d!=="mod"){g=new s(null),g.length=I+1,g.words=new Array(g.length);for(var b=0;b<g.length;b++)g.words[b]=0}var k=S.clone()._ishlnsubmul(E,1,I);k.negative===0&&(S=k,g&&(g.words[I]=1));for(var ve=I-1;ve>=0;ve--){var he=(S.words[E.length+ve]|0)*67108864+(S.words[E.length+ve-1]|0);for(he=Math.min(he/M|0,67108863),S._ishlnsubmul(E,he,ve);S.negative!==0;)he--,S.negative=0,S._ishlnsubmul(E,1,ve),S.isZero()||(S.negative^=1);g&&(g.words[ve]=he)}return g&&g._strip(),S._strip(),d!=="div"&&m!==0&&S.iushrn(m),{div:g||null,mod:S}},s.prototype.divmod=function(h,d,m){if(n(!h.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var S,E,M;return this.negative!==0&&h.negative===0?(M=this.neg().divmod(h,d),d!=="mod"&&(S=M.div.neg()),d!=="div"&&(E=M.mod.neg(),m&&E.negative!==0&&E.iadd(h)),{div:S,mod:E}):this.negative===0&&h.negative!==0?(M=this.divmod(h.neg(),d),d!=="mod"&&(S=M.div.neg()),{div:S,mod:M.mod}):this.negative&h.negative?(M=this.neg().divmod(h.neg(),d),d!=="div"&&(E=M.mod.neg(),m&&E.negative!==0&&E.isub(h)),{div:M.div,mod:E}):h.length>this.length||this.cmp(h)<0?{div:new s(0),mod:this}:h.length===1?d==="div"?{div:this.divn(h.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new s(this.modrn(h.words[0]))}:this._wordDiv(h,d)},s.prototype.div=function(h){return this.divmod(h,"div",!1).div},s.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},s.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},s.prototype.divRound=function(h){var d=this.divmod(h);if(d.mod.isZero())return d.div;var m=d.div.negative!==0?d.mod.isub(h):d.mod,S=h.ushrn(1),E=h.andln(1),M=m.cmp(S);return M<0||E===1&&M===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(h){var d=h<0;d&&(h=-h),n(h<=67108863);for(var m=(1<<26)%h,S=0,E=this.length-1;E>=0;E--)S=(m*S+(this.words[E]|0))%h;return d?-S:S},s.prototype.modn=function(h){return this.modrn(h)},s.prototype.idivn=function(h){var d=h<0;d&&(h=-h),n(h<=67108863);for(var m=0,S=this.length-1;S>=0;S--){var E=(this.words[S]|0)+m*67108864;this.words[S]=E/h|0,m=E%h}return this._strip(),d?this.ineg():this},s.prototype.divn=function(h){return this.clone().idivn(h)},s.prototype.egcd=function(h){n(h.negative===0),n(!h.isZero());var d=this,m=h.clone();d.negative!==0?d=d.umod(h):d=d.clone();for(var S=new s(1),E=new s(0),M=new s(0),j=new s(1),I=0;d.isEven()&&m.isEven();)d.iushrn(1),m.iushrn(1),++I;for(var g=m.clone(),b=d.clone();!d.isZero();){for(var k=0,ve=1;!(d.words[0]&ve)&&k<26;++k,ve<<=1);if(k>0)for(d.iushrn(k);k-- >0;)(S.isOdd()||E.isOdd())&&(S.iadd(g),E.isub(b)),S.iushrn(1),E.iushrn(1);for(var he=0,we=1;!(m.words[0]&we)&&he<26;++he,we<<=1);if(he>0)for(m.iushrn(he);he-- >0;)(M.isOdd()||j.isOdd())&&(M.iadd(g),j.isub(b)),M.iushrn(1),j.iushrn(1);d.cmp(m)>=0?(d.isub(m),S.isub(M),E.isub(j)):(m.isub(d),M.isub(S),j.isub(E))}return{a:M,b:j,gcd:m.iushln(I)}},s.prototype._invmp=function(h){n(h.negative===0),n(!h.isZero());var d=this,m=h.clone();d.negative!==0?d=d.umod(h):d=d.clone();for(var S=new s(1),E=new s(0),M=m.clone();d.cmpn(1)>0&&m.cmpn(1)>0;){for(var j=0,I=1;!(d.words[0]&I)&&j<26;++j,I<<=1);if(j>0)for(d.iushrn(j);j-- >0;)S.isOdd()&&S.iadd(M),S.iushrn(1);for(var g=0,b=1;!(m.words[0]&b)&&g<26;++g,b<<=1);if(g>0)for(m.iushrn(g);g-- >0;)E.isOdd()&&E.iadd(M),E.iushrn(1);d.cmp(m)>=0?(d.isub(m),S.isub(E)):(m.isub(d),E.isub(S))}var k;return d.cmpn(1)===0?k=S:k=E,k.cmpn(0)<0&&k.iadd(h),k},s.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var d=this.clone(),m=h.clone();d.negative=0,m.negative=0;for(var S=0;d.isEven()&&m.isEven();S++)d.iushrn(1),m.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;m.isEven();)m.iushrn(1);var E=d.cmp(m);if(E<0){var M=d;d=m,m=M}else if(E===0||m.cmpn(1)===0)break;d.isub(m)}while(!0);return m.iushln(S)},s.prototype.invm=function(h){return this.egcd(h).a.umod(h)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(h){return this.words[0]&h},s.prototype.bincn=function(h){n(typeof h=="number");var d=h%26,m=(h-d)/26,S=1<<d;if(this.length<=m)return this._expand(m+1),this.words[m]|=S,this;for(var E=S,M=m;E!==0&&M<this.length;M++){var j=this.words[M]|0;j+=E,E=j>>>26,j&=67108863,this.words[M]=j}return E!==0&&(this.words[M]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(h){var d=h<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var m;if(this.length>1)m=1;else{d&&(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},s.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var d=this.ucmp(h);return this.negative!==0?-d|0:d},s.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var d=0,m=this.length-1;m>=0;m--){var S=this.words[m]|0,E=h.words[m]|0;if(S!==E){S<E?d=-1:S>E&&(d=1);break}}return d},s.prototype.gtn=function(h){return this.cmpn(h)===1},s.prototype.gt=function(h){return this.cmp(h)===1},s.prototype.gten=function(h){return this.cmpn(h)>=0},s.prototype.gte=function(h){return this.cmp(h)>=0},s.prototype.ltn=function(h){return this.cmpn(h)===-1},s.prototype.lt=function(h){return this.cmp(h)===-1},s.prototype.lten=function(h){return this.cmpn(h)<=0},s.prototype.lte=function(h){return this.cmp(h)<=0},s.prototype.eqn=function(h){return this.cmpn(h)===0},s.prototype.eq=function(h){return this.cmp(h)===0},s.red=function(h){return new de(h)},s.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)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(h){return this.red=h,this},s.prototype.forceRed=function(h){return n(!this.red,"Already a number in reduction context"),this._forceRed(h)},s.prototype.redAdd=function(h){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},s.prototype.redIAdd=function(h){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},s.prototype.redSub=function(h){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},s.prototype.redISub=function(h){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},s.prototype.redShl=function(h){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},s.prototype.redMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},s.prototype.redIMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.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 H(N,h){this.name=N,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var h=new s(null);return h.words=new Array(Math.ceil(this.n/13)),h},H.prototype.ireduce=function(h){var d=h,m;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),m=d.bitLength();while(m>this.n);var S=m<this.n?-1:d.ucmp(this.p);return S===0?(d.words[0]=0,d.length=1):S>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},H.prototype.split=function(h,d){h.iushrn(this.n,0,d)},H.prototype.imulK=function(h){return h.imul(this.k)};function $(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i($,H),$.prototype.split=function(h,d){for(var m=4194303,S=Math.min(h.length,9),E=0;E<S;E++)d.words[E]=h.words[E];if(d.length=S,h.length<=9){h.words[0]=0,h.length=1;return}var M=h.words[9];for(d.words[d.length++]=M&m,E=10;E<h.length;E++){var j=h.words[E]|0;h.words[E-10]=(j&m)<<4|M>>>22,M=j}M>>>=22,h.words[E-10]=M,M===0&&h.length>10?h.length-=10:h.length-=9},$.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var d=0,m=0;m<h.length;m++){var S=h.words[m]|0;d+=S*977,h.words[m]=d&67108863,d=S*64+(d/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function Z(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(Z,H);function ce(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(ce,H);function ne(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(ne,H),ne.prototype.imulK=function(h){for(var d=0,m=0;m<h.length;m++){var S=(h.words[m]|0)*19+d,E=S&67108863;S>>>=26,h.words[m]=E,d=S}return d!==0&&(h.words[h.length++]=d),h},s._prime=function(h){if(B[h])return B[h];var d;if(h==="k256")d=new $;else if(h==="p224")d=new Z;else if(h==="p192")d=new ce;else if(h==="p25519")d=new ne;else throw new Error("Unknown prime "+h);return B[h]=d,d};function de(N){if(typeof N=="string"){var h=s._prime(N);this.m=h.p,this.prime=h}else n(N.gtn(1),"modulus must be greater than 1"),this.m=N,this.prime=null}de.prototype._verify1=function(h){n(h.negative===0,"red works only with positives"),n(h.red,"red works only with red numbers")},de.prototype._verify2=function(h,d){n((h.negative|d.negative)===0,"red works only with positives"),n(h.red&&h.red===d.red,"red works only with red numbers")},de.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(u(h,h.umod(this.m)._forceRed(this)),h)},de.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},de.prototype.add=function(h,d){this._verify2(h,d);var m=h.add(d);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},de.prototype.iadd=function(h,d){this._verify2(h,d);var m=h.iadd(d);return m.cmp(this.m)>=0&&m.isub(this.m),m},de.prototype.sub=function(h,d){this._verify2(h,d);var m=h.sub(d);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},de.prototype.isub=function(h,d){this._verify2(h,d);var m=h.isub(d);return m.cmpn(0)<0&&m.iadd(this.m),m},de.prototype.shl=function(h,d){return this._verify1(h),this.imod(h.ushln(d))},de.prototype.imul=function(h,d){return this._verify2(h,d),this.imod(h.imul(d))},de.prototype.mul=function(h,d){return this._verify2(h,d),this.imod(h.mul(d))},de.prototype.isqr=function(h){return this.imul(h,h.clone())},de.prototype.sqr=function(h){return this.mul(h,h)},de.prototype.sqrt=function(h){if(h.isZero())return h.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var m=this.m.add(new s(1)).iushrn(2);return this.pow(h,m)}for(var S=this.m.subn(1),E=0;!S.isZero()&&S.andln(1)===0;)E++,S.iushrn(1);n(!S.isZero());var M=new s(1).toRed(this),j=M.redNeg(),I=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new s(2*g*g).toRed(this);this.pow(g,I).cmp(j)!==0;)g.redIAdd(j);for(var b=this.pow(g,S),k=this.pow(h,S.addn(1).iushrn(1)),ve=this.pow(h,S),he=E;ve.cmp(M)!==0;){for(var we=ve,Oe=0;we.cmp(M)!==0;Oe++)we=we.redSqr();n(Oe<he);var je=this.pow(b,new s(1).iushln(he-Oe-1));k=k.redMul(je),b=je.redSqr(),ve=ve.redMul(b),he=Oe}return k},de.prototype.invm=function(h){var d=h._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},de.prototype.pow=function(h,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return h.clone();var m=4,S=new Array(1<<m);S[0]=new s(1).toRed(this),S[1]=h;for(var E=2;E<S.length;E++)S[E]=this.mul(S[E-1],h);var M=S[0],j=0,I=0,g=d.bitLength()%26;for(g===0&&(g=26),E=d.length-1;E>=0;E--){for(var b=d.words[E],k=g-1;k>=0;k--){var ve=b>>k&1;if(M!==S[0]&&(M=this.sqr(M)),ve===0&&j===0){I=0;continue}j<<=1,j|=ve,I++,!(I!==m&&(E!==0||k!==0))&&(M=this.mul(M,S[j]),I=0,j=0)}g=26}return M},de.prototype.convertTo=function(h){var d=h.umod(this.m);return d===h?d.clone():d},de.prototype.convertFrom=function(h){var d=h.clone();return d.red=null,d},s.mont=function(h){return new q(h)};function q(N){de.call(this,N),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)}i(q,de),q.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},q.prototype.convertFrom=function(h){var d=this.imod(h.mul(this.rinv));return d.red=null,d},q.prototype.imul=function(h,d){if(h.isZero()||d.isZero())return h.words[0]=0,h.length=1,h;var m=h.imul(d),S=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=m.isub(S).iushrn(this.shift),M=E;return E.cmp(this.m)>=0?M=E.isub(this.m):E.cmpn(0)<0&&(M=E.iadd(this.m)),M._forceRed(this)},q.prototype.mul=function(h,d){if(h.isZero()||d.isZero())return new s(0)._forceRed(this);var m=h.mul(d),S=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=m.isub(S).iushrn(this.shift),M=E;return E.cmp(this.m)>=0?M=E.isub(this.m):E.cmpn(0)<0&&(M=E.iadd(this.m)),M._forceRed(this)},q.prototype.invm=function(h){var d=this.imod(h._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(e,Cr)}(vd);var Am=vd.exports;const Tm=io(Am);var ux=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gn,"__esModule",{value:!0}),gn.parseAccumulatorUpdateData=gn.sliceAccumulatorUpdateData=gn.parseTwapMessage=gn.parsePriceFeedMessage=gn.isAccumulatorUpdateData=void 0;const vn=ux(Am),dx="504e4155",fx=1,hx=0,bd=20,px=0,mx=1;function yd(e){return e.toString("hex").slice(0,8)===dx&&e[4]===fx&&e[5]===hx}gn.isAccumulatorUpdateData=yd;function gx(e){let t=0;if(e.readUInt8(t)!==px)throw new Error("Not a price feed message");t+=1;const n=e.subarray(t,t+32);t+=32;const i=new vn.default(e.subarray(t,t+8),"be");t+=8;const s=new vn.default(e.subarray(t,t+8),"be");t+=8;const o=e.readInt32BE(t);t+=4;const a=new vn.default(e.subarray(t,t+8),"be");t+=8;const c=new vn.default(e.subarray(t,t+8),"be");t+=8;const l=new vn.default(e.subarray(t,t+8),"be");t+=8;const u=new vn.default(e.subarray(t,t+8),"be");return t+=8,{feedId:n,price:i,confidence:s,exponent:o,publishTime:a,prevPublishTime:c,emaPrice:l,emaConf:u}}gn.parsePriceFeedMessage=gx;function vx(e){let t=0;if(e.readUInt8(t)!==mx)throw new Error("Not a twap message");t+=1;const n=e.subarray(t,t+32);t+=32;const i=new vn.default(e.subarray(t,t+16),"be");t+=16;const s=new vn.default(e.subarray(t,t+16),"be");t+=16;const o=new vn.default(e.subarray(t,t+8),"be");t+=8;const a=e.readInt32BE(t);t+=4;const c=new vn.default(e.subarray(t,t+8),"be");t+=8;const l=new vn.default(e.subarray(t,t+8),"be");t+=8;const u=new vn.default(e.subarray(t,t+8),"be");return t+=8,{feedId:n,cumulativePrice:i,cumulativeConf:s,numDownSlots:o,exponent:a,publishTime:c,prevPublishTime:l,publishSlot:u}}gn.parseTwapMessage=vx;function bx(e,t,r){if(!yd(e))throw new Error("Invalid accumulator message");let n=6;const i=e.readUint8(n);n+=1+i,n+=1;const s=e.readUint16BE(n);n+=2,n+=s;const o=n,a=[],c=e.readUInt8(n);n+=1;for(let u=0;u<c;u++){const f=n,p=e.readUint16BE(n);n+=2,n+=p;const y=e.readUInt8(n);n+=1,n+=bd*y,a.push(e.subarray(f,n))}if(n!==e.length)throw new Error("Didn't reach the end of the message");const l=a.slice(t,r);return Oc.concat([e.subarray(0,o),Oc.from([l.length]),...a.slice(t,r)])}gn.sliceAccumulatorUpdateData=bx;function yx(e){if(!yd(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 s=e.readUInt8(t),o=[];t+=1;for(let a=0;a<s;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 f=[];for(let p=0;p<u;p++)f.push(Array.from(e.subarray(t,t+bd))),t+=bd;o.push({message:l,proof:f})}if(t!==e.length)throw new Error("Didn't reach the end of the message");return{vaa:i,updates:o}}gn.parseAccumulatorUpdateData=yx,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=Mc;var r=gn;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){Et(this,"conf");Et(this,"expo");Et(this,"price");Et(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){Et(this,"attestationTime");Et(this,"emitterChain");Et(this,"priceServiceReceiveTime");Et(this,"sequenceNumber");Et(this,"slot");Et(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 s=class n4{constructor(a){Et(this,"emaPrice");Et(this,"id");Et(this,"metadata");Et(this,"vaa");Et(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 n4({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=s}(fd);function Mm(e,t){return function(){return e.apply(t,arguments)}}const{toString:wx}=Object.prototype,{getPrototypeOf:wd}=Object,{iterator:Pc,toStringTag:Im}=Symbol,Rc=(e=>t=>{const r=wx.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Pn=e=>(e=e.toLowerCase(),t=>Rc(t)===e),jc=e=>t=>typeof t===e,{isArray:mo}=Array,ma=jc("undefined");function xx(e){return e!==null&&!ma(e)&&e.constructor!==null&&!ma(e.constructor)&&Yr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Om=Pn("ArrayBuffer");function Sx(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Om(e.buffer),t}const _x=jc("string"),Yr=jc("function"),Pm=jc("number"),Nc=e=>e!==null&&typeof e=="object",Ex=e=>e===!0||e===!1,kc=e=>{if(Rc(e)!=="object")return!1;const t=wd(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Im in e)&&!(Pc in e)},Cx=Pn("Date"),Ax=Pn("File"),Tx=Pn("Blob"),Mx=Pn("FileList"),Ix=e=>Nc(e)&&Yr(e.pipe),Ox=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Yr(e.append)&&((t=Rc(e))==="formdata"||t==="object"&&Yr(e.toString)&&e.toString()==="[object FormData]"))},Px=Pn("URLSearchParams"),[Rx,jx,Nx,kx]=["ReadableStream","Request","Response","Headers"].map(Pn),Dx=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ga(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),mo(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const s=r?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(n=0;n<o;n++)a=s[n],t.call(null,e[a],a,e)}}function Rm(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 ks=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Cr)(),jm=e=>!ma(e)&&e!==ks;function xd(){const{caseless:e}=jm(this)&&this||{},t={},r=(n,i)=>{const s=e&&Rm(t,i)||i;kc(t[s])&&kc(n)?t[s]=xd(t[s],n):kc(n)?t[s]=xd({},n):mo(n)?t[s]=n.slice():t[s]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&ga(arguments[n],r);return t}const Lx=(e,t,r,{allOwnKeys:n}={})=>(ga(t,(i,s)=>{r&&Yr(i)?e[s]=Mm(i,r):e[s]=i},{allOwnKeys:n}),e),Bx=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ux=(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)},Fx=(e,t,r,n)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!n||n(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=r!==!1&&wd(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},$x=(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},Vx=e=>{if(!e)return null;if(mo(e))return e;let t=e.length;if(!Pm(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},zx=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&wd(Uint8Array)),qx=(e,t)=>{const n=(e&&e[Pc]).call(e);let i;for(;(i=n.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},Hx=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Wx=Pn("HTMLFormElement"),Gx=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Nm=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Kx=Pn("RegExp"),km=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ga(r,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(n[s]=o||i)}),Object.defineProperties(e,n)},Yx=e=>{km(e,(t,r)=>{if(Yr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Yr(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+"'")})}})},Jx=(e,t)=>{const r={},n=i=>{i.forEach(s=>{r[s]=!0})};return mo(e)?n(e):n(String(e).split(t)),r},Xx=()=>{},Zx=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Qx(e){return!!(e&&Yr(e.append)&&e[Im]==="FormData"&&e[Pc])}const e5=e=>{const t=new Array(10),r=(n,i)=>{if(Nc(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const s=mo(n)?[]:{};return ga(n,(o,a)=>{const c=r(o,i+1);!ma(c)&&(s[a]=c)}),t[i]=void 0,s}}return n};return r(e,0)},t5=Pn("AsyncFunction"),r5=e=>e&&(Nc(e)||Yr(e))&&Yr(e.then)&&Yr(e.catch),Dm=((e,t)=>e?setImmediate:t?((r,n)=>(ks.addEventListener("message",({source:i,data:s})=>{i===ks&&s===r&&n.length&&n.shift()()},!1),i=>{n.push(i),ks.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Yr(ks.postMessage)),n5=typeof queueMicrotask<"u"?queueMicrotask.bind(ks):typeof _n<"u"&&_n.nextTick||Dm;var xe={isArray:mo,isArrayBuffer:Om,isBuffer:xx,isFormData:Ox,isArrayBufferView:Sx,isString:_x,isNumber:Pm,isBoolean:Ex,isObject:Nc,isPlainObject:kc,isReadableStream:Rx,isRequest:jx,isResponse:Nx,isHeaders:kx,isUndefined:ma,isDate:Cx,isFile:Ax,isBlob:Tx,isRegExp:Kx,isFunction:Yr,isStream:Ix,isURLSearchParams:Px,isTypedArray:zx,isFileList:Mx,forEach:ga,merge:xd,extend:Lx,trim:Dx,stripBOM:Bx,inherits:Ux,toFlatObject:Fx,kindOf:Rc,kindOfTest:Pn,endsWith:$x,toArray:Vx,forEachEntry:qx,matchAll:Hx,isHTMLForm:Wx,hasOwnProperty:Nm,hasOwnProp:Nm,reduceDescriptors:km,freezeMethods:Yx,toObjectSet:Jx,toCamelCase:Gx,noop:Xx,toFiniteNumber:Zx,findKey:Rm,global:ks,isContextDefined:jm,isSpecCompliantForm:Qx,toJSONObject:e5,isAsyncFn:t5,isThenable:r5,setImmediate:Dm,asap:n5,isIterable:e=>e!=null&&Yr(e[Pc])};function xt(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)}xe.inherits(xt,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:xe.toJSONObject(this.config),code:this.code,status:this.status}}});const Lm=xt.prototype,Bm={};["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=>{Bm[e]={value:e}}),Object.defineProperties(xt,Bm),Object.defineProperty(Lm,"isAxiosError",{value:!0}),xt.from=(e,t,r,n,i,s)=>{const o=Object.create(Lm);return xe.toFlatObject(e,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),xt.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};var i5=null;function Sd(e){return xe.isPlainObject(e)||xe.isArray(e)}function Um(e){return xe.endsWith(e,"[]")?e.slice(0,-2):e}function Fm(e,t,r){return e?e.concat(t).map(function(i,s){return i=Um(i),!r&&s?"["+i+"]":i}).join(r?".":""):t}function s5(e){return xe.isArray(e)&&!e.some(Sd)}const o5=xe.toFlatObject(xe,{},null,function(t){return/^is[A-Z]/.test(t)});function Dc(e,t,r){if(!xe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=xe.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,_){return!xe.isUndefined(_[v])});const n=r.metaTokens,i=r.visitor||u,s=r.dots,o=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&xe.isSpecCompliantForm(t);if(!xe.isFunction(i))throw new TypeError("visitor must be a function");function l(x){if(x===null)return"";if(xe.isDate(x))return x.toISOString();if(!c&&xe.isBlob(x))throw new xt("Blob is not supported. Use a Buffer instead.");return xe.isArrayBuffer(x)||xe.isTypedArray(x)?c&&typeof Blob=="function"?new Blob([x]):Oc.from(x):x}function u(x,v,_){let T=x;if(x&&!_&&typeof x=="object"){if(xe.endsWith(v,"{}"))v=n?v:v.slice(0,-2),x=JSON.stringify(x);else if(xe.isArray(x)&&s5(x)||(xe.isFileList(x)||xe.endsWith(v,"[]"))&&(T=xe.toArray(x)))return v=Um(v),T.forEach(function(R,F){!(xe.isUndefined(R)||R===null)&&t.append(o===!0?Fm([v],F,s):o===null?v:v+"[]",l(R))}),!1}return Sd(x)?!0:(t.append(Fm(_,v,s),l(x)),!1)}const f=[],p=Object.assign(o5,{defaultVisitor:u,convertValue:l,isVisitable:Sd});function y(x,v){if(!xe.isUndefined(x)){if(f.indexOf(x)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(x),xe.forEach(x,function(T,O){(!(xe.isUndefined(T)||T===null)&&i.call(t,T,xe.isString(O)?O.trim():O,v,p))===!0&&y(T,v?v.concat(O):[O])}),f.pop()}}if(!xe.isObject(e))throw new TypeError("data must be an object");return y(e),t}function $m(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function _d(e,t){this._pairs=[],e&&Dc(e,this,t)}const Vm=_d.prototype;Vm.append=function(t,r){this._pairs.push([t,r])},Vm.toString=function(t){const r=t?function(n){return t.call(this,n,$m)}:$m;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function a5(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function zm(e,t,r){if(!t)return e;const n=r&&r.encode||a5;xe.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let s;if(i?s=i(t,r):s=xe.isURLSearchParams(t)?t.toString():new _d(t,r).toString(n),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class c5{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){xe.forEach(this.handlers,function(n){n!==null&&t(n)})}}var qm=c5,Hm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},l5=typeof URLSearchParams<"u"?URLSearchParams:_d,u5=typeof FormData<"u"?FormData:null,d5=typeof Blob<"u"?Blob:null,f5={isBrowser:!0,classes:{URLSearchParams:l5,FormData:u5,Blob:d5},protocols:["http","https","file","blob","url","data"]};const Ed=typeof window<"u"&&typeof document<"u",Cd=typeof navigator=="object"&&navigator||void 0,h5=Ed&&(!Cd||["ReactNative","NativeScript","NS"].indexOf(Cd.product)<0),p5=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),m5=Ed&&window.location.href||"http://localhost";var g5=Object.freeze({__proto__:null,hasBrowserEnv:Ed,hasStandardBrowserWebWorkerEnv:p5,hasStandardBrowserEnv:h5,navigator:Cd,origin:m5}),Dr={...g5,...f5};function v5(e,t){return Dc(e,new Dr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){return Dr.isNode&&xe.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function b5(e){return xe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function y5(e){const t={},r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n<i;n++)s=r[n],t[s]=e[s];return t}function Wm(e){function t(r,n,i,s){let o=r[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=s>=r.length;return o=!o&&xe.isArray(i)?i.length:o,c?(xe.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!xe.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],s)&&xe.isArray(i[o])&&(i[o]=y5(i[o])),!a)}if(xe.isFormData(e)&&xe.isFunction(e.entries)){const r={};return xe.forEachEntry(e,(n,i)=>{t(b5(n),i,r,0)}),r}return null}function w5(e,t,r){if(xe.isString(e))try{return(t||JSON.parse)(e),xe.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Ad={transitional:Hm,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=xe.isObject(t);if(s&&xe.isHTMLForm(t)&&(t=new FormData(t)),xe.isFormData(t))return i?JSON.stringify(Wm(t)):t;if(xe.isArrayBuffer(t)||xe.isBuffer(t)||xe.isStream(t)||xe.isFile(t)||xe.isBlob(t)||xe.isReadableStream(t))return t;if(xe.isArrayBufferView(t))return t.buffer;if(xe.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return v5(t,this.formSerializer).toString();if((a=xe.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Dc(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),w5(t)):t}],transformResponse:[function(t){const r=this.transitional||Ad.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(xe.isResponse(t)||xe.isReadableStream(t))return t;if(t&&xe.isString(t)&&(n&&!this.responseType||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?xt.from(a,xt.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:Dr.classes.FormData,Blob:Dr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};xe.forEach(["delete","get","head","post","put","patch"],e=>{Ad.headers[e]={}});var Td=Ad;const x5=xe.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 S5=e=>{const t={};let r,n,i;return e&&e.split(`
|
|
30
|
-
`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&
|
|
31
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}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[Gm]=this[Gm]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=va(o);n[a]||(A5(i,o),n[a]=!0)}return xe.isArray(t)?t.forEach(s):s(t),this}}Bc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),xe.reduceDescriptors(Bc.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),xe.freezeMethods(Bc);var Rn=Bc;function Id(e,t){const r=this||Td,n=t||r,i=Rn.from(n.headers);let s=n.data;return xe.forEach(e,function(a){s=a.call(r,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Km(e){return!!(e&&e.__CANCEL__)}function go(e,t,r){xt.call(this,e??"canceled",xt.ERR_CANCELED,t,r),this.name="CanceledError"}xe.inherits(go,xt,{__CANCEL__:!0});function Ym(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new xt("Request failed with status code "+r.status,[xt.ERR_BAD_REQUEST,xt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function T5(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function M5(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=n[s];o||(o=l),r[i]=c,n[i]=l;let f=s,p=0;for(;f!==i;)p+=r[f++],f=f%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),l-o<t)return;const y=u&&l-u;return y?Math.round(p*1e3/y):void 0}}function I5(e,t){let r=0,n=1e3/t,i,s;const o=(l,u=Date.now())=>{r=u,i=null,s&&(clearTimeout(s),s=null),e.apply(null,l)};return[(...l)=>{const u=Date.now(),f=u-r;f>=n?o(l,u):(i=l,s||(s=setTimeout(()=>{s=null,o(i)},n-f)))},()=>i&&o(i)]}const Uc=(e,t,r=3)=>{let n=0;const i=M5(50,250);return I5(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,c=o-n,l=i(c),u=o<=a;n=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-o)/l:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},r)},Jm=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Xm=e=>(...t)=>xe.asap(()=>e(...t));var O5=Dr.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Dr.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Dr.origin),Dr.navigator&&/(msie|trident)/i.test(Dr.navigator.userAgent)):()=>!0,P5=Dr.hasStandardBrowserEnv?{write(e,t,r,n,i,s){const o=[e+"="+encodeURIComponent(t)];xe.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),xe.isString(n)&&o.push("path="+n),xe.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.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 R5(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function j5(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Zm(e,t,r){let n=!R5(t);return e&&(n||r==!1)?j5(e,t):t}const Qm=e=>e instanceof Rn?{...e}:e;function Ds(e,t){t=t||{};const r={};function n(l,u,f,p){return xe.isPlainObject(l)&&xe.isPlainObject(u)?xe.merge.call({caseless:p},l,u):xe.isPlainObject(u)?xe.merge({},u):xe.isArray(u)?u.slice():u}function i(l,u,f,p){if(xe.isUndefined(u)){if(!xe.isUndefined(l))return n(void 0,l,f,p)}else return n(l,u,f,p)}function s(l,u){if(!xe.isUndefined(u))return n(void 0,u)}function o(l,u){if(xe.isUndefined(u)){if(!xe.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function a(l,u,f){if(f in t)return n(l,u);if(f in e)return n(void 0,l)}const c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(l,u,f)=>i(Qm(l),Qm(u),f,!0)};return xe.forEach(Object.keys(Object.assign({},e,t)),function(u){const f=c[u]||i,p=f(e[u],t[u],u);xe.isUndefined(p)&&f!==a||(r[u]=p)}),r}var e1=e=>{const t=Ds({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;t.headers=o=Rn.from(o),t.url=zm(Zm(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(xe.isFormData(r)){if(Dr.hasStandardBrowserEnv||Dr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...u]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...u].join("; "))}}if(Dr.hasStandardBrowserEnv&&(n&&xe.isFunction(n)&&(n=n(t)),n||n!==!1&&O5(t.url))){const l=i&&s&&P5.read(s);l&&o.set(i,l)}return t},N5=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const i=e1(e);let s=i.data;const o=Rn.from(i.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=i,u,f,p,y,x;function v(){y&&y(),x&&x(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let _=new XMLHttpRequest;_.open(i.method.toUpperCase(),i.url,!0),_.timeout=i.timeout;function T(){if(!_)return;const R=Rn.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),B={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:R,config:e,request:_};Ym(function($){r($),v()},function($){n($),v()},B),_=null}"onloadend"in _?_.onloadend=T:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(T)},_.onabort=function(){_&&(n(new xt("Request aborted",xt.ECONNABORTED,e,_)),_=null)},_.onerror=function(){n(new xt("Network Error",xt.ERR_NETWORK,e,_)),_=null},_.ontimeout=function(){let F=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const B=i.transitional||Hm;i.timeoutErrorMessage&&(F=i.timeoutErrorMessage),n(new xt(F,B.clarifyTimeoutError?xt.ETIMEDOUT:xt.ECONNABORTED,e,_)),_=null},s===void 0&&o.setContentType(null),"setRequestHeader"in _&&xe.forEach(o.toJSON(),function(F,B){_.setRequestHeader(B,F)}),xe.isUndefined(i.withCredentials)||(_.withCredentials=!!i.withCredentials),a&&a!=="json"&&(_.responseType=i.responseType),l&&([p,x]=Uc(l,!0),_.addEventListener("progress",p)),c&&_.upload&&([f,y]=Uc(c),_.upload.addEventListener("progress",f),_.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(u=R=>{_&&(n(!R||R.type?new go(null,e,_):R),_.abort(),_=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const O=T5(i.url);if(O&&Dr.protocols.indexOf(O)===-1){n(new xt("Unsupported protocol "+O+":",xt.ERR_BAD_REQUEST,e));return}_.send(s||null)})},k5=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const s=function(l){if(!i){i=!0,a();const u=l instanceof Error?l:this.reason;n.abort(u instanceof xt?u:new go(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,s(new xt(`timeout ${t} of ms exceeded`,xt.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>l.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>xe.asap(a),c}};const D5=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},L5=async function*(e,t){for await(const r of B5(e))yield*D5(r,t)},B5=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()}},t1=(e,t,r,n)=>{const i=L5(e,t);let s=0,o,a=c=>{o||(o=!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 f=u.byteLength;if(r){let p=s+=f;r(p)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),i.return()}},{highWaterMark:2})},Fc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",r1=Fc&&typeof ReadableStream=="function",U5=Fc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),n1=(e,...t)=>{try{return!!e(...t)}catch{return!1}},F5=r1&&n1(()=>{let e=!1;const t=new Request(Dr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),i1=64*1024,Od=r1&&n1(()=>xe.isReadableStream(new Response("").body)),$c={stream:Od&&(e=>e.body)};Fc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!$c[t]&&($c[t]=xe.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new xt(`Response type '${t}' is not supported`,xt.ERR_NOT_SUPPORT,n)})})})(new Response);const $5=async e=>{if(e==null)return 0;if(xe.isBlob(e))return e.size;if(xe.isSpecCompliantForm(e))return(await new Request(Dr.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(xe.isArrayBufferView(e)||xe.isArrayBuffer(e))return e.byteLength;if(xe.isURLSearchParams(e)&&(e=e+""),xe.isString(e))return(await U5(e)).byteLength},V5=async(e,t)=>{const r=xe.toFiniteNumber(e.getContentLength());return r??$5(t)};var z5=Fc&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:f="same-origin",fetchOptions:p}=e1(e);l=l?(l+"").toLowerCase():"text";let y=k5([i,s&&s.toAbortSignal()],o),x;const v=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let _;try{if(c&&F5&&r!=="get"&&r!=="head"&&(_=await V5(u,n))!==0){let B=new Request(t,{method:"POST",body:n,duplex:"half"}),H;if(xe.isFormData(n)&&(H=B.headers.get("content-type"))&&u.setContentType(H),B.body){const[$,Z]=Jm(_,Uc(Xm(c)));n=t1(B.body,i1,$,Z)}}xe.isString(f)||(f=f?"include":"omit");const T="credentials"in Request.prototype;x=new Request(t,{...p,signal:y,method:r.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",credentials:T?f:void 0});let O=await fetch(x);const R=Od&&(l==="stream"||l==="response");if(Od&&(a||R&&v)){const B={};["status","statusText","headers"].forEach(ce=>{B[ce]=O[ce]});const H=xe.toFiniteNumber(O.headers.get("content-length")),[$,Z]=a&&Jm(H,Uc(Xm(a),!0))||[];O=new Response(t1(O.body,i1,$,()=>{Z&&Z(),v&&v()}),B)}l=l||"text";let F=await $c[xe.findKey($c,l)||"text"](O,e);return!R&&v&&v(),await new Promise((B,H)=>{Ym(B,H,{data:F,headers:Rn.from(O.headers),status:O.status,statusText:O.statusText,config:e,request:x})})}catch(T){throw v&&v(),T&&T.name==="TypeError"&&/Load failed|fetch/i.test(T.message)?Object.assign(new xt("Network Error",xt.ERR_NETWORK,e,x),{cause:T.cause||T}):xt.from(T,T&&T.code,e,x)}});const Pd={http:i5,xhr:N5,fetch:z5};xe.forEach(Pd,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const s1=e=>`- ${e}`,q5=e=>xe.isFunction(e)||e===null||e===!1;var o1={getAdapter:e=>{e=xe.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let s=0;s<t;s++){r=e[s];let o;if(n=r,!q5(r)&&(n=Pd[(o=String(r)).toLowerCase()],n===void 0))throw new xt(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+s]=n}if(!n){const s=Object.entries(i).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since :
|
|
32
|
-
`+s.map(
|
|
33
|
-
`):" "+
|
|
34
|
-
`+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ds(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&zc.assertOptions(n,{silentJSONParsing:Qn.transitional(Qn.boolean),forcedJSONParsing:Qn.transitional(Qn.boolean),clarifyTimeoutError:Qn.transitional(Qn.boolean)},!1),i!=null&&(xe.isFunction(i)?r.paramsSerializer={serialize:i}:zc.assertOptions(i,{encode:Qn.function,serialize:Qn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),zc.assertOptions(r,{baseUrl:Qn.spelling("baseURL"),withXsrfToken:Qn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&xe.merge(s.common,s[r.method]);s&&xe.forEach(["delete","get","head","post","put","patch","common"],x=>{delete s[x]}),r.headers=Rn.concat(o,s);const a=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(r)===!1||(c=c&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});const l=[];this.interceptors.response.forEach(function(v){l.push(v.fulfilled,v.rejected)});let u,f=0,p;if(!c){const x=[a1.bind(this),void 0];for(x.unshift.apply(x,a),x.push.apply(x,l),p=x.length,u=Promise.resolve(r);f<p;)u=u.then(x[f++],x[f++]);return u}p=a.length;let y=r;for(f=0;f<p;){const x=a[f++],v=a[f++];try{y=x(y)}catch(_){v.call(this,_);break}}try{u=a1.call(this,y)}catch(x){return Promise.reject(x)}for(f=0,p=l.length;f<p;)u=u.then(l[f++],l[f++]);return u}getUri(t){t=Ds(this.defaults,t);const r=Zm(t.baseURL,t.url,t.allowAbsoluteUrls);return zm(r,t.params,t.paramsSerializer)}}xe.forEach(["delete","get","head","options"],function(t){qc.prototype[t]=function(r,n){return this.request(Ds(n||{},{method:t,url:r,data:(n||{}).data}))}}),xe.forEach(["post","put","patch"],function(t){function r(n){return function(s,o,a){return this.request(Ds(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}qc.prototype[t]=r(),qc.prototype[t+"Form"]=r(!0)});var Hc=qc;class jd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},t(function(s,o,a){n.reason||(n.reason=new go(s,o,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 jd(function(i){t=i}),cancel:t}}}var W5=jd;function G5(e){return function(r){return e.apply(null,r)}}function K5(e){return xe.isObject(e)&&e.isAxiosError===!0}const Nd={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(Nd).forEach(([e,t])=>{Nd[t]=e});var Y5=Nd;function u1(e){const t=new Hc(e),r=Mm(Hc.prototype.request,t);return xe.extend(r,Hc.prototype,t,{allOwnKeys:!0}),xe.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return u1(Ds(e,i))},r}const vr=u1(Td);vr.Axios=Hc,vr.CanceledError=go,vr.CancelToken=W5,vr.isCancel=Km,vr.VERSION=c1,vr.toFormData=Dc,vr.AxiosError=xt,vr.Cancel=vr.CanceledError,vr.all=function(t){return Promise.all(t)},vr.spread=G5,vr.isAxiosError=K5,vr.mergeConfig=Ds,vr.AxiosHeaders=Rn,vr.formToJSON=e=>Wm(xe.isHTMLForm(e)?new FormData(e):e),vr.getAdapter=o1.getAdapter,vr.HttpStatusCode=Y5,vr.default=vr;var d1=vr,kd={exports:{}},on={},f1={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})(f1);var J5=f1.exports,Dd={exports:{}},Ld={exports:{}},h1;function Wc(){return h1||(h1=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}(Ld)),Ld.exports}var p1;function X5(){return p1||(p1=1,function(e){var t=Wc().default;function r(){e.exports=r=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var n,i={},s=Object.prototype,o=s.hasOwnProperty,a=typeof Symbol=="function"?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function f(N,h,d,m){return Object.defineProperty(N,h,{value:d,enumerable:!m,configurable:!m,writable:!m})}try{f({},"")}catch{f=function(d,m,S){return d[m]=S}}function p(N,h,d,m){var S=h&&h.prototype instanceof v?h:v,E=Object.create(S.prototype);return f(E,"_invoke",function(M,j,I){var g=1;return function(b,k){if(g===3)throw Error("Generator is already running");if(g===4){if(b==="throw")throw k;return{value:n,done:!0}}for(I.method=b,I.arg=k;;){var ve=I.delegate;if(ve){var he=Z(ve,I);if(he){if(he===x)continue;return he}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if(g===1)throw g=4,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);g=3;var we=y(M,j,I);if(we.type==="normal"){if(g=I.done?4:2,we.arg===x)continue;return{value:we.arg,done:I.done}}we.type==="throw"&&(g=4,I.method="throw",I.arg=we.arg)}}}(N,d,new de(m||[])),!0),E}function y(N,h,d){try{return{type:"normal",arg:N.call(h,d)}}catch(m){return{type:"throw",arg:m}}}i.wrap=p;var x={};function v(){}function _(){}function T(){}var O={};f(O,c,function(){return this});var R=Object.getPrototypeOf,F=R&&R(R(q([])));F&&F!==s&&o.call(F,c)&&(O=F);var B=T.prototype=v.prototype=Object.create(O);function H(N){["next","throw","return"].forEach(function(h){f(N,h,function(d){return this._invoke(h,d)})})}function $(N,h){function d(S,E,M,j){var I=y(N[S],N,E);if(I.type!=="throw"){var g=I.arg,b=g.value;return b&&t(b)=="object"&&o.call(b,"__await")?h.resolve(b.__await).then(function(k){d("next",k,M,j)},function(k){d("throw",k,M,j)}):h.resolve(b).then(function(k){g.value=k,M(g)},function(k){return d("throw",k,M,j)})}j(I.arg)}var m;f(this,"_invoke",function(S,E){function M(){return new h(function(j,I){d(S,E,j,I)})}return m=m?m.then(M,M):M()},!0)}function Z(N,h){var d=h.method,m=N.i[d];if(m===n)return h.delegate=null,d==="throw"&&N.i.return&&(h.method="return",h.arg=n,Z(N,h),h.method==="throw")||d!=="return"&&(h.method="throw",h.arg=new TypeError("The iterator does not provide a '"+d+"' method")),x;var S=y(m,N.i,h.arg);if(S.type==="throw")return h.method="throw",h.arg=S.arg,h.delegate=null,x;var E=S.arg;return E?E.done?(h[N.r]=E.value,h.next=N.n,h.method!=="return"&&(h.method="next",h.arg=n),h.delegate=null,x):E:(h.method="throw",h.arg=new TypeError("iterator result is not an object"),h.delegate=null,x)}function ce(N){this.tryEntries.push(N)}function ne(N){var h=N[4]||{};h.type="normal",h.arg=n,N[4]=h}function de(N){this.tryEntries=[[-1]],N.forEach(ce,this),this.reset(!0)}function q(N){if(N!=null){var h=N[c];if(h)return h.call(N);if(typeof N.next=="function")return N;if(!isNaN(N.length)){var d=-1,m=function S(){for(;++d<N.length;)if(o.call(N,d))return S.value=N[d],S.done=!1,S;return S.value=n,S.done=!0,S};return m.next=m}}throw new TypeError(t(N)+" is not iterable")}return _.prototype=T,f(B,"constructor",T),f(T,"constructor",_),_.displayName=f(T,u,"GeneratorFunction"),i.isGeneratorFunction=function(N){var h=typeof N=="function"&&N.constructor;return!!h&&(h===_||(h.displayName||h.name)==="GeneratorFunction")},i.mark=function(N){return Object.setPrototypeOf?Object.setPrototypeOf(N,T):(N.__proto__=T,f(N,u,"GeneratorFunction")),N.prototype=Object.create(B),N},i.awrap=function(N){return{__await:N}},H($.prototype),f($.prototype,l,function(){return this}),i.AsyncIterator=$,i.async=function(N,h,d,m,S){S===void 0&&(S=Promise);var E=new $(p(N,h,d,m),S);return i.isGeneratorFunction(h)?E:E.next().then(function(M){return M.done?M.value:E.next()})},H(B),f(B,u,"Generator"),f(B,c,function(){return this}),f(B,"toString",function(){return"[object Generator]"}),i.keys=function(N){var h=Object(N),d=[];for(var m in h)d.unshift(m);return function S(){for(;d.length;)if((m=d.pop())in h)return S.value=m,S.done=!1,S;return S.done=!0,S}},i.values=q,de.prototype={constructor:de,reset:function(h){if(this.prev=this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(ne),!h)for(var d in this)d.charAt(0)==="t"&&o.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=n)},stop:function(){this.done=!0;var h=this.tryEntries[0][4];if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var d=this;function m(b){M.type="throw",M.arg=h,d.next=b}for(var S=d.tryEntries.length-1;S>=0;--S){var E=this.tryEntries[S],M=E[4],j=this.prev,I=E[1],g=E[2];if(E[0]===-1)return m("end"),!1;if(!I&&!g)throw Error("try statement without catch or finally");if(E[0]!=null&&E[0]<=j){if(j<I)return this.method="next",this.arg=n,m(I),!0;if(j<g)return m(g),!1}}},abrupt:function(h,d){for(var m=this.tryEntries.length-1;m>=0;--m){var S=this.tryEntries[m];if(S[0]>-1&&S[0]<=this.prev&&this.prev<S[2]){var E=S;break}}E&&(h==="break"||h==="continue")&&E[0]<=d&&d<=E[2]&&(E=null);var M=E?E[4]:{};return M.type=h,M.arg=d,E?(this.method="next",this.next=E[2],x):this.complete(M)},complete:function(h,d){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&d&&(this.next=d),x},finish:function(h){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m[2]===h)return this.complete(m[4],m[3]),ne(m),x}},catch:function(h){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m[0]===h){var S=m[4];if(S.type==="throw"){var E=S.arg;ne(m)}return E}}throw Error("illegal catch attempt")},delegateYield:function(h,d,m){return this.delegate={i:q(h),r:d,n:m},this.method==="next"&&(this.arg=n),x}},i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Dd)),Dd.exports}var Bd,m1;function Z5(){if(m1)return Bd;m1=1;var e=X5()();Bd=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return Bd}var Ud={exports:{}},g1;function Q5(){return g1||(g1=1,function(e){function t(n,i,s,o,a,c,l){try{var u=n[c](l),f=u.value}catch(p){return void s(p)}u.done?i(f):Promise.resolve(f).then(o,a)}function r(n){return function(){var i=this,s=arguments;return new Promise(function(o,a){var c=n.apply(i,s);function l(f){t(c,o,a,l,u,"next",f)}function u(f){t(c,o,a,l,u,"throw",f)}l(void 0)})}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Ud)),Ud.exports}var Fd={exports:{}},$d={exports:{}},Vd={exports:{}},v1;function e7(){return v1||(v1=1,function(e){var t=Wc().default;function r(n,i){if(t(n)!="object"||!n)return n;var s=n[Symbol.toPrimitive];if(s!==void 0){var o=s.call(n,i||"default");if(t(o)!="object")return o;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}(Vd)),Vd.exports}var b1;function t7(){return b1||(b1=1,function(e){var t=Wc().default,r=e7();function n(i){var s=r(i,"string");return t(s)=="symbol"?s:s+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}($d)),$d.exports}var y1;function r7(){return y1||(y1=1,function(e){var t=t7();function r(n,i,s){return(i=t(i))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s,n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Fd)),Fd.exports}var zd,w1;function n7(){if(w1)return zd;w1=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 zd=t=>!e.has(t&&t.code),zd}var ba=J5;Object.defineProperty(on,"__esModule",{value:!0}),on.isNetworkError=Wd,on.isRetryableError=Kc,on.isSafeRequestError=E1,on.isIdempotentRequestError=Gd,on.isNetworkOrIdempotentRequestError=Kd,on.exponentialDelay=C1,on.default=Ls,on.DEFAULT_OPTIONS=on.namespace=void 0;var Gc=ba(Z5()),i7=ba(Wc()),x1=ba(Q5()),s7=ba(r7()),o7=ba(n7());function S1(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 qd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?S1(Object(r),!0).forEach(function(n){(0,s7.default)(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):S1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Hd="axios-retry";on.namespace=Hd;function Wd(e){var t=["ERR_CANCELED","ECONNABORTED"];return!e.response&&!!e.code&&!t.includes(e.code)&&(0,o7.default)(e)}var _1=["get","head","options"],a7=_1.concat(["put","delete"]);function Kc(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status>=500&&e.response.status<=599)}function E1(e){return e.config?Kc(e)&&_1.indexOf(e.config.method)!==-1:!1}function Gd(e){return e.config?Kc(e)&&a7.indexOf(e.config.method)!==-1:!1}function Kd(e){return Wd(e)||Gd(e)}function c7(){return 0}function C1(){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 A1={retries:3,retryCondition:Kd,retryDelay:c7,shouldResetTimeout:!1,onRetry:function(){}};on.DEFAULT_OPTIONS=A1;function l7(e,t){return qd(qd(qd({},A1),t),e[Hd])}function T1(e,t){var r=l7(e,t);return r.retryCount=r.retryCount||0,e[Hd]=r,r}function u7(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 d7(e,t){return Yd.apply(this,arguments)}function Yd(){return Yd=(0,x1.default)(Gc.default.mark(function e(t,r){var n,i,s,o;return Gc.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(n=t.retries,i=t.retryCondition,s=t.retryCount<n&&i(r),(0,i7.default)(s)!=="object"){c.next=13;break}return c.prev=3,c.next=6,s;case 6:return o=c.sent,c.abrupt("return",o!==!1);case 10:return c.prev=10,c.t0=c.catch(3),c.abrupt("return",!1);case 13:return c.abrupt("return",s);case 14:case"end":return c.stop()}},e,null,[[3,10]])})),Yd.apply(this,arguments)}function Ls(e,t){var r=e.interceptors.request.use(function(i){var s=T1(i,t);return s.lastRequestTime=Date.now(),i}),n=e.interceptors.response.use(null,function(){var i=(0,x1.default)(Gc.default.mark(function s(o){var a,c,l,u,f,p,y,x;return Gc.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(a=o.config,a){_.next=3;break}return _.abrupt("return",Promise.reject(o));case 3:return c=T1(a,t),_.next=6,d7(c,o);case 6:if(!_.sent){_.next=21;break}if(c.retryCount+=1,l=c.retryDelay,u=c.shouldResetTimeout,f=c.onRetry,p=l(c.retryCount,o),u7(e,a),!(!u&&a.timeout&&c.lastRequestTime)){_.next=17;break}if(y=Date.now()-c.lastRequestTime,x=a.timeout-y-p,!(x<=0)){_.next=16;break}return _.abrupt("return",Promise.reject(o));case 16:a.timeout=x;case 17:return a.transformRequest=[function(T){return T}],_.next=20,f(c.retryCount,o,a);case 20:return _.abrupt("return",new Promise(function(T){return setTimeout(function(){return T(e(a))},p)}));case 21:return _.abrupt("return",Promise.reject(o));case 22:case"end":return _.stop()}},s)}));return function(s){return i.apply(this,arguments)}}());return{requestInterceptorId:r,responseInterceptorId:n}}Ls.isNetworkError=Wd,Ls.isSafeRequestError=E1,Ls.isIdempotentRequestError=Gd,Ls.isNetworkOrIdempotentRequestError=Kd,Ls.exponentialDelay=C1,Ls.isRetryableError=Kc;const M1=on.default;kd.exports=M1,kd.exports.default=M1;var f7=kd.exports,Yc={},vo=null;typeof WebSocket<"u"?vo=WebSocket:typeof MozWebSocket<"u"?vo=MozWebSocket:typeof Cr<"u"?vo=Cr.WebSocket||Cr.MozWebSocket:typeof window<"u"?vo=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(vo=self.WebSocket||self.MozWebSocket);var h7=vo,p7=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.ResilientWebSocket=void 0;const m7=p7(h7),g7=3e4+3e3;class v7{constructor(t,r){Et(this,"endpoint");Et(this,"wsClient");Et(this,"wsUserClosed");Et(this,"wsFailedAttempts");Et(this,"pingTimeout");Et(this,"logger");Et(this,"onError");Et(this,"onMessage");Et(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 m7.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=b7(this.wsFailedAttempts);(r=this.logger)==null||r.error(`Connection closed unexpectedly or because of timeout. Reconnecting after ${i}ms.`),await I1(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()},g7)}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 I1(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}}Yc.ResilientWebSocket=v7;async function I1(e){return new Promise(t=>setTimeout(t,e))}function b7(e){return 2**e*100}var bo={};Object.defineProperty(bo,"__esModule",{value:!0}),bo.removeLeading0xIfExists=bo.makeWebsocketUrl=void 0;function y7(e){const t=new URL("ws",e),r=t.protocol==="https:";return t.protocol=r?"wss:":"ws:",t.toString()}bo.makeWebsocketUrl=y7;function w7(e){return e.startsWith("0x")?e.substring(2):e}bo.removeLeading0xIfExists=w7;var O1=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.PriceServiceConnection=void 0;const Jd=fd,x7=O1(d1),P1=O1(f7),S7=Yc,Xd=bo;class _7{constructor(t,r){Et(this,"httpClient");Et(this,"priceFeedCallbacks");Et(this,"wsClient");Et(this,"wsEndpoint");Et(this,"logger");Et(this,"priceFeedRequestConfig");Et(this,"onWsError");var n,i,s;this.httpClient=x7.default.create({baseURL:t,timeout:(r==null?void 0:r.timeout)||5e3}),(0,P1.default)(this.httpClient,{retries:(r==null?void 0:r.httpRetries)||3,retryDelay:P1.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:(s=r==null?void 0:r.priceFeedRequestConfig)==null?void 0:s.allowOutOfOrder},this.priceFeedCallbacks=new Map,this.logger=(r==null?void 0:r.logger)||{trace:()=>{},debug:()=>{},info:()=>{},warn:console.warn,error:console.error},this.onWsError=o=>{this.logger.error(o),typeof _n<"u"&&typeof _n.exit=="function"?(this.logger.error("Halting the process due to the websocket error"),_n.exit(1)):this.logger.error("Cannot halt process. Please handle the websocket error.")},this.wsEndpoint=(0,Xd.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=>Jd.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 Jd.PriceFeed.fromJson(n.data)}async getPriceFeedIds(){return(await this.httpClient.get("/api/price_feed_ids")).data}async subscribePriceFeedUpdates(t,r){var s;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(o=>(0,Xd.removeLeading0xIfExists)(o));const n=[];for(const o of t)this.priceFeedCallbacks.has(o)||(this.priceFeedCallbacks.set(o,new Set),n.push(o)),this.priceFeedCallbacks.get(o).add(r);const i={ids:n,type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};await((s=this.wsClient)==null?void 0:s.send(JSON.stringify(i)))}async unsubscribePriceFeedUpdates(t,r){var s;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(o=>(0,Xd.removeLeading0xIfExists)(o));const n=[];for(const o of t)if(this.priceFeedCallbacks.has(o)){let a=!1;r===void 0?(this.priceFeedCallbacks.delete(o),a=!0):(this.priceFeedCallbacks.get(o).delete(r),this.priceFeedCallbacks.get(o).size===0&&(this.priceFeedCallbacks.delete(o),a=!0)),a&&n.push(o)}const i={ids:n,type:"unsubscribe"};await((s=this.wsClient)==null?void 0:s.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 S7.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=Jd.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()}}Tc.PriceServiceConnection=_7,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseAccumulatorUpdateData=e.isAccumulatorUpdateData=e.Price=e.PriceFeed=e.PriceFeedMetadata=e.PriceServiceConnection=void 0;var t=Tc;Object.defineProperty(e,"PriceServiceConnection",{enumerable:!0,get:function(){return t.PriceServiceConnection}});var r=fd;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}})}(dd),Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.SuiPriceServiceConnection=void 0;const E7=dd,C7=Ic();class A7 extends E7.PriceServiceConnection{async getPriceFeedsUpdateData(t){return(await this.getLatestVaas(t)).map(n=>C7.Buffer.from(n,"base64"))}}Ac.SuiPriceServiceConnection=A7;var Jc={};const T7=Rh(w3),Bs=Rh(L4);var Zd=Object.defineProperty,M7=Object.getOwnPropertyDescriptor,I7=Object.getOwnPropertyNames,O7=Object.prototype.hasOwnProperty,P7=(e,t)=>{for(var r in t)Zd(e,r,{get:t[r],enumerable:!0})},R7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of I7(t))!O7.call(e,i)&&i!==r&&Zd(e,i,{get:()=>t[i],enumerable:!(n=M7(t,i))||n.enumerable});return e},j7=e=>R7(Zd({},"__esModule",{value:!0}),e),R1={};P7(R1,{isValidSuiNSName:()=>D7,normalizeSuiNSName:()=>L7});var N7=j7(R1);const j1=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,N1=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,k7=235;function D7(e){return e.length>k7?!1:e.includes("@")?j1.test(e):N1.test(e)}function L7(e,t="at"){const r=e.toLowerCase();let n;if(r.includes("@")){if(!j1.test(r))throw new Error(`Invalid SuiNS name ${e}`);const[i,s]=r.split("@");n=[...i?i.split("."):[],s]}else{if(!N1.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 Qd=Object.defineProperty,B7=Object.getOwnPropertyDescriptor,U7=Object.getOwnPropertyNames,F7=Object.prototype.hasOwnProperty,$7=(e,t)=>{for(var r in t)Qd(e,r,{get:t[r],enumerable:!0})},V7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of U7(t))!F7.call(e,i)&&i!==r&&Qd(e,i,{get:()=>t[i],enumerable:!(n=B7(t,i))||n.enumerable});return e},z7=e=>V7(Qd({},"__esModule",{value:!0}),e),k1={};$7(k1,{isValidNamedPackage:()=>L1,isValidNamedType:()=>Y7});var q7=z7(k1),H7=N7;const W7=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,G7=/^\d+$/,K7=64,D1="/",L1=e=>{const t=e.split(D1);if(t.length<2||t.length>3)return!1;const[r,n,i]=t;return i!==void 0&&!G7.test(i)||!(0,H7.isValidSuiNSName)(r)?!1:W7.test(n)&&n.length<K7},Y7=e=>{const t=e.split(/::|<|>|,/);for(const r of t)if(r.includes(D1)&&!L1(r))return!1;return!0};var ef=Object.defineProperty,J7=Object.getOwnPropertyDescriptor,X7=Object.getOwnPropertyNames,Z7=Object.prototype.hasOwnProperty,Q7=(e,t)=>{for(var r in t)ef(e,r,{get:t[r],enumerable:!0})},eS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of X7(t))!Z7.call(e,i)&&i!==r&&ef(e,i,{get:()=>t[i],enumerable:!(n=J7(t,i))||n.enumerable});return e},tS=e=>eS(ef({},"__esModule",{value:!0}),e),B1={};Q7(B1,{SUI_ADDRESS_LENGTH:()=>tf,isValidSuiAddress:()=>$1,isValidSuiObjectId:()=>sS,isValidTransactionDigest:()=>iS,normalizeStructTag:()=>V1,normalizeSuiAddress:()=>nf,normalizeSuiObjectId:()=>aS,parseStructTag:()=>rf});var U1=tS(B1),F1=Bs,rS=q7;const nS=32;function iS(e){try{return(0,F1.fromBase58)(e).length===nS}catch{return!1}}const tf=32;function $1(e){return cS(e)&&lS(e)===tf}function sS(e){return $1(e)}function oS(e){return e.includes("::")?rf(e):e}function rf(e){const[t,r]=e.split("::"),n=(0,rS.isValidNamedPackage)(t),i=e.slice(t.length+r.length+4),s=i.includes("<")?i.slice(0,i.indexOf("<")):i,o=i.includes("<")?(0,F1.splitGenericParameters)(i.slice(i.indexOf("<")+1,i.lastIndexOf(">"))).map(a=>oS(a.trim())):[];return{address:n?t:nf(t),module:r,name:s,typeParams:o}}function V1(e){const{address:t,module:r,name:n,typeParams:i}=typeof e=="string"?rf(e):e,s=(i==null?void 0:i.length)>0?`<${i.map(o=>typeof o=="string"?o:V1(o)).join(",")}>`:"";return`${t}::${r}::${n}${s}`}function nf(e,t=!1){let r=e.toLowerCase();return!t&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(tf*2,"0")}`}function aS(e,t=!1){return nf(e,t)}function cS(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function lS(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}var sf=Object.defineProperty,uS=Object.getOwnPropertyDescriptor,dS=Object.getOwnPropertyNames,fS=Object.prototype.hasOwnProperty,hS=(e,t)=>{for(var r in t)sf(e,r,{get:t[r],enumerable:!0})},pS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of dS(t))!fS.call(e,i)&&i!==r&&sf(e,i,{get:()=>t[i],enumerable:!(n=uS(t,i))||n.enumerable});return e},mS=e=>pS(sf({},"__esModule",{value:!0}),e),z1={};hS(z1,{TypeTagSerializer:()=>Us});var q1=mS(z1),gS=Bs,vS=U1;const bS=/^vector<(.+)>$/,yS=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;class Us{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:Us.parseFromStr(n[1],r)};const i=t.match(yS);if(i)return{struct:{address:r?(0,vS.normalizeSuiAddress)(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:Us.parseStructTypeArgs(i[5],r)}};throw new Error(`Encountered unexpected token when parsing type args for ${t}`)}static parseStructTypeArgs(t,r=!1){return(0,gS.splitGenericParameters)(t).map(n=>Us.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<${Us.tagToString(t.vector)}>`;if("struct"in t){const r=t.struct,n=r.typeParams.map(Us.tagToString).join(", ");return`${r.address}::${r.module}::${r.name}${n?`<${n}>`:""}`}throw new Error("Invalid TypeTag")}}var of=Object.defineProperty,wS=Object.getOwnPropertyDescriptor,xS=Object.getOwnPropertyNames,SS=Object.prototype.hasOwnProperty,_S=(e,t)=>{for(var r in t)of(e,r,{get:t[r],enumerable:!0})},ES=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of xS(t))!SS.call(e,i)&&i!==r&&of(e,i,{get:()=>t[i],enumerable:!(n=wS(t,i))||n.enumerable});return e},CS=e=>ES(of({},"__esModule",{value:!0}),e),H1={};_S(H1,{Address:()=>an,AppId:()=>cg,Argument:()=>ei,CallArg:()=>J1,Command:()=>Z1,CompressedSignature:()=>dg,GasData:()=>ng,Intent:()=>lg,IntentMessage:()=>ug,IntentScope:()=>og,IntentVersion:()=>ag,MultiSig:()=>IS,MultiSigPkMap:()=>hg,MultiSigPublicKey:()=>pg,ObjectArg:()=>Y1,ObjectDigest:()=>G1,Owner:()=>MS,PasskeyAuthenticator:()=>PS,ProgrammableMoveCall:()=>X1,ProgrammableTransaction:()=>Q1,PublicKey:()=>fg,SenderSignedData:()=>OS,SenderSignedTransaction:()=>gg,SharedObjectRef:()=>K1,StructTag:()=>rg,SuiObjectRef:()=>Xc,TransactionData:()=>sg,TransactionDataV1:()=>ig,TransactionExpiration:()=>tg,TransactionKind:()=>eg,TypeTag:()=>lf,base64String:()=>mg});var af=CS(H1),Ee=Bs,ya=U1,W1=q1;function AS(e){return Ee.bcs.u64({name:"unsafe_u64",...e}).transform({input:t=>t,output:t=>Number(t)})}function TS(e){return Ee.bcs.enum("Option",{None:null,Some:e})}const an=Ee.bcs.bytes(ya.SUI_ADDRESS_LENGTH).transform({validate:e=>{const t=typeof e=="string"?e:(0,Ee.toHex)(e);if(!t||!(0,ya.isValidSuiAddress)((0,ya.normalizeSuiAddress)(t)))throw new Error(`Invalid Sui address ${t}`)},input:e=>typeof e=="string"?(0,Ee.fromHex)((0,ya.normalizeSuiAddress)(e)):e,output:e=>(0,ya.normalizeSuiAddress)((0,Ee.toHex)(e))}),G1=Ee.bcs.vector(Ee.bcs.u8()).transform({name:"ObjectDigest",input:e=>(0,Ee.fromBase58)(e),output:e=>(0,Ee.toBase58)(new Uint8Array(e)),validate:e=>{if((0,Ee.fromBase58)(e).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),Xc=Ee.bcs.struct("SuiObjectRef",{objectId:an,version:Ee.bcs.u64(),digest:G1}),K1=Ee.bcs.struct("SharedObjectRef",{objectId:an,initialSharedVersion:Ee.bcs.u64(),mutable:Ee.bcs.bool()}),Y1=Ee.bcs.enum("ObjectArg",{ImmOrOwnedObject:Xc,SharedObject:K1,Receiving:Xc}),MS=Ee.bcs.enum("Owner",{AddressOwner:an,ObjectOwner:an,Shared:Ee.bcs.struct("Shared",{initialSharedVersion:Ee.bcs.u64()}),Immutable:null,ConsensusV2:Ee.bcs.struct("ConsensusV2",{authenticator:Ee.bcs.enum("Authenticator",{SingleOwner:an}),startVersion:Ee.bcs.u64()})}),J1=Ee.bcs.enum("CallArg",{Pure:Ee.bcs.struct("Pure",{bytes:Ee.bcs.vector(Ee.bcs.u8()).transform({input:e=>typeof e=="string"?(0,Ee.fromBase64)(e):e,output:e=>(0,Ee.toBase64)(new Uint8Array(e))})}),Object:Y1}),cf=Ee.bcs.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:Ee.bcs.lazy(()=>cf),struct:Ee.bcs.lazy(()=>rg),u16:null,u32:null,u256:null}),lf=cf.transform({input:e=>typeof e=="string"?W1.TypeTagSerializer.parseFromStr(e,!0):e,output:e=>W1.TypeTagSerializer.tagToString(e)}),ei=Ee.bcs.enum("Argument",{GasCoin:null,Input:Ee.bcs.u16(),Result:Ee.bcs.u16(),NestedResult:Ee.bcs.tuple([Ee.bcs.u16(),Ee.bcs.u16()])}),X1=Ee.bcs.struct("ProgrammableMoveCall",{package:an,module:Ee.bcs.string(),function:Ee.bcs.string(),typeArguments:Ee.bcs.vector(lf),arguments:Ee.bcs.vector(ei)}),Z1=Ee.bcs.enum("Command",{MoveCall:X1,TransferObjects:Ee.bcs.struct("TransferObjects",{objects:Ee.bcs.vector(ei),address:ei}),SplitCoins:Ee.bcs.struct("SplitCoins",{coin:ei,amounts:Ee.bcs.vector(ei)}),MergeCoins:Ee.bcs.struct("MergeCoins",{destination:ei,sources:Ee.bcs.vector(ei)}),Publish:Ee.bcs.struct("Publish",{modules:Ee.bcs.vector(Ee.bcs.vector(Ee.bcs.u8()).transform({input:e=>typeof e=="string"?(0,Ee.fromBase64)(e):e,output:e=>(0,Ee.toBase64)(new Uint8Array(e))})),dependencies:Ee.bcs.vector(an)}),MakeMoveVec:Ee.bcs.struct("MakeMoveVec",{type:TS(lf).transform({input:e=>e===null?{None:!0}:{Some:e},output:e=>e.Some??null}),elements:Ee.bcs.vector(ei)}),Upgrade:Ee.bcs.struct("Upgrade",{modules:Ee.bcs.vector(Ee.bcs.vector(Ee.bcs.u8()).transform({input:e=>typeof e=="string"?(0,Ee.fromBase64)(e):e,output:e=>(0,Ee.toBase64)(new Uint8Array(e))})),dependencies:Ee.bcs.vector(an),package:an,ticket:ei})}),Q1=Ee.bcs.struct("ProgrammableTransaction",{inputs:Ee.bcs.vector(J1),commands:Ee.bcs.vector(Z1)}),eg=Ee.bcs.enum("TransactionKind",{ProgrammableTransaction:Q1,ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null}),tg=Ee.bcs.enum("TransactionExpiration",{None:null,Epoch:AS()}),rg=Ee.bcs.struct("StructTag",{address:an,module:Ee.bcs.string(),name:Ee.bcs.string(),typeParams:Ee.bcs.vector(cf)}),ng=Ee.bcs.struct("GasData",{payment:Ee.bcs.vector(Xc),owner:an,price:Ee.bcs.u64(),budget:Ee.bcs.u64()}),ig=Ee.bcs.struct("TransactionDataV1",{kind:eg,sender:an,gasData:ng,expiration:tg}),sg=Ee.bcs.enum("TransactionData",{V1:ig}),og=Ee.bcs.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),ag=Ee.bcs.enum("IntentVersion",{V0:null}),cg=Ee.bcs.enum("AppId",{Sui:null}),lg=Ee.bcs.struct("Intent",{scope:og,version:ag,appId:cg});function ug(e){return Ee.bcs.struct(`IntentMessage<${e.name}>`,{intent:lg,value:e})}const dg=Ee.bcs.enum("CompressedSignature",{ED25519:Ee.bcs.fixedArray(64,Ee.bcs.u8()),Secp256k1:Ee.bcs.fixedArray(64,Ee.bcs.u8()),Secp256r1:Ee.bcs.fixedArray(64,Ee.bcs.u8()),ZkLogin:Ee.bcs.vector(Ee.bcs.u8())}),fg=Ee.bcs.enum("PublicKey",{ED25519:Ee.bcs.fixedArray(32,Ee.bcs.u8()),Secp256k1:Ee.bcs.fixedArray(33,Ee.bcs.u8()),Secp256r1:Ee.bcs.fixedArray(33,Ee.bcs.u8()),ZkLogin:Ee.bcs.vector(Ee.bcs.u8())}),hg=Ee.bcs.struct("MultiSigPkMap",{pubKey:fg,weight:Ee.bcs.u8()}),pg=Ee.bcs.struct("MultiSigPublicKey",{pk_map:Ee.bcs.vector(hg),threshold:Ee.bcs.u16()}),IS=Ee.bcs.struct("MultiSig",{sigs:Ee.bcs.vector(dg),bitmap:Ee.bcs.u16(),multisig_pk:pg}),mg=Ee.bcs.vector(Ee.bcs.u8()).transform({input:e=>typeof e=="string"?(0,Ee.fromBase64)(e):e,output:e=>(0,Ee.toBase64)(new Uint8Array(e))}),gg=Ee.bcs.struct("SenderSignedTransaction",{intentMessage:ug(sg),txSignatures:Ee.bcs.vector(mg)}),OS=Ee.bcs.vector(gg,{name:"SenderSignedData"}),PS=Ee.bcs.struct("PasskeyAuthenticator",{authenticatorData:Ee.bcs.vector(Ee.bcs.u8()),clientDataJson:Ee.bcs.string(),userSignature:Ee.bcs.vector(Ee.bcs.u8())});var uf=Object.defineProperty,RS=Object.getOwnPropertyDescriptor,jS=Object.getOwnPropertyNames,NS=Object.prototype.hasOwnProperty,kS=(e,t)=>{for(var r in t)uf(e,r,{get:t[r],enumerable:!0})},DS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of jS(t))!NS.call(e,i)&&i!==r&&uf(e,i,{get:()=>t[i],enumerable:!(n=RS(t,i))||n.enumerable});return e},LS=e=>DS(uf({},"__esModule",{value:!0}),e),vg={};kS(vg,{TransactionEffects:()=>XS});var BS=LS(vg),Te=Bs,Rt=af;const US=Te.bcs.enum("PackageUpgradeError",{UnableToFetchPackage:Te.bcs.struct("UnableToFetchPackage",{packageId:Rt.Address}),NotAPackage:Te.bcs.struct("NotAPackage",{objectId:Rt.Address}),IncompatibleUpgrade:null,DigestDoesNotMatch:Te.bcs.struct("DigestDoesNotMatch",{digest:Te.bcs.vector(Te.bcs.u8())}),UnknownUpgradePolicy:Te.bcs.struct("UnknownUpgradePolicy",{policy:Te.bcs.u8()}),PackageIDDoesNotMatch:Te.bcs.struct("PackageIDDoesNotMatch",{packageId:Rt.Address,ticketId:Rt.Address})}),FS=Te.bcs.struct("ModuleId",{address:Rt.Address,name:Te.bcs.string()}),bg=Te.bcs.struct("MoveLocation",{module:FS,function:Te.bcs.u16(),instruction:Te.bcs.u16(),functionName:Te.bcs.option(Te.bcs.string())}),$S=Te.bcs.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:Te.bcs.struct("IndexOutOfBounds",{idx:Te.bcs.u16()}),SecondaryIndexOutOfBounds:Te.bcs.struct("SecondaryIndexOutOfBounds",{resultIdx:Te.bcs.u16(),secondaryIdx:Te.bcs.u16()}),InvalidResultArity:Te.bcs.struct("InvalidResultArity",{resultIdx:Te.bcs.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null}),VS=Te.bcs.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),zS=Te.bcs.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:Te.bcs.struct("MoveObjectTooBig",{objectSize:Te.bcs.u64(),maxObjectSize:Te.bcs.u64()}),MovePackageTooBig:Te.bcs.struct("MovePackageTooBig",{objectSize:Te.bcs.u64(),maxObjectSize:Te.bcs.u64()}),CircularObjectOwnership:Te.bcs.struct("CircularObjectOwnership",{object:Rt.Address}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:Te.bcs.option(bg),MoveAbort:Te.bcs.tuple([bg,Te.bcs.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:Te.bcs.struct("CommandArgumentError",{argIdx:Te.bcs.u16(),kind:$S}),TypeArgumentError:Te.bcs.struct("TypeArgumentError",{argumentIdx:Te.bcs.u16(),kind:VS}),UnusedValueWithoutDrop:Te.bcs.struct("UnusedValueWithoutDrop",{resultIdx:Te.bcs.u16(),secondaryIdx:Te.bcs.u16()}),InvalidPublicFunctionReturnType:Te.bcs.struct("InvalidPublicFunctionReturnType",{idx:Te.bcs.u16()}),InvalidTransferObject:null,EffectsTooLarge:Te.bcs.struct("EffectsTooLarge",{currentSize:Te.bcs.u64(),maxSize:Te.bcs.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:Te.bcs.struct("PackageUpgradeError",{upgradeError:US}),WrittenObjectsTooLarge:Te.bcs.struct("WrittenObjectsTooLarge",{currentSize:Te.bcs.u64(),maxSize:Te.bcs.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:Te.bcs.struct("ExecutionCancelledDueToSharedObjectCongestion",{congestedObjects:Te.bcs.vector(Rt.Address)}),AddressDeniedForCoin:Te.bcs.struct("AddressDeniedForCoin",{address:Rt.Address,coinType:Te.bcs.string()}),CoinTypeGlobalPause:Te.bcs.struct("CoinTypeGlobalPause",{coinType:Te.bcs.string()}),ExecutionCancelledDueToRandomnessUnavailable:null}),yg=Te.bcs.enum("ExecutionStatus",{Success:null,Failed:Te.bcs.struct("ExecutionFailed",{error:zS,command:Te.bcs.option(Te.bcs.u64())})}),wg=Te.bcs.struct("GasCostSummary",{computationCost:Te.bcs.u64(),storageCost:Te.bcs.u64(),storageRebate:Te.bcs.u64(),nonRefundableStorageFee:Te.bcs.u64()}),qS=Te.bcs.struct("TransactionEffectsV1",{status:yg,executedEpoch:Te.bcs.u64(),gasUsed:wg,modifiedAtVersions:Te.bcs.vector(Te.bcs.tuple([Rt.Address,Te.bcs.u64()])),sharedObjects:Te.bcs.vector(Rt.SuiObjectRef),transactionDigest:Rt.ObjectDigest,created:Te.bcs.vector(Te.bcs.tuple([Rt.SuiObjectRef,Rt.Owner])),mutated:Te.bcs.vector(Te.bcs.tuple([Rt.SuiObjectRef,Rt.Owner])),unwrapped:Te.bcs.vector(Te.bcs.tuple([Rt.SuiObjectRef,Rt.Owner])),deleted:Te.bcs.vector(Rt.SuiObjectRef),unwrappedThenDeleted:Te.bcs.vector(Rt.SuiObjectRef),wrapped:Te.bcs.vector(Rt.SuiObjectRef),gasObject:Te.bcs.tuple([Rt.SuiObjectRef,Rt.Owner]),eventsDigest:Te.bcs.option(Rt.ObjectDigest),dependencies:Te.bcs.vector(Rt.ObjectDigest)}),df=Te.bcs.tuple([Te.bcs.u64(),Rt.ObjectDigest]),HS=Te.bcs.enum("ObjectIn",{NotExist:null,Exist:Te.bcs.tuple([df,Rt.Owner])}),WS=Te.bcs.enum("ObjectOut",{NotExist:null,ObjectWrite:Te.bcs.tuple([Rt.ObjectDigest,Rt.Owner]),PackageWrite:df}),GS=Te.bcs.enum("IDOperation",{None:null,Created:null,Deleted:null}),KS=Te.bcs.struct("EffectsObjectChange",{inputState:HS,outputState:WS,idOperation:GS}),YS=Te.bcs.enum("UnchangedSharedKind",{ReadOnlyRoot:df,MutateDeleted:Te.bcs.u64(),ReadDeleted:Te.bcs.u64(),Cancelled:Te.bcs.u64(),PerEpochConfig:null}),JS=Te.bcs.struct("TransactionEffectsV2",{status:yg,executedEpoch:Te.bcs.u64(),gasUsed:wg,transactionDigest:Rt.ObjectDigest,gasObjectIndex:Te.bcs.option(Te.bcs.u32()),eventsDigest:Te.bcs.option(Rt.ObjectDigest),dependencies:Te.bcs.vector(Rt.ObjectDigest),lamportVersion:Te.bcs.u64(),changedObjects:Te.bcs.vector(Te.bcs.tuple([Rt.Address,KS])),unchangedSharedObjects:Te.bcs.vector(Te.bcs.tuple([Rt.Address,YS])),auxDataDigest:Te.bcs.option(Rt.ObjectDigest)}),XS=Te.bcs.enum("TransactionEffects",{V1:qS,V2:JS});var ff=Object.defineProperty,ZS=Object.getOwnPropertyDescriptor,QS=Object.getOwnPropertyNames,e9=Object.prototype.hasOwnProperty,t9=(e,t)=>{for(var r in t)ff(e,r,{get:t[r],enumerable:!0})},r9=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of QS(t))!e9.call(e,i)&&i!==r&&ff(e,i,{get:()=>t[i],enumerable:!(n=ZS(t,i))||n.enumerable});return e},n9=e=>r9(ff({},"__esModule",{value:!0}),e),xg={};t9(xg,{pureBcsSchemaFromTypeName:()=>hf});var i9=n9(xg),ti=Bs,s9=af;function hf(e){switch(e){case"u8":return ti.bcs.u8();case"u16":return ti.bcs.u16();case"u32":return ti.bcs.u32();case"u64":return ti.bcs.u64();case"u128":return ti.bcs.u128();case"u256":return ti.bcs.u256();case"bool":return ti.bcs.bool();case"string":return ti.bcs.string();case"id":case"address":return s9.Address}const t=e.match(/^(vector|option)<(.+)>$/);if(t){const[r,n]=t.slice(1);return r==="vector"?ti.bcs.vector(hf(n)):ti.bcs.option(hf(n))}throw new Error(`Invalid Pure type name: ${e}`)}var pf=Object.defineProperty,o9=Object.getOwnPropertyDescriptor,a9=Object.getOwnPropertyNames,c9=Object.prototype.hasOwnProperty,l9=(e,t)=>{for(var r in t)pf(e,r,{get:t[r],enumerable:!0})},u9=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of a9(t))!c9.call(e,i)&&i!==r&&pf(e,i,{get:()=>t[i],enumerable:!(n=o9(t,i))||n.enumerable});return e},d9=e=>u9(pf({},"__esModule",{value:!0}),e),Sg={};l9(Sg,{BcsType:()=>p9.BcsType,TypeTagSerializer:()=>h9.TypeTagSerializer,bcs:()=>g9,pureBcsSchemaFromTypeName:()=>m9.pureBcsSchemaFromTypeName});var _g=d9(Sg),ri=Bs,Lt=af,f9=BS,h9=q1,p9=Bs,m9=i9;const g9={...ri.bcs,U8:ri.bcs.u8(),U16:ri.bcs.u16(),U32:ri.bcs.u32(),U64:ri.bcs.u64(),U128:ri.bcs.u128(),U256:ri.bcs.u256(),ULEB128:ri.bcs.uleb128(),Bool:ri.bcs.bool(),String:ri.bcs.string(),Address:Lt.Address,AppId:Lt.AppId,Argument:Lt.Argument,CallArg:Lt.CallArg,Command:Lt.Command,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,PasskeyAuthenticator:Lt.PasskeyAuthenticator,ProgrammableMoveCall:Lt.ProgrammableMoveCall,ProgrammableTransaction:Lt.ProgrammableTransaction,PublicKey:Lt.PublicKey,SenderSignedData:Lt.SenderSignedData,SenderSignedTransaction:Lt.SenderSignedTransaction,SharedObjectRef:Lt.SharedObjectRef,StructTag:Lt.StructTag,SuiObjectRef:Lt.SuiObjectRef,TransactionData:Lt.TransactionData,TransactionDataV1:Lt.TransactionDataV1,TransactionEffects:f9.TransactionEffects,TransactionExpiration:Lt.TransactionExpiration,TransactionKind:Lt.TransactionKind,TypeTag:Lt.TypeTag};Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.SuiPythClient=void 0;const Zc=T7,yo=_g,v9=Ic(),mf=16*1024;class b9{constructor(t,r,n){Et(this,"provider");Et(this,"pythStateId");Et(this,"wormholeStateId");Et(this,"pythPackageId");Et(this,"wormholePackageId");Et(this,"priceTableInfo");Et(this,"priceFeedObjectIdCache",new Map);Et(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,s;if(((s=(i=n.data)==null?void 0:i.content)==null?void 0:s.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 s of t){const[o]=r.moveCall({target:`${n}::vaa::parse_and_verify`,arguments:[r.object(this.wormholeStateId),r.pure(yo.bcs.vector(yo.bcs.U8).serialize(Array.from(s),{maxSize:mf}).toBytes()),r.object(Zc.SUI_CLOCK_OBJECT_ID)]});i.push(o)}return i}async verifyVaasAndGetHotPotato(t,r,n){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]),s=await this.verifyVaas([i],t),[o]=t.moveCall({target:`${n}::pyth::create_authenticated_price_infos_using_accumulator`,arguments:[t.object(this.pythStateId),t.pure(yo.bcs.vector(yo.bcs.U8).serialize(Array.from(r[0]),{maxSize:mf}).toBytes()),s[0],t.object(Zc.SUI_CLOCK_OBJECT_ID)]});return o}async executePriceFeedUpdates(t,r,n,i,s){const o=[];let a=0;for(const c of n){const l=await this.getPriceFeedObjectId(c);if(!l)throw new Error(`Price feed ${c} not found, please create it first`);o.push(l),[i]=t.moveCall({target:`${r}::pyth::update_single_price_feed`,arguments:[t.object(this.pythStateId),i,t.object(l),s[a],t.object(Zc.SUI_CLOCK_OBJECT_ID)]}),a++}return t.moveCall({target:`${r}::hot_potato_vector::destroy`,arguments:[i],typeArguments:[`${r}::price_info::PriceInfo`]}),o}async updatePriceFeeds(t,r,n){const i=await this.getPythPackageId(),s=await this.verifyVaasAndGetHotPotato(t,r,i),o=await this.getBaseUpdateFee(),a=t.splitCoins(t.gas,n.map(()=>t.pure.u64(o)));return await this.executePriceFeedUpdates(t,i,n,s,a)}async updatePriceFeedsWithCoins(t,r,n,i){const s=await this.getPythPackageId(),o=await this.verifyVaasAndGetHotPotato(t,r,s);return await this.executePriceFeedUpdates(t,s,n,o,i)}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]),s=await this.verifyVaas([i],t);t.moveCall({target:`${n}::pyth::create_price_feeds_using_accumulator`,arguments:[t.object(this.pythStateId),t.pure(yo.bcs.vector(yo.bcs.U8).serialize(Array.from(r[0]),{maxSize:mf}).toBytes()),s[0],t.object(Zc.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(),s=await this.provider.getDynamicFieldObject({parentId:n,name:{type:`${i}::price_identifier::PriceIdentifier`,value:{bytes:Array.from(v9.Buffer.from(r,"hex"))}}});if(!s.data||!s.data.content)return;if(s.data.content.dataType!=="moveObject")throw new Error("Price feed type mismatch");this.priceFeedObjectIdCache.set(r,s.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),s=n+2;return t.subarray(s,s+i)}}Jc.SuiPythClient=b9,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PriceFeed=e.Price=e.SuiPythClient=e.SuiPriceServiceConnection=void 0;var t=Ac;Object.defineProperty(e,"SuiPriceServiceConnection",{enumerable:!0,get:function(){return t.SuiPriceServiceConnection}});var r=Jc;Object.defineProperty(e,"SuiPythClient",{enumerable:!0,get:function(){return r.SuiPythClient}});var n=dd;Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return n.Price}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return n.PriceFeed}})}(ud);var Qc={exports:{}},Eg={exports:{}},Cg={exports:{}};(function(e){(function(t){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,s=Math.floor,o="[BigNumber Error] ",a=o+"Number primitive has more than 15 significant digits: ",c=1e14,l=14,u=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,y=1e9;function x(H){var $,Z,ce,ne=k.prototype={constructor:k,toString:null,valueOf:null},de=new k(1),q=20,N=4,h=-7,d=21,m=-1e7,S=1e7,E=!1,M=1,j=0,I={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},g="0123456789abcdefghijklmnopqrstuvwxyz",b=!0;function k(L,z){var G,re,ee,Q,fe,W,K,te,oe=this;if(!(oe instanceof k))return new k(L,z);if(z==null){if(L&&L._isBigNumber===!0){oe.s=L.s,!L.c||L.e>S?oe.c=oe.e=null:L.e<m?oe.c=[oe.e=0]:(oe.e=L.e,oe.c=L.c.slice());return}if((W=typeof L=="number")&&L*0==0){if(oe.s=1/L<0?(L=-L,-1):1,L===~~L){for(Q=0,fe=L;fe>=10;fe/=10,Q++);Q>S?oe.c=oe.e=null:(oe.e=Q,oe.c=[L]);return}te=String(L)}else{if(!n.test(te=String(L)))return ce(oe,te,W);oe.s=te.charCodeAt(0)==45?(te=te.slice(1),-1):1}(Q=te.indexOf("."))>-1&&(te=te.replace(".","")),(fe=te.search(/e/i))>0?(Q<0&&(Q=fe),Q+=+te.slice(fe+1),te=te.substring(0,fe)):Q<0&&(Q=te.length)}else{if(O(z,2,g.length,"Base"),z==10&&b)return oe=new k(L),Oe(oe,q+oe.e+1,N);if(te=String(L),W=typeof L=="number"){if(L*0!=0)return ce(oe,te,W,z);if(oe.s=1/L<0?(te=te.slice(1),-1):1,k.DEBUG&&te.replace(/^0\.0*|\./,"").length>15)throw Error(a+L)}else oe.s=te.charCodeAt(0)===45?(te=te.slice(1),-1):1;for(G=g.slice(0,z),Q=fe=0,K=te.length;fe<K;fe++)if(G.indexOf(re=te.charAt(fe))<0){if(re=="."){if(fe>Q){Q=K;continue}}else if(!ee&&(te==te.toUpperCase()&&(te=te.toLowerCase())||te==te.toLowerCase()&&(te=te.toUpperCase()))){ee=!0,fe=-1,Q=0;continue}return ce(oe,String(L),W,z)}W=!1,te=Z(te,z,10,oe.s),(Q=te.indexOf("."))>-1?te=te.replace(".",""):Q=te.length}for(fe=0;te.charCodeAt(fe)===48;fe++);for(K=te.length;te.charCodeAt(--K)===48;);if(te=te.slice(fe,++K)){if(K-=fe,W&&k.DEBUG&&K>15&&(L>u||L!==s(L)))throw Error(a+oe.s*L);if((Q=Q-fe-1)>S)oe.c=oe.e=null;else if(Q<m)oe.c=[oe.e=0];else{if(oe.e=Q,oe.c=[],fe=(Q+1)%l,Q<0&&(fe+=l),fe<K){for(fe&&oe.c.push(+te.slice(0,fe)),K-=l;fe<K;)oe.c.push(+te.slice(fe,fe+=l));fe=l-(te=te.slice(fe)).length}else fe-=K;for(;fe--;te+="0");oe.c.push(+te)}}else oe.c=[oe.e=0]}k.clone=x,k.ROUND_UP=0,k.ROUND_DOWN=1,k.ROUND_CEIL=2,k.ROUND_FLOOR=3,k.ROUND_HALF_UP=4,k.ROUND_HALF_DOWN=5,k.ROUND_HALF_EVEN=6,k.ROUND_HALF_CEIL=7,k.ROUND_HALF_FLOOR=8,k.EUCLID=9,k.config=k.set=function(L){var z,G;if(L!=null)if(typeof L=="object"){if(L.hasOwnProperty(z="DECIMAL_PLACES")&&(G=L[z],O(G,0,y,z),q=G),L.hasOwnProperty(z="ROUNDING_MODE")&&(G=L[z],O(G,0,8,z),N=G),L.hasOwnProperty(z="EXPONENTIAL_AT")&&(G=L[z],G&&G.pop?(O(G[0],-y,0,z),O(G[1],0,y,z),h=G[0],d=G[1]):(O(G,-y,y,z),h=-(d=G<0?-G:G))),L.hasOwnProperty(z="RANGE"))if(G=L[z],G&&G.pop)O(G[0],-y,-1,z),O(G[1],1,y,z),m=G[0],S=G[1];else if(O(G,-y,y,z),G)m=-(S=G<0?-G:G);else throw Error(o+z+" cannot be zero: "+G);if(L.hasOwnProperty(z="CRYPTO"))if(G=L[z],G===!!G)if(G)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))E=G;else throw E=!G,Error(o+"crypto unavailable");else E=G;else throw Error(o+z+" not true or false: "+G);if(L.hasOwnProperty(z="MODULO_MODE")&&(G=L[z],O(G,0,9,z),M=G),L.hasOwnProperty(z="POW_PRECISION")&&(G=L[z],O(G,0,y,z),j=G),L.hasOwnProperty(z="FORMAT"))if(G=L[z],typeof G=="object")I=G;else throw Error(o+z+" not an object: "+G);if(L.hasOwnProperty(z="ALPHABET"))if(G=L[z],typeof G=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(G))b=G.slice(0,10)=="0123456789",g=G;else throw Error(o+z+" invalid: "+G)}else throw Error(o+"Object expected: "+L);return{DECIMAL_PLACES:q,ROUNDING_MODE:N,EXPONENTIAL_AT:[h,d],RANGE:[m,S],CRYPTO:E,MODULO_MODE:M,POW_PRECISION:j,FORMAT:I,ALPHABET:g}},k.isBigNumber=function(L){if(!L||L._isBigNumber!==!0)return!1;if(!k.DEBUG)return!0;var z,G,re=L.c,ee=L.e,Q=L.s;e:if({}.toString.call(re)=="[object Array]"){if((Q===1||Q===-1)&&ee>=-y&&ee<=y&&ee===s(ee)){if(re[0]===0){if(ee===0&&re.length===1)return!0;break e}if(z=(ee+1)%l,z<1&&(z+=l),String(re[0]).length==z){for(z=0;z<re.length;z++)if(G=re[z],G<0||G>=c||G!==s(G))break e;if(G!==0)return!0}}}else if(re===null&&ee===null&&(Q===null||Q===1||Q===-1))return!0;throw Error(o+"Invalid BigNumber: "+L)},k.maximum=k.max=function(){return he(arguments,-1)},k.minimum=k.min=function(){return he(arguments,1)},k.random=function(){var L=9007199254740992,z=Math.random()*L&2097151?function(){return s(Math.random()*L)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(G){var re,ee,Q,fe,W,K=0,te=[],oe=new k(de);if(G==null?G=q:O(G,0,y),fe=i(G/l),E)if(crypto.getRandomValues){for(re=crypto.getRandomValues(new Uint32Array(fe*=2));K<fe;)W=re[K]*131072+(re[K+1]>>>11),W>=9e15?(ee=crypto.getRandomValues(new Uint32Array(2)),re[K]=ee[0],re[K+1]=ee[1]):(te.push(W%1e14),K+=2);K=fe/2}else if(crypto.randomBytes){for(re=crypto.randomBytes(fe*=7);K<fe;)W=(re[K]&31)*281474976710656+re[K+1]*1099511627776+re[K+2]*4294967296+re[K+3]*16777216+(re[K+4]<<16)+(re[K+5]<<8)+re[K+6],W>=9e15?crypto.randomBytes(7).copy(re,K):(te.push(W%1e14),K+=7);K=fe/7}else throw E=!1,Error(o+"crypto unavailable");if(!E)for(;K<fe;)W=z(),W<9e15&&(te[K++]=W%1e14);for(fe=te[--K],G%=l,fe&&G&&(W=f[l-G],te[K]=s(fe/W)*W);te[K]===0;te.pop(),K--);if(K<0)te=[Q=0];else{for(Q=-1;te[0]===0;te.splice(0,1),Q-=l);for(K=1,W=te[0];W>=10;W/=10,K++);K<l&&(Q-=l-K)}return oe.e=Q,oe.c=te,oe}}(),k.sum=function(){for(var L=1,z=arguments,G=new k(z[0]);L<z.length;)G=G.plus(z[L++]);return G},Z=function(){var L="0123456789";function z(G,re,ee,Q){for(var fe,W=[0],K,te=0,oe=G.length;te<oe;){for(K=W.length;K--;W[K]*=re);for(W[0]+=Q.indexOf(G.charAt(te++)),fe=0;fe<W.length;fe++)W[fe]>ee-1&&(W[fe+1]==null&&(W[fe+1]=0),W[fe+1]+=W[fe]/ee|0,W[fe]%=ee)}return W.reverse()}return function(G,re,ee,Q,fe){var W,K,te,oe,pe,Se,_e,Ne,He=G.indexOf("."),Ge=q,Re=N;for(He>=0&&(oe=j,j=0,G=G.replace(".",""),Ne=new k(re),Se=Ne.pow(G.length-He),j=oe,Ne.c=z(B(_(Se.c),Se.e,"0"),10,ee,L),Ne.e=Ne.c.length),_e=z(G,re,ee,fe?(W=g,L):(W=L,g)),te=oe=_e.length;_e[--oe]==0;_e.pop());if(!_e[0])return W.charAt(0);if(He<0?--te:(Se.c=_e,Se.e=te,Se.s=Q,Se=$(Se,Ne,Ge,Re,ee),_e=Se.c,pe=Se.r,te=Se.e),K=te+Ge+1,He=_e[K],oe=ee/2,pe=pe||K<0||_e[K+1]!=null,pe=Re<4?(He!=null||pe)&&(Re==0||Re==(Se.s<0?3:2)):He>oe||He==oe&&(Re==4||pe||Re==6&&_e[K-1]&1||Re==(Se.s<0?8:7)),K<1||!_e[0])G=pe?B(W.charAt(1),-Ge,W.charAt(0)):W.charAt(0);else{if(_e.length=K,pe)for(--ee;++_e[--K]>ee;)_e[K]=0,K||(++te,_e=[1].concat(_e));for(oe=_e.length;!_e[--oe];);for(He=0,G="";He<=oe;G+=W.charAt(_e[He++]));G=B(G,te,W.charAt(0))}return G}}(),$=function(){function L(re,ee,Q){var fe,W,K,te,oe=0,pe=re.length,Se=ee%p,_e=ee/p|0;for(re=re.slice();pe--;)K=re[pe]%p,te=re[pe]/p|0,fe=_e*K+te*Se,W=Se*K+fe%p*p+oe,oe=(W/Q|0)+(fe/p|0)+_e*te,re[pe]=W%Q;return oe&&(re=[oe].concat(re)),re}function z(re,ee,Q,fe){var W,K;if(Q!=fe)K=Q>fe?1:-1;else for(W=K=0;W<Q;W++)if(re[W]!=ee[W]){K=re[W]>ee[W]?1:-1;break}return K}function G(re,ee,Q,fe){for(var W=0;Q--;)re[Q]-=W,W=re[Q]<ee[Q]?1:0,re[Q]=W*fe+re[Q]-ee[Q];for(;!re[0]&&re.length>1;re.splice(0,1));}return function(re,ee,Q,fe,W){var K,te,oe,pe,Se,_e,Ne,He,Ge,Re,Ke,nt,Qe,Mt,jt,Xe,St,vt=re.s==ee.s?1:-1,Ye=re.c,it=ee.c;if(!Ye||!Ye[0]||!it||!it[0])return new k(!re.s||!ee.s||(Ye?it&&Ye[0]==it[0]:!it)?NaN:Ye&&Ye[0]==0||!it?vt*0:vt/0);for(He=new k(vt),Ge=He.c=[],te=re.e-ee.e,vt=Q+te+1,W||(W=c,te=v(re.e/l)-v(ee.e/l),vt=vt/l|0),oe=0;it[oe]==(Ye[oe]||0);oe++);if(it[oe]>(Ye[oe]||0)&&te--,vt<0)Ge.push(1),pe=!0;else{for(Mt=Ye.length,Xe=it.length,oe=0,vt+=2,Se=s(W/(it[0]+1)),Se>1&&(it=L(it,Se,W),Ye=L(Ye,Se,W),Xe=it.length,Mt=Ye.length),Qe=Xe,Re=Ye.slice(0,Xe),Ke=Re.length;Ke<Xe;Re[Ke++]=0);St=it.slice(),St=[0].concat(St),jt=it[0],it[1]>=W/2&&jt++;do{if(Se=0,K=z(it,Re,Xe,Ke),K<0){if(nt=Re[0],Xe!=Ke&&(nt=nt*W+(Re[1]||0)),Se=s(nt/jt),Se>1)for(Se>=W&&(Se=W-1),_e=L(it,Se,W),Ne=_e.length,Ke=Re.length;z(_e,Re,Ne,Ke)==1;)Se--,G(_e,Xe<Ne?St:it,Ne,W),Ne=_e.length,K=1;else Se==0&&(K=Se=1),_e=it.slice(),Ne=_e.length;if(Ne<Ke&&(_e=[0].concat(_e)),G(Re,_e,Ke,W),Ke=Re.length,K==-1)for(;z(it,Re,Xe,Ke)<1;)Se++,G(Re,Xe<Ke?St:it,Ke,W),Ke=Re.length}else K===0&&(Se++,Re=[0]);Ge[oe++]=Se,Re[0]?Re[Ke++]=Ye[Qe]||0:(Re=[Ye[Qe]],Ke=1)}while((Qe++<Mt||Re[0]!=null)&&vt--);pe=Re[0]!=null,Ge[0]||Ge.splice(0,1)}if(W==c){for(oe=1,vt=Ge[0];vt>=10;vt/=10,oe++);Oe(He,Q+(He.e=oe+te*l-1)+1,fe,pe)}else He.e=te,He.r=+pe;return He}}();function ve(L,z,G,re){var ee,Q,fe,W,K;if(G==null?G=N:O(G,0,8),!L.c)return L.toString();if(ee=L.c[0],fe=L.e,z==null)K=_(L.c),K=re==1||re==2&&(fe<=h||fe>=d)?F(K,fe):B(K,fe,"0");else if(L=Oe(new k(L),z,G),Q=L.e,K=_(L.c),W=K.length,re==1||re==2&&(z<=Q||Q<=h)){for(;W<z;K+="0",W++);K=F(K,Q)}else if(z-=fe+(re===2&&Q>fe),K=B(K,Q,"0"),Q+1>W){if(--z>0)for(K+=".";z--;K+="0");}else if(z+=Q-W,z>0)for(Q+1==W&&(K+=".");z--;K+="0");return L.s<0&&ee?"-"+K:K}function he(L,z){for(var G,re,ee=1,Q=new k(L[0]);ee<L.length;ee++)re=new k(L[ee]),(!re.s||(G=T(Q,re))===z||G===0&&Q.s===z)&&(Q=re);return Q}function we(L,z,G){for(var re=1,ee=z.length;!z[--ee];z.pop());for(ee=z[0];ee>=10;ee/=10,re++);return(G=re+G*l-1)>S?L.c=L.e=null:G<m?L.c=[L.e=0]:(L.e=G,L.c=z),L}ce=function(){var L=/^(-?)0([xbo])(?=\w[\w.]*$)/i,z=/^([^.]+)\.$/,G=/^\.([^.]+)$/,re=/^-?(Infinity|NaN)$/,ee=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(Q,fe,W,K){var te,oe=W?fe:fe.replace(ee,"");if(re.test(oe))Q.s=isNaN(oe)?null:oe<0?-1:1;else{if(!W&&(oe=oe.replace(L,function(pe,Se,_e){return te=(_e=_e.toLowerCase())=="x"?16:_e=="b"?2:8,!K||K==te?Se:pe}),K&&(te=K,oe=oe.replace(z,"$1").replace(G,"0.$1")),fe!=oe))return new k(oe,te);if(k.DEBUG)throw Error(o+"Not a"+(K?" base "+K:"")+" number: "+fe);Q.s=null}Q.c=Q.e=null}}();function Oe(L,z,G,re){var ee,Q,fe,W,K,te,oe,pe=L.c,Se=f;if(pe){e:{for(ee=1,W=pe[0];W>=10;W/=10,ee++);if(Q=z-ee,Q<0)Q+=l,fe=z,K=pe[te=0],oe=s(K/Se[ee-fe-1]%10);else if(te=i((Q+1)/l),te>=pe.length)if(re){for(;pe.length<=te;pe.push(0));K=oe=0,ee=1,Q%=l,fe=Q-l+1}else break e;else{for(K=W=pe[te],ee=1;W>=10;W/=10,ee++);Q%=l,fe=Q-l+ee,oe=fe<0?0:s(K/Se[ee-fe-1]%10)}if(re=re||z<0||pe[te+1]!=null||(fe<0?K:K%Se[ee-fe-1]),re=G<4?(oe||re)&&(G==0||G==(L.s<0?3:2)):oe>5||oe==5&&(G==4||re||G==6&&(Q>0?fe>0?K/Se[ee-fe]:0:pe[te-1])%10&1||G==(L.s<0?8:7)),z<1||!pe[0])return pe.length=0,re?(z-=L.e+1,pe[0]=Se[(l-z%l)%l],L.e=-z||0):pe[0]=L.e=0,L;if(Q==0?(pe.length=te,W=1,te--):(pe.length=te+1,W=Se[l-Q],pe[te]=fe>0?s(K/Se[ee-fe]%Se[fe])*W:0),re)for(;;)if(te==0){for(Q=1,fe=pe[0];fe>=10;fe/=10,Q++);for(fe=pe[0]+=W,W=1;fe>=10;fe/=10,W++);Q!=W&&(L.e++,pe[0]==c&&(pe[0]=1));break}else{if(pe[te]+=W,pe[te]!=c)break;pe[te--]=0,W=1}for(Q=pe.length;pe[--Q]===0;pe.pop());}L.e>S?L.c=L.e=null:L.e<m&&(L.c=[L.e=0])}return L}function je(L){var z,G=L.e;return G===null?L.toString():(z=_(L.c),z=G<=h||G>=d?F(z,G):B(z,G,"0"),L.s<0?"-"+z:z)}return ne.absoluteValue=ne.abs=function(){var L=new k(this);return L.s<0&&(L.s=1),L},ne.comparedTo=function(L,z){return T(this,new k(L,z))},ne.decimalPlaces=ne.dp=function(L,z){var G,re,ee,Q=this;if(L!=null)return O(L,0,y),z==null?z=N:O(z,0,8),Oe(new k(Q),L+Q.e+1,z);if(!(G=Q.c))return null;if(re=((ee=G.length-1)-v(this.e/l))*l,ee=G[ee])for(;ee%10==0;ee/=10,re--);return re<0&&(re=0),re},ne.dividedBy=ne.div=function(L,z){return $(this,new k(L,z),q,N)},ne.dividedToIntegerBy=ne.idiv=function(L,z){return $(this,new k(L,z),0,1)},ne.exponentiatedBy=ne.pow=function(L,z){var G,re,ee,Q,fe,W,K,te,oe,pe=this;if(L=new k(L),L.c&&!L.isInteger())throw Error(o+"Exponent not an integer: "+je(L));if(z!=null&&(z=new k(z)),W=L.e>14,!pe.c||!pe.c[0]||pe.c[0]==1&&!pe.e&&pe.c.length==1||!L.c||!L.c[0])return oe=new k(Math.pow(+je(pe),W?L.s*(2-R(L)):+je(L))),z?oe.mod(z):oe;if(K=L.s<0,z){if(z.c?!z.c[0]:!z.s)return new k(NaN);re=!K&&pe.isInteger()&&z.isInteger(),re&&(pe=pe.mod(z))}else{if(L.e>9&&(pe.e>0||pe.e<-1||(pe.e==0?pe.c[0]>1||W&&pe.c[1]>=24e7:pe.c[0]<8e13||W&&pe.c[0]<=9999975e7)))return Q=pe.s<0&&R(L)?-0:0,pe.e>-1&&(Q=1/Q),new k(K?1/Q:Q);j&&(Q=i(j/l+2))}for(W?(G=new k(.5),K&&(L.s=1),te=R(L)):(ee=Math.abs(+je(L)),te=ee%2),oe=new k(de);;){if(te){if(oe=oe.times(pe),!oe.c)break;Q?oe.c.length>Q&&(oe.c.length=Q):re&&(oe=oe.mod(z))}if(ee){if(ee=s(ee/2),ee===0)break;te=ee%2}else if(L=L.times(G),Oe(L,L.e+1,1),L.e>14)te=R(L);else{if(ee=+je(L),ee===0)break;te=ee%2}pe=pe.times(pe),Q?pe.c&&pe.c.length>Q&&(pe.c.length=Q):re&&(pe=pe.mod(z))}return re?oe:(K&&(oe=de.div(oe)),z?oe.mod(z):Q?Oe(oe,j,N,fe):oe)},ne.integerValue=function(L){var z=new k(this);return L==null?L=N:O(L,0,8),Oe(z,z.e+1,L)},ne.isEqualTo=ne.eq=function(L,z){return T(this,new k(L,z))===0},ne.isFinite=function(){return!!this.c},ne.isGreaterThan=ne.gt=function(L,z){return T(this,new k(L,z))>0},ne.isGreaterThanOrEqualTo=ne.gte=function(L,z){return(z=T(this,new k(L,z)))===1||z===0},ne.isInteger=function(){return!!this.c&&v(this.e/l)>this.c.length-2},ne.isLessThan=ne.lt=function(L,z){return T(this,new k(L,z))<0},ne.isLessThanOrEqualTo=ne.lte=function(L,z){return(z=T(this,new k(L,z)))===-1||z===0},ne.isNaN=function(){return!this.s},ne.isNegative=function(){return this.s<0},ne.isPositive=function(){return this.s>0},ne.isZero=function(){return!!this.c&&this.c[0]==0},ne.minus=function(L,z){var G,re,ee,Q,fe=this,W=fe.s;if(L=new k(L,z),z=L.s,!W||!z)return new k(NaN);if(W!=z)return L.s=-z,fe.plus(L);var K=fe.e/l,te=L.e/l,oe=fe.c,pe=L.c;if(!K||!te){if(!oe||!pe)return oe?(L.s=-z,L):new k(pe?fe:NaN);if(!oe[0]||!pe[0])return pe[0]?(L.s=-z,L):new k(oe[0]?fe:N==3?-0:0)}if(K=v(K),te=v(te),oe=oe.slice(),W=K-te){for((Q=W<0)?(W=-W,ee=oe):(te=K,ee=pe),ee.reverse(),z=W;z--;ee.push(0));ee.reverse()}else for(re=(Q=(W=oe.length)<(z=pe.length))?W:z,W=z=0;z<re;z++)if(oe[z]!=pe[z]){Q=oe[z]<pe[z];break}if(Q&&(ee=oe,oe=pe,pe=ee,L.s=-L.s),z=(re=pe.length)-(G=oe.length),z>0)for(;z--;oe[G++]=0);for(z=c-1;re>W;){if(oe[--re]<pe[re]){for(G=re;G&&!oe[--G];oe[G]=z);--oe[G],oe[re]+=c}oe[re]-=pe[re]}for(;oe[0]==0;oe.splice(0,1),--te);return oe[0]?we(L,oe,te):(L.s=N==3?-1:1,L.c=[L.e=0],L)},ne.modulo=ne.mod=function(L,z){var G,re,ee=this;return L=new k(L,z),!ee.c||!L.s||L.c&&!L.c[0]?new k(NaN):!L.c||ee.c&&!ee.c[0]?new k(ee):(M==9?(re=L.s,L.s=1,G=$(ee,L,0,3),L.s=re,G.s*=re):G=$(ee,L,0,M),L=ee.minus(G.times(L)),!L.c[0]&&M==1&&(L.s=ee.s),L)},ne.multipliedBy=ne.times=function(L,z){var G,re,ee,Q,fe,W,K,te,oe,pe,Se,_e,Ne,He,Ge,Re=this,Ke=Re.c,nt=(L=new k(L,z)).c;if(!Ke||!nt||!Ke[0]||!nt[0])return!Re.s||!L.s||Ke&&!Ke[0]&&!nt||nt&&!nt[0]&&!Ke?L.c=L.e=L.s=null:(L.s*=Re.s,!Ke||!nt?L.c=L.e=null:(L.c=[0],L.e=0)),L;for(re=v(Re.e/l)+v(L.e/l),L.s*=Re.s,K=Ke.length,pe=nt.length,K<pe&&(Ne=Ke,Ke=nt,nt=Ne,ee=K,K=pe,pe=ee),ee=K+pe,Ne=[];ee--;Ne.push(0));for(He=c,Ge=p,ee=pe;--ee>=0;){for(G=0,Se=nt[ee]%Ge,_e=nt[ee]/Ge|0,fe=K,Q=ee+fe;Q>ee;)te=Ke[--fe]%Ge,oe=Ke[fe]/Ge|0,W=_e*te+oe*Se,te=Se*te+W%Ge*Ge+Ne[Q]+G,G=(te/He|0)+(W/Ge|0)+_e*oe,Ne[Q--]=te%He;Ne[Q]=G}return G?++re:Ne.splice(0,1),we(L,Ne,re)},ne.negated=function(){var L=new k(this);return L.s=-L.s||null,L},ne.plus=function(L,z){var G,re=this,ee=re.s;if(L=new k(L,z),z=L.s,!ee||!z)return new k(NaN);if(ee!=z)return L.s=-z,re.minus(L);var Q=re.e/l,fe=L.e/l,W=re.c,K=L.c;if(!Q||!fe){if(!W||!K)return new k(ee/0);if(!W[0]||!K[0])return K[0]?L:new k(W[0]?re:ee*0)}if(Q=v(Q),fe=v(fe),W=W.slice(),ee=Q-fe){for(ee>0?(fe=Q,G=K):(ee=-ee,G=W),G.reverse();ee--;G.push(0));G.reverse()}for(ee=W.length,z=K.length,ee-z<0&&(G=K,K=W,W=G,z=ee),ee=0;z;)ee=(W[--z]=W[z]+K[z]+ee)/c|0,W[z]=c===W[z]?0:W[z]%c;return ee&&(W=[ee].concat(W),++fe),we(L,W,fe)},ne.precision=ne.sd=function(L,z){var G,re,ee,Q=this;if(L!=null&&L!==!!L)return O(L,1,y),z==null?z=N:O(z,0,8),Oe(new k(Q),L,z);if(!(G=Q.c))return null;if(ee=G.length-1,re=ee*l+1,ee=G[ee]){for(;ee%10==0;ee/=10,re--);for(ee=G[0];ee>=10;ee/=10,re++);}return L&&Q.e+1>re&&(re=Q.e+1),re},ne.shiftedBy=function(L){return O(L,-u,u),this.times("1e"+L)},ne.squareRoot=ne.sqrt=function(){var L,z,G,re,ee,Q=this,fe=Q.c,W=Q.s,K=Q.e,te=q+4,oe=new k("0.5");if(W!==1||!fe||!fe[0])return new k(!W||W<0&&(!fe||fe[0])?NaN:fe?Q:1/0);if(W=Math.sqrt(+je(Q)),W==0||W==1/0?(z=_(fe),(z.length+K)%2==0&&(z+="0"),W=Math.sqrt(+z),K=v((K+1)/2)-(K<0||K%2),W==1/0?z="5e"+K:(z=W.toExponential(),z=z.slice(0,z.indexOf("e")+1)+K),G=new k(z)):G=new k(W+""),G.c[0]){for(K=G.e,W=K+te,W<3&&(W=0);;)if(ee=G,G=oe.times(ee.plus($(Q,ee,te,1))),_(ee.c).slice(0,W)===(z=_(G.c)).slice(0,W))if(G.e<K&&--W,z=z.slice(W-3,W+1),z=="9999"||!re&&z=="4999"){if(!re&&(Oe(ee,ee.e+q+2,0),ee.times(ee).eq(Q))){G=ee;break}te+=4,W+=4,re=1}else{(!+z||!+z.slice(1)&&z.charAt(0)=="5")&&(Oe(G,G.e+q+2,1),L=!G.times(G).eq(Q));break}}return Oe(G,G.e+q+1,N,L)},ne.toExponential=function(L,z){return L!=null&&(O(L,0,y),L++),ve(this,L,z,1)},ne.toFixed=function(L,z){return L!=null&&(O(L,0,y),L=L+this.e+1),ve(this,L,z)},ne.toFormat=function(L,z,G){var re,ee=this;if(G==null)L!=null&&z&&typeof z=="object"?(G=z,z=null):L&&typeof L=="object"?(G=L,L=z=null):G=I;else if(typeof G!="object")throw Error(o+"Argument not an object: "+G);if(re=ee.toFixed(L,z),ee.c){var Q,fe=re.split("."),W=+G.groupSize,K=+G.secondaryGroupSize,te=G.groupSeparator||"",oe=fe[0],pe=fe[1],Se=ee.s<0,_e=Se?oe.slice(1):oe,Ne=_e.length;if(K&&(Q=W,W=K,K=Q,Ne-=Q),W>0&&Ne>0){for(Q=Ne%W||W,oe=_e.substr(0,Q);Q<Ne;Q+=W)oe+=te+_e.substr(Q,W);K>0&&(oe+=te+_e.slice(Q)),Se&&(oe="-"+oe)}re=pe?oe+(G.decimalSeparator||"")+((K=+G.fractionGroupSize)?pe.replace(new RegExp("\\d{"+K+"}\\B","g"),"$&"+(G.fractionGroupSeparator||"")):pe):oe}return(G.prefix||"")+re+(G.suffix||"")},ne.toFraction=function(L){var z,G,re,ee,Q,fe,W,K,te,oe,pe,Se,_e=this,Ne=_e.c;if(L!=null&&(W=new k(L),!W.isInteger()&&(W.c||W.s!==1)||W.lt(de)))throw Error(o+"Argument "+(W.isInteger()?"out of range: ":"not an integer: ")+je(W));if(!Ne)return new k(_e);for(z=new k(de),te=G=new k(de),re=K=new k(de),Se=_(Ne),Q=z.e=Se.length-_e.e-1,z.c[0]=f[(fe=Q%l)<0?l+fe:fe],L=!L||W.comparedTo(z)>0?Q>0?z:te:W,fe=S,S=1/0,W=new k(Se),K.c[0]=0;oe=$(W,z,0,1),ee=G.plus(oe.times(re)),ee.comparedTo(L)!=1;)G=re,re=ee,te=K.plus(oe.times(ee=te)),K=ee,z=W.minus(oe.times(ee=z)),W=ee;return ee=$(L.minus(G),re,0,1),K=K.plus(ee.times(te)),G=G.plus(ee.times(re)),K.s=te.s=_e.s,Q=Q*2,pe=$(te,re,Q,N).minus(_e).abs().comparedTo($(K,G,Q,N).minus(_e).abs())<1?[te,re]:[K,G],S=fe,pe},ne.toNumber=function(){return+je(this)},ne.toPrecision=function(L,z){return L!=null&&O(L,1,y),ve(this,L,z,2)},ne.toString=function(L){var z,G=this,re=G.s,ee=G.e;return ee===null?re?(z="Infinity",re<0&&(z="-"+z)):z="NaN":(L==null?z=ee<=h||ee>=d?F(_(G.c),ee):B(_(G.c),ee,"0"):L===10&&b?(G=Oe(new k(G),q+ee+1,N),z=B(_(G.c),G.e,"0")):(O(L,2,g.length,"Base"),z=Z(B(_(G.c),ee,"0"),10,L,re,!0)),re<0&&G.c[0]&&(z="-"+z)),z},ne.valueOf=ne.toJSON=function(){return je(this)},ne._isBigNumber=!0,H!=null&&k.set(H),k}function v(H){var $=H|0;return H>0||H===$?$:$-1}function _(H){for(var $,Z,ce=1,ne=H.length,de=H[0]+"";ce<ne;){for($=H[ce++]+"",Z=l-$.length;Z--;$="0"+$);de+=$}for(ne=de.length;de.charCodeAt(--ne)===48;);return de.slice(0,ne+1||1)}function T(H,$){var Z,ce,ne=H.c,de=$.c,q=H.s,N=$.s,h=H.e,d=$.e;if(!q||!N)return null;if(Z=ne&&!ne[0],ce=de&&!de[0],Z||ce)return Z?ce?0:-N:q;if(q!=N)return q;if(Z=q<0,ce=h==d,!ne||!de)return ce?0:!ne^Z?1:-1;if(!ce)return h>d^Z?1:-1;for(N=(h=ne.length)<(d=de.length)?h:d,q=0;q<N;q++)if(ne[q]!=de[q])return ne[q]>de[q]^Z?1:-1;return h==d?0:h>d^Z?1:-1}function O(H,$,Z,ce){if(H<$||H>Z||H!==s(H))throw Error(o+(ce||"Argument")+(typeof H=="number"?H<$||H>Z?" out of range: ":" not an integer: ":" not a primitive number: ")+String(H))}function R(H){var $=H.c.length-1;return v(H.e/l)==$&&H.c[$]%2!=0}function F(H,$){return(H.length>1?H.charAt(0)+"."+H.slice(1):H)+($<0?"e":"e+")+$}function B(H,$,Z){var ce,ne;if($<0){for(ne=Z+".";++$;ne+=Z);H=ne+H}else if(ce=H.length,++$>ce){for(ne=Z,$-=ce;--$;ne+=Z);H+=ne}else $<ce&&(H=H.slice(0,$)+"."+H.slice($));return H}r=x(),r.default=r.BigNumber=r,e.exports?e.exports=r:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=r)})(Cr)})(Cg);var Ag=Cg.exports;(function(e){var t=Ag,r=e.exports;(function(){var n=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i,s,o={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},a;function c(u){return n.lastIndex=0,n.test(u)?'"'+u.replace(n,function(f){var p=o[f];return typeof p=="string"?p:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+u+'"'}function l(u,f){var p,y,x,v,_=i,T,O=f[u],R=O!=null&&(O instanceof t||t.isBigNumber(O));switch(O&&typeof O=="object"&&typeof O.toJSON=="function"&&(O=O.toJSON(u)),typeof a=="function"&&(O=a.call(f,u,O)),typeof O){case"string":return R?O:c(O);case"number":return isFinite(O)?String(O):"null";case"boolean":case"null":case"bigint":return String(O);case"object":if(!O)return"null";if(i+=s,T=[],Object.prototype.toString.apply(O)==="[object Array]"){for(v=O.length,p=0;p<v;p+=1)T[p]=l(p,O)||"null";return x=T.length===0?"[]":i?`[
|
|
29
|
+
*/(function(O){const R=r,F=_,B=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;O.Buffer=q,O.SlowBuffer=b,O.INSPECT_MAX_BYTES=50;const H=2147483647;O.kMaxLength=H;const{Uint8Array:$,ArrayBuffer:Z,SharedArrayBuffer:ce}=globalThis;q.TYPED_ARRAY_SUPPORT=ne(),!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 ne(){try{const D=new $(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,$.prototype),Object.setPrototypeOf(D,C),D.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 de(D){if(D>H)throw new RangeError('The value "'+D+'" is invalid for option "size"');const C=new $(D);return Object.setPrototypeOf(C,q.prototype),C}function q(D,C,A){if(typeof D=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(D)}return N(D,C,A)}q.poolSize=8192;function N(D,C,A){if(typeof D=="string")return S(D,C);if(Z.isView(D))return M(D);if(D==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof D);if(_t(D,Z)||D&&_t(D.buffer,Z)||typeof ce<"u"&&(_t(D,ce)||D&&_t(D.buffer,ce)))return j(D,C,A);if(typeof D=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const V=D.valueOf&&D.valueOf();if(V!=null&&V!==D)return q.from(V,C,A);const se=I(D);if(se)return se;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof D[Symbol.toPrimitive]=="function")return q.from(D[Symbol.toPrimitive]("string"),C,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof D)}q.from=function(D,C,A){return N(D,C,A)},Object.setPrototypeOf(q.prototype,$.prototype),Object.setPrototypeOf(q,$);function h(D){if(typeof D!="number")throw new TypeError('"size" argument must be of type number');if(D<0)throw new RangeError('The value "'+D+'" is invalid for option "size"')}function d(D,C,A){return h(D),D<=0?de(D):C!==void 0?typeof A=="string"?de(D).fill(C,A):de(D).fill(C):de(D)}q.alloc=function(D,C,A){return d(D,C,A)};function m(D){return h(D),de(D<0?0:g(D)|0)}q.allocUnsafe=function(D){return m(D)},q.allocUnsafeSlow=function(D){return m(D)};function S(D,C){if((typeof C!="string"||C==="")&&(C="utf8"),!q.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const A=k(D,C)|0;let V=de(A);const se=V.write(D,C);return se!==A&&(V=V.slice(0,se)),V}function E(D){const C=D.length<0?0:g(D.length)|0,A=de(C);for(let V=0;V<C;V+=1)A[V]=D[V]&255;return A}function M(D){if(_t(D,$)){const C=new $(D);return j(C.buffer,C.byteOffset,C.byteLength)}return E(D)}function j(D,C,A){if(C<0||D.byteLength<C)throw new RangeError('"offset" is outside of buffer bounds');if(D.byteLength<C+(A||0))throw new RangeError('"length" is outside of buffer bounds');let V;return C===void 0&&A===void 0?V=new $(D):A===void 0?V=new $(D,C):V=new $(D,C,A),Object.setPrototypeOf(V,q.prototype),V}function I(D){if(q.isBuffer(D)){const C=g(D.length)|0,A=de(C);return A.length===0||D.copy(A,0,0,C),A}if(D.length!==void 0)return typeof D.length!="number"||kt(D.length)?de(0):E(D);if(D.type==="Buffer"&&Array.isArray(D.data))return E(D.data)}function g(D){if(D>=H)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+H.toString(16)+" bytes");return D|0}function b(D){return+D!=D&&(D=0),q.alloc(+D)}q.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==q.prototype},q.compare=function(C,A){if(_t(C,$)&&(C=q.from(C,C.offset,C.byteLength)),_t(A,$)&&(A=q.from(A,A.offset,A.byteLength)),!q.isBuffer(C)||!q.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(C===A)return 0;let V=C.length,se=A.length;for(let me=0,be=Math.min(V,se);me<be;++me)if(C[me]!==A[me]){V=C[me],se=A[me];break}return V<se?-1:se<V?1:0},q.isEncoding=function(C){switch(String(C).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(C,A){if(!Array.isArray(C))throw new TypeError('"list" argument must be an Array of Buffers');if(C.length===0)return q.alloc(0);let V;if(A===void 0)for(A=0,V=0;V<C.length;++V)A+=C[V].length;const se=q.allocUnsafe(A);let me=0;for(V=0;V<C.length;++V){let be=C[V];if(_t(be,$))me+be.length>se.length?(q.isBuffer(be)||(be=q.from(be)),be.copy(se,me)):$.prototype.set.call(se,be,me);else if(q.isBuffer(be))be.copy(se,me);else throw new TypeError('"list" argument must be an Array of Buffers');me+=be.length}return se};function k(D,C){if(q.isBuffer(D))return D.length;if(Z.isView(D)||_t(D,Z))return D.byteLength;if(typeof D!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof D);const A=D.length,V=arguments.length>2&&arguments[2]===!0;if(!V&&A===0)return 0;let se=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Nt(D).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return Pt(D).length;default:if(se)return V?-1:Nt(D).length;C=(""+C).toLowerCase(),se=!0}}q.byteLength=k;function ve(D,C,A){let V=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,C>>>=0,A<=C))return"";for(D||(D="utf8");;)switch(D){case"hex":return oe(this,C,A);case"utf8":case"utf-8":return Q(this,C,A);case"ascii":return K(this,C,A);case"latin1":case"binary":return te(this,C,A);case"base64":return ee(this,C,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,C,A);default:if(V)throw new TypeError("Unknown encoding: "+D);D=(D+"").toLowerCase(),V=!0}}q.prototype._isBuffer=!0;function he(D,C,A){const V=D[C];D[C]=D[A],D[A]=V}q.prototype.swap16=function(){const C=this.length;if(C%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;A<C;A+=2)he(this,A,A+1);return this},q.prototype.swap32=function(){const C=this.length;if(C%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<C;A+=4)he(this,A,A+3),he(this,A+1,A+2);return this},q.prototype.swap64=function(){const C=this.length;if(C%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let A=0;A<C;A+=8)he(this,A,A+7),he(this,A+1,A+6),he(this,A+2,A+5),he(this,A+3,A+4);return this},q.prototype.toString=function(){const C=this.length;return C===0?"":arguments.length===0?Q(this,0,C):ve.apply(this,arguments)},q.prototype.toLocaleString=q.prototype.toString,q.prototype.equals=function(C){if(!q.isBuffer(C))throw new TypeError("Argument must be a Buffer");return this===C?!0:q.compare(this,C)===0},q.prototype.inspect=function(){let C="";const A=O.INSPECT_MAX_BYTES;return C=this.toString("hex",0,A).replace(/(.{2})/g,"$1 ").trim(),this.length>A&&(C+=" ... "),"<Buffer "+C+">"},B&&(q.prototype[B]=q.prototype.inspect),q.prototype.compare=function(C,A,V,se,me){if(_t(C,$)&&(C=q.from(C,C.offset,C.byteLength)),!q.isBuffer(C))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof C);if(A===void 0&&(A=0),V===void 0&&(V=C?C.length:0),se===void 0&&(se=0),me===void 0&&(me=this.length),A<0||V>C.length||se<0||me>this.length)throw new RangeError("out of range index");if(se>=me&&A>=V)return 0;if(se>=me)return-1;if(A>=V)return 1;if(A>>>=0,V>>>=0,se>>>=0,me>>>=0,this===C)return 0;let be=me-se,We=V-A;const ut=Math.min(be,We),qe=this.slice(se,me),J=C.slice(A,V);for(let ye=0;ye<ut;++ye)if(qe[ye]!==J[ye]){be=qe[ye],We=J[ye];break}return be<We?-1:We<be?1:0};function we(D,C,A,V,se){if(D.length===0)return-1;if(typeof A=="string"?(V=A,A=0):A>2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,kt(A)&&(A=se?0:D.length-1),A<0&&(A=D.length+A),A>=D.length){if(se)return-1;A=D.length-1}else if(A<0)if(se)A=0;else return-1;if(typeof C=="string"&&(C=q.from(C,V)),q.isBuffer(C))return C.length===0?-1:Oe(D,C,A,V,se);if(typeof C=="number")return C=C&255,typeof $.prototype.indexOf=="function"?se?$.prototype.indexOf.call(D,C,A):$.prototype.lastIndexOf.call(D,C,A):Oe(D,[C],A,V,se);throw new TypeError("val must be string, number or Buffer")}function Oe(D,C,A,V,se){let me=1,be=D.length,We=C.length;if(V!==void 0&&(V=String(V).toLowerCase(),V==="ucs2"||V==="ucs-2"||V==="utf16le"||V==="utf-16le")){if(D.length<2||C.length<2)return-1;me=2,be/=2,We/=2,A/=2}function ut(J,ye){return me===1?J[ye]:J.readUInt16BE(ye*me)}let qe;if(se){let J=-1;for(qe=A;qe<be;qe++)if(ut(D,qe)===ut(C,J===-1?0:qe-J)){if(J===-1&&(J=qe),qe-J+1===We)return J*me}else J!==-1&&(qe-=qe-J),J=-1}else for(A+We>be&&(A=be-We),qe=A;qe>=0;qe--){let J=!0;for(let ye=0;ye<We;ye++)if(ut(D,qe+ye)!==ut(C,ye)){J=!1;break}if(J)return qe}return-1}q.prototype.includes=function(C,A,V){return this.indexOf(C,A,V)!==-1},q.prototype.indexOf=function(C,A,V){return we(this,C,A,V,!0)},q.prototype.lastIndexOf=function(C,A,V){return we(this,C,A,V,!1)};function je(D,C,A,V){A=Number(A)||0;const se=D.length-A;V?(V=Number(V),V>se&&(V=se)):V=se;const me=C.length;V>me/2&&(V=me/2);let be;for(be=0;be<V;++be){const We=parseInt(C.substr(be*2,2),16);if(kt(We))return be;D[A+be]=We}return be}function L(D,C,A,V){return st(Nt(C,D.length-A),D,A,V)}function z(D,C,A,V){return st(ft(C),D,A,V)}function G(D,C,A,V){return st(Pt(C),D,A,V)}function re(D,C,A,V){return st(It(C,D.length-A),D,A,V)}q.prototype.write=function(C,A,V,se){if(A===void 0)se="utf8",V=this.length,A=0;else if(V===void 0&&typeof A=="string")se=A,V=this.length,A=0;else if(isFinite(A))A=A>>>0,isFinite(V)?(V=V>>>0,se===void 0&&(se="utf8")):(se=V,V=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const me=this.length-A;if((V===void 0||V>me)&&(V=me),C.length>0&&(V<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");se||(se="utf8");let be=!1;for(;;)switch(se){case"hex":return je(this,C,A,V);case"utf8":case"utf-8":return L(this,C,A,V);case"ascii":case"latin1":case"binary":return z(this,C,A,V);case"base64":return G(this,C,A,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,C,A,V);default:if(be)throw new TypeError("Unknown encoding: "+se);se=(""+se).toLowerCase(),be=!0}},q.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(D,C,A){return C===0&&A===D.length?R.fromByteArray(D):R.fromByteArray(D.slice(C,A))}function Q(D,C,A){A=Math.min(D.length,A);const V=[];let se=C;for(;se<A;){const me=D[se];let be=null,We=me>239?4:me>223?3:me>191?2:1;if(se+We<=A){let ut,qe,J,ye;switch(We){case 1:me<128&&(be=me);break;case 2:ut=D[se+1],(ut&192)===128&&(ye=(me&31)<<6|ut&63,ye>127&&(be=ye));break;case 3:ut=D[se+1],qe=D[se+2],(ut&192)===128&&(qe&192)===128&&(ye=(me&15)<<12|(ut&63)<<6|qe&63,ye>2047&&(ye<55296||ye>57343)&&(be=ye));break;case 4:ut=D[se+1],qe=D[se+2],J=D[se+3],(ut&192)===128&&(qe&192)===128&&(J&192)===128&&(ye=(me&15)<<18|(ut&63)<<12|(qe&63)<<6|J&63,ye>65535&&ye<1114112&&(be=ye))}}be===null?(be=65533,We=1):be>65535&&(be-=65536,V.push(be>>>10&1023|55296),be=56320|be&1023),V.push(be),se+=We}return W(V)}const fe=4096;function W(D){const C=D.length;if(C<=fe)return String.fromCharCode.apply(String,D);let A="",V=0;for(;V<C;)A+=String.fromCharCode.apply(String,D.slice(V,V+=fe));return A}function K(D,C,A){let V="";A=Math.min(D.length,A);for(let se=C;se<A;++se)V+=String.fromCharCode(D[se]&127);return V}function te(D,C,A){let V="";A=Math.min(D.length,A);for(let se=C;se<A;++se)V+=String.fromCharCode(D[se]);return V}function oe(D,C,A){const V=D.length;(!C||C<0)&&(C=0),(!A||A<0||A>V)&&(A=V);let se="";for(let me=C;me<A;++me)se+=pt[D[me]];return se}function pe(D,C,A){const V=D.slice(C,A);let se="";for(let me=0;me<V.length-1;me+=2)se+=String.fromCharCode(V[me]+V[me+1]*256);return se}q.prototype.slice=function(C,A){const V=this.length;C=~~C,A=A===void 0?V:~~A,C<0?(C+=V,C<0&&(C=0)):C>V&&(C=V),A<0?(A+=V,A<0&&(A=0)):A>V&&(A=V),A<C&&(A=C);const se=this.subarray(C,A);return Object.setPrototypeOf(se,q.prototype),se};function Se(D,C,A){if(D%1!==0||D<0)throw new RangeError("offset is not uint");if(D+C>A)throw new RangeError("Trying to access beyond buffer length")}q.prototype.readUintLE=q.prototype.readUIntLE=function(C,A,V){C=C>>>0,A=A>>>0,V||Se(C,A,this.length);let se=this[C],me=1,be=0;for(;++be<A&&(me*=256);)se+=this[C+be]*me;return se},q.prototype.readUintBE=q.prototype.readUIntBE=function(C,A,V){C=C>>>0,A=A>>>0,V||Se(C,A,this.length);let se=this[C+--A],me=1;for(;A>0&&(me*=256);)se+=this[C+--A]*me;return se},q.prototype.readUint8=q.prototype.readUInt8=function(C,A){return C=C>>>0,A||Se(C,1,this.length),this[C]},q.prototype.readUint16LE=q.prototype.readUInt16LE=function(C,A){return C=C>>>0,A||Se(C,2,this.length),this[C]|this[C+1]<<8},q.prototype.readUint16BE=q.prototype.readUInt16BE=function(C,A){return C=C>>>0,A||Se(C,2,this.length),this[C]<<8|this[C+1]},q.prototype.readUint32LE=q.prototype.readUInt32LE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+this[C+3]*16777216},q.prototype.readUint32BE=q.prototype.readUInt32BE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},q.prototype.readBigUInt64LE=Ot(function(C){C=C>>>0,St(C,"offset");const A=this[C],V=this[C+7];(A===void 0||V===void 0)&&vt(C,this.length-8);const se=A+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,me=this[++C]+this[++C]*2**8+this[++C]*2**16+V*2**24;return BigInt(se)+(BigInt(me)<<BigInt(32))}),q.prototype.readBigUInt64BE=Ot(function(C){C=C>>>0,St(C,"offset");const A=this[C],V=this[C+7];(A===void 0||V===void 0)&&vt(C,this.length-8);const se=A*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],me=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+V;return(BigInt(se)<<BigInt(32))+BigInt(me)}),q.prototype.readIntLE=function(C,A,V){C=C>>>0,A=A>>>0,V||Se(C,A,this.length);let se=this[C],me=1,be=0;for(;++be<A&&(me*=256);)se+=this[C+be]*me;return me*=128,se>=me&&(se-=Math.pow(2,8*A)),se},q.prototype.readIntBE=function(C,A,V){C=C>>>0,A=A>>>0,V||Se(C,A,this.length);let se=A,me=1,be=this[C+--se];for(;se>0&&(me*=256);)be+=this[C+--se]*me;return me*=128,be>=me&&(be-=Math.pow(2,8*A)),be},q.prototype.readInt8=function(C,A){return C=C>>>0,A||Se(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},q.prototype.readInt16LE=function(C,A){C=C>>>0,A||Se(C,2,this.length);const V=this[C]|this[C+1]<<8;return V&32768?V|4294901760:V},q.prototype.readInt16BE=function(C,A){C=C>>>0,A||Se(C,2,this.length);const V=this[C+1]|this[C]<<8;return V&32768?V|4294901760:V},q.prototype.readInt32LE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},q.prototype.readInt32BE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},q.prototype.readBigInt64LE=Ot(function(C){C=C>>>0,St(C,"offset");const A=this[C],V=this[C+7];(A===void 0||V===void 0)&&vt(C,this.length-8);const se=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(V<<24);return(BigInt(se)<<BigInt(32))+BigInt(A+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24)}),q.prototype.readBigInt64BE=Ot(function(C){C=C>>>0,St(C,"offset");const A=this[C],V=this[C+7];(A===void 0||V===void 0)&&vt(C,this.length-8);const se=(A<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(se)<<BigInt(32))+BigInt(this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+V)}),q.prototype.readFloatLE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),F.read(this,C,!0,23,4)},q.prototype.readFloatBE=function(C,A){return C=C>>>0,A||Se(C,4,this.length),F.read(this,C,!1,23,4)},q.prototype.readDoubleLE=function(C,A){return C=C>>>0,A||Se(C,8,this.length),F.read(this,C,!0,52,8)},q.prototype.readDoubleBE=function(C,A){return C=C>>>0,A||Se(C,8,this.length),F.read(this,C,!1,52,8)};function _e(D,C,A,V,se,me){if(!q.isBuffer(D))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>se||C<me)throw new RangeError('"value" argument is out of bounds');if(A+V>D.length)throw new RangeError("Index out of range")}q.prototype.writeUintLE=q.prototype.writeUIntLE=function(C,A,V,se){if(C=+C,A=A>>>0,V=V>>>0,!se){const We=Math.pow(2,8*V)-1;_e(this,C,A,V,We,0)}let me=1,be=0;for(this[A]=C&255;++be<V&&(me*=256);)this[A+be]=C/me&255;return A+V},q.prototype.writeUintBE=q.prototype.writeUIntBE=function(C,A,V,se){if(C=+C,A=A>>>0,V=V>>>0,!se){const We=Math.pow(2,8*V)-1;_e(this,C,A,V,We,0)}let me=V-1,be=1;for(this[A+me]=C&255;--me>=0&&(be*=256);)this[A+me]=C/be&255;return A+V},q.prototype.writeUint8=q.prototype.writeUInt8=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,1,255,0),this[A]=C&255,A+1},q.prototype.writeUint16LE=q.prototype.writeUInt16LE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,2,65535,0),this[A]=C&255,this[A+1]=C>>>8,A+2},q.prototype.writeUint16BE=q.prototype.writeUInt16BE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,2,65535,0),this[A]=C>>>8,this[A+1]=C&255,A+2},q.prototype.writeUint32LE=q.prototype.writeUInt32LE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,4,4294967295,0),this[A+3]=C>>>24,this[A+2]=C>>>16,this[A+1]=C>>>8,this[A]=C&255,A+4},q.prototype.writeUint32BE=q.prototype.writeUInt32BE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,4,4294967295,0),this[A]=C>>>24,this[A+1]=C>>>16,this[A+2]=C>>>8,this[A+3]=C&255,A+4};function Ne(D,C,A,V,se){Xe(C,V,se,D,A,7);let me=Number(C&BigInt(4294967295));D[A++]=me,me=me>>8,D[A++]=me,me=me>>8,D[A++]=me,me=me>>8,D[A++]=me;let be=Number(C>>BigInt(32)&BigInt(4294967295));return D[A++]=be,be=be>>8,D[A++]=be,be=be>>8,D[A++]=be,be=be>>8,D[A++]=be,A}function He(D,C,A,V,se){Xe(C,V,se,D,A,7);let me=Number(C&BigInt(4294967295));D[A+7]=me,me=me>>8,D[A+6]=me,me=me>>8,D[A+5]=me,me=me>>8,D[A+4]=me;let be=Number(C>>BigInt(32)&BigInt(4294967295));return D[A+3]=be,be=be>>8,D[A+2]=be,be=be>>8,D[A+1]=be,be=be>>8,D[A]=be,A+8}q.prototype.writeBigUInt64LE=Ot(function(C,A=0){return Ne(this,C,A,BigInt(0),BigInt("0xffffffffffffffff"))}),q.prototype.writeBigUInt64BE=Ot(function(C,A=0){return He(this,C,A,BigInt(0),BigInt("0xffffffffffffffff"))}),q.prototype.writeIntLE=function(C,A,V,se){if(C=+C,A=A>>>0,!se){const ut=Math.pow(2,8*V-1);_e(this,C,A,V,ut-1,-ut)}let me=0,be=1,We=0;for(this[A]=C&255;++me<V&&(be*=256);)C<0&&We===0&&this[A+me-1]!==0&&(We=1),this[A+me]=(C/be>>0)-We&255;return A+V},q.prototype.writeIntBE=function(C,A,V,se){if(C=+C,A=A>>>0,!se){const ut=Math.pow(2,8*V-1);_e(this,C,A,V,ut-1,-ut)}let me=V-1,be=1,We=0;for(this[A+me]=C&255;--me>=0&&(be*=256);)C<0&&We===0&&this[A+me+1]!==0&&(We=1),this[A+me]=(C/be>>0)-We&255;return A+V},q.prototype.writeInt8=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,1,127,-128),C<0&&(C=255+C+1),this[A]=C&255,A+1},q.prototype.writeInt16LE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,2,32767,-32768),this[A]=C&255,this[A+1]=C>>>8,A+2},q.prototype.writeInt16BE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,2,32767,-32768),this[A]=C>>>8,this[A+1]=C&255,A+2},q.prototype.writeInt32LE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,4,2147483647,-2147483648),this[A]=C&255,this[A+1]=C>>>8,this[A+2]=C>>>16,this[A+3]=C>>>24,A+4},q.prototype.writeInt32BE=function(C,A,V){return C=+C,A=A>>>0,V||_e(this,C,A,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),this[A]=C>>>24,this[A+1]=C>>>16,this[A+2]=C>>>8,this[A+3]=C&255,A+4},q.prototype.writeBigInt64LE=Ot(function(C,A=0){return Ne(this,C,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),q.prototype.writeBigInt64BE=Ot(function(C,A=0){return He(this,C,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ge(D,C,A,V,se,me){if(A+V>D.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function Re(D,C,A,V,se){return C=+C,A=A>>>0,se||Ge(D,C,A,4),F.write(D,C,A,V,23,4),A+4}q.prototype.writeFloatLE=function(C,A,V){return Re(this,C,A,!0,V)},q.prototype.writeFloatBE=function(C,A,V){return Re(this,C,A,!1,V)};function Ke(D,C,A,V,se){return C=+C,A=A>>>0,se||Ge(D,C,A,8),F.write(D,C,A,V,52,8),A+8}q.prototype.writeDoubleLE=function(C,A,V){return Ke(this,C,A,!0,V)},q.prototype.writeDoubleBE=function(C,A,V){return Ke(this,C,A,!1,V)},q.prototype.copy=function(C,A,V,se){if(!q.isBuffer(C))throw new TypeError("argument should be a Buffer");if(V||(V=0),!se&&se!==0&&(se=this.length),A>=C.length&&(A=C.length),A||(A=0),se>0&&se<V&&(se=V),se===V||C.length===0||this.length===0)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(V<0||V>=this.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("sourceEnd out of bounds");se>this.length&&(se=this.length),C.length-A<se-V&&(se=C.length-A+V);const me=se-V;return this===C&&typeof $.prototype.copyWithin=="function"?this.copyWithin(A,V,se):$.prototype.set.call(C,this.subarray(V,se),A),me},q.prototype.fill=function(C,A,V,se){if(typeof C=="string"){if(typeof A=="string"?(se=A,A=0,V=this.length):typeof V=="string"&&(se=V,V=this.length),se!==void 0&&typeof se!="string")throw new TypeError("encoding must be a string");if(typeof se=="string"&&!q.isEncoding(se))throw new TypeError("Unknown encoding: "+se);if(C.length===1){const be=C.charCodeAt(0);(se==="utf8"&&be<128||se==="latin1")&&(C=be)}}else typeof C=="number"?C=C&255:typeof C=="boolean"&&(C=Number(C));if(A<0||this.length<A||this.length<V)throw new RangeError("Out of range index");if(V<=A)return this;A=A>>>0,V=V===void 0?this.length:V>>>0,C||(C=0);let me;if(typeof C=="number")for(me=A;me<V;++me)this[me]=C;else{const be=q.isBuffer(C)?C:q.from(C,se),We=be.length;if(We===0)throw new TypeError('The value "'+C+'" is invalid for argument "value"');for(me=0;me<V-A;++me)this[me+A]=be[me%We]}return this};const nt={};function Qe(D,C,A){nt[D]=class extends A{constructor(){super(),Object.defineProperty(this,"message",{value:C.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${D}]`,this.stack,delete this.name}get code(){return D}set code(se){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:se,writable:!0})}toString(){return`${this.name} [${D}]: ${this.message}`}}}Qe("ERR_BUFFER_OUT_OF_BOUNDS",function(D){return D?`${D} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Qe("ERR_INVALID_ARG_TYPE",function(D,C){return`The "${D}" argument must be of type number. Received type ${typeof C}`},TypeError),Qe("ERR_OUT_OF_RANGE",function(D,C,A){let V=`The value of "${D}" is out of range.`,se=A;return Number.isInteger(A)&&Math.abs(A)>2**32?se=Mt(String(A)):typeof A=="bigint"&&(se=String(A),(A>BigInt(2)**BigInt(32)||A<-(BigInt(2)**BigInt(32)))&&(se=Mt(se)),se+="n"),V+=` It must be ${C}. Received ${se}`,V},RangeError);function Mt(D){let C="",A=D.length;const V=D[0]==="-"?1:0;for(;A>=V+4;A-=3)C=`_${D.slice(A-3,A)}${C}`;return`${D.slice(0,A)}${C}`}function jt(D,C,A){St(C,"offset"),(D[C]===void 0||D[C+A]===void 0)&&vt(C,D.length-(A+1))}function Xe(D,C,A,V,se,me){if(D>A||D<C){const be=typeof C=="bigint"?"n":"";let We;throw me>3?C===0||C===BigInt(0)?We=`>= 0${be} and < 2${be} ** ${(me+1)*8}${be}`:We=`>= -(2${be} ** ${(me+1)*8-1}${be}) and < 2 ** ${(me+1)*8-1}${be}`:We=`>= ${C}${be} and <= ${A}${be}`,new nt.ERR_OUT_OF_RANGE("value",We,D)}jt(V,se,me)}function St(D,C){if(typeof D!="number")throw new nt.ERR_INVALID_ARG_TYPE(C,"number",D)}function vt(D,C,A){throw Math.floor(D)!==D?(St(D,A),new nt.ERR_OUT_OF_RANGE(A||"offset","an integer",D)):C<0?new nt.ERR_BUFFER_OUT_OF_BOUNDS:new nt.ERR_OUT_OF_RANGE(A||"offset",`>= ${A?1:0} and <= ${C}`,D)}const Ye=/[^+/0-9A-Za-z-_]/g;function it(D){if(D=D.split("=")[0],D=D.trim().replace(Ye,""),D.length<2)return"";for(;D.length%4!==0;)D=D+"=";return D}function Nt(D,C){C=C||1/0;let A;const V=D.length;let se=null;const me=[];for(let be=0;be<V;++be){if(A=D.charCodeAt(be),A>55295&&A<57344){if(!se){if(A>56319){(C-=3)>-1&&me.push(239,191,189);continue}else if(be+1===V){(C-=3)>-1&&me.push(239,191,189);continue}se=A;continue}if(A<56320){(C-=3)>-1&&me.push(239,191,189),se=A;continue}A=(se-55296<<10|A-56320)+65536}else se&&(C-=3)>-1&&me.push(239,191,189);if(se=null,A<128){if((C-=1)<0)break;me.push(A)}else if(A<2048){if((C-=2)<0)break;me.push(A>>6|192,A&63|128)}else if(A<65536){if((C-=3)<0)break;me.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((C-=4)<0)break;me.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return me}function ft(D){const C=[];for(let A=0;A<D.length;++A)C.push(D.charCodeAt(A)&255);return C}function It(D,C){let A,V,se;const me=[];for(let be=0;be<D.length&&!((C-=2)<0);++be)A=D.charCodeAt(be),V=A>>8,se=A%256,me.push(se),me.push(V);return me}function Pt(D){return R.toByteArray(it(D))}function st(D,C,A,V){let se;for(se=0;se<V&&!(se+A>=C.length||se>=D.length);++se)C[se+A]=D[se];return se}function _t(D,C){return D instanceof C||D!=null&&D.constructor!=null&&D.constructor.name!=null&&D.constructor.name===C.name}function kt(D){return D!==D}const pt=function(){const D="0123456789abcdef",C=new Array(256);for(let A=0;A<16;++A){const V=A*16;for(let se=0;se<16;++se)C[V+se]=D[A]+D[se]}return C}();function Ot(D){return typeof BigInt>"u"?qt:D}function qt(){throw new Error("BigInt not supported")}})(t);const T=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=T,e.isAscii=t.isAscii,e.isUtf8=t.isUtf8,e.kMaxLength=t.kMaxLength,e.kStringMaxLength=t.kStringMaxLength,e.resolveObjectURL=t.resolveObjectURL,e.transcode=t.transcode})(ma);const Oc=io(ma);var gn={},gd={exports:{}};gd.exports,function(e){(function(t,r){function n(N,h){if(!N)throw new Error(h||"Assertion failed")}function i(N,h){N.super_=h;var d=function(){};d.prototype=h.prototype,N.prototype=new d,N.prototype.constructor=N}function s(N,h,d){if(s.isBN(N))return N;this.negative=0,this.words=null,this.length=0,this.red=null,N!==null&&((h==="le"||h==="be")&&(d=h,h=10),this._init(N||0,h||10,d||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=ma.Buffer}catch{}s.isBN=function(h){return h instanceof s?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===s.wordSize&&Array.isArray(h.words)},s.max=function(h,d){return h.cmp(d)>0?h:d},s.min=function(h,d){return h.cmp(d)<0?h:d},s.prototype._init=function(h,d,m){if(typeof h=="number")return this._initNumber(h,d,m);if(typeof h=="object")return this._initArray(h,d,m);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),h=h.toString().replace(/\s+/g,"");var S=0;h[0]==="-"&&(S++,this.negative=1),S<h.length&&(d===16?this._parseHex(h,S,m):(this._parseBase(h,d,S),m==="le"&&this._initArray(this.toArray(),d,m)))},s.prototype._initNumber=function(h,d,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(),d,m)},s.prototype._initArray=function(h,d,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 E,M,j=0;if(m==="be")for(S=h.length-1,E=0;S>=0;S-=3)M=h[S]|h[S-1]<<8|h[S-2]<<16,this.words[E]|=M<<j&67108863,this.words[E+1]=M>>>26-j&67108863,j+=24,j>=26&&(j-=26,E++);else if(m==="le")for(S=0,E=0;S<h.length;S+=3)M=h[S]|h[S+1]<<8|h[S+2]<<16,this.words[E]|=M<<j&67108863,this.words[E+1]=M>>>26-j&67108863,j+=24,j>=26&&(j-=26,E++);return this._strip()};function a(N,h){var d=N.charCodeAt(h);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+N)}function c(N,h,d){var m=a(N,d);return d-1>=h&&(m|=a(N,d-1)<<4),m}s.prototype._parseHex=function(h,d,m){this.length=Math.ceil((h.length-d)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var E=0,M=0,j;if(m==="be")for(S=h.length-1;S>=d;S-=2)j=c(h,d,S)<<E,this.words[M]|=j&67108863,E>=18?(E-=18,M+=1,this.words[M]|=j>>>26):E+=8;else{var I=h.length-d;for(S=I%2===0?d+1:d;S<h.length;S+=2)j=c(h,d,S)<<E,this.words[M]|=j&67108863,E>=18?(E-=18,M+=1,this.words[M]|=j>>>26):E+=8}this._strip()};function l(N,h,d,m){for(var S=0,E=0,M=Math.min(N.length,d),j=h;j<M;j++){var I=N.charCodeAt(j)-48;S*=m,I>=49?E=I-49+10:I>=17?E=I-17+10:E=I,n(I>=0&&E<m,"Invalid character"),S+=E}return S}s.prototype._parseBase=function(h,d,m){this.words=[0],this.length=1;for(var S=0,E=1;E<=67108863;E*=d)S++;S--,E=E/d|0;for(var M=h.length-m,j=M%S,I=Math.min(M,M-j)+m,g=0,b=m;b<I;b+=S)g=l(h,b,b+S,d),this.imuln(E),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(j!==0){var k=1;for(g=l(h,b,h.length,d),b=0;b<j;b++)k*=d;this.imuln(k),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this._strip()},s.prototype.copy=function(h){h.words=new Array(this.length);for(var d=0;d<this.length;d++)h.words[d]=this.words[d];h.length=this.length,h.negative=this.negative,h.red=this.red};function u(N,h){N.words=h.words,N.length=h.length,N.negative=h.negative,N.red=h.red}if(s.prototype._move=function(h){u(h,this)},s.prototype.clone=function(){var h=new s(null);return this.copy(h),h},s.prototype._expand=function(h){for(;this.length<h;)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")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){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];s.prototype.toString=function(h,d){h=h||10,d=d|0||1;var m;if(h===16||h==="hex"){m="";for(var S=0,E=0,M=0;M<this.length;M++){var j=this.words[M],I=((j<<S|E)&16777215).toString(16);E=j>>>24-S&16777215,S+=2,S>=26&&(S-=26,M--),E!==0||M!==this.length-1?m=p[6-I.length]+I+m:m=I+m}for(E!==0&&(m=E.toString(16)+m);m.length%d!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(h===(h|0)&&h>=2&&h<=36){var g=y[h],b=x[h];m="";var k=this.clone();for(k.negative=0;!k.isZero();){var ve=k.modrn(b).toString(h);k=k.idivn(b),k.isZero()?m=ve+m:m=p[g-ve.length]+ve+m}for(this.isZero()&&(m="0"+m);m.length%d!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}n(!1,"Base should be between 2 and 36")},s.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},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(h,d){return this.toArrayLike(o,h,d)}),s.prototype.toArray=function(h,d){return this.toArrayLike(Array,h,d)};var v=function(h,d){return h.allocUnsafe?h.allocUnsafe(d):new h(d)};s.prototype.toArrayLike=function(h,d,m){this._strip();var S=this.byteLength(),E=m||Math.max(1,S);n(S<=E,"byte array longer than desired length"),n(E>0,"Requested array length <= 0");var M=v(h,E),j=d==="le"?"LE":"BE";return this["_toArrayLike"+j](M,S),M},s.prototype._toArrayLikeLE=function(h,d){for(var m=0,S=0,E=0,M=0;E<this.length;E++){var j=this.words[E]<<M|S;h[m++]=j&255,m<h.length&&(h[m++]=j>>8&255),m<h.length&&(h[m++]=j>>16&255),M===6?(m<h.length&&(h[m++]=j>>24&255),S=0,M=0):(S=j>>>24,M+=2)}if(m<h.length)for(h[m++]=S;m<h.length;)h[m++]=0},s.prototype._toArrayLikeBE=function(h,d){for(var m=h.length-1,S=0,E=0,M=0;E<this.length;E++){var j=this.words[E]<<M|S;h[m--]=j&255,m>=0&&(h[m--]=j>>8&255),m>=0&&(h[m--]=j>>16&255),M===6?(m>=0&&(h[m--]=j>>24&255),S=0,M=0):(S=j>>>24,M+=2)}if(m>=0)for(h[m--]=S;m>=0;)h[m--]=0},Math.clz32?s.prototype._countBits=function(h){return 32-Math.clz32(h)}:s.prototype._countBits=function(h){var d=h,m=0;return d>=4096&&(m+=13,d>>>=13),d>=64&&(m+=7,d>>>=7),d>=8&&(m+=4,d>>>=4),d>=2&&(m+=2,d>>>=2),m+d},s.prototype._zeroBits=function(h){if(h===0)return 26;var d=h,m=0;return d&8191||(m+=13,d>>>=13),d&127||(m+=7,d>>>=7),d&15||(m+=4,d>>>=4),d&3||(m+=2,d>>>=2),d&1||m++,m},s.prototype.bitLength=function(){var h=this.words[this.length-1],d=this._countBits(h);return(this.length-1)*26+d};function _(N){for(var h=new Array(N.bitLength()),d=0;d<h.length;d++){var m=d/26|0,S=d%26;h[d]=N.words[m]>>>S&1}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,d=0;d<this.length;d++){var m=this._zeroBits(this.words[d]);if(h+=m,m!==26)break}return h},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},s.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).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(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var d=0;d<h.length;d++)this.words[d]=this.words[d]|h.words[d];return this._strip()},s.prototype.ior=function(h){return n((this.negative|h.negative)===0),this.iuor(h)},s.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},s.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},s.prototype.iuand=function(h){var d;this.length>h.length?d=h:d=this;for(var m=0;m<d.length;m++)this.words[m]=this.words[m]&h.words[m];return this.length=d.length,this._strip()},s.prototype.iand=function(h){return n((this.negative|h.negative)===0),this.iuand(h)},s.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},s.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},s.prototype.iuxor=function(h){var d,m;this.length>h.length?(d=this,m=h):(d=h,m=this);for(var S=0;S<m.length;S++)this.words[S]=d.words[S]^m.words[S];if(this!==d)for(;S<d.length;S++)this.words[S]=d.words[S];return this.length=d.length,this._strip()},s.prototype.ixor=function(h){return n((this.negative|h.negative)===0),this.iuxor(h)},s.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},s.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},s.prototype.inotn=function(h){n(typeof h=="number"&&h>=0);var d=Math.ceil(h/26)|0,m=h%26;this._expand(d),m>0&&d--;for(var S=0;S<d;S++)this.words[S]=~this.words[S]&67108863;return m>0&&(this.words[S]=~this.words[S]&67108863>>26-m),this._strip()},s.prototype.notn=function(h){return this.clone().inotn(h)},s.prototype.setn=function(h,d){n(typeof h=="number"&&h>=0);var m=h/26|0,S=h%26;return this._expand(m+1),d?this.words[m]=this.words[m]|1<<S:this.words[m]=this.words[m]&~(1<<S),this._strip()},s.prototype.iadd=function(h){var d;if(this.negative!==0&&h.negative===0)return this.negative=0,d=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,d=this.isub(h),h.negative=1,d._normSign();var m,S;this.length>h.length?(m=this,S=h):(m=h,S=this);for(var E=0,M=0;M<S.length;M++)d=(m.words[M]|0)+(S.words[M]|0)+E,this.words[M]=d&67108863,E=d>>>26;for(;E!==0&&M<m.length;M++)d=(m.words[M]|0)+E,this.words[M]=d&67108863,E=d>>>26;if(this.length=m.length,E!==0)this.words[this.length]=E,this.length++;else if(m!==this)for(;M<m.length;M++)this.words[M]=m.words[M];return this},s.prototype.add=function(h){var d;return h.negative!==0&&this.negative===0?(h.negative=0,d=this.sub(h),h.negative^=1,d):h.negative===0&&this.negative!==0?(this.negative=0,d=h.sub(this),this.negative=1,d):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},s.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var d=this.iadd(h);return h.negative=1,d._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,E;m>0?(S=this,E=h):(S=h,E=this);for(var M=0,j=0;j<E.length;j++)d=(S.words[j]|0)-(E.words[j]|0)+M,M=d>>26,this.words[j]=d&67108863;for(;M!==0&&j<S.length;j++)d=(S.words[j]|0)+M,M=d>>26,this.words[j]=d&67108863;if(M===0&&j<S.length&&S!==this)for(;j<S.length;j++)this.words[j]=S.words[j];return this.length=Math.max(this.length,j),S!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(h){return this.clone().isub(h)};function T(N,h,d){d.negative=h.negative^N.negative;var m=N.length+h.length|0;d.length=m,m=m-1|0;var S=N.words[0]|0,E=h.words[0]|0,M=S*E,j=M&67108863,I=M/67108864|0;d.words[0]=j;for(var g=1;g<m;g++){for(var b=I>>>26,k=I&67108863,ve=Math.min(g,h.length-1),he=Math.max(0,g-N.length+1);he<=ve;he++){var we=g-he|0;S=N.words[we]|0,E=h.words[he]|0,M=S*E+k,b+=M/67108864|0,k=M&67108863}d.words[g]=k|0,I=b|0}return I!==0?d.words[g]=I|0:d.length--,d._strip()}var O=function(h,d,m){var S=h.words,E=d.words,M=m.words,j=0,I,g,b,k=S[0]|0,ve=k&8191,he=k>>>13,we=S[1]|0,Oe=we&8191,je=we>>>13,L=S[2]|0,z=L&8191,G=L>>>13,re=S[3]|0,ee=re&8191,Q=re>>>13,fe=S[4]|0,W=fe&8191,K=fe>>>13,te=S[5]|0,oe=te&8191,pe=te>>>13,Se=S[6]|0,_e=Se&8191,Ne=Se>>>13,He=S[7]|0,Ge=He&8191,Re=He>>>13,Ke=S[8]|0,nt=Ke&8191,Qe=Ke>>>13,Mt=S[9]|0,jt=Mt&8191,Xe=Mt>>>13,St=E[0]|0,vt=St&8191,Ye=St>>>13,it=E[1]|0,Nt=it&8191,ft=it>>>13,It=E[2]|0,Pt=It&8191,st=It>>>13,_t=E[3]|0,kt=_t&8191,pt=_t>>>13,Ot=E[4]|0,qt=Ot&8191,D=Ot>>>13,C=E[5]|0,A=C&8191,V=C>>>13,se=E[6]|0,me=se&8191,be=se>>>13,We=E[7]|0,ut=We&8191,qe=We>>>13,J=E[8]|0,ye=J&8191,Ce=J>>>13,Ve=E[9]|0,et=Ve&8191,ze=Ve>>>13;m.negative=h.negative^d.negative,m.length=19,I=Math.imul(ve,vt),g=Math.imul(ve,Ye),g=g+Math.imul(he,vt)|0,b=Math.imul(he,Ye);var Je=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Je>>>26)|0,Je&=67108863,I=Math.imul(Oe,vt),g=Math.imul(Oe,Ye),g=g+Math.imul(je,vt)|0,b=Math.imul(je,Ye),I=I+Math.imul(ve,Nt)|0,g=g+Math.imul(ve,ft)|0,g=g+Math.imul(he,Nt)|0,b=b+Math.imul(he,ft)|0;var bt=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(bt>>>26)|0,bt&=67108863,I=Math.imul(z,vt),g=Math.imul(z,Ye),g=g+Math.imul(G,vt)|0,b=Math.imul(G,Ye),I=I+Math.imul(Oe,Nt)|0,g=g+Math.imul(Oe,ft)|0,g=g+Math.imul(je,Nt)|0,b=b+Math.imul(je,ft)|0,I=I+Math.imul(ve,Pt)|0,g=g+Math.imul(ve,st)|0,g=g+Math.imul(he,Pt)|0,b=b+Math.imul(he,st)|0;var rr=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(rr>>>26)|0,rr&=67108863,I=Math.imul(ee,vt),g=Math.imul(ee,Ye),g=g+Math.imul(Q,vt)|0,b=Math.imul(Q,Ye),I=I+Math.imul(z,Nt)|0,g=g+Math.imul(z,ft)|0,g=g+Math.imul(G,Nt)|0,b=b+Math.imul(G,ft)|0,I=I+Math.imul(Oe,Pt)|0,g=g+Math.imul(Oe,st)|0,g=g+Math.imul(je,Pt)|0,b=b+Math.imul(je,st)|0,I=I+Math.imul(ve,kt)|0,g=g+Math.imul(ve,pt)|0,g=g+Math.imul(he,kt)|0,b=b+Math.imul(he,pt)|0;var Bt=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,I=Math.imul(W,vt),g=Math.imul(W,Ye),g=g+Math.imul(K,vt)|0,b=Math.imul(K,Ye),I=I+Math.imul(ee,Nt)|0,g=g+Math.imul(ee,ft)|0,g=g+Math.imul(Q,Nt)|0,b=b+Math.imul(Q,ft)|0,I=I+Math.imul(z,Pt)|0,g=g+Math.imul(z,st)|0,g=g+Math.imul(G,Pt)|0,b=b+Math.imul(G,st)|0,I=I+Math.imul(Oe,kt)|0,g=g+Math.imul(Oe,pt)|0,g=g+Math.imul(je,kt)|0,b=b+Math.imul(je,pt)|0,I=I+Math.imul(ve,qt)|0,g=g+Math.imul(ve,D)|0,g=g+Math.imul(he,qt)|0,b=b+Math.imul(he,D)|0;var Vt=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,I=Math.imul(oe,vt),g=Math.imul(oe,Ye),g=g+Math.imul(pe,vt)|0,b=Math.imul(pe,Ye),I=I+Math.imul(W,Nt)|0,g=g+Math.imul(W,ft)|0,g=g+Math.imul(K,Nt)|0,b=b+Math.imul(K,ft)|0,I=I+Math.imul(ee,Pt)|0,g=g+Math.imul(ee,st)|0,g=g+Math.imul(Q,Pt)|0,b=b+Math.imul(Q,st)|0,I=I+Math.imul(z,kt)|0,g=g+Math.imul(z,pt)|0,g=g+Math.imul(G,kt)|0,b=b+Math.imul(G,pt)|0,I=I+Math.imul(Oe,qt)|0,g=g+Math.imul(Oe,D)|0,g=g+Math.imul(je,qt)|0,b=b+Math.imul(je,D)|0,I=I+Math.imul(ve,A)|0,g=g+Math.imul(ve,V)|0,g=g+Math.imul(he,A)|0,b=b+Math.imul(he,V)|0;var fr=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(fr>>>26)|0,fr&=67108863,I=Math.imul(_e,vt),g=Math.imul(_e,Ye),g=g+Math.imul(Ne,vt)|0,b=Math.imul(Ne,Ye),I=I+Math.imul(oe,Nt)|0,g=g+Math.imul(oe,ft)|0,g=g+Math.imul(pe,Nt)|0,b=b+Math.imul(pe,ft)|0,I=I+Math.imul(W,Pt)|0,g=g+Math.imul(W,st)|0,g=g+Math.imul(K,Pt)|0,b=b+Math.imul(K,st)|0,I=I+Math.imul(ee,kt)|0,g=g+Math.imul(ee,pt)|0,g=g+Math.imul(Q,kt)|0,b=b+Math.imul(Q,pt)|0,I=I+Math.imul(z,qt)|0,g=g+Math.imul(z,D)|0,g=g+Math.imul(G,qt)|0,b=b+Math.imul(G,D)|0,I=I+Math.imul(Oe,A)|0,g=g+Math.imul(Oe,V)|0,g=g+Math.imul(je,A)|0,b=b+Math.imul(je,V)|0,I=I+Math.imul(ve,me)|0,g=g+Math.imul(ve,be)|0,g=g+Math.imul(he,me)|0,b=b+Math.imul(he,be)|0;var Nr=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,I=Math.imul(Ge,vt),g=Math.imul(Ge,Ye),g=g+Math.imul(Re,vt)|0,b=Math.imul(Re,Ye),I=I+Math.imul(_e,Nt)|0,g=g+Math.imul(_e,ft)|0,g=g+Math.imul(Ne,Nt)|0,b=b+Math.imul(Ne,ft)|0,I=I+Math.imul(oe,Pt)|0,g=g+Math.imul(oe,st)|0,g=g+Math.imul(pe,Pt)|0,b=b+Math.imul(pe,st)|0,I=I+Math.imul(W,kt)|0,g=g+Math.imul(W,pt)|0,g=g+Math.imul(K,kt)|0,b=b+Math.imul(K,pt)|0,I=I+Math.imul(ee,qt)|0,g=g+Math.imul(ee,D)|0,g=g+Math.imul(Q,qt)|0,b=b+Math.imul(Q,D)|0,I=I+Math.imul(z,A)|0,g=g+Math.imul(z,V)|0,g=g+Math.imul(G,A)|0,b=b+Math.imul(G,V)|0,I=I+Math.imul(Oe,me)|0,g=g+Math.imul(Oe,be)|0,g=g+Math.imul(je,me)|0,b=b+Math.imul(je,be)|0,I=I+Math.imul(ve,ut)|0,g=g+Math.imul(ve,qe)|0,g=g+Math.imul(he,ut)|0,b=b+Math.imul(he,qe)|0;var mr=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(mr>>>26)|0,mr&=67108863,I=Math.imul(nt,vt),g=Math.imul(nt,Ye),g=g+Math.imul(Qe,vt)|0,b=Math.imul(Qe,Ye),I=I+Math.imul(Ge,Nt)|0,g=g+Math.imul(Ge,ft)|0,g=g+Math.imul(Re,Nt)|0,b=b+Math.imul(Re,ft)|0,I=I+Math.imul(_e,Pt)|0,g=g+Math.imul(_e,st)|0,g=g+Math.imul(Ne,Pt)|0,b=b+Math.imul(Ne,st)|0,I=I+Math.imul(oe,kt)|0,g=g+Math.imul(oe,pt)|0,g=g+Math.imul(pe,kt)|0,b=b+Math.imul(pe,pt)|0,I=I+Math.imul(W,qt)|0,g=g+Math.imul(W,D)|0,g=g+Math.imul(K,qt)|0,b=b+Math.imul(K,D)|0,I=I+Math.imul(ee,A)|0,g=g+Math.imul(ee,V)|0,g=g+Math.imul(Q,A)|0,b=b+Math.imul(Q,V)|0,I=I+Math.imul(z,me)|0,g=g+Math.imul(z,be)|0,g=g+Math.imul(G,me)|0,b=b+Math.imul(G,be)|0,I=I+Math.imul(Oe,ut)|0,g=g+Math.imul(Oe,qe)|0,g=g+Math.imul(je,ut)|0,b=b+Math.imul(je,qe)|0,I=I+Math.imul(ve,ye)|0,g=g+Math.imul(ve,Ce)|0,g=g+Math.imul(he,ye)|0,b=b+Math.imul(he,Ce)|0;var nr=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(nr>>>26)|0,nr&=67108863,I=Math.imul(jt,vt),g=Math.imul(jt,Ye),g=g+Math.imul(Xe,vt)|0,b=Math.imul(Xe,Ye),I=I+Math.imul(nt,Nt)|0,g=g+Math.imul(nt,ft)|0,g=g+Math.imul(Qe,Nt)|0,b=b+Math.imul(Qe,ft)|0,I=I+Math.imul(Ge,Pt)|0,g=g+Math.imul(Ge,st)|0,g=g+Math.imul(Re,Pt)|0,b=b+Math.imul(Re,st)|0,I=I+Math.imul(_e,kt)|0,g=g+Math.imul(_e,pt)|0,g=g+Math.imul(Ne,kt)|0,b=b+Math.imul(Ne,pt)|0,I=I+Math.imul(oe,qt)|0,g=g+Math.imul(oe,D)|0,g=g+Math.imul(pe,qt)|0,b=b+Math.imul(pe,D)|0,I=I+Math.imul(W,A)|0,g=g+Math.imul(W,V)|0,g=g+Math.imul(K,A)|0,b=b+Math.imul(K,V)|0,I=I+Math.imul(ee,me)|0,g=g+Math.imul(ee,be)|0,g=g+Math.imul(Q,me)|0,b=b+Math.imul(Q,be)|0,I=I+Math.imul(z,ut)|0,g=g+Math.imul(z,qe)|0,g=g+Math.imul(G,ut)|0,b=b+Math.imul(G,qe)|0,I=I+Math.imul(Oe,ye)|0,g=g+Math.imul(Oe,Ce)|0,g=g+Math.imul(je,ye)|0,b=b+Math.imul(je,Ce)|0,I=I+Math.imul(ve,et)|0,g=g+Math.imul(ve,ze)|0,g=g+Math.imul(he,et)|0,b=b+Math.imul(he,ze)|0;var Ar=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,I=Math.imul(jt,Nt),g=Math.imul(jt,ft),g=g+Math.imul(Xe,Nt)|0,b=Math.imul(Xe,ft),I=I+Math.imul(nt,Pt)|0,g=g+Math.imul(nt,st)|0,g=g+Math.imul(Qe,Pt)|0,b=b+Math.imul(Qe,st)|0,I=I+Math.imul(Ge,kt)|0,g=g+Math.imul(Ge,pt)|0,g=g+Math.imul(Re,kt)|0,b=b+Math.imul(Re,pt)|0,I=I+Math.imul(_e,qt)|0,g=g+Math.imul(_e,D)|0,g=g+Math.imul(Ne,qt)|0,b=b+Math.imul(Ne,D)|0,I=I+Math.imul(oe,A)|0,g=g+Math.imul(oe,V)|0,g=g+Math.imul(pe,A)|0,b=b+Math.imul(pe,V)|0,I=I+Math.imul(W,me)|0,g=g+Math.imul(W,be)|0,g=g+Math.imul(K,me)|0,b=b+Math.imul(K,be)|0,I=I+Math.imul(ee,ut)|0,g=g+Math.imul(ee,qe)|0,g=g+Math.imul(Q,ut)|0,b=b+Math.imul(Q,qe)|0,I=I+Math.imul(z,ye)|0,g=g+Math.imul(z,Ce)|0,g=g+Math.imul(G,ye)|0,b=b+Math.imul(G,Ce)|0,I=I+Math.imul(Oe,et)|0,g=g+Math.imul(Oe,ze)|0,g=g+Math.imul(je,et)|0,b=b+Math.imul(je,ze)|0;var Fn=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,I=Math.imul(jt,Pt),g=Math.imul(jt,st),g=g+Math.imul(Xe,Pt)|0,b=Math.imul(Xe,st),I=I+Math.imul(nt,kt)|0,g=g+Math.imul(nt,pt)|0,g=g+Math.imul(Qe,kt)|0,b=b+Math.imul(Qe,pt)|0,I=I+Math.imul(Ge,qt)|0,g=g+Math.imul(Ge,D)|0,g=g+Math.imul(Re,qt)|0,b=b+Math.imul(Re,D)|0,I=I+Math.imul(_e,A)|0,g=g+Math.imul(_e,V)|0,g=g+Math.imul(Ne,A)|0,b=b+Math.imul(Ne,V)|0,I=I+Math.imul(oe,me)|0,g=g+Math.imul(oe,be)|0,g=g+Math.imul(pe,me)|0,b=b+Math.imul(pe,be)|0,I=I+Math.imul(W,ut)|0,g=g+Math.imul(W,qe)|0,g=g+Math.imul(K,ut)|0,b=b+Math.imul(K,qe)|0,I=I+Math.imul(ee,ye)|0,g=g+Math.imul(ee,Ce)|0,g=g+Math.imul(Q,ye)|0,b=b+Math.imul(Q,Ce)|0,I=I+Math.imul(z,et)|0,g=g+Math.imul(z,ze)|0,g=g+Math.imul(G,et)|0,b=b+Math.imul(G,ze)|0;var tn=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(tn>>>26)|0,tn&=67108863,I=Math.imul(jt,kt),g=Math.imul(jt,pt),g=g+Math.imul(Xe,kt)|0,b=Math.imul(Xe,pt),I=I+Math.imul(nt,qt)|0,g=g+Math.imul(nt,D)|0,g=g+Math.imul(Qe,qt)|0,b=b+Math.imul(Qe,D)|0,I=I+Math.imul(Ge,A)|0,g=g+Math.imul(Ge,V)|0,g=g+Math.imul(Re,A)|0,b=b+Math.imul(Re,V)|0,I=I+Math.imul(_e,me)|0,g=g+Math.imul(_e,be)|0,g=g+Math.imul(Ne,me)|0,b=b+Math.imul(Ne,be)|0,I=I+Math.imul(oe,ut)|0,g=g+Math.imul(oe,qe)|0,g=g+Math.imul(pe,ut)|0,b=b+Math.imul(pe,qe)|0,I=I+Math.imul(W,ye)|0,g=g+Math.imul(W,Ce)|0,g=g+Math.imul(K,ye)|0,b=b+Math.imul(K,Ce)|0,I=I+Math.imul(ee,et)|0,g=g+Math.imul(ee,ze)|0,g=g+Math.imul(Q,et)|0,b=b+Math.imul(Q,ze)|0;var $n=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+($n>>>26)|0,$n&=67108863,I=Math.imul(jt,qt),g=Math.imul(jt,D),g=g+Math.imul(Xe,qt)|0,b=Math.imul(Xe,D),I=I+Math.imul(nt,A)|0,g=g+Math.imul(nt,V)|0,g=g+Math.imul(Qe,A)|0,b=b+Math.imul(Qe,V)|0,I=I+Math.imul(Ge,me)|0,g=g+Math.imul(Ge,be)|0,g=g+Math.imul(Re,me)|0,b=b+Math.imul(Re,be)|0,I=I+Math.imul(_e,ut)|0,g=g+Math.imul(_e,qe)|0,g=g+Math.imul(Ne,ut)|0,b=b+Math.imul(Ne,qe)|0,I=I+Math.imul(oe,ye)|0,g=g+Math.imul(oe,Ce)|0,g=g+Math.imul(pe,ye)|0,b=b+Math.imul(pe,Ce)|0,I=I+Math.imul(W,et)|0,g=g+Math.imul(W,ze)|0,g=g+Math.imul(K,et)|0,b=b+Math.imul(K,ze)|0;var qi=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(qi>>>26)|0,qi&=67108863,I=Math.imul(jt,A),g=Math.imul(jt,V),g=g+Math.imul(Xe,A)|0,b=Math.imul(Xe,V),I=I+Math.imul(nt,me)|0,g=g+Math.imul(nt,be)|0,g=g+Math.imul(Qe,me)|0,b=b+Math.imul(Qe,be)|0,I=I+Math.imul(Ge,ut)|0,g=g+Math.imul(Ge,qe)|0,g=g+Math.imul(Re,ut)|0,b=b+Math.imul(Re,qe)|0,I=I+Math.imul(_e,ye)|0,g=g+Math.imul(_e,Ce)|0,g=g+Math.imul(Ne,ye)|0,b=b+Math.imul(Ne,Ce)|0,I=I+Math.imul(oe,et)|0,g=g+Math.imul(oe,ze)|0,g=g+Math.imul(pe,et)|0,b=b+Math.imul(pe,ze)|0;var Hi=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Hi>>>26)|0,Hi&=67108863,I=Math.imul(jt,me),g=Math.imul(jt,be),g=g+Math.imul(Xe,me)|0,b=Math.imul(Xe,be),I=I+Math.imul(nt,ut)|0,g=g+Math.imul(nt,qe)|0,g=g+Math.imul(Qe,ut)|0,b=b+Math.imul(Qe,qe)|0,I=I+Math.imul(Ge,ye)|0,g=g+Math.imul(Ge,Ce)|0,g=g+Math.imul(Re,ye)|0,b=b+Math.imul(Re,Ce)|0,I=I+Math.imul(_e,et)|0,g=g+Math.imul(_e,ze)|0,g=g+Math.imul(Ne,et)|0,b=b+Math.imul(Ne,ze)|0;var Vn=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,I=Math.imul(jt,ut),g=Math.imul(jt,qe),g=g+Math.imul(Xe,ut)|0,b=Math.imul(Xe,qe),I=I+Math.imul(nt,ye)|0,g=g+Math.imul(nt,Ce)|0,g=g+Math.imul(Qe,ye)|0,b=b+Math.imul(Qe,Ce)|0,I=I+Math.imul(Ge,et)|0,g=g+Math.imul(Ge,ze)|0,g=g+Math.imul(Re,et)|0,b=b+Math.imul(Re,ze)|0;var Wi=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,I=Math.imul(jt,ye),g=Math.imul(jt,Ce),g=g+Math.imul(Xe,ye)|0,b=Math.imul(Xe,Ce),I=I+Math.imul(nt,et)|0,g=g+Math.imul(nt,ze)|0,g=g+Math.imul(Qe,et)|0,b=b+Math.imul(Qe,ze)|0;var Gi=(j+I|0)+((g&8191)<<13)|0;j=(b+(g>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,I=Math.imul(jt,et),g=Math.imul(jt,ze),g=g+Math.imul(Xe,et)|0,b=Math.imul(Xe,ze);var U=(j+I|0)+((g&8191)<<13)|0;return j=(b+(g>>>13)|0)+(U>>>26)|0,U&=67108863,M[0]=Je,M[1]=bt,M[2]=rr,M[3]=Bt,M[4]=Vt,M[5]=fr,M[6]=Nr,M[7]=mr,M[8]=nr,M[9]=Ar,M[10]=Fn,M[11]=tn,M[12]=$n,M[13]=qi,M[14]=Hi,M[15]=Vn,M[16]=Wi,M[17]=Gi,M[18]=U,j!==0&&(M[19]=j,m.length++),m};Math.imul||(O=T);function R(N,h,d){d.negative=h.negative^N.negative,d.length=N.length+h.length;for(var m=0,S=0,E=0;E<d.length-1;E++){var M=S;S=0;for(var j=m&67108863,I=Math.min(E,h.length-1),g=Math.max(0,E-N.length+1);g<=I;g++){var b=E-g,k=N.words[b]|0,ve=h.words[g]|0,he=k*ve,we=he&67108863;M=M+(he/67108864|0)|0,we=we+j|0,j=we&67108863,M=M+(we>>>26)|0,S+=M>>>26,M&=67108863}d.words[E]=j,m=M,M=S}return m!==0?d.words[E]=m:d.length--,d._strip()}function F(N,h,d){return R(N,h,d)}s.prototype.mulTo=function(h,d){var m,S=this.length+h.length;return this.length===10&&h.length===10?m=O(this,h,d):S<63?m=T(this,h,d):S<1024?m=R(this,h,d):m=F(this,h,d),m},s.prototype.mul=function(h){var d=new s(null);return d.words=new Array(this.length+h.length),this.mulTo(h,d)},s.prototype.mulf=function(h){var d=new s(null);return d.words=new Array(this.length+h.length),F(this,h,d)},s.prototype.imul=function(h){return this.clone().mulTo(h,this)},s.prototype.imuln=function(h){var d=h<0;d&&(h=-h),n(typeof h=="number"),n(h<67108864);for(var m=0,S=0;S<this.length;S++){var E=(this.words[S]|0)*h,M=(E&67108863)+(m&67108863);m>>=26,m+=E/67108864|0,m+=M>>>26,this.words[S]=M&67108863}return m!==0&&(this.words[S]=m,this.length++),this.length=h===0?1:this.length,d?this.ineg():this},s.prototype.muln=function(h){return this.clone().imuln(h)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(h){var d=_(h);if(d.length===0)return new s(1);for(var m=this,S=0;S<d.length&&d[S]===0;S++,m=m.sqr());if(++S<d.length)for(var E=m.sqr();S<d.length;S++,E=E.sqr())d[S]!==0&&(m=m.mul(E));return m},s.prototype.iushln=function(h){n(typeof h=="number"&&h>=0);var d=h%26,m=(h-d)/26,S=67108863>>>26-d<<26-d,E;if(d!==0){var M=0;for(E=0;E<this.length;E++){var j=this.words[E]&S,I=(this.words[E]|0)-j<<d;this.words[E]=I|M,M=j>>>26-d}M&&(this.words[E]=M,this.length++)}if(m!==0){for(E=this.length-1;E>=0;E--)this.words[E+m]=this.words[E];for(E=0;E<m;E++)this.words[E]=0;this.length+=m}return this._strip()},s.prototype.ishln=function(h){return n(this.negative===0),this.iushln(h)},s.prototype.iushrn=function(h,d,m){n(typeof h=="number"&&h>=0);var S;d?S=(d-d%26)/26:S=0;var E=h%26,M=Math.min((h-E)/26,this.length),j=67108863^67108863>>>E<<E,I=m;if(S-=M,S=Math.max(0,S),I){for(var g=0;g<M;g++)I.words[g]=this.words[g];I.length=M}if(M!==0)if(this.length>M)for(this.length-=M,g=0;g<this.length;g++)this.words[g]=this.words[g+M];else this.words[0]=0,this.length=1;var b=0;for(g=this.length-1;g>=0&&(b!==0||g>=S);g--){var k=this.words[g]|0;this.words[g]=b<<26-E|k>>>E,b=k&j}return I&&b!==0&&(I.words[I.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(h,d,m){return n(this.negative===0),this.iushrn(h,d,m)},s.prototype.shln=function(h){return this.clone().ishln(h)},s.prototype.ushln=function(h){return this.clone().iushln(h)},s.prototype.shrn=function(h){return this.clone().ishrn(h)},s.prototype.ushrn=function(h){return this.clone().iushrn(h)},s.prototype.testn=function(h){n(typeof h=="number"&&h>=0);var d=h%26,m=(h-d)/26,S=1<<d;if(this.length<=m)return!1;var E=this.words[m];return!!(E&S)},s.prototype.imaskn=function(h){n(typeof h=="number"&&h>=0);var d=h%26,m=(h-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(d!==0&&m++,this.length=Math.min(m,this.length),d!==0){var S=67108863^67108863>>>d<<d;this.words[this.length-1]&=S}return this._strip()},s.prototype.maskn=function(h){return this.clone().imaskn(h)},s.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)},s.prototype._iaddn=function(h){this.words[0]+=h;for(var d=0;d<this.length&&this.words[d]>=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.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 d=0;d<this.length&&this.words[d]<0;d++)this.words[d]+=67108864,this.words[d+1]-=1;return this._strip()},s.prototype.addn=function(h){return this.clone().iaddn(h)},s.prototype.subn=function(h){return this.clone().isubn(h)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(h,d,m){var S=h.length+m,E;this._expand(S);var M,j=0;for(E=0;E<h.length;E++){M=(this.words[E+m]|0)+j;var I=(h.words[E]|0)*d;M-=I&67108863,j=(M>>26)-(I/67108864|0),this.words[E+m]=M&67108863}for(;E<this.length-m;E++)M=(this.words[E+m]|0)+j,j=M>>26,this.words[E+m]=M&67108863;if(j===0)return this._strip();for(n(j===-1),j=0,E=0;E<this.length;E++)M=-(this.words[E]|0)+j,j=M>>26,this.words[E]=M&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(h,d){var m=this.length-h.length,S=this.clone(),E=h,M=E.words[E.length-1]|0,j=this._countBits(M);m=26-j,m!==0&&(E=E.ushln(m),S.iushln(m),M=E.words[E.length-1]|0);var I=S.length-E.length,g;if(d!=="mod"){g=new s(null),g.length=I+1,g.words=new Array(g.length);for(var b=0;b<g.length;b++)g.words[b]=0}var k=S.clone()._ishlnsubmul(E,1,I);k.negative===0&&(S=k,g&&(g.words[I]=1));for(var ve=I-1;ve>=0;ve--){var he=(S.words[E.length+ve]|0)*67108864+(S.words[E.length+ve-1]|0);for(he=Math.min(he/M|0,67108863),S._ishlnsubmul(E,he,ve);S.negative!==0;)he--,S.negative=0,S._ishlnsubmul(E,1,ve),S.isZero()||(S.negative^=1);g&&(g.words[ve]=he)}return g&&g._strip(),S._strip(),d!=="div"&&m!==0&&S.iushrn(m),{div:g||null,mod:S}},s.prototype.divmod=function(h,d,m){if(n(!h.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var S,E,M;return this.negative!==0&&h.negative===0?(M=this.neg().divmod(h,d),d!=="mod"&&(S=M.div.neg()),d!=="div"&&(E=M.mod.neg(),m&&E.negative!==0&&E.iadd(h)),{div:S,mod:E}):this.negative===0&&h.negative!==0?(M=this.divmod(h.neg(),d),d!=="mod"&&(S=M.div.neg()),{div:S,mod:M.mod}):this.negative&h.negative?(M=this.neg().divmod(h.neg(),d),d!=="div"&&(E=M.mod.neg(),m&&E.negative!==0&&E.isub(h)),{div:M.div,mod:E}):h.length>this.length||this.cmp(h)<0?{div:new s(0),mod:this}:h.length===1?d==="div"?{div:this.divn(h.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new s(this.modrn(h.words[0]))}:this._wordDiv(h,d)},s.prototype.div=function(h){return this.divmod(h,"div",!1).div},s.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},s.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},s.prototype.divRound=function(h){var d=this.divmod(h);if(d.mod.isZero())return d.div;var m=d.div.negative!==0?d.mod.isub(h):d.mod,S=h.ushrn(1),E=h.andln(1),M=m.cmp(S);return M<0||E===1&&M===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(h){var d=h<0;d&&(h=-h),n(h<=67108863);for(var m=(1<<26)%h,S=0,E=this.length-1;E>=0;E--)S=(m*S+(this.words[E]|0))%h;return d?-S:S},s.prototype.modn=function(h){return this.modrn(h)},s.prototype.idivn=function(h){var d=h<0;d&&(h=-h),n(h<=67108863);for(var m=0,S=this.length-1;S>=0;S--){var E=(this.words[S]|0)+m*67108864;this.words[S]=E/h|0,m=E%h}return this._strip(),d?this.ineg():this},s.prototype.divn=function(h){return this.clone().idivn(h)},s.prototype.egcd=function(h){n(h.negative===0),n(!h.isZero());var d=this,m=h.clone();d.negative!==0?d=d.umod(h):d=d.clone();for(var S=new s(1),E=new s(0),M=new s(0),j=new s(1),I=0;d.isEven()&&m.isEven();)d.iushrn(1),m.iushrn(1),++I;for(var g=m.clone(),b=d.clone();!d.isZero();){for(var k=0,ve=1;!(d.words[0]&ve)&&k<26;++k,ve<<=1);if(k>0)for(d.iushrn(k);k-- >0;)(S.isOdd()||E.isOdd())&&(S.iadd(g),E.isub(b)),S.iushrn(1),E.iushrn(1);for(var he=0,we=1;!(m.words[0]&we)&&he<26;++he,we<<=1);if(he>0)for(m.iushrn(he);he-- >0;)(M.isOdd()||j.isOdd())&&(M.iadd(g),j.isub(b)),M.iushrn(1),j.iushrn(1);d.cmp(m)>=0?(d.isub(m),S.isub(M),E.isub(j)):(m.isub(d),M.isub(S),j.isub(E))}return{a:M,b:j,gcd:m.iushln(I)}},s.prototype._invmp=function(h){n(h.negative===0),n(!h.isZero());var d=this,m=h.clone();d.negative!==0?d=d.umod(h):d=d.clone();for(var S=new s(1),E=new s(0),M=m.clone();d.cmpn(1)>0&&m.cmpn(1)>0;){for(var j=0,I=1;!(d.words[0]&I)&&j<26;++j,I<<=1);if(j>0)for(d.iushrn(j);j-- >0;)S.isOdd()&&S.iadd(M),S.iushrn(1);for(var g=0,b=1;!(m.words[0]&b)&&g<26;++g,b<<=1);if(g>0)for(m.iushrn(g);g-- >0;)E.isOdd()&&E.iadd(M),E.iushrn(1);d.cmp(m)>=0?(d.isub(m),S.isub(E)):(m.isub(d),E.isub(S))}var k;return d.cmpn(1)===0?k=S:k=E,k.cmpn(0)<0&&k.iadd(h),k},s.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var d=this.clone(),m=h.clone();d.negative=0,m.negative=0;for(var S=0;d.isEven()&&m.isEven();S++)d.iushrn(1),m.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;m.isEven();)m.iushrn(1);var E=d.cmp(m);if(E<0){var M=d;d=m,m=M}else if(E===0||m.cmpn(1)===0)break;d.isub(m)}while(!0);return m.iushln(S)},s.prototype.invm=function(h){return this.egcd(h).a.umod(h)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(h){return this.words[0]&h},s.prototype.bincn=function(h){n(typeof h=="number");var d=h%26,m=(h-d)/26,S=1<<d;if(this.length<=m)return this._expand(m+1),this.words[m]|=S,this;for(var E=S,M=m;E!==0&&M<this.length;M++){var j=this.words[M]|0;j+=E,E=j>>>26,j&=67108863,this.words[M]=j}return E!==0&&(this.words[M]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(h){var d=h<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var m;if(this.length>1)m=1;else{d&&(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},s.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var d=this.ucmp(h);return this.negative!==0?-d|0:d},s.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var d=0,m=this.length-1;m>=0;m--){var S=this.words[m]|0,E=h.words[m]|0;if(S!==E){S<E?d=-1:S>E&&(d=1);break}}return d},s.prototype.gtn=function(h){return this.cmpn(h)===1},s.prototype.gt=function(h){return this.cmp(h)===1},s.prototype.gten=function(h){return this.cmpn(h)>=0},s.prototype.gte=function(h){return this.cmp(h)>=0},s.prototype.ltn=function(h){return this.cmpn(h)===-1},s.prototype.lt=function(h){return this.cmp(h)===-1},s.prototype.lten=function(h){return this.cmpn(h)<=0},s.prototype.lte=function(h){return this.cmp(h)<=0},s.prototype.eqn=function(h){return this.cmpn(h)===0},s.prototype.eq=function(h){return this.cmp(h)===0},s.red=function(h){return new de(h)},s.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)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(h){return this.red=h,this},s.prototype.forceRed=function(h){return n(!this.red,"Already a number in reduction context"),this._forceRed(h)},s.prototype.redAdd=function(h){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},s.prototype.redIAdd=function(h){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},s.prototype.redSub=function(h){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},s.prototype.redISub=function(h){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},s.prototype.redShl=function(h){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},s.prototype.redMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},s.prototype.redIMul=function(h){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.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 H(N,h){this.name=N,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var h=new s(null);return h.words=new Array(Math.ceil(this.n/13)),h},H.prototype.ireduce=function(h){var d=h,m;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),m=d.bitLength();while(m>this.n);var S=m<this.n?-1:d.ucmp(this.p);return S===0?(d.words[0]=0,d.length=1):S>0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},H.prototype.split=function(h,d){h.iushrn(this.n,0,d)},H.prototype.imulK=function(h){return h.imul(this.k)};function $(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i($,H),$.prototype.split=function(h,d){for(var m=4194303,S=Math.min(h.length,9),E=0;E<S;E++)d.words[E]=h.words[E];if(d.length=S,h.length<=9){h.words[0]=0,h.length=1;return}var M=h.words[9];for(d.words[d.length++]=M&m,E=10;E<h.length;E++){var j=h.words[E]|0;h.words[E-10]=(j&m)<<4|M>>>22,M=j}M>>>=22,h.words[E-10]=M,M===0&&h.length>10?h.length-=10:h.length-=9},$.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var d=0,m=0;m<h.length;m++){var S=h.words[m]|0;d+=S*977,h.words[m]=d&67108863,d=S*64+(d/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function Z(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(Z,H);function ce(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(ce,H);function ne(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(ne,H),ne.prototype.imulK=function(h){for(var d=0,m=0;m<h.length;m++){var S=(h.words[m]|0)*19+d,E=S&67108863;S>>>=26,h.words[m]=E,d=S}return d!==0&&(h.words[h.length++]=d),h},s._prime=function(h){if(B[h])return B[h];var d;if(h==="k256")d=new $;else if(h==="p224")d=new Z;else if(h==="p192")d=new ce;else if(h==="p25519")d=new ne;else throw new Error("Unknown prime "+h);return B[h]=d,d};function de(N){if(typeof N=="string"){var h=s._prime(N);this.m=h.p,this.prime=h}else n(N.gtn(1),"modulus must be greater than 1"),this.m=N,this.prime=null}de.prototype._verify1=function(h){n(h.negative===0,"red works only with positives"),n(h.red,"red works only with red numbers")},de.prototype._verify2=function(h,d){n((h.negative|d.negative)===0,"red works only with positives"),n(h.red&&h.red===d.red,"red works only with red numbers")},de.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(u(h,h.umod(this.m)._forceRed(this)),h)},de.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},de.prototype.add=function(h,d){this._verify2(h,d);var m=h.add(d);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},de.prototype.iadd=function(h,d){this._verify2(h,d);var m=h.iadd(d);return m.cmp(this.m)>=0&&m.isub(this.m),m},de.prototype.sub=function(h,d){this._verify2(h,d);var m=h.sub(d);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},de.prototype.isub=function(h,d){this._verify2(h,d);var m=h.isub(d);return m.cmpn(0)<0&&m.iadd(this.m),m},de.prototype.shl=function(h,d){return this._verify1(h),this.imod(h.ushln(d))},de.prototype.imul=function(h,d){return this._verify2(h,d),this.imod(h.imul(d))},de.prototype.mul=function(h,d){return this._verify2(h,d),this.imod(h.mul(d))},de.prototype.isqr=function(h){return this.imul(h,h.clone())},de.prototype.sqr=function(h){return this.mul(h,h)},de.prototype.sqrt=function(h){if(h.isZero())return h.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var m=this.m.add(new s(1)).iushrn(2);return this.pow(h,m)}for(var S=this.m.subn(1),E=0;!S.isZero()&&S.andln(1)===0;)E++,S.iushrn(1);n(!S.isZero());var M=new s(1).toRed(this),j=M.redNeg(),I=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new s(2*g*g).toRed(this);this.pow(g,I).cmp(j)!==0;)g.redIAdd(j);for(var b=this.pow(g,S),k=this.pow(h,S.addn(1).iushrn(1)),ve=this.pow(h,S),he=E;ve.cmp(M)!==0;){for(var we=ve,Oe=0;we.cmp(M)!==0;Oe++)we=we.redSqr();n(Oe<he);var je=this.pow(b,new s(1).iushln(he-Oe-1));k=k.redMul(je),b=je.redSqr(),ve=ve.redMul(b),he=Oe}return k},de.prototype.invm=function(h){var d=h._invmp(this.m);return d.negative!==0?(d.negative=0,this.imod(d).redNeg()):this.imod(d)},de.prototype.pow=function(h,d){if(d.isZero())return new s(1).toRed(this);if(d.cmpn(1)===0)return h.clone();var m=4,S=new Array(1<<m);S[0]=new s(1).toRed(this),S[1]=h;for(var E=2;E<S.length;E++)S[E]=this.mul(S[E-1],h);var M=S[0],j=0,I=0,g=d.bitLength()%26;for(g===0&&(g=26),E=d.length-1;E>=0;E--){for(var b=d.words[E],k=g-1;k>=0;k--){var ve=b>>k&1;if(M!==S[0]&&(M=this.sqr(M)),ve===0&&j===0){I=0;continue}j<<=1,j|=ve,I++,!(I!==m&&(E!==0||k!==0))&&(M=this.mul(M,S[j]),I=0,j=0)}g=26}return M},de.prototype.convertTo=function(h){var d=h.umod(this.m);return d===h?d.clone():d},de.prototype.convertFrom=function(h){var d=h.clone();return d.red=null,d},s.mont=function(h){return new q(h)};function q(N){de.call(this,N),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)}i(q,de),q.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},q.prototype.convertFrom=function(h){var d=this.imod(h.mul(this.rinv));return d.red=null,d},q.prototype.imul=function(h,d){if(h.isZero()||d.isZero())return h.words[0]=0,h.length=1,h;var m=h.imul(d),S=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=m.isub(S).iushrn(this.shift),M=E;return E.cmp(this.m)>=0?M=E.isub(this.m):E.cmpn(0)<0&&(M=E.iadd(this.m)),M._forceRed(this)},q.prototype.mul=function(h,d){if(h.isZero()||d.isZero())return new s(0)._forceRed(this);var m=h.mul(d),S=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=m.isub(S).iushrn(this.shift),M=E;return E.cmp(this.m)>=0?M=E.isub(this.m):E.cmpn(0)<0&&(M=E.iadd(this.m)),M._forceRed(this)},q.prototype.invm=function(h){var d=this.imod(h._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(e,Cr)}(gd);var Em=gd.exports;const Cm=io(Em);var lx=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gn,"__esModule",{value:!0}),gn.parseAccumulatorUpdateData=gn.sliceAccumulatorUpdateData=gn.parseTwapMessage=gn.parsePriceFeedMessage=gn.isAccumulatorUpdateData=void 0;const vn=lx(Em),ux="504e4155",dx=1,fx=0,vd=20,hx=0,px=1;function bd(e){return e.toString("hex").slice(0,8)===ux&&e[4]===dx&&e[5]===fx}gn.isAccumulatorUpdateData=bd;function mx(e){let t=0;if(e.readUInt8(t)!==hx)throw new Error("Not a price feed message");t+=1;const n=e.subarray(t,t+32);t+=32;const i=new vn.default(e.subarray(t,t+8),"be");t+=8;const s=new vn.default(e.subarray(t,t+8),"be");t+=8;const o=e.readInt32BE(t);t+=4;const a=new vn.default(e.subarray(t,t+8),"be");t+=8;const c=new vn.default(e.subarray(t,t+8),"be");t+=8;const l=new vn.default(e.subarray(t,t+8),"be");t+=8;const u=new vn.default(e.subarray(t,t+8),"be");return t+=8,{feedId:n,price:i,confidence:s,exponent:o,publishTime:a,prevPublishTime:c,emaPrice:l,emaConf:u}}gn.parsePriceFeedMessage=mx;function gx(e){let t=0;if(e.readUInt8(t)!==px)throw new Error("Not a twap message");t+=1;const n=e.subarray(t,t+32);t+=32;const i=new vn.default(e.subarray(t,t+16),"be");t+=16;const s=new vn.default(e.subarray(t,t+16),"be");t+=16;const o=new vn.default(e.subarray(t,t+8),"be");t+=8;const a=e.readInt32BE(t);t+=4;const c=new vn.default(e.subarray(t,t+8),"be");t+=8;const l=new vn.default(e.subarray(t,t+8),"be");t+=8;const u=new vn.default(e.subarray(t,t+8),"be");return t+=8,{feedId:n,cumulativePrice:i,cumulativeConf:s,numDownSlots:o,exponent:a,publishTime:c,prevPublishTime:l,publishSlot:u}}gn.parseTwapMessage=gx;function vx(e,t,r){if(!bd(e))throw new Error("Invalid accumulator message");let n=6;const i=e.readUint8(n);n+=1+i,n+=1;const s=e.readUint16BE(n);n+=2,n+=s;const o=n,a=[],c=e.readUInt8(n);n+=1;for(let u=0;u<c;u++){const f=n,p=e.readUint16BE(n);n+=2,n+=p;const y=e.readUInt8(n);n+=1,n+=vd*y,a.push(e.subarray(f,n))}if(n!==e.length)throw new Error("Didn't reach the end of the message");const l=a.slice(t,r);return Oc.concat([e.subarray(0,o),Oc.from([l.length]),...a.slice(t,r)])}gn.sliceAccumulatorUpdateData=vx;function bx(e){if(!bd(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 s=e.readUInt8(t),o=[];t+=1;for(let a=0;a<s;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 f=[];for(let p=0;p<u;p++)f.push(Array.from(e.subarray(t,t+vd))),t+=vd;o.push({message:l,proof:f})}if(t!==e.length)throw new Error("Didn't reach the end of the message");return{vaa:i,updates:o}}gn.parseAccumulatorUpdateData=bx,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=Ic;var r=gn;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){Et(this,"conf");Et(this,"expo");Et(this,"price");Et(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){Et(this,"attestationTime");Et(this,"emitterChain");Et(this,"priceServiceReceiveTime");Et(this,"sequenceNumber");Et(this,"slot");Et(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 s=class n4{constructor(a){Et(this,"emaPrice");Et(this,"id");Et(this,"metadata");Et(this,"vaa");Et(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 n4({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=s}(fd);function Am(e,t){return function(){return e.apply(t,arguments)}}const{toString:yx}=Object.prototype,{getPrototypeOf:yd}=Object,{iterator:Pc,toStringTag:Tm}=Symbol,Rc=(e=>t=>{const r=yx.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Pn=e=>(e=e.toLowerCase(),t=>Rc(t)===e),jc=e=>t=>typeof t===e,{isArray:mo}=Array,ga=jc("undefined");function wx(e){return e!==null&&!ga(e)&&e.constructor!==null&&!ga(e.constructor)&&Yr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Mm=Pn("ArrayBuffer");function xx(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Mm(e.buffer),t}const Sx=jc("string"),Yr=jc("function"),Im=jc("number"),Nc=e=>e!==null&&typeof e=="object",_x=e=>e===!0||e===!1,kc=e=>{if(Rc(e)!=="object")return!1;const t=yd(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Tm in e)&&!(Pc in e)},Ex=Pn("Date"),Cx=Pn("File"),Ax=Pn("Blob"),Tx=Pn("FileList"),Mx=e=>Nc(e)&&Yr(e.pipe),Ix=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Yr(e.append)&&((t=Rc(e))==="formdata"||t==="object"&&Yr(e.toString)&&e.toString()==="[object FormData]"))},Ox=Pn("URLSearchParams"),[Px,Rx,jx,Nx]=["ReadableStream","Request","Response","Headers"].map(Pn),kx=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function va(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),mo(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const s=r?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(n=0;n<o;n++)a=s[n],t.call(null,e[a],a,e)}}function Om(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 Ds=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Cr)(),Pm=e=>!ga(e)&&e!==Ds;function wd(){const{caseless:e}=Pm(this)&&this||{},t={},r=(n,i)=>{const s=e&&Om(t,i)||i;kc(t[s])&&kc(n)?t[s]=wd(t[s],n):kc(n)?t[s]=wd({},n):mo(n)?t[s]=n.slice():t[s]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&va(arguments[n],r);return t}const Dx=(e,t,r,{allOwnKeys:n}={})=>(va(t,(i,s)=>{r&&Yr(i)?e[s]=Am(i,r):e[s]=i},{allOwnKeys:n}),e),Lx=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Bx=(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)},Ux=(e,t,r,n)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!n||n(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=r!==!1&&yd(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Fx=(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},$x=e=>{if(!e)return null;if(mo(e))return e;let t=e.length;if(!Im(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Vx=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&yd(Uint8Array)),zx=(e,t)=>{const n=(e&&e[Pc]).call(e);let i;for(;(i=n.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},qx=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Hx=Pn("HTMLFormElement"),Wx=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Rm=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Gx=Pn("RegExp"),jm=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};va(r,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(n[s]=o||i)}),Object.defineProperties(e,n)},Kx=e=>{jm(e,(t,r)=>{if(Yr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(Yr(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+"'")})}})},Yx=(e,t)=>{const r={},n=i=>{i.forEach(s=>{r[s]=!0})};return mo(e)?n(e):n(String(e).split(t)),r},Jx=()=>{},Xx=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Zx(e){return!!(e&&Yr(e.append)&&e[Tm]==="FormData"&&e[Pc])}const Qx=e=>{const t=new Array(10),r=(n,i)=>{if(Nc(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const s=mo(n)?[]:{};return va(n,(o,a)=>{const c=r(o,i+1);!ga(c)&&(s[a]=c)}),t[i]=void 0,s}}return n};return r(e,0)},e5=Pn("AsyncFunction"),t5=e=>e&&(Nc(e)||Yr(e))&&Yr(e.then)&&Yr(e.catch),Nm=((e,t)=>e?setImmediate:t?((r,n)=>(Ds.addEventListener("message",({source:i,data:s})=>{i===Ds&&s===r&&n.length&&n.shift()()},!1),i=>{n.push(i),Ds.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Yr(Ds.postMessage)),r5=typeof queueMicrotask<"u"?queueMicrotask.bind(Ds):typeof _n<"u"&&_n.nextTick||Nm;var xe={isArray:mo,isArrayBuffer:Mm,isBuffer:wx,isFormData:Ix,isArrayBufferView:xx,isString:Sx,isNumber:Im,isBoolean:_x,isObject:Nc,isPlainObject:kc,isReadableStream:Px,isRequest:Rx,isResponse:jx,isHeaders:Nx,isUndefined:ga,isDate:Ex,isFile:Cx,isBlob:Ax,isRegExp:Gx,isFunction:Yr,isStream:Mx,isURLSearchParams:Ox,isTypedArray:Vx,isFileList:Tx,forEach:va,merge:wd,extend:Dx,trim:kx,stripBOM:Lx,inherits:Bx,toFlatObject:Ux,kindOf:Rc,kindOfTest:Pn,endsWith:Fx,toArray:$x,forEachEntry:zx,matchAll:qx,isHTMLForm:Hx,hasOwnProperty:Rm,hasOwnProp:Rm,reduceDescriptors:jm,freezeMethods:Kx,toObjectSet:Yx,toCamelCase:Wx,noop:Jx,toFiniteNumber:Xx,findKey:Om,global:Ds,isContextDefined:Pm,isSpecCompliantForm:Zx,toJSONObject:Qx,isAsyncFn:e5,isThenable:t5,setImmediate:Nm,asap:r5,isIterable:e=>e!=null&&Yr(e[Pc])};function xt(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)}xe.inherits(xt,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:xe.toJSONObject(this.config),code:this.code,status:this.status}}});const km=xt.prototype,Dm={};["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=>{Dm[e]={value:e}}),Object.defineProperties(xt,Dm),Object.defineProperty(km,"isAxiosError",{value:!0}),xt.from=(e,t,r,n,i,s)=>{const o=Object.create(km);return xe.toFlatObject(e,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),xt.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};var n5=null;function xd(e){return xe.isPlainObject(e)||xe.isArray(e)}function Lm(e){return xe.endsWith(e,"[]")?e.slice(0,-2):e}function Bm(e,t,r){return e?e.concat(t).map(function(i,s){return i=Lm(i),!r&&s?"["+i+"]":i}).join(r?".":""):t}function i5(e){return xe.isArray(e)&&!e.some(xd)}const s5=xe.toFlatObject(xe,{},null,function(t){return/^is[A-Z]/.test(t)});function Dc(e,t,r){if(!xe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=xe.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,_){return!xe.isUndefined(_[v])});const n=r.metaTokens,i=r.visitor||u,s=r.dots,o=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&xe.isSpecCompliantForm(t);if(!xe.isFunction(i))throw new TypeError("visitor must be a function");function l(x){if(x===null)return"";if(xe.isDate(x))return x.toISOString();if(!c&&xe.isBlob(x))throw new xt("Blob is not supported. Use a Buffer instead.");return xe.isArrayBuffer(x)||xe.isTypedArray(x)?c&&typeof Blob=="function"?new Blob([x]):Oc.from(x):x}function u(x,v,_){let T=x;if(x&&!_&&typeof x=="object"){if(xe.endsWith(v,"{}"))v=n?v:v.slice(0,-2),x=JSON.stringify(x);else if(xe.isArray(x)&&i5(x)||(xe.isFileList(x)||xe.endsWith(v,"[]"))&&(T=xe.toArray(x)))return v=Lm(v),T.forEach(function(R,F){!(xe.isUndefined(R)||R===null)&&t.append(o===!0?Bm([v],F,s):o===null?v:v+"[]",l(R))}),!1}return xd(x)?!0:(t.append(Bm(_,v,s),l(x)),!1)}const f=[],p=Object.assign(s5,{defaultVisitor:u,convertValue:l,isVisitable:xd});function y(x,v){if(!xe.isUndefined(x)){if(f.indexOf(x)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(x),xe.forEach(x,function(T,O){(!(xe.isUndefined(T)||T===null)&&i.call(t,T,xe.isString(O)?O.trim():O,v,p))===!0&&y(T,v?v.concat(O):[O])}),f.pop()}}if(!xe.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Um(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Sd(e,t){this._pairs=[],e&&Dc(e,this,t)}const Fm=Sd.prototype;Fm.append=function(t,r){this._pairs.push([t,r])},Fm.toString=function(t){const r=t?function(n){return t.call(this,n,Um)}:Um;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function o5(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $m(e,t,r){if(!t)return e;const n=r&&r.encode||o5;xe.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let s;if(i?s=i(t,r):s=xe.isURLSearchParams(t)?t.toString():new Sd(t,r).toString(n),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class a5{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){xe.forEach(this.handlers,function(n){n!==null&&t(n)})}}var Vm=a5,zm={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},c5=typeof URLSearchParams<"u"?URLSearchParams:Sd,l5=typeof FormData<"u"?FormData:null,u5=typeof Blob<"u"?Blob:null,d5={isBrowser:!0,classes:{URLSearchParams:c5,FormData:l5,Blob:u5},protocols:["http","https","file","blob","url","data"]};const _d=typeof window<"u"&&typeof document<"u",Ed=typeof navigator=="object"&&navigator||void 0,f5=_d&&(!Ed||["ReactNative","NativeScript","NS"].indexOf(Ed.product)<0),h5=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),p5=_d&&window.location.href||"http://localhost";var m5=Object.freeze({__proto__:null,hasBrowserEnv:_d,hasStandardBrowserWebWorkerEnv:h5,hasStandardBrowserEnv:f5,navigator:Ed,origin:p5}),Dr={...m5,...d5};function g5(e,t){return Dc(e,new Dr.classes.URLSearchParams,Object.assign({visitor:function(r,n,i,s){return Dr.isNode&&xe.isBuffer(r)?(this.append(n,r.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function v5(e){return xe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function b5(e){const t={},r=Object.keys(e);let n;const i=r.length;let s;for(n=0;n<i;n++)s=r[n],t[s]=e[s];return t}function qm(e){function t(r,n,i,s){let o=r[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=s>=r.length;return o=!o&&xe.isArray(i)?i.length:o,c?(xe.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!xe.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],s)&&xe.isArray(i[o])&&(i[o]=b5(i[o])),!a)}if(xe.isFormData(e)&&xe.isFunction(e.entries)){const r={};return xe.forEachEntry(e,(n,i)=>{t(v5(n),i,r,0)}),r}return null}function y5(e,t,r){if(xe.isString(e))try{return(t||JSON.parse)(e),xe.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const Cd={transitional:zm,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,s=xe.isObject(t);if(s&&xe.isHTMLForm(t)&&(t=new FormData(t)),xe.isFormData(t))return i?JSON.stringify(qm(t)):t;if(xe.isArrayBuffer(t)||xe.isBuffer(t)||xe.isStream(t)||xe.isFile(t)||xe.isBlob(t)||xe.isReadableStream(t))return t;if(xe.isArrayBufferView(t))return t.buffer;if(xe.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return g5(t,this.formSerializer).toString();if((a=xe.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Dc(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return s||i?(r.setContentType("application/json",!1),y5(t)):t}],transformResponse:[function(t){const r=this.transitional||Cd.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(xe.isResponse(t)||xe.isReadableStream(t))return t;if(t&&xe.isString(t)&&(n&&!this.responseType||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?xt.from(a,xt.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:Dr.classes.FormData,Blob:Dr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};xe.forEach(["delete","get","head","post","put","patch"],e=>{Cd.headers[e]={}});var Ad=Cd;const w5=xe.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 x5=e=>{const t={};let r,n,i;return e&&e.split(`
|
|
30
|
+
`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&w5[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};const Hm=Symbol("internals");function ba(e){return e&&String(e).trim().toLowerCase()}function Lc(e){return e===!1||e==null?e:xe.isArray(e)?e.map(Lc):String(e)}function S5(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 _5=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Td(e,t,r,n,i){if(xe.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!xe.isString(t)){if(xe.isString(n))return t.indexOf(n)!==-1;if(xe.isRegExp(n))return n.test(t)}}function E5(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function C5(e,t){const r=xe.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,s,o){return this[n].call(this,t,i,s,o)},configurable:!0})})}class Bc{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function s(a,c,l){const u=ba(c);if(!u)throw new Error("header name must be a non-empty string");const f=xe.findKey(i,u);(!f||i[f]===void 0||l===!0||l===void 0&&i[f]!==!1)&&(i[f||c]=Lc(a))}const o=(a,c)=>xe.forEach(a,(l,u)=>s(l,u,c));if(xe.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(xe.isString(t)&&(t=t.trim())&&!_5(t))o(x5(t),r);else if(xe.isObject(t)&&xe.isIterable(t)){let a={},c,l;for(const u of t){if(!xe.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[l=u[0]]=(c=a[l])?xe.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}o(a,r)}else t!=null&&s(r,t,n);return this}get(t,r){if(t=ba(t),t){const n=xe.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return S5(i);if(xe.isFunction(r))return r.call(this,i,n);if(xe.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=ba(t),t){const n=xe.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Td(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function s(o){if(o=ba(o),o){const a=xe.findKey(n,o);a&&(!r||Td(n,n[a],a,r))&&(delete n[a],i=!0)}}return xe.isArray(t)?t.forEach(s):s(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const s=r[n];(!t||Td(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const r=this,n={};return xe.forEach(this,(i,s)=>{const o=xe.findKey(n,s);if(o){r[o]=Lc(i),delete r[s];return}const a=t?E5(s):String(s).trim();a!==s&&delete r[s],r[a]=Lc(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return xe.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&xe.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
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}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[Hm]=this[Hm]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=ba(o);n[a]||(C5(i,o),n[a]=!0)}return xe.isArray(t)?t.forEach(s):s(t),this}}Bc.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),xe.reduceDescriptors(Bc.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),xe.freezeMethods(Bc);var Rn=Bc;function Md(e,t){const r=this||Ad,n=t||r,i=Rn.from(n.headers);let s=n.data;return xe.forEach(e,function(a){s=a.call(r,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Wm(e){return!!(e&&e.__CANCEL__)}function go(e,t,r){xt.call(this,e??"canceled",xt.ERR_CANCELED,t,r),this.name="CanceledError"}xe.inherits(go,xt,{__CANCEL__:!0});function Gm(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new xt("Request failed with status code "+r.status,[xt.ERR_BAD_REQUEST,xt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function A5(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function T5(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(c){const l=Date.now(),u=n[s];o||(o=l),r[i]=c,n[i]=l;let f=s,p=0;for(;f!==i;)p+=r[f++],f=f%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),l-o<t)return;const y=u&&l-u;return y?Math.round(p*1e3/y):void 0}}function M5(e,t){let r=0,n=1e3/t,i,s;const o=(l,u=Date.now())=>{r=u,i=null,s&&(clearTimeout(s),s=null),e.apply(null,l)};return[(...l)=>{const u=Date.now(),f=u-r;f>=n?o(l,u):(i=l,s||(s=setTimeout(()=>{s=null,o(i)},n-f)))},()=>i&&o(i)]}const Uc=(e,t,r=3)=>{let n=0;const i=T5(50,250);return M5(s=>{const o=s.loaded,a=s.lengthComputable?s.total:void 0,c=o-n,l=i(c),u=o<=a;n=o;const f={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&u?(a-o)/l:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},r)},Km=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ym=e=>(...t)=>xe.asap(()=>e(...t));var I5=Dr.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Dr.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Dr.origin),Dr.navigator&&/(msie|trident)/i.test(Dr.navigator.userAgent)):()=>!0,O5=Dr.hasStandardBrowserEnv?{write(e,t,r,n,i,s){const o=[e+"="+encodeURIComponent(t)];xe.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),xe.isString(n)&&o.push("path="+n),xe.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.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 P5(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function R5(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Jm(e,t,r){let n=!P5(t);return e&&(n||r==!1)?R5(e,t):t}const Xm=e=>e instanceof Rn?{...e}:e;function Ls(e,t){t=t||{};const r={};function n(l,u,f,p){return xe.isPlainObject(l)&&xe.isPlainObject(u)?xe.merge.call({caseless:p},l,u):xe.isPlainObject(u)?xe.merge({},u):xe.isArray(u)?u.slice():u}function i(l,u,f,p){if(xe.isUndefined(u)){if(!xe.isUndefined(l))return n(void 0,l,f,p)}else return n(l,u,f,p)}function s(l,u){if(!xe.isUndefined(u))return n(void 0,u)}function o(l,u){if(xe.isUndefined(u)){if(!xe.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function a(l,u,f){if(f in t)return n(l,u);if(f in e)return n(void 0,l)}const c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(l,u,f)=>i(Xm(l),Xm(u),f,!0)};return xe.forEach(Object.keys(Object.assign({},e,t)),function(u){const f=c[u]||i,p=f(e[u],t[u],u);xe.isUndefined(p)&&f!==a||(r[u]=p)}),r}var Zm=e=>{const t=Ls({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:o,auth:a}=t;t.headers=o=Rn.from(o),t.url=$m(Jm(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(xe.isFormData(r)){if(Dr.hasStandardBrowserEnv||Dr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...u]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...u].join("; "))}}if(Dr.hasStandardBrowserEnv&&(n&&xe.isFunction(n)&&(n=n(t)),n||n!==!1&&I5(t.url))){const l=i&&s&&O5.read(s);l&&o.set(i,l)}return t},j5=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const i=Zm(e);let s=i.data;const o=Rn.from(i.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=i,u,f,p,y,x;function v(){y&&y(),x&&x(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let _=new XMLHttpRequest;_.open(i.method.toUpperCase(),i.url,!0),_.timeout=i.timeout;function T(){if(!_)return;const R=Rn.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders()),B={data:!a||a==="text"||a==="json"?_.responseText:_.response,status:_.status,statusText:_.statusText,headers:R,config:e,request:_};Gm(function($){r($),v()},function($){n($),v()},B),_=null}"onloadend"in _?_.onloadend=T:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(T)},_.onabort=function(){_&&(n(new xt("Request aborted",xt.ECONNABORTED,e,_)),_=null)},_.onerror=function(){n(new xt("Network Error",xt.ERR_NETWORK,e,_)),_=null},_.ontimeout=function(){let F=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const B=i.transitional||zm;i.timeoutErrorMessage&&(F=i.timeoutErrorMessage),n(new xt(F,B.clarifyTimeoutError?xt.ETIMEDOUT:xt.ECONNABORTED,e,_)),_=null},s===void 0&&o.setContentType(null),"setRequestHeader"in _&&xe.forEach(o.toJSON(),function(F,B){_.setRequestHeader(B,F)}),xe.isUndefined(i.withCredentials)||(_.withCredentials=!!i.withCredentials),a&&a!=="json"&&(_.responseType=i.responseType),l&&([p,x]=Uc(l,!0),_.addEventListener("progress",p)),c&&_.upload&&([f,y]=Uc(c),_.upload.addEventListener("progress",f),_.upload.addEventListener("loadend",y)),(i.cancelToken||i.signal)&&(u=R=>{_&&(n(!R||R.type?new go(null,e,_):R),_.abort(),_=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const O=A5(i.url);if(O&&Dr.protocols.indexOf(O)===-1){n(new xt("Unsupported protocol "+O+":",xt.ERR_BAD_REQUEST,e));return}_.send(s||null)})},N5=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const s=function(l){if(!i){i=!0,a();const u=l instanceof Error?l:this.reason;n.abort(u instanceof xt?u:new go(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,s(new xt(`timeout ${t} of ms exceeded`,xt.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),e=null)};e.forEach(l=>l.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>xe.asap(a),c}};const k5=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},D5=async function*(e,t){for await(const r of L5(e))yield*k5(r,t)},L5=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()}},Qm=(e,t,r,n)=>{const i=D5(e,t);let s=0,o,a=c=>{o||(o=!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 f=u.byteLength;if(r){let p=s+=f;r(p)}c.enqueue(new Uint8Array(u))}catch(l){throw a(l),l}},cancel(c){return a(c),i.return()}},{highWaterMark:2})},Fc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",e1=Fc&&typeof ReadableStream=="function",B5=Fc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),t1=(e,...t)=>{try{return!!e(...t)}catch{return!1}},U5=e1&&t1(()=>{let e=!1;const t=new Request(Dr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),r1=64*1024,Id=e1&&t1(()=>xe.isReadableStream(new Response("").body)),$c={stream:Id&&(e=>e.body)};Fc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!$c[t]&&($c[t]=xe.isFunction(e[t])?r=>r[t]():(r,n)=>{throw new xt(`Response type '${t}' is not supported`,xt.ERR_NOT_SUPPORT,n)})})})(new Response);const F5=async e=>{if(e==null)return 0;if(xe.isBlob(e))return e.size;if(xe.isSpecCompliantForm(e))return(await new Request(Dr.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(xe.isArrayBufferView(e)||xe.isArrayBuffer(e))return e.byteLength;if(xe.isURLSearchParams(e)&&(e=e+""),xe.isString(e))return(await B5(e)).byteLength},$5=async(e,t)=>{const r=xe.toFiniteNumber(e.getContentLength());return r??F5(t)};var V5=Fc&&(async e=>{let{url:t,method:r,data:n,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:f="same-origin",fetchOptions:p}=Zm(e);l=l?(l+"").toLowerCase():"text";let y=N5([i,s&&s.toAbortSignal()],o),x;const v=y&&y.unsubscribe&&(()=>{y.unsubscribe()});let _;try{if(c&&U5&&r!=="get"&&r!=="head"&&(_=await $5(u,n))!==0){let B=new Request(t,{method:"POST",body:n,duplex:"half"}),H;if(xe.isFormData(n)&&(H=B.headers.get("content-type"))&&u.setContentType(H),B.body){const[$,Z]=Km(_,Uc(Ym(c)));n=Qm(B.body,r1,$,Z)}}xe.isString(f)||(f=f?"include":"omit");const T="credentials"in Request.prototype;x=new Request(t,{...p,signal:y,method:r.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",credentials:T?f:void 0});let O=await fetch(x);const R=Id&&(l==="stream"||l==="response");if(Id&&(a||R&&v)){const B={};["status","statusText","headers"].forEach(ce=>{B[ce]=O[ce]});const H=xe.toFiniteNumber(O.headers.get("content-length")),[$,Z]=a&&Km(H,Uc(Ym(a),!0))||[];O=new Response(Qm(O.body,r1,$,()=>{Z&&Z(),v&&v()}),B)}l=l||"text";let F=await $c[xe.findKey($c,l)||"text"](O,e);return!R&&v&&v(),await new Promise((B,H)=>{Gm(B,H,{data:F,headers:Rn.from(O.headers),status:O.status,statusText:O.statusText,config:e,request:x})})}catch(T){throw v&&v(),T&&T.name==="TypeError"&&/Load failed|fetch/i.test(T.message)?Object.assign(new xt("Network Error",xt.ERR_NETWORK,e,x),{cause:T.cause||T}):xt.from(T,T&&T.code,e,x)}});const Od={http:n5,xhr:j5,fetch:V5};xe.forEach(Od,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const n1=e=>`- ${e}`,z5=e=>xe.isFunction(e)||e===null||e===!1;var i1={getAdapter:e=>{e=xe.isArray(e)?e:[e];const{length:t}=e;let r,n;const i={};for(let s=0;s<t;s++){r=e[s];let o;if(n=r,!z5(r)&&(n=Od[(o=String(r)).toLowerCase()],n===void 0))throw new xt(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+s]=n}if(!n){const s=Object.entries(i).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since :
|
|
32
|
+
`+s.map(n1).join(`
|
|
33
|
+
`):" "+n1(s[0]):"as no adapter specified";throw new xt("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:Od};function Pd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new go(null,e)}function s1(e){return Pd(e),e.headers=Rn.from(e.headers),e.data=Md.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),i1.getAdapter(e.adapter||Ad.adapter)(e).then(function(n){return Pd(e),n.data=Md.call(e,e.transformResponse,n),n.headers=Rn.from(n.headers),n},function(n){return Wm(n)||(Pd(e),n&&n.response&&(n.response.data=Md.call(e,e.transformResponse,n.response),n.response.headers=Rn.from(n.response.headers))),Promise.reject(n)})}const o1="1.9.0",Vc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Vc[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const a1={};Vc.transitional=function(t,r,n){function i(s,o){return"[Axios v"+o1+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,a)=>{if(t===!1)throw new xt(i(o," has been removed"+(r?" in "+r:"")),xt.ERR_DEPRECATED);return r&&!a1[o]&&(a1[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(s,o,a):!0}},Vc.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function q5(e,t,r){if(typeof e!="object")throw new xt("options must be an object",xt.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const s=n[i],o=t[s];if(o){const a=e[s],c=a===void 0||o(a,s,e);if(c!==!0)throw new xt("option "+s+" must be "+c,xt.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new xt("Unknown option "+s,xt.ERR_BAD_OPTION)}}var zc={assertOptions:q5,validators:Vc};const Qn=zc.validators;class qc{constructor(t){this.defaults=t||{},this.interceptors={request:new Vm,response:new Vm}}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 s=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
34
|
+
`+s):n.stack=s}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ls(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:s}=r;n!==void 0&&zc.assertOptions(n,{silentJSONParsing:Qn.transitional(Qn.boolean),forcedJSONParsing:Qn.transitional(Qn.boolean),clarifyTimeoutError:Qn.transitional(Qn.boolean)},!1),i!=null&&(xe.isFunction(i)?r.paramsSerializer={serialize:i}:zc.assertOptions(i,{encode:Qn.function,serialize:Qn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),zc.assertOptions(r,{baseUrl:Qn.spelling("baseURL"),withXsrfToken:Qn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=s&&xe.merge(s.common,s[r.method]);s&&xe.forEach(["delete","get","head","post","put","patch","common"],x=>{delete s[x]}),r.headers=Rn.concat(o,s);const a=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(r)===!1||(c=c&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});const l=[];this.interceptors.response.forEach(function(v){l.push(v.fulfilled,v.rejected)});let u,f=0,p;if(!c){const x=[s1.bind(this),void 0];for(x.unshift.apply(x,a),x.push.apply(x,l),p=x.length,u=Promise.resolve(r);f<p;)u=u.then(x[f++],x[f++]);return u}p=a.length;let y=r;for(f=0;f<p;){const x=a[f++],v=a[f++];try{y=x(y)}catch(_){v.call(this,_);break}}try{u=s1.call(this,y)}catch(x){return Promise.reject(x)}for(f=0,p=l.length;f<p;)u=u.then(l[f++],l[f++]);return u}getUri(t){t=Ls(this.defaults,t);const r=Jm(t.baseURL,t.url,t.allowAbsoluteUrls);return $m(r,t.params,t.paramsSerializer)}}xe.forEach(["delete","get","head","options"],function(t){qc.prototype[t]=function(r,n){return this.request(Ls(n||{},{method:t,url:r,data:(n||{}).data}))}}),xe.forEach(["post","put","patch"],function(t){function r(n){return function(s,o,a){return this.request(Ls(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}qc.prototype[t]=r(),qc.prototype[t+"Form"]=r(!0)});var Hc=qc;class Rd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(s){r=s});const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{n.subscribe(a),s=a}).then(i);return o.cancel=function(){n.unsubscribe(s)},o},t(function(s,o,a){n.reason||(n.reason=new go(s,o,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 Rd(function(i){t=i}),cancel:t}}}var H5=Rd;function W5(e){return function(r){return e.apply(null,r)}}function G5(e){return xe.isObject(e)&&e.isAxiosError===!0}const jd={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(jd).forEach(([e,t])=>{jd[t]=e});var K5=jd;function c1(e){const t=new Hc(e),r=Am(Hc.prototype.request,t);return xe.extend(r,Hc.prototype,t,{allOwnKeys:!0}),xe.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return c1(Ls(e,i))},r}const vr=c1(Ad);vr.Axios=Hc,vr.CanceledError=go,vr.CancelToken=H5,vr.isCancel=Wm,vr.VERSION=o1,vr.toFormData=Dc,vr.AxiosError=xt,vr.Cancel=vr.CanceledError,vr.all=function(t){return Promise.all(t)},vr.spread=W5,vr.isAxiosError=G5,vr.mergeConfig=Ls,vr.AxiosHeaders=Rn,vr.formToJSON=e=>qm(xe.isHTMLForm(e)?new FormData(e):e),vr.getAdapter=i1.getAdapter,vr.HttpStatusCode=K5,vr.default=vr;var l1=vr,Nd={exports:{}},on={},u1={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})(u1);var Y5=u1.exports,kd={exports:{}},Dd={exports:{}},d1;function Wc(){return d1||(d1=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}(Dd)),Dd.exports}var f1;function J5(){return f1||(f1=1,function(e){var t=Wc().default;function r(){e.exports=r=function(){return i},e.exports.__esModule=!0,e.exports.default=e.exports;var n,i={},s=Object.prototype,o=s.hasOwnProperty,a=typeof Symbol=="function"?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function f(N,h,d,m){return Object.defineProperty(N,h,{value:d,enumerable:!m,configurable:!m,writable:!m})}try{f({},"")}catch{f=function(d,m,S){return d[m]=S}}function p(N,h,d,m){var S=h&&h.prototype instanceof v?h:v,E=Object.create(S.prototype);return f(E,"_invoke",function(M,j,I){var g=1;return function(b,k){if(g===3)throw Error("Generator is already running");if(g===4){if(b==="throw")throw k;return{value:n,done:!0}}for(I.method=b,I.arg=k;;){var ve=I.delegate;if(ve){var he=Z(ve,I);if(he){if(he===x)continue;return he}}if(I.method==="next")I.sent=I._sent=I.arg;else if(I.method==="throw"){if(g===1)throw g=4,I.arg;I.dispatchException(I.arg)}else I.method==="return"&&I.abrupt("return",I.arg);g=3;var we=y(M,j,I);if(we.type==="normal"){if(g=I.done?4:2,we.arg===x)continue;return{value:we.arg,done:I.done}}we.type==="throw"&&(g=4,I.method="throw",I.arg=we.arg)}}}(N,d,new de(m||[])),!0),E}function y(N,h,d){try{return{type:"normal",arg:N.call(h,d)}}catch(m){return{type:"throw",arg:m}}}i.wrap=p;var x={};function v(){}function _(){}function T(){}var O={};f(O,c,function(){return this});var R=Object.getPrototypeOf,F=R&&R(R(q([])));F&&F!==s&&o.call(F,c)&&(O=F);var B=T.prototype=v.prototype=Object.create(O);function H(N){["next","throw","return"].forEach(function(h){f(N,h,function(d){return this._invoke(h,d)})})}function $(N,h){function d(S,E,M,j){var I=y(N[S],N,E);if(I.type!=="throw"){var g=I.arg,b=g.value;return b&&t(b)=="object"&&o.call(b,"__await")?h.resolve(b.__await).then(function(k){d("next",k,M,j)},function(k){d("throw",k,M,j)}):h.resolve(b).then(function(k){g.value=k,M(g)},function(k){return d("throw",k,M,j)})}j(I.arg)}var m;f(this,"_invoke",function(S,E){function M(){return new h(function(j,I){d(S,E,j,I)})}return m=m?m.then(M,M):M()},!0)}function Z(N,h){var d=h.method,m=N.i[d];if(m===n)return h.delegate=null,d==="throw"&&N.i.return&&(h.method="return",h.arg=n,Z(N,h),h.method==="throw")||d!=="return"&&(h.method="throw",h.arg=new TypeError("The iterator does not provide a '"+d+"' method")),x;var S=y(m,N.i,h.arg);if(S.type==="throw")return h.method="throw",h.arg=S.arg,h.delegate=null,x;var E=S.arg;return E?E.done?(h[N.r]=E.value,h.next=N.n,h.method!=="return"&&(h.method="next",h.arg=n),h.delegate=null,x):E:(h.method="throw",h.arg=new TypeError("iterator result is not an object"),h.delegate=null,x)}function ce(N){this.tryEntries.push(N)}function ne(N){var h=N[4]||{};h.type="normal",h.arg=n,N[4]=h}function de(N){this.tryEntries=[[-1]],N.forEach(ce,this),this.reset(!0)}function q(N){if(N!=null){var h=N[c];if(h)return h.call(N);if(typeof N.next=="function")return N;if(!isNaN(N.length)){var d=-1,m=function S(){for(;++d<N.length;)if(o.call(N,d))return S.value=N[d],S.done=!1,S;return S.value=n,S.done=!0,S};return m.next=m}}throw new TypeError(t(N)+" is not iterable")}return _.prototype=T,f(B,"constructor",T),f(T,"constructor",_),_.displayName=f(T,u,"GeneratorFunction"),i.isGeneratorFunction=function(N){var h=typeof N=="function"&&N.constructor;return!!h&&(h===_||(h.displayName||h.name)==="GeneratorFunction")},i.mark=function(N){return Object.setPrototypeOf?Object.setPrototypeOf(N,T):(N.__proto__=T,f(N,u,"GeneratorFunction")),N.prototype=Object.create(B),N},i.awrap=function(N){return{__await:N}},H($.prototype),f($.prototype,l,function(){return this}),i.AsyncIterator=$,i.async=function(N,h,d,m,S){S===void 0&&(S=Promise);var E=new $(p(N,h,d,m),S);return i.isGeneratorFunction(h)?E:E.next().then(function(M){return M.done?M.value:E.next()})},H(B),f(B,u,"Generator"),f(B,c,function(){return this}),f(B,"toString",function(){return"[object Generator]"}),i.keys=function(N){var h=Object(N),d=[];for(var m in h)d.unshift(m);return function S(){for(;d.length;)if((m=d.pop())in h)return S.value=m,S.done=!1,S;return S.done=!0,S}},i.values=q,de.prototype={constructor:de,reset:function(h){if(this.prev=this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(ne),!h)for(var d in this)d.charAt(0)==="t"&&o.call(this,d)&&!isNaN(+d.slice(1))&&(this[d]=n)},stop:function(){this.done=!0;var h=this.tryEntries[0][4];if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var d=this;function m(b){M.type="throw",M.arg=h,d.next=b}for(var S=d.tryEntries.length-1;S>=0;--S){var E=this.tryEntries[S],M=E[4],j=this.prev,I=E[1],g=E[2];if(E[0]===-1)return m("end"),!1;if(!I&&!g)throw Error("try statement without catch or finally");if(E[0]!=null&&E[0]<=j){if(j<I)return this.method="next",this.arg=n,m(I),!0;if(j<g)return m(g),!1}}},abrupt:function(h,d){for(var m=this.tryEntries.length-1;m>=0;--m){var S=this.tryEntries[m];if(S[0]>-1&&S[0]<=this.prev&&this.prev<S[2]){var E=S;break}}E&&(h==="break"||h==="continue")&&E[0]<=d&&d<=E[2]&&(E=null);var M=E?E[4]:{};return M.type=h,M.arg=d,E?(this.method="next",this.next=E[2],x):this.complete(M)},complete:function(h,d){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&d&&(this.next=d),x},finish:function(h){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m[2]===h)return this.complete(m[4],m[3]),ne(m),x}},catch:function(h){for(var d=this.tryEntries.length-1;d>=0;--d){var m=this.tryEntries[d];if(m[0]===h){var S=m[4];if(S.type==="throw"){var E=S.arg;ne(m)}return E}}throw Error("illegal catch attempt")},delegateYield:function(h,d,m){return this.delegate={i:q(h),r:d,n:m},this.method==="next"&&(this.arg=n),x}},i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(kd)),kd.exports}var Ld,h1;function X5(){if(h1)return Ld;h1=1;var e=J5()();Ld=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return Ld}var Bd={exports:{}},p1;function Z5(){return p1||(p1=1,function(e){function t(n,i,s,o,a,c,l){try{var u=n[c](l),f=u.value}catch(p){return void s(p)}u.done?i(f):Promise.resolve(f).then(o,a)}function r(n){return function(){var i=this,s=arguments;return new Promise(function(o,a){var c=n.apply(i,s);function l(f){t(c,o,a,l,u,"next",f)}function u(f){t(c,o,a,l,u,"throw",f)}l(void 0)})}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Bd)),Bd.exports}var Ud={exports:{}},Fd={exports:{}},$d={exports:{}},m1;function Q5(){return m1||(m1=1,function(e){var t=Wc().default;function r(n,i){if(t(n)!="object"||!n)return n;var s=n[Symbol.toPrimitive];if(s!==void 0){var o=s.call(n,i||"default");if(t(o)!="object")return o;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}($d)),$d.exports}var g1;function e7(){return g1||(g1=1,function(e){var t=Wc().default,r=Q5();function n(i){var s=r(i,"string");return t(s)=="symbol"?s:s+""}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(Fd)),Fd.exports}var v1;function t7(){return v1||(v1=1,function(e){var t=e7();function r(n,i,s){return(i=t(i))in n?Object.defineProperty(n,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[i]=s,n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}(Ud)),Ud.exports}var Vd,b1;function r7(){if(b1)return Vd;b1=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 Vd=t=>!e.has(t&&t.code),Vd}var ya=Y5;Object.defineProperty(on,"__esModule",{value:!0}),on.isNetworkError=Hd,on.isRetryableError=Kc,on.isSafeRequestError=S1,on.isIdempotentRequestError=Wd,on.isNetworkOrIdempotentRequestError=Gd,on.exponentialDelay=_1,on.default=Bs,on.DEFAULT_OPTIONS=on.namespace=void 0;var Gc=ya(X5()),n7=ya(Wc()),y1=ya(Z5()),i7=ya(t7()),s7=ya(r7());function w1(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 zd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w1(Object(r),!0).forEach(function(n){(0,i7.default)(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var qd="axios-retry";on.namespace=qd;function Hd(e){var t=["ERR_CANCELED","ECONNABORTED"];return!e.response&&!!e.code&&!t.includes(e.code)&&(0,s7.default)(e)}var x1=["get","head","options"],o7=x1.concat(["put","delete"]);function Kc(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status>=500&&e.response.status<=599)}function S1(e){return e.config?Kc(e)&&x1.indexOf(e.config.method)!==-1:!1}function Wd(e){return e.config?Kc(e)&&o7.indexOf(e.config.method)!==-1:!1}function Gd(e){return Hd(e)||Wd(e)}function a7(){return 0}function _1(){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 E1={retries:3,retryCondition:Gd,retryDelay:a7,shouldResetTimeout:!1,onRetry:function(){}};on.DEFAULT_OPTIONS=E1;function c7(e,t){return zd(zd(zd({},E1),t),e[qd])}function C1(e,t){var r=c7(e,t);return r.retryCount=r.retryCount||0,e[qd]=r,r}function l7(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 u7(e,t){return Kd.apply(this,arguments)}function Kd(){return Kd=(0,y1.default)(Gc.default.mark(function e(t,r){var n,i,s,o;return Gc.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(n=t.retries,i=t.retryCondition,s=t.retryCount<n&&i(r),(0,n7.default)(s)!=="object"){c.next=13;break}return c.prev=3,c.next=6,s;case 6:return o=c.sent,c.abrupt("return",o!==!1);case 10:return c.prev=10,c.t0=c.catch(3),c.abrupt("return",!1);case 13:return c.abrupt("return",s);case 14:case"end":return c.stop()}},e,null,[[3,10]])})),Kd.apply(this,arguments)}function Bs(e,t){var r=e.interceptors.request.use(function(i){var s=C1(i,t);return s.lastRequestTime=Date.now(),i}),n=e.interceptors.response.use(null,function(){var i=(0,y1.default)(Gc.default.mark(function s(o){var a,c,l,u,f,p,y,x;return Gc.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(a=o.config,a){_.next=3;break}return _.abrupt("return",Promise.reject(o));case 3:return c=C1(a,t),_.next=6,u7(c,o);case 6:if(!_.sent){_.next=21;break}if(c.retryCount+=1,l=c.retryDelay,u=c.shouldResetTimeout,f=c.onRetry,p=l(c.retryCount,o),l7(e,a),!(!u&&a.timeout&&c.lastRequestTime)){_.next=17;break}if(y=Date.now()-c.lastRequestTime,x=a.timeout-y-p,!(x<=0)){_.next=16;break}return _.abrupt("return",Promise.reject(o));case 16:a.timeout=x;case 17:return a.transformRequest=[function(T){return T}],_.next=20,f(c.retryCount,o,a);case 20:return _.abrupt("return",new Promise(function(T){return setTimeout(function(){return T(e(a))},p)}));case 21:return _.abrupt("return",Promise.reject(o));case 22:case"end":return _.stop()}},s)}));return function(s){return i.apply(this,arguments)}}());return{requestInterceptorId:r,responseInterceptorId:n}}Bs.isNetworkError=Hd,Bs.isSafeRequestError=S1,Bs.isIdempotentRequestError=Wd,Bs.isNetworkOrIdempotentRequestError=Gd,Bs.exponentialDelay=_1,Bs.isRetryableError=Kc;const A1=on.default;Nd.exports=A1,Nd.exports.default=A1;var d7=Nd.exports,Yc={},vo=null;typeof WebSocket<"u"?vo=WebSocket:typeof MozWebSocket<"u"?vo=MozWebSocket:typeof Cr<"u"?vo=Cr.WebSocket||Cr.MozWebSocket:typeof window<"u"?vo=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(vo=self.WebSocket||self.MozWebSocket);var f7=vo,h7=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.ResilientWebSocket=void 0;const p7=h7(f7),m7=3e4+3e3;class g7{constructor(t,r){Et(this,"endpoint");Et(this,"wsClient");Et(this,"wsUserClosed");Et(this,"wsFailedAttempts");Et(this,"pingTimeout");Et(this,"logger");Et(this,"onError");Et(this,"onMessage");Et(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 p7.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=v7(this.wsFailedAttempts);(r=this.logger)==null||r.error(`Connection closed unexpectedly or because of timeout. Reconnecting after ${i}ms.`),await T1(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()},m7)}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 T1(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}}Yc.ResilientWebSocket=g7;async function T1(e){return new Promise(t=>setTimeout(t,e))}function v7(e){return 2**e*100}var bo={};Object.defineProperty(bo,"__esModule",{value:!0}),bo.removeLeading0xIfExists=bo.makeWebsocketUrl=void 0;function b7(e){const t=new URL("ws",e),r=t.protocol==="https:";return t.protocol=r?"wss:":"ws:",t.toString()}bo.makeWebsocketUrl=b7;function y7(e){return e.startsWith("0x")?e.substring(2):e}bo.removeLeading0xIfExists=y7;var M1=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.PriceServiceConnection=void 0;const Yd=fd,w7=M1(l1),I1=M1(d7),x7=Yc,Jd=bo;class S7{constructor(t,r){Et(this,"httpClient");Et(this,"priceFeedCallbacks");Et(this,"wsClient");Et(this,"wsEndpoint");Et(this,"logger");Et(this,"priceFeedRequestConfig");Et(this,"onWsError");var n,i,s;this.httpClient=w7.default.create({baseURL:t,timeout:(r==null?void 0:r.timeout)||5e3}),(0,I1.default)(this.httpClient,{retries:(r==null?void 0:r.httpRetries)||3,retryDelay:I1.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:(s=r==null?void 0:r.priceFeedRequestConfig)==null?void 0:s.allowOutOfOrder},this.priceFeedCallbacks=new Map,this.logger=(r==null?void 0:r.logger)||{trace:()=>{},debug:()=>{},info:()=>{},warn:console.warn,error:console.error},this.onWsError=o=>{this.logger.error(o),typeof _n<"u"&&typeof _n.exit=="function"?(this.logger.error("Halting the process due to the websocket error"),_n.exit(1)):this.logger.error("Cannot halt process. Please handle the websocket error.")},this.wsEndpoint=(0,Jd.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=>Yd.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 Yd.PriceFeed.fromJson(n.data)}async getPriceFeedIds(){return(await this.httpClient.get("/api/price_feed_ids")).data}async subscribePriceFeedUpdates(t,r){var s;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(o=>(0,Jd.removeLeading0xIfExists)(o));const n=[];for(const o of t)this.priceFeedCallbacks.has(o)||(this.priceFeedCallbacks.set(o,new Set),n.push(o)),this.priceFeedCallbacks.get(o).add(r);const i={ids:n,type:"subscribe",verbose:this.priceFeedRequestConfig.verbose,binary:this.priceFeedRequestConfig.binary,allow_out_of_order:this.priceFeedRequestConfig.allowOutOfOrder};await((s=this.wsClient)==null?void 0:s.send(JSON.stringify(i)))}async unsubscribePriceFeedUpdates(t,r){var s;this.wsClient===void 0&&await this.startWebSocket(),t=t.map(o=>(0,Jd.removeLeading0xIfExists)(o));const n=[];for(const o of t)if(this.priceFeedCallbacks.has(o)){let a=!1;r===void 0?(this.priceFeedCallbacks.delete(o),a=!0):(this.priceFeedCallbacks.get(o).delete(r),this.priceFeedCallbacks.get(o).size===0&&(this.priceFeedCallbacks.delete(o),a=!0)),a&&n.push(o)}const i={ids:n,type:"unsubscribe"};await((s=this.wsClient)==null?void 0:s.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 x7.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=Yd.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()}}Mc.PriceServiceConnection=S7,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseAccumulatorUpdateData=e.isAccumulatorUpdateData=e.Price=e.PriceFeed=e.PriceFeedMetadata=e.PriceServiceConnection=void 0;var t=Mc;Object.defineProperty(e,"PriceServiceConnection",{enumerable:!0,get:function(){return t.PriceServiceConnection}});var r=fd;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}})}(dd),Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.SuiPriceServiceConnection=void 0;const _7=dd,E7=ma;class C7 extends _7.PriceServiceConnection{async getPriceFeedsUpdateData(t){return(await this.getLatestVaas(t)).map(n=>E7.Buffer.from(n,"base64"))}}Tc.SuiPriceServiceConnection=C7;var Jc={};const A7=Ph(w3),Us=Ph(L4);var Xd=Object.defineProperty,T7=Object.getOwnPropertyDescriptor,M7=Object.getOwnPropertyNames,I7=Object.prototype.hasOwnProperty,O7=(e,t)=>{for(var r in t)Xd(e,r,{get:t[r],enumerable:!0})},P7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of M7(t))!I7.call(e,i)&&i!==r&&Xd(e,i,{get:()=>t[i],enumerable:!(n=T7(t,i))||n.enumerable});return e},R7=e=>P7(Xd({},"__esModule",{value:!0}),e),O1={};O7(O1,{isValidSuiNSName:()=>k7,normalizeSuiNSName:()=>D7});var j7=R7(O1);const P1=/^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i,R1=/^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i,N7=235;function k7(e){return e.length>N7?!1:e.includes("@")?P1.test(e):R1.test(e)}function D7(e,t="at"){const r=e.toLowerCase();let n;if(r.includes("@")){if(!P1.test(r))throw new Error(`Invalid SuiNS name ${e}`);const[i,s]=r.split("@");n=[...i?i.split("."):[],s]}else{if(!R1.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 Zd=Object.defineProperty,L7=Object.getOwnPropertyDescriptor,B7=Object.getOwnPropertyNames,U7=Object.prototype.hasOwnProperty,F7=(e,t)=>{for(var r in t)Zd(e,r,{get:t[r],enumerable:!0})},$7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of B7(t))!U7.call(e,i)&&i!==r&&Zd(e,i,{get:()=>t[i],enumerable:!(n=L7(t,i))||n.enumerable});return e},V7=e=>$7(Zd({},"__esModule",{value:!0}),e),j1={};F7(j1,{isValidNamedPackage:()=>k1,isValidNamedType:()=>K7});var z7=V7(j1),q7=j7;const H7=/^([a-z0-9]+(?:-[a-z0-9]+)*)$/,W7=/^\d+$/,G7=64,N1="/",k1=e=>{const t=e.split(N1);if(t.length<2||t.length>3)return!1;const[r,n,i]=t;return i!==void 0&&!W7.test(i)||!(0,q7.isValidSuiNSName)(r)?!1:H7.test(n)&&n.length<G7},K7=e=>{const t=e.split(/::|<|>|,/);for(const r of t)if(r.includes(N1)&&!k1(r))return!1;return!0};var Qd=Object.defineProperty,Y7=Object.getOwnPropertyDescriptor,J7=Object.getOwnPropertyNames,X7=Object.prototype.hasOwnProperty,Z7=(e,t)=>{for(var r in t)Qd(e,r,{get:t[r],enumerable:!0})},Q7=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of J7(t))!X7.call(e,i)&&i!==r&&Qd(e,i,{get:()=>t[i],enumerable:!(n=Y7(t,i))||n.enumerable});return e},eS=e=>Q7(Qd({},"__esModule",{value:!0}),e),D1={};Z7(D1,{SUI_ADDRESS_LENGTH:()=>ef,isValidSuiAddress:()=>U1,isValidSuiObjectId:()=>iS,isValidTransactionDigest:()=>nS,normalizeStructTag:()=>F1,normalizeSuiAddress:()=>rf,normalizeSuiObjectId:()=>oS,parseStructTag:()=>tf});var L1=eS(D1),B1=Us,tS=z7;const rS=32;function nS(e){try{return(0,B1.fromBase58)(e).length===rS}catch{return!1}}const ef=32;function U1(e){return aS(e)&&cS(e)===ef}function iS(e){return U1(e)}function sS(e){return e.includes("::")?tf(e):e}function tf(e){const[t,r]=e.split("::"),n=(0,tS.isValidNamedPackage)(t),i=e.slice(t.length+r.length+4),s=i.includes("<")?i.slice(0,i.indexOf("<")):i,o=i.includes("<")?(0,B1.splitGenericParameters)(i.slice(i.indexOf("<")+1,i.lastIndexOf(">"))).map(a=>sS(a.trim())):[];return{address:n?t:rf(t),module:r,name:s,typeParams:o}}function F1(e){const{address:t,module:r,name:n,typeParams:i}=typeof e=="string"?tf(e):e,s=(i==null?void 0:i.length)>0?`<${i.map(o=>typeof o=="string"?o:F1(o)).join(",")}>`:"";return`${t}::${r}::${n}${s}`}function rf(e,t=!1){let r=e.toLowerCase();return!t&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(ef*2,"0")}`}function oS(e,t=!1){return rf(e,t)}function aS(e){return/^(0x|0X)?[a-fA-F0-9]+$/.test(e)&&e.length%2===0}function cS(e){return/^(0x|0X)/.test(e)?(e.length-2)/2:e.length/2}var nf=Object.defineProperty,lS=Object.getOwnPropertyDescriptor,uS=Object.getOwnPropertyNames,dS=Object.prototype.hasOwnProperty,fS=(e,t)=>{for(var r in t)nf(e,r,{get:t[r],enumerable:!0})},hS=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of uS(t))!dS.call(e,i)&&i!==r&&nf(e,i,{get:()=>t[i],enumerable:!(n=lS(t,i))||n.enumerable});return e},pS=e=>hS(nf({},"__esModule",{value:!0}),e),$1={};fS($1,{TypeTagSerializer:()=>Fs});var V1=pS($1),mS=Us,gS=L1;const vS=/^vector<(.+)>$/,bS=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;class Fs{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(vS);if(n)return{vector:Fs.parseFromStr(n[1],r)};const i=t.match(bS);if(i)return{struct:{address:r?(0,gS.normalizeSuiAddress)(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:Fs.parseStructTypeArgs(i[5],r)}};throw new Error(`Encountered unexpected token when parsing type args for ${t}`)}static parseStructTypeArgs(t,r=!1){return(0,mS.splitGenericParameters)(t).map(n=>Fs.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<${Fs.tagToString(t.vector)}>`;if("struct"in t){const r=t.struct,n=r.typeParams.map(Fs.tagToString).join(", ");return`${r.address}::${r.module}::${r.name}${n?`<${n}>`:""}`}throw new Error("Invalid TypeTag")}}var sf=Object.defineProperty,yS=Object.getOwnPropertyDescriptor,wS=Object.getOwnPropertyNames,xS=Object.prototype.hasOwnProperty,SS=(e,t)=>{for(var r in t)sf(e,r,{get:t[r],enumerable:!0})},_S=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of wS(t))!xS.call(e,i)&&i!==r&&sf(e,i,{get:()=>t[i],enumerable:!(n=yS(t,i))||n.enumerable});return e},ES=e=>_S(sf({},"__esModule",{value:!0}),e),z1={};SS(z1,{Address:()=>an,AppId:()=>og,Argument:()=>ei,CallArg:()=>K1,Command:()=>J1,CompressedSignature:()=>lg,GasData:()=>tg,Intent:()=>ag,IntentMessage:()=>cg,IntentScope:()=>ig,IntentVersion:()=>sg,MultiSig:()=>MS,MultiSigPkMap:()=>dg,MultiSigPublicKey:()=>fg,ObjectArg:()=>G1,ObjectDigest:()=>H1,Owner:()=>TS,PasskeyAuthenticator:()=>OS,ProgrammableMoveCall:()=>Y1,ProgrammableTransaction:()=>X1,PublicKey:()=>ug,SenderSignedData:()=>IS,SenderSignedTransaction:()=>pg,SharedObjectRef:()=>W1,StructTag:()=>eg,SuiObjectRef:()=>Xc,TransactionData:()=>ng,TransactionDataV1:()=>rg,TransactionExpiration:()=>Q1,TransactionKind:()=>Z1,TypeTag:()=>cf,base64String:()=>hg});var of=ES(z1),Ee=Us,wa=L1,q1=V1;function CS(e){return Ee.bcs.u64({name:"unsafe_u64",...e}).transform({input:t=>t,output:t=>Number(t)})}function AS(e){return Ee.bcs.enum("Option",{None:null,Some:e})}const an=Ee.bcs.bytes(wa.SUI_ADDRESS_LENGTH).transform({validate:e=>{const t=typeof e=="string"?e:(0,Ee.toHex)(e);if(!t||!(0,wa.isValidSuiAddress)((0,wa.normalizeSuiAddress)(t)))throw new Error(`Invalid Sui address ${t}`)},input:e=>typeof e=="string"?(0,Ee.fromHex)((0,wa.normalizeSuiAddress)(e)):e,output:e=>(0,wa.normalizeSuiAddress)((0,Ee.toHex)(e))}),H1=Ee.bcs.vector(Ee.bcs.u8()).transform({name:"ObjectDigest",input:e=>(0,Ee.fromBase58)(e),output:e=>(0,Ee.toBase58)(new Uint8Array(e)),validate:e=>{if((0,Ee.fromBase58)(e).length!==32)throw new Error("ObjectDigest must be 32 bytes")}}),Xc=Ee.bcs.struct("SuiObjectRef",{objectId:an,version:Ee.bcs.u64(),digest:H1}),W1=Ee.bcs.struct("SharedObjectRef",{objectId:an,initialSharedVersion:Ee.bcs.u64(),mutable:Ee.bcs.bool()}),G1=Ee.bcs.enum("ObjectArg",{ImmOrOwnedObject:Xc,SharedObject:W1,Receiving:Xc}),TS=Ee.bcs.enum("Owner",{AddressOwner:an,ObjectOwner:an,Shared:Ee.bcs.struct("Shared",{initialSharedVersion:Ee.bcs.u64()}),Immutable:null,ConsensusV2:Ee.bcs.struct("ConsensusV2",{authenticator:Ee.bcs.enum("Authenticator",{SingleOwner:an}),startVersion:Ee.bcs.u64()})}),K1=Ee.bcs.enum("CallArg",{Pure:Ee.bcs.struct("Pure",{bytes:Ee.bcs.vector(Ee.bcs.u8()).transform({input:e=>typeof e=="string"?(0,Ee.fromBase64)(e):e,output:e=>(0,Ee.toBase64)(new Uint8Array(e))})}),Object:G1}),af=Ee.bcs.enum("TypeTag",{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:Ee.bcs.lazy(()=>af),struct:Ee.bcs.lazy(()=>eg),u16:null,u32:null,u256:null}),cf=af.transform({input:e=>typeof e=="string"?q1.TypeTagSerializer.parseFromStr(e,!0):e,output:e=>q1.TypeTagSerializer.tagToString(e)}),ei=Ee.bcs.enum("Argument",{GasCoin:null,Input:Ee.bcs.u16(),Result:Ee.bcs.u16(),NestedResult:Ee.bcs.tuple([Ee.bcs.u16(),Ee.bcs.u16()])}),Y1=Ee.bcs.struct("ProgrammableMoveCall",{package:an,module:Ee.bcs.string(),function:Ee.bcs.string(),typeArguments:Ee.bcs.vector(cf),arguments:Ee.bcs.vector(ei)}),J1=Ee.bcs.enum("Command",{MoveCall:Y1,TransferObjects:Ee.bcs.struct("TransferObjects",{objects:Ee.bcs.vector(ei),address:ei}),SplitCoins:Ee.bcs.struct("SplitCoins",{coin:ei,amounts:Ee.bcs.vector(ei)}),MergeCoins:Ee.bcs.struct("MergeCoins",{destination:ei,sources:Ee.bcs.vector(ei)}),Publish:Ee.bcs.struct("Publish",{modules:Ee.bcs.vector(Ee.bcs.vector(Ee.bcs.u8()).transform({input:e=>typeof e=="string"?(0,Ee.fromBase64)(e):e,output:e=>(0,Ee.toBase64)(new Uint8Array(e))})),dependencies:Ee.bcs.vector(an)}),MakeMoveVec:Ee.bcs.struct("MakeMoveVec",{type:AS(cf).transform({input:e=>e===null?{None:!0}:{Some:e},output:e=>e.Some??null}),elements:Ee.bcs.vector(ei)}),Upgrade:Ee.bcs.struct("Upgrade",{modules:Ee.bcs.vector(Ee.bcs.vector(Ee.bcs.u8()).transform({input:e=>typeof e=="string"?(0,Ee.fromBase64)(e):e,output:e=>(0,Ee.toBase64)(new Uint8Array(e))})),dependencies:Ee.bcs.vector(an),package:an,ticket:ei})}),X1=Ee.bcs.struct("ProgrammableTransaction",{inputs:Ee.bcs.vector(K1),commands:Ee.bcs.vector(J1)}),Z1=Ee.bcs.enum("TransactionKind",{ProgrammableTransaction:X1,ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null}),Q1=Ee.bcs.enum("TransactionExpiration",{None:null,Epoch:CS()}),eg=Ee.bcs.struct("StructTag",{address:an,module:Ee.bcs.string(),name:Ee.bcs.string(),typeParams:Ee.bcs.vector(af)}),tg=Ee.bcs.struct("GasData",{payment:Ee.bcs.vector(Xc),owner:an,price:Ee.bcs.u64(),budget:Ee.bcs.u64()}),rg=Ee.bcs.struct("TransactionDataV1",{kind:Z1,sender:an,gasData:tg,expiration:Q1}),ng=Ee.bcs.enum("TransactionData",{V1:rg}),ig=Ee.bcs.enum("IntentScope",{TransactionData:null,TransactionEffects:null,CheckpointSummary:null,PersonalMessage:null}),sg=Ee.bcs.enum("IntentVersion",{V0:null}),og=Ee.bcs.enum("AppId",{Sui:null}),ag=Ee.bcs.struct("Intent",{scope:ig,version:sg,appId:og});function cg(e){return Ee.bcs.struct(`IntentMessage<${e.name}>`,{intent:ag,value:e})}const lg=Ee.bcs.enum("CompressedSignature",{ED25519:Ee.bcs.fixedArray(64,Ee.bcs.u8()),Secp256k1:Ee.bcs.fixedArray(64,Ee.bcs.u8()),Secp256r1:Ee.bcs.fixedArray(64,Ee.bcs.u8()),ZkLogin:Ee.bcs.vector(Ee.bcs.u8())}),ug=Ee.bcs.enum("PublicKey",{ED25519:Ee.bcs.fixedArray(32,Ee.bcs.u8()),Secp256k1:Ee.bcs.fixedArray(33,Ee.bcs.u8()),Secp256r1:Ee.bcs.fixedArray(33,Ee.bcs.u8()),ZkLogin:Ee.bcs.vector(Ee.bcs.u8())}),dg=Ee.bcs.struct("MultiSigPkMap",{pubKey:ug,weight:Ee.bcs.u8()}),fg=Ee.bcs.struct("MultiSigPublicKey",{pk_map:Ee.bcs.vector(dg),threshold:Ee.bcs.u16()}),MS=Ee.bcs.struct("MultiSig",{sigs:Ee.bcs.vector(lg),bitmap:Ee.bcs.u16(),multisig_pk:fg}),hg=Ee.bcs.vector(Ee.bcs.u8()).transform({input:e=>typeof e=="string"?(0,Ee.fromBase64)(e):e,output:e=>(0,Ee.toBase64)(new Uint8Array(e))}),pg=Ee.bcs.struct("SenderSignedTransaction",{intentMessage:cg(ng),txSignatures:Ee.bcs.vector(hg)}),IS=Ee.bcs.vector(pg,{name:"SenderSignedData"}),OS=Ee.bcs.struct("PasskeyAuthenticator",{authenticatorData:Ee.bcs.vector(Ee.bcs.u8()),clientDataJson:Ee.bcs.string(),userSignature:Ee.bcs.vector(Ee.bcs.u8())});var lf=Object.defineProperty,PS=Object.getOwnPropertyDescriptor,RS=Object.getOwnPropertyNames,jS=Object.prototype.hasOwnProperty,NS=(e,t)=>{for(var r in t)lf(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))!jS.call(e,i)&&i!==r&&lf(e,i,{get:()=>t[i],enumerable:!(n=PS(t,i))||n.enumerable});return e},DS=e=>kS(lf({},"__esModule",{value:!0}),e),mg={};NS(mg,{TransactionEffects:()=>JS});var LS=DS(mg),Te=Us,Rt=of;const BS=Te.bcs.enum("PackageUpgradeError",{UnableToFetchPackage:Te.bcs.struct("UnableToFetchPackage",{packageId:Rt.Address}),NotAPackage:Te.bcs.struct("NotAPackage",{objectId:Rt.Address}),IncompatibleUpgrade:null,DigestDoesNotMatch:Te.bcs.struct("DigestDoesNotMatch",{digest:Te.bcs.vector(Te.bcs.u8())}),UnknownUpgradePolicy:Te.bcs.struct("UnknownUpgradePolicy",{policy:Te.bcs.u8()}),PackageIDDoesNotMatch:Te.bcs.struct("PackageIDDoesNotMatch",{packageId:Rt.Address,ticketId:Rt.Address})}),US=Te.bcs.struct("ModuleId",{address:Rt.Address,name:Te.bcs.string()}),gg=Te.bcs.struct("MoveLocation",{module:US,function:Te.bcs.u16(),instruction:Te.bcs.u16(),functionName:Te.bcs.option(Te.bcs.string())}),FS=Te.bcs.enum("CommandArgumentError",{TypeMismatch:null,InvalidBCSBytes:null,InvalidUsageOfPureArg:null,InvalidArgumentToPrivateEntryFunction:null,IndexOutOfBounds:Te.bcs.struct("IndexOutOfBounds",{idx:Te.bcs.u16()}),SecondaryIndexOutOfBounds:Te.bcs.struct("SecondaryIndexOutOfBounds",{resultIdx:Te.bcs.u16(),secondaryIdx:Te.bcs.u16()}),InvalidResultArity:Te.bcs.struct("InvalidResultArity",{resultIdx:Te.bcs.u16()}),InvalidGasCoinUsage:null,InvalidValueUsage:null,InvalidObjectByValue:null,InvalidObjectByMutRef:null,SharedObjectOperationNotAllowed:null}),$S=Te.bcs.enum("TypeArgumentError",{TypeNotFound:null,ConstraintNotSatisfied:null}),VS=Te.bcs.enum("ExecutionFailureStatus",{InsufficientGas:null,InvalidGasObject:null,InvariantViolation:null,FeatureNotYetSupported:null,MoveObjectTooBig:Te.bcs.struct("MoveObjectTooBig",{objectSize:Te.bcs.u64(),maxObjectSize:Te.bcs.u64()}),MovePackageTooBig:Te.bcs.struct("MovePackageTooBig",{objectSize:Te.bcs.u64(),maxObjectSize:Te.bcs.u64()}),CircularObjectOwnership:Te.bcs.struct("CircularObjectOwnership",{object:Rt.Address}),InsufficientCoinBalance:null,CoinBalanceOverflow:null,PublishErrorNonZeroAddress:null,SuiMoveVerificationError:null,MovePrimitiveRuntimeError:Te.bcs.option(gg),MoveAbort:Te.bcs.tuple([gg,Te.bcs.u64()]),VMVerificationOrDeserializationError:null,VMInvariantViolation:null,FunctionNotFound:null,ArityMismatch:null,TypeArityMismatch:null,NonEntryFunctionInvoked:null,CommandArgumentError:Te.bcs.struct("CommandArgumentError",{argIdx:Te.bcs.u16(),kind:FS}),TypeArgumentError:Te.bcs.struct("TypeArgumentError",{argumentIdx:Te.bcs.u16(),kind:$S}),UnusedValueWithoutDrop:Te.bcs.struct("UnusedValueWithoutDrop",{resultIdx:Te.bcs.u16(),secondaryIdx:Te.bcs.u16()}),InvalidPublicFunctionReturnType:Te.bcs.struct("InvalidPublicFunctionReturnType",{idx:Te.bcs.u16()}),InvalidTransferObject:null,EffectsTooLarge:Te.bcs.struct("EffectsTooLarge",{currentSize:Te.bcs.u64(),maxSize:Te.bcs.u64()}),PublishUpgradeMissingDependency:null,PublishUpgradeDependencyDowngrade:null,PackageUpgradeError:Te.bcs.struct("PackageUpgradeError",{upgradeError:BS}),WrittenObjectsTooLarge:Te.bcs.struct("WrittenObjectsTooLarge",{currentSize:Te.bcs.u64(),maxSize:Te.bcs.u64()}),CertificateDenied:null,SuiMoveVerificationTimedout:null,SharedObjectOperationNotAllowed:null,InputObjectDeleted:null,ExecutionCancelledDueToSharedObjectCongestion:Te.bcs.struct("ExecutionCancelledDueToSharedObjectCongestion",{congestedObjects:Te.bcs.vector(Rt.Address)}),AddressDeniedForCoin:Te.bcs.struct("AddressDeniedForCoin",{address:Rt.Address,coinType:Te.bcs.string()}),CoinTypeGlobalPause:Te.bcs.struct("CoinTypeGlobalPause",{coinType:Te.bcs.string()}),ExecutionCancelledDueToRandomnessUnavailable:null}),vg=Te.bcs.enum("ExecutionStatus",{Success:null,Failed:Te.bcs.struct("ExecutionFailed",{error:VS,command:Te.bcs.option(Te.bcs.u64())})}),bg=Te.bcs.struct("GasCostSummary",{computationCost:Te.bcs.u64(),storageCost:Te.bcs.u64(),storageRebate:Te.bcs.u64(),nonRefundableStorageFee:Te.bcs.u64()}),zS=Te.bcs.struct("TransactionEffectsV1",{status:vg,executedEpoch:Te.bcs.u64(),gasUsed:bg,modifiedAtVersions:Te.bcs.vector(Te.bcs.tuple([Rt.Address,Te.bcs.u64()])),sharedObjects:Te.bcs.vector(Rt.SuiObjectRef),transactionDigest:Rt.ObjectDigest,created:Te.bcs.vector(Te.bcs.tuple([Rt.SuiObjectRef,Rt.Owner])),mutated:Te.bcs.vector(Te.bcs.tuple([Rt.SuiObjectRef,Rt.Owner])),unwrapped:Te.bcs.vector(Te.bcs.tuple([Rt.SuiObjectRef,Rt.Owner])),deleted:Te.bcs.vector(Rt.SuiObjectRef),unwrappedThenDeleted:Te.bcs.vector(Rt.SuiObjectRef),wrapped:Te.bcs.vector(Rt.SuiObjectRef),gasObject:Te.bcs.tuple([Rt.SuiObjectRef,Rt.Owner]),eventsDigest:Te.bcs.option(Rt.ObjectDigest),dependencies:Te.bcs.vector(Rt.ObjectDigest)}),uf=Te.bcs.tuple([Te.bcs.u64(),Rt.ObjectDigest]),qS=Te.bcs.enum("ObjectIn",{NotExist:null,Exist:Te.bcs.tuple([uf,Rt.Owner])}),HS=Te.bcs.enum("ObjectOut",{NotExist:null,ObjectWrite:Te.bcs.tuple([Rt.ObjectDigest,Rt.Owner]),PackageWrite:uf}),WS=Te.bcs.enum("IDOperation",{None:null,Created:null,Deleted:null}),GS=Te.bcs.struct("EffectsObjectChange",{inputState:qS,outputState:HS,idOperation:WS}),KS=Te.bcs.enum("UnchangedSharedKind",{ReadOnlyRoot:uf,MutateDeleted:Te.bcs.u64(),ReadDeleted:Te.bcs.u64(),Cancelled:Te.bcs.u64(),PerEpochConfig:null}),YS=Te.bcs.struct("TransactionEffectsV2",{status:vg,executedEpoch:Te.bcs.u64(),gasUsed:bg,transactionDigest:Rt.ObjectDigest,gasObjectIndex:Te.bcs.option(Te.bcs.u32()),eventsDigest:Te.bcs.option(Rt.ObjectDigest),dependencies:Te.bcs.vector(Rt.ObjectDigest),lamportVersion:Te.bcs.u64(),changedObjects:Te.bcs.vector(Te.bcs.tuple([Rt.Address,GS])),unchangedSharedObjects:Te.bcs.vector(Te.bcs.tuple([Rt.Address,KS])),auxDataDigest:Te.bcs.option(Rt.ObjectDigest)}),JS=Te.bcs.enum("TransactionEffects",{V1:zS,V2:YS});var df=Object.defineProperty,XS=Object.getOwnPropertyDescriptor,ZS=Object.getOwnPropertyNames,QS=Object.prototype.hasOwnProperty,e9=(e,t)=>{for(var r in t)df(e,r,{get:t[r],enumerable:!0})},t9=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ZS(t))!QS.call(e,i)&&i!==r&&df(e,i,{get:()=>t[i],enumerable:!(n=XS(t,i))||n.enumerable});return e},r9=e=>t9(df({},"__esModule",{value:!0}),e),yg={};e9(yg,{pureBcsSchemaFromTypeName:()=>ff});var n9=r9(yg),ti=Us,i9=of;function ff(e){switch(e){case"u8":return ti.bcs.u8();case"u16":return ti.bcs.u16();case"u32":return ti.bcs.u32();case"u64":return ti.bcs.u64();case"u128":return ti.bcs.u128();case"u256":return ti.bcs.u256();case"bool":return ti.bcs.bool();case"string":return ti.bcs.string();case"id":case"address":return i9.Address}const t=e.match(/^(vector|option)<(.+)>$/);if(t){const[r,n]=t.slice(1);return r==="vector"?ti.bcs.vector(ff(n)):ti.bcs.option(ff(n))}throw new Error(`Invalid Pure type name: ${e}`)}var hf=Object.defineProperty,s9=Object.getOwnPropertyDescriptor,o9=Object.getOwnPropertyNames,a9=Object.prototype.hasOwnProperty,c9=(e,t)=>{for(var r in t)hf(e,r,{get:t[r],enumerable:!0})},l9=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of o9(t))!a9.call(e,i)&&i!==r&&hf(e,i,{get:()=>t[i],enumerable:!(n=s9(t,i))||n.enumerable});return e},u9=e=>l9(hf({},"__esModule",{value:!0}),e),wg={};c9(wg,{BcsType:()=>h9.BcsType,TypeTagSerializer:()=>f9.TypeTagSerializer,bcs:()=>m9,pureBcsSchemaFromTypeName:()=>p9.pureBcsSchemaFromTypeName});var xg=u9(wg),ri=Us,Lt=of,d9=LS,f9=V1,h9=Us,p9=n9;const m9={...ri.bcs,U8:ri.bcs.u8(),U16:ri.bcs.u16(),U32:ri.bcs.u32(),U64:ri.bcs.u64(),U128:ri.bcs.u128(),U256:ri.bcs.u256(),ULEB128:ri.bcs.uleb128(),Bool:ri.bcs.bool(),String:ri.bcs.string(),Address:Lt.Address,AppId:Lt.AppId,Argument:Lt.Argument,CallArg:Lt.CallArg,Command:Lt.Command,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,PasskeyAuthenticator:Lt.PasskeyAuthenticator,ProgrammableMoveCall:Lt.ProgrammableMoveCall,ProgrammableTransaction:Lt.ProgrammableTransaction,PublicKey:Lt.PublicKey,SenderSignedData:Lt.SenderSignedData,SenderSignedTransaction:Lt.SenderSignedTransaction,SharedObjectRef:Lt.SharedObjectRef,StructTag:Lt.StructTag,SuiObjectRef:Lt.SuiObjectRef,TransactionData:Lt.TransactionData,TransactionDataV1:Lt.TransactionDataV1,TransactionEffects:d9.TransactionEffects,TransactionExpiration:Lt.TransactionExpiration,TransactionKind:Lt.TransactionKind,TypeTag:Lt.TypeTag};Object.defineProperty(Jc,"__esModule",{value:!0}),Jc.SuiPythClient=void 0;const Zc=A7,yo=xg,g9=ma,pf=16*1024;class v9{constructor(t,r,n){Et(this,"provider");Et(this,"pythStateId");Et(this,"wormholeStateId");Et(this,"pythPackageId");Et(this,"wormholePackageId");Et(this,"priceTableInfo");Et(this,"priceFeedObjectIdCache",new Map);Et(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,s;if(((s=(i=n.data)==null?void 0:i.content)==null?void 0:s.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 s of t){const[o]=r.moveCall({target:`${n}::vaa::parse_and_verify`,arguments:[r.object(this.wormholeStateId),r.pure(yo.bcs.vector(yo.bcs.U8).serialize(Array.from(s),{maxSize:pf}).toBytes()),r.object(Zc.SUI_CLOCK_OBJECT_ID)]});i.push(o)}return i}async verifyVaasAndGetHotPotato(t,r,n){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]),s=await this.verifyVaas([i],t),[o]=t.moveCall({target:`${n}::pyth::create_authenticated_price_infos_using_accumulator`,arguments:[t.object(this.pythStateId),t.pure(yo.bcs.vector(yo.bcs.U8).serialize(Array.from(r[0]),{maxSize:pf}).toBytes()),s[0],t.object(Zc.SUI_CLOCK_OBJECT_ID)]});return o}async executePriceFeedUpdates(t,r,n,i,s){const o=[];let a=0;for(const c of n){const l=await this.getPriceFeedObjectId(c);if(!l)throw new Error(`Price feed ${c} not found, please create it first`);o.push(l),[i]=t.moveCall({target:`${r}::pyth::update_single_price_feed`,arguments:[t.object(this.pythStateId),i,t.object(l),s[a],t.object(Zc.SUI_CLOCK_OBJECT_ID)]}),a++}return t.moveCall({target:`${r}::hot_potato_vector::destroy`,arguments:[i],typeArguments:[`${r}::price_info::PriceInfo`]}),o}async updatePriceFeeds(t,r,n){const i=await this.getPythPackageId(),s=await this.verifyVaasAndGetHotPotato(t,r,i),o=await this.getBaseUpdateFee(),a=t.splitCoins(t.gas,n.map(()=>t.pure.u64(o)));return await this.executePriceFeedUpdates(t,i,n,s,a)}async updatePriceFeedsWithCoins(t,r,n,i){const s=await this.getPythPackageId(),o=await this.verifyVaasAndGetHotPotato(t,r,s);return await this.executePriceFeedUpdates(t,s,n,o,i)}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]),s=await this.verifyVaas([i],t);t.moveCall({target:`${n}::pyth::create_price_feeds_using_accumulator`,arguments:[t.object(this.pythStateId),t.pure(yo.bcs.vector(yo.bcs.U8).serialize(Array.from(r[0]),{maxSize:pf}).toBytes()),s[0],t.object(Zc.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(),s=await this.provider.getDynamicFieldObject({parentId:n,name:{type:`${i}::price_identifier::PriceIdentifier`,value:{bytes:Array.from(g9.Buffer.from(r,"hex"))}}});if(!s.data||!s.data.content)return;if(s.data.content.dataType!=="moveObject")throw new Error("Price feed type mismatch");this.priceFeedObjectIdCache.set(r,s.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),s=n+2;return t.subarray(s,s+i)}}Jc.SuiPythClient=v9,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PriceFeed=e.Price=e.SuiPythClient=e.SuiPriceServiceConnection=void 0;var t=Tc;Object.defineProperty(e,"SuiPriceServiceConnection",{enumerable:!0,get:function(){return t.SuiPriceServiceConnection}});var r=Jc;Object.defineProperty(e,"SuiPythClient",{enumerable:!0,get:function(){return r.SuiPythClient}});var n=dd;Object.defineProperty(e,"Price",{enumerable:!0,get:function(){return n.Price}}),Object.defineProperty(e,"PriceFeed",{enumerable:!0,get:function(){return n.PriceFeed}})}(ud);var Qc={exports:{}},Sg={exports:{}},_g={exports:{}};(function(e){(function(t){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,s=Math.floor,o="[BigNumber Error] ",a=o+"Number primitive has more than 15 significant digits: ",c=1e14,l=14,u=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,y=1e9;function x(H){var $,Z,ce,ne=k.prototype={constructor:k,toString:null,valueOf:null},de=new k(1),q=20,N=4,h=-7,d=21,m=-1e7,S=1e7,E=!1,M=1,j=0,I={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},g="0123456789abcdefghijklmnopqrstuvwxyz",b=!0;function k(L,z){var G,re,ee,Q,fe,W,K,te,oe=this;if(!(oe instanceof k))return new k(L,z);if(z==null){if(L&&L._isBigNumber===!0){oe.s=L.s,!L.c||L.e>S?oe.c=oe.e=null:L.e<m?oe.c=[oe.e=0]:(oe.e=L.e,oe.c=L.c.slice());return}if((W=typeof L=="number")&&L*0==0){if(oe.s=1/L<0?(L=-L,-1):1,L===~~L){for(Q=0,fe=L;fe>=10;fe/=10,Q++);Q>S?oe.c=oe.e=null:(oe.e=Q,oe.c=[L]);return}te=String(L)}else{if(!n.test(te=String(L)))return ce(oe,te,W);oe.s=te.charCodeAt(0)==45?(te=te.slice(1),-1):1}(Q=te.indexOf("."))>-1&&(te=te.replace(".","")),(fe=te.search(/e/i))>0?(Q<0&&(Q=fe),Q+=+te.slice(fe+1),te=te.substring(0,fe)):Q<0&&(Q=te.length)}else{if(O(z,2,g.length,"Base"),z==10&&b)return oe=new k(L),Oe(oe,q+oe.e+1,N);if(te=String(L),W=typeof L=="number"){if(L*0!=0)return ce(oe,te,W,z);if(oe.s=1/L<0?(te=te.slice(1),-1):1,k.DEBUG&&te.replace(/^0\.0*|\./,"").length>15)throw Error(a+L)}else oe.s=te.charCodeAt(0)===45?(te=te.slice(1),-1):1;for(G=g.slice(0,z),Q=fe=0,K=te.length;fe<K;fe++)if(G.indexOf(re=te.charAt(fe))<0){if(re=="."){if(fe>Q){Q=K;continue}}else if(!ee&&(te==te.toUpperCase()&&(te=te.toLowerCase())||te==te.toLowerCase()&&(te=te.toUpperCase()))){ee=!0,fe=-1,Q=0;continue}return ce(oe,String(L),W,z)}W=!1,te=Z(te,z,10,oe.s),(Q=te.indexOf("."))>-1?te=te.replace(".",""):Q=te.length}for(fe=0;te.charCodeAt(fe)===48;fe++);for(K=te.length;te.charCodeAt(--K)===48;);if(te=te.slice(fe,++K)){if(K-=fe,W&&k.DEBUG&&K>15&&(L>u||L!==s(L)))throw Error(a+oe.s*L);if((Q=Q-fe-1)>S)oe.c=oe.e=null;else if(Q<m)oe.c=[oe.e=0];else{if(oe.e=Q,oe.c=[],fe=(Q+1)%l,Q<0&&(fe+=l),fe<K){for(fe&&oe.c.push(+te.slice(0,fe)),K-=l;fe<K;)oe.c.push(+te.slice(fe,fe+=l));fe=l-(te=te.slice(fe)).length}else fe-=K;for(;fe--;te+="0");oe.c.push(+te)}}else oe.c=[oe.e=0]}k.clone=x,k.ROUND_UP=0,k.ROUND_DOWN=1,k.ROUND_CEIL=2,k.ROUND_FLOOR=3,k.ROUND_HALF_UP=4,k.ROUND_HALF_DOWN=5,k.ROUND_HALF_EVEN=6,k.ROUND_HALF_CEIL=7,k.ROUND_HALF_FLOOR=8,k.EUCLID=9,k.config=k.set=function(L){var z,G;if(L!=null)if(typeof L=="object"){if(L.hasOwnProperty(z="DECIMAL_PLACES")&&(G=L[z],O(G,0,y,z),q=G),L.hasOwnProperty(z="ROUNDING_MODE")&&(G=L[z],O(G,0,8,z),N=G),L.hasOwnProperty(z="EXPONENTIAL_AT")&&(G=L[z],G&&G.pop?(O(G[0],-y,0,z),O(G[1],0,y,z),h=G[0],d=G[1]):(O(G,-y,y,z),h=-(d=G<0?-G:G))),L.hasOwnProperty(z="RANGE"))if(G=L[z],G&&G.pop)O(G[0],-y,-1,z),O(G[1],1,y,z),m=G[0],S=G[1];else if(O(G,-y,y,z),G)m=-(S=G<0?-G:G);else throw Error(o+z+" cannot be zero: "+G);if(L.hasOwnProperty(z="CRYPTO"))if(G=L[z],G===!!G)if(G)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))E=G;else throw E=!G,Error(o+"crypto unavailable");else E=G;else throw Error(o+z+" not true or false: "+G);if(L.hasOwnProperty(z="MODULO_MODE")&&(G=L[z],O(G,0,9,z),M=G),L.hasOwnProperty(z="POW_PRECISION")&&(G=L[z],O(G,0,y,z),j=G),L.hasOwnProperty(z="FORMAT"))if(G=L[z],typeof G=="object")I=G;else throw Error(o+z+" not an object: "+G);if(L.hasOwnProperty(z="ALPHABET"))if(G=L[z],typeof G=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(G))b=G.slice(0,10)=="0123456789",g=G;else throw Error(o+z+" invalid: "+G)}else throw Error(o+"Object expected: "+L);return{DECIMAL_PLACES:q,ROUNDING_MODE:N,EXPONENTIAL_AT:[h,d],RANGE:[m,S],CRYPTO:E,MODULO_MODE:M,POW_PRECISION:j,FORMAT:I,ALPHABET:g}},k.isBigNumber=function(L){if(!L||L._isBigNumber!==!0)return!1;if(!k.DEBUG)return!0;var z,G,re=L.c,ee=L.e,Q=L.s;e:if({}.toString.call(re)=="[object Array]"){if((Q===1||Q===-1)&&ee>=-y&&ee<=y&&ee===s(ee)){if(re[0]===0){if(ee===0&&re.length===1)return!0;break e}if(z=(ee+1)%l,z<1&&(z+=l),String(re[0]).length==z){for(z=0;z<re.length;z++)if(G=re[z],G<0||G>=c||G!==s(G))break e;if(G!==0)return!0}}}else if(re===null&&ee===null&&(Q===null||Q===1||Q===-1))return!0;throw Error(o+"Invalid BigNumber: "+L)},k.maximum=k.max=function(){return he(arguments,-1)},k.minimum=k.min=function(){return he(arguments,1)},k.random=function(){var L=9007199254740992,z=Math.random()*L&2097151?function(){return s(Math.random()*L)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(G){var re,ee,Q,fe,W,K=0,te=[],oe=new k(de);if(G==null?G=q:O(G,0,y),fe=i(G/l),E)if(crypto.getRandomValues){for(re=crypto.getRandomValues(new Uint32Array(fe*=2));K<fe;)W=re[K]*131072+(re[K+1]>>>11),W>=9e15?(ee=crypto.getRandomValues(new Uint32Array(2)),re[K]=ee[0],re[K+1]=ee[1]):(te.push(W%1e14),K+=2);K=fe/2}else if(crypto.randomBytes){for(re=crypto.randomBytes(fe*=7);K<fe;)W=(re[K]&31)*281474976710656+re[K+1]*1099511627776+re[K+2]*4294967296+re[K+3]*16777216+(re[K+4]<<16)+(re[K+5]<<8)+re[K+6],W>=9e15?crypto.randomBytes(7).copy(re,K):(te.push(W%1e14),K+=7);K=fe/7}else throw E=!1,Error(o+"crypto unavailable");if(!E)for(;K<fe;)W=z(),W<9e15&&(te[K++]=W%1e14);for(fe=te[--K],G%=l,fe&&G&&(W=f[l-G],te[K]=s(fe/W)*W);te[K]===0;te.pop(),K--);if(K<0)te=[Q=0];else{for(Q=-1;te[0]===0;te.splice(0,1),Q-=l);for(K=1,W=te[0];W>=10;W/=10,K++);K<l&&(Q-=l-K)}return oe.e=Q,oe.c=te,oe}}(),k.sum=function(){for(var L=1,z=arguments,G=new k(z[0]);L<z.length;)G=G.plus(z[L++]);return G},Z=function(){var L="0123456789";function z(G,re,ee,Q){for(var fe,W=[0],K,te=0,oe=G.length;te<oe;){for(K=W.length;K--;W[K]*=re);for(W[0]+=Q.indexOf(G.charAt(te++)),fe=0;fe<W.length;fe++)W[fe]>ee-1&&(W[fe+1]==null&&(W[fe+1]=0),W[fe+1]+=W[fe]/ee|0,W[fe]%=ee)}return W.reverse()}return function(G,re,ee,Q,fe){var W,K,te,oe,pe,Se,_e,Ne,He=G.indexOf("."),Ge=q,Re=N;for(He>=0&&(oe=j,j=0,G=G.replace(".",""),Ne=new k(re),Se=Ne.pow(G.length-He),j=oe,Ne.c=z(B(_(Se.c),Se.e,"0"),10,ee,L),Ne.e=Ne.c.length),_e=z(G,re,ee,fe?(W=g,L):(W=L,g)),te=oe=_e.length;_e[--oe]==0;_e.pop());if(!_e[0])return W.charAt(0);if(He<0?--te:(Se.c=_e,Se.e=te,Se.s=Q,Se=$(Se,Ne,Ge,Re,ee),_e=Se.c,pe=Se.r,te=Se.e),K=te+Ge+1,He=_e[K],oe=ee/2,pe=pe||K<0||_e[K+1]!=null,pe=Re<4?(He!=null||pe)&&(Re==0||Re==(Se.s<0?3:2)):He>oe||He==oe&&(Re==4||pe||Re==6&&_e[K-1]&1||Re==(Se.s<0?8:7)),K<1||!_e[0])G=pe?B(W.charAt(1),-Ge,W.charAt(0)):W.charAt(0);else{if(_e.length=K,pe)for(--ee;++_e[--K]>ee;)_e[K]=0,K||(++te,_e=[1].concat(_e));for(oe=_e.length;!_e[--oe];);for(He=0,G="";He<=oe;G+=W.charAt(_e[He++]));G=B(G,te,W.charAt(0))}return G}}(),$=function(){function L(re,ee,Q){var fe,W,K,te,oe=0,pe=re.length,Se=ee%p,_e=ee/p|0;for(re=re.slice();pe--;)K=re[pe]%p,te=re[pe]/p|0,fe=_e*K+te*Se,W=Se*K+fe%p*p+oe,oe=(W/Q|0)+(fe/p|0)+_e*te,re[pe]=W%Q;return oe&&(re=[oe].concat(re)),re}function z(re,ee,Q,fe){var W,K;if(Q!=fe)K=Q>fe?1:-1;else for(W=K=0;W<Q;W++)if(re[W]!=ee[W]){K=re[W]>ee[W]?1:-1;break}return K}function G(re,ee,Q,fe){for(var W=0;Q--;)re[Q]-=W,W=re[Q]<ee[Q]?1:0,re[Q]=W*fe+re[Q]-ee[Q];for(;!re[0]&&re.length>1;re.splice(0,1));}return function(re,ee,Q,fe,W){var K,te,oe,pe,Se,_e,Ne,He,Ge,Re,Ke,nt,Qe,Mt,jt,Xe,St,vt=re.s==ee.s?1:-1,Ye=re.c,it=ee.c;if(!Ye||!Ye[0]||!it||!it[0])return new k(!re.s||!ee.s||(Ye?it&&Ye[0]==it[0]:!it)?NaN:Ye&&Ye[0]==0||!it?vt*0:vt/0);for(He=new k(vt),Ge=He.c=[],te=re.e-ee.e,vt=Q+te+1,W||(W=c,te=v(re.e/l)-v(ee.e/l),vt=vt/l|0),oe=0;it[oe]==(Ye[oe]||0);oe++);if(it[oe]>(Ye[oe]||0)&&te--,vt<0)Ge.push(1),pe=!0;else{for(Mt=Ye.length,Xe=it.length,oe=0,vt+=2,Se=s(W/(it[0]+1)),Se>1&&(it=L(it,Se,W),Ye=L(Ye,Se,W),Xe=it.length,Mt=Ye.length),Qe=Xe,Re=Ye.slice(0,Xe),Ke=Re.length;Ke<Xe;Re[Ke++]=0);St=it.slice(),St=[0].concat(St),jt=it[0],it[1]>=W/2&&jt++;do{if(Se=0,K=z(it,Re,Xe,Ke),K<0){if(nt=Re[0],Xe!=Ke&&(nt=nt*W+(Re[1]||0)),Se=s(nt/jt),Se>1)for(Se>=W&&(Se=W-1),_e=L(it,Se,W),Ne=_e.length,Ke=Re.length;z(_e,Re,Ne,Ke)==1;)Se--,G(_e,Xe<Ne?St:it,Ne,W),Ne=_e.length,K=1;else Se==0&&(K=Se=1),_e=it.slice(),Ne=_e.length;if(Ne<Ke&&(_e=[0].concat(_e)),G(Re,_e,Ke,W),Ke=Re.length,K==-1)for(;z(it,Re,Xe,Ke)<1;)Se++,G(Re,Xe<Ke?St:it,Ke,W),Ke=Re.length}else K===0&&(Se++,Re=[0]);Ge[oe++]=Se,Re[0]?Re[Ke++]=Ye[Qe]||0:(Re=[Ye[Qe]],Ke=1)}while((Qe++<Mt||Re[0]!=null)&&vt--);pe=Re[0]!=null,Ge[0]||Ge.splice(0,1)}if(W==c){for(oe=1,vt=Ge[0];vt>=10;vt/=10,oe++);Oe(He,Q+(He.e=oe+te*l-1)+1,fe,pe)}else He.e=te,He.r=+pe;return He}}();function ve(L,z,G,re){var ee,Q,fe,W,K;if(G==null?G=N:O(G,0,8),!L.c)return L.toString();if(ee=L.c[0],fe=L.e,z==null)K=_(L.c),K=re==1||re==2&&(fe<=h||fe>=d)?F(K,fe):B(K,fe,"0");else if(L=Oe(new k(L),z,G),Q=L.e,K=_(L.c),W=K.length,re==1||re==2&&(z<=Q||Q<=h)){for(;W<z;K+="0",W++);K=F(K,Q)}else if(z-=fe+(re===2&&Q>fe),K=B(K,Q,"0"),Q+1>W){if(--z>0)for(K+=".";z--;K+="0");}else if(z+=Q-W,z>0)for(Q+1==W&&(K+=".");z--;K+="0");return L.s<0&&ee?"-"+K:K}function he(L,z){for(var G,re,ee=1,Q=new k(L[0]);ee<L.length;ee++)re=new k(L[ee]),(!re.s||(G=T(Q,re))===z||G===0&&Q.s===z)&&(Q=re);return Q}function we(L,z,G){for(var re=1,ee=z.length;!z[--ee];z.pop());for(ee=z[0];ee>=10;ee/=10,re++);return(G=re+G*l-1)>S?L.c=L.e=null:G<m?L.c=[L.e=0]:(L.e=G,L.c=z),L}ce=function(){var L=/^(-?)0([xbo])(?=\w[\w.]*$)/i,z=/^([^.]+)\.$/,G=/^\.([^.]+)$/,re=/^-?(Infinity|NaN)$/,ee=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(Q,fe,W,K){var te,oe=W?fe:fe.replace(ee,"");if(re.test(oe))Q.s=isNaN(oe)?null:oe<0?-1:1;else{if(!W&&(oe=oe.replace(L,function(pe,Se,_e){return te=(_e=_e.toLowerCase())=="x"?16:_e=="b"?2:8,!K||K==te?Se:pe}),K&&(te=K,oe=oe.replace(z,"$1").replace(G,"0.$1")),fe!=oe))return new k(oe,te);if(k.DEBUG)throw Error(o+"Not a"+(K?" base "+K:"")+" number: "+fe);Q.s=null}Q.c=Q.e=null}}();function Oe(L,z,G,re){var ee,Q,fe,W,K,te,oe,pe=L.c,Se=f;if(pe){e:{for(ee=1,W=pe[0];W>=10;W/=10,ee++);if(Q=z-ee,Q<0)Q+=l,fe=z,K=pe[te=0],oe=s(K/Se[ee-fe-1]%10);else if(te=i((Q+1)/l),te>=pe.length)if(re){for(;pe.length<=te;pe.push(0));K=oe=0,ee=1,Q%=l,fe=Q-l+1}else break e;else{for(K=W=pe[te],ee=1;W>=10;W/=10,ee++);Q%=l,fe=Q-l+ee,oe=fe<0?0:s(K/Se[ee-fe-1]%10)}if(re=re||z<0||pe[te+1]!=null||(fe<0?K:K%Se[ee-fe-1]),re=G<4?(oe||re)&&(G==0||G==(L.s<0?3:2)):oe>5||oe==5&&(G==4||re||G==6&&(Q>0?fe>0?K/Se[ee-fe]:0:pe[te-1])%10&1||G==(L.s<0?8:7)),z<1||!pe[0])return pe.length=0,re?(z-=L.e+1,pe[0]=Se[(l-z%l)%l],L.e=-z||0):pe[0]=L.e=0,L;if(Q==0?(pe.length=te,W=1,te--):(pe.length=te+1,W=Se[l-Q],pe[te]=fe>0?s(K/Se[ee-fe]%Se[fe])*W:0),re)for(;;)if(te==0){for(Q=1,fe=pe[0];fe>=10;fe/=10,Q++);for(fe=pe[0]+=W,W=1;fe>=10;fe/=10,W++);Q!=W&&(L.e++,pe[0]==c&&(pe[0]=1));break}else{if(pe[te]+=W,pe[te]!=c)break;pe[te--]=0,W=1}for(Q=pe.length;pe[--Q]===0;pe.pop());}L.e>S?L.c=L.e=null:L.e<m&&(L.c=[L.e=0])}return L}function je(L){var z,G=L.e;return G===null?L.toString():(z=_(L.c),z=G<=h||G>=d?F(z,G):B(z,G,"0"),L.s<0?"-"+z:z)}return ne.absoluteValue=ne.abs=function(){var L=new k(this);return L.s<0&&(L.s=1),L},ne.comparedTo=function(L,z){return T(this,new k(L,z))},ne.decimalPlaces=ne.dp=function(L,z){var G,re,ee,Q=this;if(L!=null)return O(L,0,y),z==null?z=N:O(z,0,8),Oe(new k(Q),L+Q.e+1,z);if(!(G=Q.c))return null;if(re=((ee=G.length-1)-v(this.e/l))*l,ee=G[ee])for(;ee%10==0;ee/=10,re--);return re<0&&(re=0),re},ne.dividedBy=ne.div=function(L,z){return $(this,new k(L,z),q,N)},ne.dividedToIntegerBy=ne.idiv=function(L,z){return $(this,new k(L,z),0,1)},ne.exponentiatedBy=ne.pow=function(L,z){var G,re,ee,Q,fe,W,K,te,oe,pe=this;if(L=new k(L),L.c&&!L.isInteger())throw Error(o+"Exponent not an integer: "+je(L));if(z!=null&&(z=new k(z)),W=L.e>14,!pe.c||!pe.c[0]||pe.c[0]==1&&!pe.e&&pe.c.length==1||!L.c||!L.c[0])return oe=new k(Math.pow(+je(pe),W?L.s*(2-R(L)):+je(L))),z?oe.mod(z):oe;if(K=L.s<0,z){if(z.c?!z.c[0]:!z.s)return new k(NaN);re=!K&&pe.isInteger()&&z.isInteger(),re&&(pe=pe.mod(z))}else{if(L.e>9&&(pe.e>0||pe.e<-1||(pe.e==0?pe.c[0]>1||W&&pe.c[1]>=24e7:pe.c[0]<8e13||W&&pe.c[0]<=9999975e7)))return Q=pe.s<0&&R(L)?-0:0,pe.e>-1&&(Q=1/Q),new k(K?1/Q:Q);j&&(Q=i(j/l+2))}for(W?(G=new k(.5),K&&(L.s=1),te=R(L)):(ee=Math.abs(+je(L)),te=ee%2),oe=new k(de);;){if(te){if(oe=oe.times(pe),!oe.c)break;Q?oe.c.length>Q&&(oe.c.length=Q):re&&(oe=oe.mod(z))}if(ee){if(ee=s(ee/2),ee===0)break;te=ee%2}else if(L=L.times(G),Oe(L,L.e+1,1),L.e>14)te=R(L);else{if(ee=+je(L),ee===0)break;te=ee%2}pe=pe.times(pe),Q?pe.c&&pe.c.length>Q&&(pe.c.length=Q):re&&(pe=pe.mod(z))}return re?oe:(K&&(oe=de.div(oe)),z?oe.mod(z):Q?Oe(oe,j,N,fe):oe)},ne.integerValue=function(L){var z=new k(this);return L==null?L=N:O(L,0,8),Oe(z,z.e+1,L)},ne.isEqualTo=ne.eq=function(L,z){return T(this,new k(L,z))===0},ne.isFinite=function(){return!!this.c},ne.isGreaterThan=ne.gt=function(L,z){return T(this,new k(L,z))>0},ne.isGreaterThanOrEqualTo=ne.gte=function(L,z){return(z=T(this,new k(L,z)))===1||z===0},ne.isInteger=function(){return!!this.c&&v(this.e/l)>this.c.length-2},ne.isLessThan=ne.lt=function(L,z){return T(this,new k(L,z))<0},ne.isLessThanOrEqualTo=ne.lte=function(L,z){return(z=T(this,new k(L,z)))===-1||z===0},ne.isNaN=function(){return!this.s},ne.isNegative=function(){return this.s<0},ne.isPositive=function(){return this.s>0},ne.isZero=function(){return!!this.c&&this.c[0]==0},ne.minus=function(L,z){var G,re,ee,Q,fe=this,W=fe.s;if(L=new k(L,z),z=L.s,!W||!z)return new k(NaN);if(W!=z)return L.s=-z,fe.plus(L);var K=fe.e/l,te=L.e/l,oe=fe.c,pe=L.c;if(!K||!te){if(!oe||!pe)return oe?(L.s=-z,L):new k(pe?fe:NaN);if(!oe[0]||!pe[0])return pe[0]?(L.s=-z,L):new k(oe[0]?fe:N==3?-0:0)}if(K=v(K),te=v(te),oe=oe.slice(),W=K-te){for((Q=W<0)?(W=-W,ee=oe):(te=K,ee=pe),ee.reverse(),z=W;z--;ee.push(0));ee.reverse()}else for(re=(Q=(W=oe.length)<(z=pe.length))?W:z,W=z=0;z<re;z++)if(oe[z]!=pe[z]){Q=oe[z]<pe[z];break}if(Q&&(ee=oe,oe=pe,pe=ee,L.s=-L.s),z=(re=pe.length)-(G=oe.length),z>0)for(;z--;oe[G++]=0);for(z=c-1;re>W;){if(oe[--re]<pe[re]){for(G=re;G&&!oe[--G];oe[G]=z);--oe[G],oe[re]+=c}oe[re]-=pe[re]}for(;oe[0]==0;oe.splice(0,1),--te);return oe[0]?we(L,oe,te):(L.s=N==3?-1:1,L.c=[L.e=0],L)},ne.modulo=ne.mod=function(L,z){var G,re,ee=this;return L=new k(L,z),!ee.c||!L.s||L.c&&!L.c[0]?new k(NaN):!L.c||ee.c&&!ee.c[0]?new k(ee):(M==9?(re=L.s,L.s=1,G=$(ee,L,0,3),L.s=re,G.s*=re):G=$(ee,L,0,M),L=ee.minus(G.times(L)),!L.c[0]&&M==1&&(L.s=ee.s),L)},ne.multipliedBy=ne.times=function(L,z){var G,re,ee,Q,fe,W,K,te,oe,pe,Se,_e,Ne,He,Ge,Re=this,Ke=Re.c,nt=(L=new k(L,z)).c;if(!Ke||!nt||!Ke[0]||!nt[0])return!Re.s||!L.s||Ke&&!Ke[0]&&!nt||nt&&!nt[0]&&!Ke?L.c=L.e=L.s=null:(L.s*=Re.s,!Ke||!nt?L.c=L.e=null:(L.c=[0],L.e=0)),L;for(re=v(Re.e/l)+v(L.e/l),L.s*=Re.s,K=Ke.length,pe=nt.length,K<pe&&(Ne=Ke,Ke=nt,nt=Ne,ee=K,K=pe,pe=ee),ee=K+pe,Ne=[];ee--;Ne.push(0));for(He=c,Ge=p,ee=pe;--ee>=0;){for(G=0,Se=nt[ee]%Ge,_e=nt[ee]/Ge|0,fe=K,Q=ee+fe;Q>ee;)te=Ke[--fe]%Ge,oe=Ke[fe]/Ge|0,W=_e*te+oe*Se,te=Se*te+W%Ge*Ge+Ne[Q]+G,G=(te/He|0)+(W/Ge|0)+_e*oe,Ne[Q--]=te%He;Ne[Q]=G}return G?++re:Ne.splice(0,1),we(L,Ne,re)},ne.negated=function(){var L=new k(this);return L.s=-L.s||null,L},ne.plus=function(L,z){var G,re=this,ee=re.s;if(L=new k(L,z),z=L.s,!ee||!z)return new k(NaN);if(ee!=z)return L.s=-z,re.minus(L);var Q=re.e/l,fe=L.e/l,W=re.c,K=L.c;if(!Q||!fe){if(!W||!K)return new k(ee/0);if(!W[0]||!K[0])return K[0]?L:new k(W[0]?re:ee*0)}if(Q=v(Q),fe=v(fe),W=W.slice(),ee=Q-fe){for(ee>0?(fe=Q,G=K):(ee=-ee,G=W),G.reverse();ee--;G.push(0));G.reverse()}for(ee=W.length,z=K.length,ee-z<0&&(G=K,K=W,W=G,z=ee),ee=0;z;)ee=(W[--z]=W[z]+K[z]+ee)/c|0,W[z]=c===W[z]?0:W[z]%c;return ee&&(W=[ee].concat(W),++fe),we(L,W,fe)},ne.precision=ne.sd=function(L,z){var G,re,ee,Q=this;if(L!=null&&L!==!!L)return O(L,1,y),z==null?z=N:O(z,0,8),Oe(new k(Q),L,z);if(!(G=Q.c))return null;if(ee=G.length-1,re=ee*l+1,ee=G[ee]){for(;ee%10==0;ee/=10,re--);for(ee=G[0];ee>=10;ee/=10,re++);}return L&&Q.e+1>re&&(re=Q.e+1),re},ne.shiftedBy=function(L){return O(L,-u,u),this.times("1e"+L)},ne.squareRoot=ne.sqrt=function(){var L,z,G,re,ee,Q=this,fe=Q.c,W=Q.s,K=Q.e,te=q+4,oe=new k("0.5");if(W!==1||!fe||!fe[0])return new k(!W||W<0&&(!fe||fe[0])?NaN:fe?Q:1/0);if(W=Math.sqrt(+je(Q)),W==0||W==1/0?(z=_(fe),(z.length+K)%2==0&&(z+="0"),W=Math.sqrt(+z),K=v((K+1)/2)-(K<0||K%2),W==1/0?z="5e"+K:(z=W.toExponential(),z=z.slice(0,z.indexOf("e")+1)+K),G=new k(z)):G=new k(W+""),G.c[0]){for(K=G.e,W=K+te,W<3&&(W=0);;)if(ee=G,G=oe.times(ee.plus($(Q,ee,te,1))),_(ee.c).slice(0,W)===(z=_(G.c)).slice(0,W))if(G.e<K&&--W,z=z.slice(W-3,W+1),z=="9999"||!re&&z=="4999"){if(!re&&(Oe(ee,ee.e+q+2,0),ee.times(ee).eq(Q))){G=ee;break}te+=4,W+=4,re=1}else{(!+z||!+z.slice(1)&&z.charAt(0)=="5")&&(Oe(G,G.e+q+2,1),L=!G.times(G).eq(Q));break}}return Oe(G,G.e+q+1,N,L)},ne.toExponential=function(L,z){return L!=null&&(O(L,0,y),L++),ve(this,L,z,1)},ne.toFixed=function(L,z){return L!=null&&(O(L,0,y),L=L+this.e+1),ve(this,L,z)},ne.toFormat=function(L,z,G){var re,ee=this;if(G==null)L!=null&&z&&typeof z=="object"?(G=z,z=null):L&&typeof L=="object"?(G=L,L=z=null):G=I;else if(typeof G!="object")throw Error(o+"Argument not an object: "+G);if(re=ee.toFixed(L,z),ee.c){var Q,fe=re.split("."),W=+G.groupSize,K=+G.secondaryGroupSize,te=G.groupSeparator||"",oe=fe[0],pe=fe[1],Se=ee.s<0,_e=Se?oe.slice(1):oe,Ne=_e.length;if(K&&(Q=W,W=K,K=Q,Ne-=Q),W>0&&Ne>0){for(Q=Ne%W||W,oe=_e.substr(0,Q);Q<Ne;Q+=W)oe+=te+_e.substr(Q,W);K>0&&(oe+=te+_e.slice(Q)),Se&&(oe="-"+oe)}re=pe?oe+(G.decimalSeparator||"")+((K=+G.fractionGroupSize)?pe.replace(new RegExp("\\d{"+K+"}\\B","g"),"$&"+(G.fractionGroupSeparator||"")):pe):oe}return(G.prefix||"")+re+(G.suffix||"")},ne.toFraction=function(L){var z,G,re,ee,Q,fe,W,K,te,oe,pe,Se,_e=this,Ne=_e.c;if(L!=null&&(W=new k(L),!W.isInteger()&&(W.c||W.s!==1)||W.lt(de)))throw Error(o+"Argument "+(W.isInteger()?"out of range: ":"not an integer: ")+je(W));if(!Ne)return new k(_e);for(z=new k(de),te=G=new k(de),re=K=new k(de),Se=_(Ne),Q=z.e=Se.length-_e.e-1,z.c[0]=f[(fe=Q%l)<0?l+fe:fe],L=!L||W.comparedTo(z)>0?Q>0?z:te:W,fe=S,S=1/0,W=new k(Se),K.c[0]=0;oe=$(W,z,0,1),ee=G.plus(oe.times(re)),ee.comparedTo(L)!=1;)G=re,re=ee,te=K.plus(oe.times(ee=te)),K=ee,z=W.minus(oe.times(ee=z)),W=ee;return ee=$(L.minus(G),re,0,1),K=K.plus(ee.times(te)),G=G.plus(ee.times(re)),K.s=te.s=_e.s,Q=Q*2,pe=$(te,re,Q,N).minus(_e).abs().comparedTo($(K,G,Q,N).minus(_e).abs())<1?[te,re]:[K,G],S=fe,pe},ne.toNumber=function(){return+je(this)},ne.toPrecision=function(L,z){return L!=null&&O(L,1,y),ve(this,L,z,2)},ne.toString=function(L){var z,G=this,re=G.s,ee=G.e;return ee===null?re?(z="Infinity",re<0&&(z="-"+z)):z="NaN":(L==null?z=ee<=h||ee>=d?F(_(G.c),ee):B(_(G.c),ee,"0"):L===10&&b?(G=Oe(new k(G),q+ee+1,N),z=B(_(G.c),G.e,"0")):(O(L,2,g.length,"Base"),z=Z(B(_(G.c),ee,"0"),10,L,re,!0)),re<0&&G.c[0]&&(z="-"+z)),z},ne.valueOf=ne.toJSON=function(){return je(this)},ne._isBigNumber=!0,H!=null&&k.set(H),k}function v(H){var $=H|0;return H>0||H===$?$:$-1}function _(H){for(var $,Z,ce=1,ne=H.length,de=H[0]+"";ce<ne;){for($=H[ce++]+"",Z=l-$.length;Z--;$="0"+$);de+=$}for(ne=de.length;de.charCodeAt(--ne)===48;);return de.slice(0,ne+1||1)}function T(H,$){var Z,ce,ne=H.c,de=$.c,q=H.s,N=$.s,h=H.e,d=$.e;if(!q||!N)return null;if(Z=ne&&!ne[0],ce=de&&!de[0],Z||ce)return Z?ce?0:-N:q;if(q!=N)return q;if(Z=q<0,ce=h==d,!ne||!de)return ce?0:!ne^Z?1:-1;if(!ce)return h>d^Z?1:-1;for(N=(h=ne.length)<(d=de.length)?h:d,q=0;q<N;q++)if(ne[q]!=de[q])return ne[q]>de[q]^Z?1:-1;return h==d?0:h>d^Z?1:-1}function O(H,$,Z,ce){if(H<$||H>Z||H!==s(H))throw Error(o+(ce||"Argument")+(typeof H=="number"?H<$||H>Z?" out of range: ":" not an integer: ":" not a primitive number: ")+String(H))}function R(H){var $=H.c.length-1;return v(H.e/l)==$&&H.c[$]%2!=0}function F(H,$){return(H.length>1?H.charAt(0)+"."+H.slice(1):H)+($<0?"e":"e+")+$}function B(H,$,Z){var ce,ne;if($<0){for(ne=Z+".";++$;ne+=Z);H=ne+H}else if(ce=H.length,++$>ce){for(ne=Z,$-=ce;--$;ne+=Z);H+=ne}else $<ce&&(H=H.slice(0,$)+"."+H.slice($));return H}r=x(),r.default=r.BigNumber=r,e.exports?e.exports=r:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=r)})(Cr)})(_g);var Eg=_g.exports;(function(e){var t=Eg,r=e.exports;(function(){var n=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,i,s,o={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},a;function c(u){return n.lastIndex=0,n.test(u)?'"'+u.replace(n,function(f){var p=o[f];return typeof p=="string"?p:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+u+'"'}function l(u,f){var p,y,x,v,_=i,T,O=f[u],R=O!=null&&(O instanceof t||t.isBigNumber(O));switch(O&&typeof O=="object"&&typeof O.toJSON=="function"&&(O=O.toJSON(u)),typeof a=="function"&&(O=a.call(f,u,O)),typeof O){case"string":return R?O:c(O);case"number":return isFinite(O)?String(O):"null";case"boolean":case"null":case"bigint":return String(O);case"object":if(!O)return"null";if(i+=s,T=[],Object.prototype.toString.apply(O)==="[object Array]"){for(v=O.length,p=0;p<v;p+=1)T[p]=l(p,O)||"null";return x=T.length===0?"[]":i?`[
|
|
35
35
|
`+i+T.join(`,
|
|
36
36
|
`+i)+`
|
|
37
37
|
`+_+"]":"["+T.join(",")+"]",i=_,x}if(a&&typeof a=="object")for(v=a.length,p=0;p<v;p+=1)typeof a[p]=="string"&&(y=a[p],x=l(y,O),x&&T.push(c(y)+(i?": ":":")+x));else Object.keys(O).forEach(function(F){var B=l(F,O);B&&T.push(c(F)+(i?": ":":")+B)});return x=T.length===0?"{}":i?`{
|
|
38
38
|
`+i+T.join(`,
|
|
39
39
|
`+i)+`
|
|
40
|
-
`+_+"}":"{"+T.join(",")+"}",i=_,x}}typeof r.stringify!="function"&&(r.stringify=function(u,f,p){var y;if(i="",s="",typeof p=="number")for(y=0;y<p;y+=1)s+=" ";else typeof p=="string"&&(s=p);if(a=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return l("",{"":u})})})()})(
|
|
41
|
-
`,r:"\r",t:" "},s,o=function(v){throw{name:"SyntaxError",message:v,at:r,text:s}},a=function(v){return v&&v!==n&&o("Expected '"+v+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},c=function(){var v,_="";for(n==="-"&&(_="-",a("-"));n>="0"&&n<="9";)_+=n,a();if(n===".")for(_+=".";a()&&n>="0"&&n<="9";)_+=n;if(n==="e"||n==="E")for(_+=n,a(),(n==="-"||n==="+")&&(_+=n,a());n>="0"&&n<="9";)_+=n,a();if(v=+_,!isFinite(v))o("Bad number");else return el==null&&(el=Ag),_.length>15?t.storeAsString?_:t.useNativeBigInt?BigInt(_):new el(_):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(v):new el(v):v},l=function(){var v,_,T="",O;if(n==='"')for(var R=r;a();){if(n==='"')return r-1>R&&(T+=s.substring(R,r-1)),a(),T;if(n==="\\"){if(r-1>R&&(T+=s.substring(R,r-1)),a(),n==="u"){for(O=0,_=0;_<4&&(v=parseInt(a(),16),!!isFinite(v));_+=1)O=O*16+v;T+=String.fromCharCode(O)}else if(typeof i[n]=="string")T+=i[n];else break;R=r}}o("Bad string")},u=function(){for(;n&&n<=" ";)a()},f=function(){switch(n){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}o("Unexpected '"+n+"'")},p,y=function(){var v=[];if(n==="["){if(a("["),u(),n==="]")return a("]"),v;for(;n;){if(v.push(p()),u(),n==="]")return a("]"),v;a(","),u()}}o("Bad array")},x=function(){var v,_=Object.create(null);if(n==="{"){if(a("{"),u(),n==="}")return a("}"),_;for(;n;){if(v=l(),u(),a(":"),t.strict===!0&&Object.hasOwnProperty.call(_,v)&&o('Duplicate key "'+v+'"'),w9.test(v)===!0?t.protoAction==="error"?o("Object contains forbidden prototype property"):t.protoAction==="ignore"?p():_[v]=p():x9.test(v)===!0?t.constructorAction==="error"?o("Object contains forbidden constructor property"):t.constructorAction==="ignore"?p():_[v]=p():_[v]=p(),u(),n==="}")return a("}"),_;a(","),u()}}o("Bad object")};return p=function(){switch(u(),n){case"{":return x();case"[":return y();case'"':return l();case"-":return c();default:return n>="0"&&n<="9"?c():f()}},function(v,_){var T;return s=v+"",r=0,n=" ",T=p(),u(),n&&o("Syntax error"),typeof _=="function"?function O(R,F){var B,H=R[F];return H&&typeof H=="object"&&Object.keys(H).forEach(function($){B=O(H,$),B!==void 0?H[$]=B:delete H[$]}),_.call(R,F,H)}({"":T},""):T}},_9=S9,Tg=y9.stringify,Mg=_9;Qc.exports=function(e){return{parse:Mg(e),stringify:Tg}},Qc.exports.parse=Mg(),Qc.exports.stringify=Tg;var E9=Qc.exports;const C9=io(E9);var A9=Object.create,gf=Object.defineProperty,T9=Object.defineProperties,M9=Object.getOwnPropertyDescriptor,I9=Object.getOwnPropertyDescriptors,Ig=Object.getOwnPropertyNames,Og=Object.getOwnPropertySymbols,O9=Object.getPrototypeOf,Pg=Object.prototype.hasOwnProperty,P9=Object.prototype.propertyIsEnumerable,Rg=(e,t,r)=>t in e?gf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,R9=(e,t)=>{for(var r in t||(t={}))Pg.call(t,r)&&Rg(e,r,t[r]);if(Og)for(var r of Og(t))P9.call(t,r)&&Rg(e,r,t[r]);return e},j9=(e,t)=>T9(e,I9(t)),N9=(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')}),k9=(e,t)=>function(){return t||(0,e[Ig(e)[0]])((t={exports:{}}).exports,t),t.exports},D9=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ig(t))!Pg.call(e,i)&&i!==r&&gf(e,i,{get:()=>t[i],enumerable:!(n=M9(t,i))||n.enumerable});return e},Fs=(e,t,r)=>(r=e!=null?A9(O9(e)):{},D9(!e||!e.__esModule?gf(r,"default",{value:e,enumerable:!0}):r,e)),ct=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{a(r.next(c))}catch(l){i(l)}},o=c=>{try{a(r.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,o);a((r=r.apply(e,t)).next())}),$s=k9({"node_modules/bn.js/lib/bn.js"(e,t){(function(r,n){function i(h,d){if(!h)throw new Error(d||"Assertion failed")}function s(h,d){h.super_=d;var m=function(){};m.prototype=d.prototype,h.prototype=new m,h.prototype.constructor=h}function o(h,d,m){if(o.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((d==="le"||d==="be")&&(m=d,d=10),this._init(h||0,d||10,m||"be"))}typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=N9("buffer").Buffer}catch{}o.isBN=function(d){return d instanceof o?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===o.wordSize&&Array.isArray(d.words)},o.max=function(d,m){return d.cmp(m)>0?d:m},o.min=function(d,m){return d.cmp(m)<0?d:m},o.prototype._init=function(d,m,S){if(typeof d=="number")return this._initNumber(d,m,S);if(typeof d=="object")return this._initArray(d,m,S);m==="hex"&&(m=16),i(m===(m|0)&&m>=2&&m<=36),d=d.toString().replace(/\s+/g,"");var E=0;d[0]==="-"&&(E++,this.negative=1),E<d.length&&(m===16?this._parseHex(d,E,S):(this._parseBase(d,m,E),S==="le"&&this._initArray(this.toArray(),m,S)))},o.prototype._initNumber=function(d,m,S){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(i(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),S==="le"&&this._initArray(this.toArray(),m,S)},o.prototype._initArray=function(d,m,S){if(i(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var M,j,I=0;if(S==="be")for(E=d.length-1,M=0;E>=0;E-=3)j=d[E]|d[E-1]<<8|d[E-2]<<16,this.words[M]|=j<<I&67108863,this.words[M+1]=j>>>26-I&67108863,I+=24,I>=26&&(I-=26,M++);else if(S==="le")for(E=0,M=0;E<d.length;E+=3)j=d[E]|d[E+1]<<8|d[E+2]<<16,this.words[M]|=j<<I&67108863,this.words[M+1]=j>>>26-I&67108863,I+=24,I>=26&&(I-=26,M++);return this._strip()};function c(h,d){var m=h.charCodeAt(d);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,d,m){var S=c(h,m);return m-1>=d&&(S|=c(h,m-1)<<4),S}o.prototype._parseHex=function(d,m,S){this.length=Math.ceil((d.length-m)/6),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var M=0,j=0,I;if(S==="be")for(E=d.length-1;E>=m;E-=2)I=l(d,m,E)<<M,this.words[j]|=I&67108863,M>=18?(M-=18,j+=1,this.words[j]|=I>>>26):M+=8;else{var g=d.length-m;for(E=g%2===0?m+1:m;E<d.length;E+=2)I=l(d,m,E)<<M,this.words[j]|=I&67108863,M>=18?(M-=18,j+=1,this.words[j]|=I>>>26):M+=8}this._strip()};function u(h,d,m,S){for(var E=0,M=0,j=Math.min(h.length,m),I=d;I<j;I++){var g=h.charCodeAt(I)-48;E*=S,g>=49?M=g-49+10:g>=17?M=g-17+10:M=g,i(g>=0&&M<S,"Invalid character"),E+=M}return E}o.prototype._parseBase=function(d,m,S){this.words=[0],this.length=1;for(var E=0,M=1;M<=67108863;M*=m)E++;E--,M=M/m|0;for(var j=d.length-S,I=j%E,g=Math.min(j,j-I)+S,b=0,k=S;k<g;k+=E)b=u(d,k,k+E,m),this.imuln(M),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b);if(I!==0){var ve=1;for(b=u(d,k,d.length,m),k=0;k<I;k++)ve*=m;this.imuln(ve),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b)}this._strip()},o.prototype.copy=function(d){d.words=new Array(this.length);for(var m=0;m<this.length;m++)d.words[m]=this.words[m];d.length=this.length,d.negative=this.negative,d.red=this.red};function f(h,d){h.words=d.words,h.length=d.length,h.negative=d.negative,h.red=d.red}if(o.prototype._move=function(d){f(d,this)},o.prototype.clone=function(){var d=new o(null);return this.copy(d),d},o.prototype._expand=function(d){for(;this.length<d;)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")]=p}catch{o.prototype.inspect=p}else o.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],v=[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(d,m){d=d||10,m=m|0||1;var S;if(d===16||d==="hex"){S="";for(var E=0,M=0,j=0;j<this.length;j++){var I=this.words[j],g=((I<<E|M)&16777215).toString(16);M=I>>>24-E&16777215,E+=2,E>=26&&(E-=26,j--),M!==0||j!==this.length-1?S=y[6-g.length]+g+S:S=g+S}for(M!==0&&(S=M.toString(16)+S);S.length%m!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}if(d===(d|0)&&d>=2&&d<=36){var b=x[d],k=v[d];S="";var ve=this.clone();for(ve.negative=0;!ve.isZero();){var he=ve.modrn(k).toString(d);ve=ve.idivn(k),ve.isZero()?S=he+S:S=y[b-he.length]+he+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")},o.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(d,m){return this.toArrayLike(a,d,m)}),o.prototype.toArray=function(d,m){return this.toArrayLike(Array,d,m)};var _=function(d,m){return d.allocUnsafe?d.allocUnsafe(m):new d(m)};o.prototype.toArrayLike=function(d,m,S){this._strip();var E=this.byteLength(),M=S||Math.max(1,E);i(E<=M,"byte array longer than desired length"),i(M>0,"Requested array length <= 0");var j=_(d,M),I=m==="le"?"LE":"BE";return this["_toArrayLike"+I](j,E),j},o.prototype._toArrayLikeLE=function(d,m){for(var S=0,E=0,M=0,j=0;M<this.length;M++){var I=this.words[M]<<j|E;d[S++]=I&255,S<d.length&&(d[S++]=I>>8&255),S<d.length&&(d[S++]=I>>16&255),j===6?(S<d.length&&(d[S++]=I>>24&255),E=0,j=0):(E=I>>>24,j+=2)}if(S<d.length)for(d[S++]=E;S<d.length;)d[S++]=0},o.prototype._toArrayLikeBE=function(d,m){for(var S=d.length-1,E=0,M=0,j=0;M<this.length;M++){var I=this.words[M]<<j|E;d[S--]=I&255,S>=0&&(d[S--]=I>>8&255),S>=0&&(d[S--]=I>>16&255),j===6?(S>=0&&(d[S--]=I>>24&255),E=0,j=0):(E=I>>>24,j+=2)}if(S>=0)for(d[S--]=E;S>=0;)d[S--]=0},Math.clz32?o.prototype._countBits=function(d){return 32-Math.clz32(d)}:o.prototype._countBits=function(d){var m=d,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},o.prototype._zeroBits=function(d){if(d===0)return 26;var m=d,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},o.prototype.bitLength=function(){var d=this.words[this.length-1],m=this._countBits(d);return(this.length-1)*26+m};function T(h){for(var d=new Array(h.bitLength()),m=0;m<d.length;m++){var S=m/26|0,E=m%26;d[m]=h.words[S]>>>E&1}return d}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,m=0;m<this.length;m++){var S=this._zeroBits(this.words[m]);if(d+=S,S!==26)break}return d},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},o.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).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(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var m=0;m<d.length;m++)this.words[m]=this.words[m]|d.words[m];return this._strip()},o.prototype.ior=function(d){return i((this.negative|d.negative)===0),this.iuor(d)},o.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},o.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},o.prototype.iuand=function(d){var m;this.length>d.length?m=d:m=this;for(var S=0;S<m.length;S++)this.words[S]=this.words[S]&d.words[S];return this.length=m.length,this._strip()},o.prototype.iand=function(d){return i((this.negative|d.negative)===0),this.iuand(d)},o.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},o.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},o.prototype.iuxor=function(d){var m,S;this.length>d.length?(m=this,S=d):(m=d,S=this);for(var E=0;E<S.length;E++)this.words[E]=m.words[E]^S.words[E];if(this!==m)for(;E<m.length;E++)this.words[E]=m.words[E];return this.length=m.length,this._strip()},o.prototype.ixor=function(d){return i((this.negative|d.negative)===0),this.iuxor(d)},o.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},o.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},o.prototype.inotn=function(d){i(typeof d=="number"&&d>=0);var m=Math.ceil(d/26)|0,S=d%26;this._expand(m),S>0&&m--;for(var E=0;E<m;E++)this.words[E]=~this.words[E]&67108863;return S>0&&(this.words[E]=~this.words[E]&67108863>>26-S),this._strip()},o.prototype.notn=function(d){return this.clone().inotn(d)},o.prototype.setn=function(d,m){i(typeof d=="number"&&d>=0);var S=d/26|0,E=d%26;return this._expand(S+1),m?this.words[S]=this.words[S]|1<<E:this.words[S]=this.words[S]&~(1<<E),this._strip()},o.prototype.iadd=function(d){var m;if(this.negative!==0&&d.negative===0)return this.negative=0,m=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,m=this.isub(d),d.negative=1,m._normSign();var S,E;this.length>d.length?(S=this,E=d):(S=d,E=this);for(var M=0,j=0;j<E.length;j++)m=(S.words[j]|0)+(E.words[j]|0)+M,this.words[j]=m&67108863,M=m>>>26;for(;M!==0&&j<S.length;j++)m=(S.words[j]|0)+M,this.words[j]=m&67108863,M=m>>>26;if(this.length=S.length,M!==0)this.words[this.length]=M,this.length++;else if(S!==this)for(;j<S.length;j++)this.words[j]=S.words[j];return this},o.prototype.add=function(d){var m;return d.negative!==0&&this.negative===0?(d.negative=0,m=this.sub(d),d.negative^=1,m):d.negative===0&&this.negative!==0?(this.negative=0,m=d.sub(this),this.negative=1,m):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},o.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var m=this.iadd(d);return d.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var S=this.cmp(d);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,M;S>0?(E=this,M=d):(E=d,M=this);for(var j=0,I=0;I<M.length;I++)m=(E.words[I]|0)-(M.words[I]|0)+j,j=m>>26,this.words[I]=m&67108863;for(;j!==0&&I<E.length;I++)m=(E.words[I]|0)+j,j=m>>26,this.words[I]=m&67108863;if(j===0&&I<E.length&&E!==this)for(;I<E.length;I++)this.words[I]=E.words[I];return this.length=Math.max(this.length,I),E!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(d){return this.clone().isub(d)};function O(h,d,m){m.negative=d.negative^h.negative;var S=h.length+d.length|0;m.length=S,S=S-1|0;var E=h.words[0]|0,M=d.words[0]|0,j=E*M,I=j&67108863,g=j/67108864|0;m.words[0]=I;for(var b=1;b<S;b++){for(var k=g>>>26,ve=g&67108863,he=Math.min(b,d.length-1),we=Math.max(0,b-h.length+1);we<=he;we++){var Oe=b-we|0;E=h.words[Oe]|0,M=d.words[we]|0,j=E*M+ve,k+=j/67108864|0,ve=j&67108863}m.words[b]=ve|0,g=k|0}return g!==0?m.words[b]=g|0:m.length--,m._strip()}var R=function(d,m,S){var E=d.words,M=m.words,j=S.words,I=0,g,b,k,ve=E[0]|0,he=ve&8191,we=ve>>>13,Oe=E[1]|0,je=Oe&8191,L=Oe>>>13,z=E[2]|0,G=z&8191,re=z>>>13,ee=E[3]|0,Q=ee&8191,fe=ee>>>13,W=E[4]|0,K=W&8191,te=W>>>13,oe=E[5]|0,pe=oe&8191,Se=oe>>>13,_e=E[6]|0,Ne=_e&8191,He=_e>>>13,Ge=E[7]|0,Re=Ge&8191,Ke=Ge>>>13,nt=E[8]|0,Qe=nt&8191,Mt=nt>>>13,jt=E[9]|0,Xe=jt&8191,St=jt>>>13,vt=M[0]|0,Ye=vt&8191,it=vt>>>13,Nt=M[1]|0,ft=Nt&8191,It=Nt>>>13,Pt=M[2]|0,st=Pt&8191,_t=Pt>>>13,kt=M[3]|0,pt=kt&8191,Ot=kt>>>13,qt=M[4]|0,D=qt&8191,C=qt>>>13,A=M[5]|0,V=A&8191,se=A>>>13,me=M[6]|0,be=me&8191,We=me>>>13,ut=M[7]|0,qe=ut&8191,J=ut>>>13,ye=M[8]|0,Ce=ye&8191,Ve=ye>>>13,et=M[9]|0,ze=et&8191,Je=et>>>13;S.negative=d.negative^m.negative,S.length=19,g=Math.imul(he,Ye),b=Math.imul(he,it),b=b+Math.imul(we,Ye)|0,k=Math.imul(we,it);var bt=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(bt>>>26)|0,bt&=67108863,g=Math.imul(je,Ye),b=Math.imul(je,it),b=b+Math.imul(L,Ye)|0,k=Math.imul(L,it),g=g+Math.imul(he,ft)|0,b=b+Math.imul(he,It)|0,b=b+Math.imul(we,ft)|0,k=k+Math.imul(we,It)|0;var rr=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(rr>>>26)|0,rr&=67108863,g=Math.imul(G,Ye),b=Math.imul(G,it),b=b+Math.imul(re,Ye)|0,k=Math.imul(re,it),g=g+Math.imul(je,ft)|0,b=b+Math.imul(je,It)|0,b=b+Math.imul(L,ft)|0,k=k+Math.imul(L,It)|0,g=g+Math.imul(he,st)|0,b=b+Math.imul(he,_t)|0,b=b+Math.imul(we,st)|0,k=k+Math.imul(we,_t)|0;var Bt=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,g=Math.imul(Q,Ye),b=Math.imul(Q,it),b=b+Math.imul(fe,Ye)|0,k=Math.imul(fe,it),g=g+Math.imul(G,ft)|0,b=b+Math.imul(G,It)|0,b=b+Math.imul(re,ft)|0,k=k+Math.imul(re,It)|0,g=g+Math.imul(je,st)|0,b=b+Math.imul(je,_t)|0,b=b+Math.imul(L,st)|0,k=k+Math.imul(L,_t)|0,g=g+Math.imul(he,pt)|0,b=b+Math.imul(he,Ot)|0,b=b+Math.imul(we,pt)|0,k=k+Math.imul(we,Ot)|0;var Vt=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,g=Math.imul(K,Ye),b=Math.imul(K,it),b=b+Math.imul(te,Ye)|0,k=Math.imul(te,it),g=g+Math.imul(Q,ft)|0,b=b+Math.imul(Q,It)|0,b=b+Math.imul(fe,ft)|0,k=k+Math.imul(fe,It)|0,g=g+Math.imul(G,st)|0,b=b+Math.imul(G,_t)|0,b=b+Math.imul(re,st)|0,k=k+Math.imul(re,_t)|0,g=g+Math.imul(je,pt)|0,b=b+Math.imul(je,Ot)|0,b=b+Math.imul(L,pt)|0,k=k+Math.imul(L,Ot)|0,g=g+Math.imul(he,D)|0,b=b+Math.imul(he,C)|0,b=b+Math.imul(we,D)|0,k=k+Math.imul(we,C)|0;var fr=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(fr>>>26)|0,fr&=67108863,g=Math.imul(pe,Ye),b=Math.imul(pe,it),b=b+Math.imul(Se,Ye)|0,k=Math.imul(Se,it),g=g+Math.imul(K,ft)|0,b=b+Math.imul(K,It)|0,b=b+Math.imul(te,ft)|0,k=k+Math.imul(te,It)|0,g=g+Math.imul(Q,st)|0,b=b+Math.imul(Q,_t)|0,b=b+Math.imul(fe,st)|0,k=k+Math.imul(fe,_t)|0,g=g+Math.imul(G,pt)|0,b=b+Math.imul(G,Ot)|0,b=b+Math.imul(re,pt)|0,k=k+Math.imul(re,Ot)|0,g=g+Math.imul(je,D)|0,b=b+Math.imul(je,C)|0,b=b+Math.imul(L,D)|0,k=k+Math.imul(L,C)|0,g=g+Math.imul(he,V)|0,b=b+Math.imul(he,se)|0,b=b+Math.imul(we,V)|0,k=k+Math.imul(we,se)|0;var Nr=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,g=Math.imul(Ne,Ye),b=Math.imul(Ne,it),b=b+Math.imul(He,Ye)|0,k=Math.imul(He,it),g=g+Math.imul(pe,ft)|0,b=b+Math.imul(pe,It)|0,b=b+Math.imul(Se,ft)|0,k=k+Math.imul(Se,It)|0,g=g+Math.imul(K,st)|0,b=b+Math.imul(K,_t)|0,b=b+Math.imul(te,st)|0,k=k+Math.imul(te,_t)|0,g=g+Math.imul(Q,pt)|0,b=b+Math.imul(Q,Ot)|0,b=b+Math.imul(fe,pt)|0,k=k+Math.imul(fe,Ot)|0,g=g+Math.imul(G,D)|0,b=b+Math.imul(G,C)|0,b=b+Math.imul(re,D)|0,k=k+Math.imul(re,C)|0,g=g+Math.imul(je,V)|0,b=b+Math.imul(je,se)|0,b=b+Math.imul(L,V)|0,k=k+Math.imul(L,se)|0,g=g+Math.imul(he,be)|0,b=b+Math.imul(he,We)|0,b=b+Math.imul(we,be)|0,k=k+Math.imul(we,We)|0;var mr=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(mr>>>26)|0,mr&=67108863,g=Math.imul(Re,Ye),b=Math.imul(Re,it),b=b+Math.imul(Ke,Ye)|0,k=Math.imul(Ke,it),g=g+Math.imul(Ne,ft)|0,b=b+Math.imul(Ne,It)|0,b=b+Math.imul(He,ft)|0,k=k+Math.imul(He,It)|0,g=g+Math.imul(pe,st)|0,b=b+Math.imul(pe,_t)|0,b=b+Math.imul(Se,st)|0,k=k+Math.imul(Se,_t)|0,g=g+Math.imul(K,pt)|0,b=b+Math.imul(K,Ot)|0,b=b+Math.imul(te,pt)|0,k=k+Math.imul(te,Ot)|0,g=g+Math.imul(Q,D)|0,b=b+Math.imul(Q,C)|0,b=b+Math.imul(fe,D)|0,k=k+Math.imul(fe,C)|0,g=g+Math.imul(G,V)|0,b=b+Math.imul(G,se)|0,b=b+Math.imul(re,V)|0,k=k+Math.imul(re,se)|0,g=g+Math.imul(je,be)|0,b=b+Math.imul(je,We)|0,b=b+Math.imul(L,be)|0,k=k+Math.imul(L,We)|0,g=g+Math.imul(he,qe)|0,b=b+Math.imul(he,J)|0,b=b+Math.imul(we,qe)|0,k=k+Math.imul(we,J)|0;var nr=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(nr>>>26)|0,nr&=67108863,g=Math.imul(Qe,Ye),b=Math.imul(Qe,it),b=b+Math.imul(Mt,Ye)|0,k=Math.imul(Mt,it),g=g+Math.imul(Re,ft)|0,b=b+Math.imul(Re,It)|0,b=b+Math.imul(Ke,ft)|0,k=k+Math.imul(Ke,It)|0,g=g+Math.imul(Ne,st)|0,b=b+Math.imul(Ne,_t)|0,b=b+Math.imul(He,st)|0,k=k+Math.imul(He,_t)|0,g=g+Math.imul(pe,pt)|0,b=b+Math.imul(pe,Ot)|0,b=b+Math.imul(Se,pt)|0,k=k+Math.imul(Se,Ot)|0,g=g+Math.imul(K,D)|0,b=b+Math.imul(K,C)|0,b=b+Math.imul(te,D)|0,k=k+Math.imul(te,C)|0,g=g+Math.imul(Q,V)|0,b=b+Math.imul(Q,se)|0,b=b+Math.imul(fe,V)|0,k=k+Math.imul(fe,se)|0,g=g+Math.imul(G,be)|0,b=b+Math.imul(G,We)|0,b=b+Math.imul(re,be)|0,k=k+Math.imul(re,We)|0,g=g+Math.imul(je,qe)|0,b=b+Math.imul(je,J)|0,b=b+Math.imul(L,qe)|0,k=k+Math.imul(L,J)|0,g=g+Math.imul(he,Ce)|0,b=b+Math.imul(he,Ve)|0,b=b+Math.imul(we,Ce)|0,k=k+Math.imul(we,Ve)|0;var Ar=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,g=Math.imul(Xe,Ye),b=Math.imul(Xe,it),b=b+Math.imul(St,Ye)|0,k=Math.imul(St,it),g=g+Math.imul(Qe,ft)|0,b=b+Math.imul(Qe,It)|0,b=b+Math.imul(Mt,ft)|0,k=k+Math.imul(Mt,It)|0,g=g+Math.imul(Re,st)|0,b=b+Math.imul(Re,_t)|0,b=b+Math.imul(Ke,st)|0,k=k+Math.imul(Ke,_t)|0,g=g+Math.imul(Ne,pt)|0,b=b+Math.imul(Ne,Ot)|0,b=b+Math.imul(He,pt)|0,k=k+Math.imul(He,Ot)|0,g=g+Math.imul(pe,D)|0,b=b+Math.imul(pe,C)|0,b=b+Math.imul(Se,D)|0,k=k+Math.imul(Se,C)|0,g=g+Math.imul(K,V)|0,b=b+Math.imul(K,se)|0,b=b+Math.imul(te,V)|0,k=k+Math.imul(te,se)|0,g=g+Math.imul(Q,be)|0,b=b+Math.imul(Q,We)|0,b=b+Math.imul(fe,be)|0,k=k+Math.imul(fe,We)|0,g=g+Math.imul(G,qe)|0,b=b+Math.imul(G,J)|0,b=b+Math.imul(re,qe)|0,k=k+Math.imul(re,J)|0,g=g+Math.imul(je,Ce)|0,b=b+Math.imul(je,Ve)|0,b=b+Math.imul(L,Ce)|0,k=k+Math.imul(L,Ve)|0,g=g+Math.imul(he,ze)|0,b=b+Math.imul(he,Je)|0,b=b+Math.imul(we,ze)|0,k=k+Math.imul(we,Je)|0;var Fn=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,g=Math.imul(Xe,ft),b=Math.imul(Xe,It),b=b+Math.imul(St,ft)|0,k=Math.imul(St,It),g=g+Math.imul(Qe,st)|0,b=b+Math.imul(Qe,_t)|0,b=b+Math.imul(Mt,st)|0,k=k+Math.imul(Mt,_t)|0,g=g+Math.imul(Re,pt)|0,b=b+Math.imul(Re,Ot)|0,b=b+Math.imul(Ke,pt)|0,k=k+Math.imul(Ke,Ot)|0,g=g+Math.imul(Ne,D)|0,b=b+Math.imul(Ne,C)|0,b=b+Math.imul(He,D)|0,k=k+Math.imul(He,C)|0,g=g+Math.imul(pe,V)|0,b=b+Math.imul(pe,se)|0,b=b+Math.imul(Se,V)|0,k=k+Math.imul(Se,se)|0,g=g+Math.imul(K,be)|0,b=b+Math.imul(K,We)|0,b=b+Math.imul(te,be)|0,k=k+Math.imul(te,We)|0,g=g+Math.imul(Q,qe)|0,b=b+Math.imul(Q,J)|0,b=b+Math.imul(fe,qe)|0,k=k+Math.imul(fe,J)|0,g=g+Math.imul(G,Ce)|0,b=b+Math.imul(G,Ve)|0,b=b+Math.imul(re,Ce)|0,k=k+Math.imul(re,Ve)|0,g=g+Math.imul(je,ze)|0,b=b+Math.imul(je,Je)|0,b=b+Math.imul(L,ze)|0,k=k+Math.imul(L,Je)|0;var tn=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(tn>>>26)|0,tn&=67108863,g=Math.imul(Xe,st),b=Math.imul(Xe,_t),b=b+Math.imul(St,st)|0,k=Math.imul(St,_t),g=g+Math.imul(Qe,pt)|0,b=b+Math.imul(Qe,Ot)|0,b=b+Math.imul(Mt,pt)|0,k=k+Math.imul(Mt,Ot)|0,g=g+Math.imul(Re,D)|0,b=b+Math.imul(Re,C)|0,b=b+Math.imul(Ke,D)|0,k=k+Math.imul(Ke,C)|0,g=g+Math.imul(Ne,V)|0,b=b+Math.imul(Ne,se)|0,b=b+Math.imul(He,V)|0,k=k+Math.imul(He,se)|0,g=g+Math.imul(pe,be)|0,b=b+Math.imul(pe,We)|0,b=b+Math.imul(Se,be)|0,k=k+Math.imul(Se,We)|0,g=g+Math.imul(K,qe)|0,b=b+Math.imul(K,J)|0,b=b+Math.imul(te,qe)|0,k=k+Math.imul(te,J)|0,g=g+Math.imul(Q,Ce)|0,b=b+Math.imul(Q,Ve)|0,b=b+Math.imul(fe,Ce)|0,k=k+Math.imul(fe,Ve)|0,g=g+Math.imul(G,ze)|0,b=b+Math.imul(G,Je)|0,b=b+Math.imul(re,ze)|0,k=k+Math.imul(re,Je)|0;var $n=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+($n>>>26)|0,$n&=67108863,g=Math.imul(Xe,pt),b=Math.imul(Xe,Ot),b=b+Math.imul(St,pt)|0,k=Math.imul(St,Ot),g=g+Math.imul(Qe,D)|0,b=b+Math.imul(Qe,C)|0,b=b+Math.imul(Mt,D)|0,k=k+Math.imul(Mt,C)|0,g=g+Math.imul(Re,V)|0,b=b+Math.imul(Re,se)|0,b=b+Math.imul(Ke,V)|0,k=k+Math.imul(Ke,se)|0,g=g+Math.imul(Ne,be)|0,b=b+Math.imul(Ne,We)|0,b=b+Math.imul(He,be)|0,k=k+Math.imul(He,We)|0,g=g+Math.imul(pe,qe)|0,b=b+Math.imul(pe,J)|0,b=b+Math.imul(Se,qe)|0,k=k+Math.imul(Se,J)|0,g=g+Math.imul(K,Ce)|0,b=b+Math.imul(K,Ve)|0,b=b+Math.imul(te,Ce)|0,k=k+Math.imul(te,Ve)|0,g=g+Math.imul(Q,ze)|0,b=b+Math.imul(Q,Je)|0,b=b+Math.imul(fe,ze)|0,k=k+Math.imul(fe,Je)|0;var qi=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(qi>>>26)|0,qi&=67108863,g=Math.imul(Xe,D),b=Math.imul(Xe,C),b=b+Math.imul(St,D)|0,k=Math.imul(St,C),g=g+Math.imul(Qe,V)|0,b=b+Math.imul(Qe,se)|0,b=b+Math.imul(Mt,V)|0,k=k+Math.imul(Mt,se)|0,g=g+Math.imul(Re,be)|0,b=b+Math.imul(Re,We)|0,b=b+Math.imul(Ke,be)|0,k=k+Math.imul(Ke,We)|0,g=g+Math.imul(Ne,qe)|0,b=b+Math.imul(Ne,J)|0,b=b+Math.imul(He,qe)|0,k=k+Math.imul(He,J)|0,g=g+Math.imul(pe,Ce)|0,b=b+Math.imul(pe,Ve)|0,b=b+Math.imul(Se,Ce)|0,k=k+Math.imul(Se,Ve)|0,g=g+Math.imul(K,ze)|0,b=b+Math.imul(K,Je)|0,b=b+Math.imul(te,ze)|0,k=k+Math.imul(te,Je)|0;var Hi=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Hi>>>26)|0,Hi&=67108863,g=Math.imul(Xe,V),b=Math.imul(Xe,se),b=b+Math.imul(St,V)|0,k=Math.imul(St,se),g=g+Math.imul(Qe,be)|0,b=b+Math.imul(Qe,We)|0,b=b+Math.imul(Mt,be)|0,k=k+Math.imul(Mt,We)|0,g=g+Math.imul(Re,qe)|0,b=b+Math.imul(Re,J)|0,b=b+Math.imul(Ke,qe)|0,k=k+Math.imul(Ke,J)|0,g=g+Math.imul(Ne,Ce)|0,b=b+Math.imul(Ne,Ve)|0,b=b+Math.imul(He,Ce)|0,k=k+Math.imul(He,Ve)|0,g=g+Math.imul(pe,ze)|0,b=b+Math.imul(pe,Je)|0,b=b+Math.imul(Se,ze)|0,k=k+Math.imul(Se,Je)|0;var Vn=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,g=Math.imul(Xe,be),b=Math.imul(Xe,We),b=b+Math.imul(St,be)|0,k=Math.imul(St,We),g=g+Math.imul(Qe,qe)|0,b=b+Math.imul(Qe,J)|0,b=b+Math.imul(Mt,qe)|0,k=k+Math.imul(Mt,J)|0,g=g+Math.imul(Re,Ce)|0,b=b+Math.imul(Re,Ve)|0,b=b+Math.imul(Ke,Ce)|0,k=k+Math.imul(Ke,Ve)|0,g=g+Math.imul(Ne,ze)|0,b=b+Math.imul(Ne,Je)|0,b=b+Math.imul(He,ze)|0,k=k+Math.imul(He,Je)|0;var Wi=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,g=Math.imul(Xe,qe),b=Math.imul(Xe,J),b=b+Math.imul(St,qe)|0,k=Math.imul(St,J),g=g+Math.imul(Qe,Ce)|0,b=b+Math.imul(Qe,Ve)|0,b=b+Math.imul(Mt,Ce)|0,k=k+Math.imul(Mt,Ve)|0,g=g+Math.imul(Re,ze)|0,b=b+Math.imul(Re,Je)|0,b=b+Math.imul(Ke,ze)|0,k=k+Math.imul(Ke,Je)|0;var Gi=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,g=Math.imul(Xe,Ce),b=Math.imul(Xe,Ve),b=b+Math.imul(St,Ce)|0,k=Math.imul(St,Ve),g=g+Math.imul(Qe,ze)|0,b=b+Math.imul(Qe,Je)|0,b=b+Math.imul(Mt,ze)|0,k=k+Math.imul(Mt,Je)|0;var U=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(U>>>26)|0,U&=67108863,g=Math.imul(Xe,ze),b=Math.imul(Xe,Je),b=b+Math.imul(St,ze)|0,k=Math.imul(St,Je);var ie=(I+g|0)+((b&8191)<<13)|0;return I=(k+(b>>>13)|0)+(ie>>>26)|0,ie&=67108863,j[0]=bt,j[1]=rr,j[2]=Bt,j[3]=Vt,j[4]=fr,j[5]=Nr,j[6]=mr,j[7]=nr,j[8]=Ar,j[9]=Fn,j[10]=tn,j[11]=$n,j[12]=qi,j[13]=Hi,j[14]=Vn,j[15]=Wi,j[16]=Gi,j[17]=U,j[18]=ie,I!==0&&(j[19]=I,S.length++),S};Math.imul||(R=O);function F(h,d,m){m.negative=d.negative^h.negative,m.length=h.length+d.length;for(var S=0,E=0,M=0;M<m.length-1;M++){var j=E;E=0;for(var I=S&67108863,g=Math.min(M,d.length-1),b=Math.max(0,M-h.length+1);b<=g;b++){var k=M-b,ve=h.words[k]|0,he=d.words[b]|0,we=ve*he,Oe=we&67108863;j=j+(we/67108864|0)|0,Oe=Oe+I|0,I=Oe&67108863,j=j+(Oe>>>26)|0,E+=j>>>26,j&=67108863}m.words[M]=I,S=j,j=E}return S!==0?m.words[M]=S:m.length--,m._strip()}function B(h,d,m){return F(h,d,m)}o.prototype.mulTo=function(d,m){var S,E=this.length+d.length;return this.length===10&&d.length===10?S=R(this,d,m):E<63?S=O(this,d,m):E<1024?S=F(this,d,m):S=B(this,d,m),S},o.prototype.mul=function(d){var m=new o(null);return m.words=new Array(this.length+d.length),this.mulTo(d,m)},o.prototype.mulf=function(d){var m=new o(null);return m.words=new Array(this.length+d.length),B(this,d,m)},o.prototype.imul=function(d){return this.clone().mulTo(d,this)},o.prototype.imuln=function(d){var m=d<0;m&&(d=-d),i(typeof d=="number"),i(d<67108864);for(var S=0,E=0;E<this.length;E++){var M=(this.words[E]|0)*d,j=(M&67108863)+(S&67108863);S>>=26,S+=M/67108864|0,S+=j>>>26,this.words[E]=j&67108863}return S!==0&&(this.words[E]=S,this.length++),m?this.ineg():this},o.prototype.muln=function(d){return this.clone().imuln(d)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(d){var m=T(d);if(m.length===0)return new o(1);for(var S=this,E=0;E<m.length&&m[E]===0;E++,S=S.sqr());if(++E<m.length)for(var M=S.sqr();E<m.length;E++,M=M.sqr())m[E]!==0&&(S=S.mul(M));return S},o.prototype.iushln=function(d){i(typeof d=="number"&&d>=0);var m=d%26,S=(d-m)/26,E=67108863>>>26-m<<26-m,M;if(m!==0){var j=0;for(M=0;M<this.length;M++){var I=this.words[M]&E,g=(this.words[M]|0)-I<<m;this.words[M]=g|j,j=I>>>26-m}j&&(this.words[M]=j,this.length++)}if(S!==0){for(M=this.length-1;M>=0;M--)this.words[M+S]=this.words[M];for(M=0;M<S;M++)this.words[M]=0;this.length+=S}return this._strip()},o.prototype.ishln=function(d){return i(this.negative===0),this.iushln(d)},o.prototype.iushrn=function(d,m,S){i(typeof d=="number"&&d>=0);var E;m?E=(m-m%26)/26:E=0;var M=d%26,j=Math.min((d-M)/26,this.length),I=67108863^67108863>>>M<<M,g=S;if(E-=j,E=Math.max(0,E),g){for(var b=0;b<j;b++)g.words[b]=this.words[b];g.length=j}if(j!==0)if(this.length>j)for(this.length-=j,b=0;b<this.length;b++)this.words[b]=this.words[b+j];else this.words[0]=0,this.length=1;var k=0;for(b=this.length-1;b>=0&&(k!==0||b>=E);b--){var ve=this.words[b]|0;this.words[b]=k<<26-M|ve>>>M,k=ve&I}return g&&k!==0&&(g.words[g.length++]=k),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(d,m,S){return i(this.negative===0),this.iushrn(d,m,S)},o.prototype.shln=function(d){return this.clone().ishln(d)},o.prototype.ushln=function(d){return this.clone().iushln(d)},o.prototype.shrn=function(d){return this.clone().ishrn(d)},o.prototype.ushrn=function(d){return this.clone().iushrn(d)},o.prototype.testn=function(d){i(typeof d=="number"&&d>=0);var m=d%26,S=(d-m)/26,E=1<<m;if(this.length<=S)return!1;var M=this.words[S];return!!(M&E)},o.prototype.imaskn=function(d){i(typeof d=="number"&&d>=0);var m=d%26,S=(d-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 E=67108863^67108863>>>m<<m;this.words[this.length-1]&=E}return this._strip()},o.prototype.maskn=function(d){return this.clone().imaskn(d)},o.prototype.iaddn=function(d){return i(typeof d=="number"),i(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<=d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},o.prototype._iaddn=function(d){this.words[0]+=d;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},o.prototype.isubn=function(d){if(i(typeof d=="number"),i(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,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()},o.prototype.addn=function(d){return this.clone().iaddn(d)},o.prototype.subn=function(d){return this.clone().isubn(d)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(d,m,S){var E=d.length+S,M;this._expand(E);var j,I=0;for(M=0;M<d.length;M++){j=(this.words[M+S]|0)+I;var g=(d.words[M]|0)*m;j-=g&67108863,I=(j>>26)-(g/67108864|0),this.words[M+S]=j&67108863}for(;M<this.length-S;M++)j=(this.words[M+S]|0)+I,I=j>>26,this.words[M+S]=j&67108863;if(I===0)return this._strip();for(i(I===-1),I=0,M=0;M<this.length;M++)j=-(this.words[M]|0)+I,I=j>>26,this.words[M]=j&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(d,m){var S=this.length-d.length,E=this.clone(),M=d,j=M.words[M.length-1]|0,I=this._countBits(j);S=26-I,S!==0&&(M=M.ushln(S),E.iushln(S),j=M.words[M.length-1]|0);var g=E.length-M.length,b;if(m!=="mod"){b=new o(null),b.length=g+1,b.words=new Array(b.length);for(var k=0;k<b.length;k++)b.words[k]=0}var ve=E.clone()._ishlnsubmul(M,1,g);ve.negative===0&&(E=ve,b&&(b.words[g]=1));for(var he=g-1;he>=0;he--){var we=(E.words[M.length+he]|0)*67108864+(E.words[M.length+he-1]|0);for(we=Math.min(we/j|0,67108863),E._ishlnsubmul(M,we,he);E.negative!==0;)we--,E.negative=0,E._ishlnsubmul(M,1,he),E.isZero()||(E.negative^=1);b&&(b.words[he]=we)}return b&&b._strip(),E._strip(),m!=="div"&&S!==0&&E.iushrn(S),{div:b||null,mod:E}},o.prototype.divmod=function(d,m,S){if(i(!d.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var E,M,j;return this.negative!==0&&d.negative===0?(j=this.neg().divmod(d,m),m!=="mod"&&(E=j.div.neg()),m!=="div"&&(M=j.mod.neg(),S&&M.negative!==0&&M.iadd(d)),{div:E,mod:M}):this.negative===0&&d.negative!==0?(j=this.divmod(d.neg(),m),m!=="mod"&&(E=j.div.neg()),{div:E,mod:j.mod}):this.negative&d.negative?(j=this.neg().divmod(d.neg(),m),m!=="div"&&(M=j.mod.neg(),S&&M.negative!==0&&M.isub(d)),{div:j.div,mod:M}):d.length>this.length||this.cmp(d)<0?{div:new o(0),mod:this}:d.length===1?m==="div"?{div:this.divn(d.words[0]),mod:null}:m==="mod"?{div:null,mod:new o(this.modrn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new o(this.modrn(d.words[0]))}:this._wordDiv(d,m)},o.prototype.div=function(d){return this.divmod(d,"div",!1).div},o.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},o.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},o.prototype.divRound=function(d){var m=this.divmod(d);if(m.mod.isZero())return m.div;var S=m.div.negative!==0?m.mod.isub(d):m.mod,E=d.ushrn(1),M=d.andln(1),j=S.cmp(E);return j<0||M===1&&j===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},o.prototype.modrn=function(d){var m=d<0;m&&(d=-d),i(d<=67108863);for(var S=(1<<26)%d,E=0,M=this.length-1;M>=0;M--)E=(S*E+(this.words[M]|0))%d;return m?-E:E},o.prototype.modn=function(d){return this.modrn(d)},o.prototype.idivn=function(d){var m=d<0;m&&(d=-d),i(d<=67108863);for(var S=0,E=this.length-1;E>=0;E--){var M=(this.words[E]|0)+S*67108864;this.words[E]=M/d|0,S=M%d}return this._strip(),m?this.ineg():this},o.prototype.divn=function(d){return this.clone().idivn(d)},o.prototype.egcd=function(d){i(d.negative===0),i(!d.isZero());var m=this,S=d.clone();m.negative!==0?m=m.umod(d):m=m.clone();for(var E=new o(1),M=new o(0),j=new o(0),I=new o(1),g=0;m.isEven()&&S.isEven();)m.iushrn(1),S.iushrn(1),++g;for(var b=S.clone(),k=m.clone();!m.isZero();){for(var ve=0,he=1;!(m.words[0]&he)&&ve<26;++ve,he<<=1);if(ve>0)for(m.iushrn(ve);ve-- >0;)(E.isOdd()||M.isOdd())&&(E.iadd(b),M.isub(k)),E.iushrn(1),M.iushrn(1);for(var we=0,Oe=1;!(S.words[0]&Oe)&&we<26;++we,Oe<<=1);if(we>0)for(S.iushrn(we);we-- >0;)(j.isOdd()||I.isOdd())&&(j.iadd(b),I.isub(k)),j.iushrn(1),I.iushrn(1);m.cmp(S)>=0?(m.isub(S),E.isub(j),M.isub(I)):(S.isub(m),j.isub(E),I.isub(M))}return{a:j,b:I,gcd:S.iushln(g)}},o.prototype._invmp=function(d){i(d.negative===0),i(!d.isZero());var m=this,S=d.clone();m.negative!==0?m=m.umod(d):m=m.clone();for(var E=new o(1),M=new o(0),j=S.clone();m.cmpn(1)>0&&S.cmpn(1)>0;){for(var I=0,g=1;!(m.words[0]&g)&&I<26;++I,g<<=1);if(I>0)for(m.iushrn(I);I-- >0;)E.isOdd()&&E.iadd(j),E.iushrn(1);for(var b=0,k=1;!(S.words[0]&k)&&b<26;++b,k<<=1);if(b>0)for(S.iushrn(b);b-- >0;)M.isOdd()&&M.iadd(j),M.iushrn(1);m.cmp(S)>=0?(m.isub(S),E.isub(M)):(S.isub(m),M.isub(E))}var ve;return m.cmpn(1)===0?ve=E:ve=M,ve.cmpn(0)<0&&ve.iadd(d),ve},o.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var m=this.clone(),S=d.clone();m.negative=0,S.negative=0;for(var E=0;m.isEven()&&S.isEven();E++)m.iushrn(1),S.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;S.isEven();)S.iushrn(1);var M=m.cmp(S);if(M<0){var j=m;m=S,S=j}else if(M===0||S.cmpn(1)===0)break;m.isub(S)}while(!0);return S.iushln(E)},o.prototype.invm=function(d){return this.egcd(d).a.umod(d)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(d){return this.words[0]&d},o.prototype.bincn=function(d){i(typeof d=="number");var m=d%26,S=(d-m)/26,E=1<<m;if(this.length<=S)return this._expand(S+1),this.words[S]|=E,this;for(var M=E,j=S;M!==0&&j<this.length;j++){var I=this.words[j]|0;I+=M,M=I>>>26,I&=67108863,this.words[j]=I}return M!==0&&(this.words[j]=M,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(d){var m=d<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&&(d=-d),i(d<=67108863,"Number is too big");var E=this.words[0]|0;S=E===d?0:E<d?-1:1}return this.negative!==0?-S|0:S},o.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var m=this.ucmp(d);return this.negative!==0?-m|0:m},o.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var m=0,S=this.length-1;S>=0;S--){var E=this.words[S]|0,M=d.words[S]|0;if(E!==M){E<M?m=-1:E>M&&(m=1);break}}return m},o.prototype.gtn=function(d){return this.cmpn(d)===1},o.prototype.gt=function(d){return this.cmp(d)===1},o.prototype.gten=function(d){return this.cmpn(d)>=0},o.prototype.gte=function(d){return this.cmp(d)>=0},o.prototype.ltn=function(d){return this.cmpn(d)===-1},o.prototype.lt=function(d){return this.cmp(d)===-1},o.prototype.lten=function(d){return this.cmpn(d)<=0},o.prototype.lte=function(d){return this.cmp(d)<=0},o.prototype.eqn=function(d){return this.cmpn(d)===0},o.prototype.eq=function(d){return this.cmp(d)===0},o.red=function(d){return new q(d)},o.prototype.toRed=function(d){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(d){return this.red=d,this},o.prototype.forceRed=function(d){return i(!this.red,"Already a number in reduction context"),this._forceRed(d)},o.prototype.redAdd=function(d){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},o.prototype.redIAdd=function(d){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},o.prototype.redSub=function(d){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},o.prototype.redISub=function(d){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},o.prototype.redShl=function(d){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},o.prototype.redMul=function(d){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},o.prototype.redIMul=function(d){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(d){return i(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var H={k256:null,p224:null,p192:null,p25519:null};function $(h,d){this.name=h,this.p=new o(d,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}$.prototype._tmp=function(){var d=new o(null);return d.words=new Array(Math.ceil(this.n/13)),d},$.prototype.ireduce=function(d){var m=d,S;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),S=m.bitLength();while(S>this.n);var E=S<this.n?-1:m.ucmp(this.p);return E===0?(m.words[0]=0,m.length=1):E>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},$.prototype.split=function(d,m){d.iushrn(this.n,0,m)},$.prototype.imulK=function(d){return d.imul(this.k)};function Z(){$.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(Z,$),Z.prototype.split=function(d,m){for(var S=4194303,E=Math.min(d.length,9),M=0;M<E;M++)m.words[M]=d.words[M];if(m.length=E,d.length<=9){d.words[0]=0,d.length=1;return}var j=d.words[9];for(m.words[m.length++]=j&S,M=10;M<d.length;M++){var I=d.words[M]|0;d.words[M-10]=(I&S)<<4|j>>>22,j=I}j>>>=22,d.words[M-10]=j,j===0&&d.length>10?d.length-=10:d.length-=9},Z.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var m=0,S=0;S<d.length;S++){var E=d.words[S]|0;m+=E*977,d.words[S]=m&67108863,m=E*64+(m/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function ce(){$.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(ce,$);function ne(){$.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(ne,$);function de(){$.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(de,$),de.prototype.imulK=function(d){for(var m=0,S=0;S<d.length;S++){var E=(d.words[S]|0)*19+m,M=E&67108863;E>>>=26,d.words[S]=M,m=E}return m!==0&&(d.words[d.length++]=m),d},o._prime=function(d){if(H[d])return H[d];var m;if(d==="k256")m=new Z;else if(d==="p224")m=new ce;else if(d==="p192")m=new ne;else if(d==="p25519")m=new de;else throw new Error("Unknown prime "+d);return H[d]=m,m};function q(h){if(typeof h=="string"){var d=o._prime(h);this.m=d.p,this.prime=d}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}q.prototype._verify1=function(d){i(d.negative===0,"red works only with positives"),i(d.red,"red works only with red numbers")},q.prototype._verify2=function(d,m){i((d.negative|m.negative)===0,"red works only with positives"),i(d.red&&d.red===m.red,"red works only with red numbers")},q.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):(f(d,d.umod(this.m)._forceRed(this)),d)},q.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},q.prototype.add=function(d,m){this._verify2(d,m);var S=d.add(m);return S.cmp(this.m)>=0&&S.isub(this.m),S._forceRed(this)},q.prototype.iadd=function(d,m){this._verify2(d,m);var S=d.iadd(m);return S.cmp(this.m)>=0&&S.isub(this.m),S},q.prototype.sub=function(d,m){this._verify2(d,m);var S=d.sub(m);return S.cmpn(0)<0&&S.iadd(this.m),S._forceRed(this)},q.prototype.isub=function(d,m){this._verify2(d,m);var S=d.isub(m);return S.cmpn(0)<0&&S.iadd(this.m),S},q.prototype.shl=function(d,m){return this._verify1(d),this.imod(d.ushln(m))},q.prototype.imul=function(d,m){return this._verify2(d,m),this.imod(d.imul(m))},q.prototype.mul=function(d,m){return this._verify2(d,m),this.imod(d.mul(m))},q.prototype.isqr=function(d){return this.imul(d,d.clone())},q.prototype.sqr=function(d){return this.mul(d,d)},q.prototype.sqrt=function(d){if(d.isZero())return d.clone();var m=this.m.andln(3);if(i(m%2===1),m===3){var S=this.m.add(new o(1)).iushrn(2);return this.pow(d,S)}for(var E=this.m.subn(1),M=0;!E.isZero()&&E.andln(1)===0;)M++,E.iushrn(1);i(!E.isZero());var j=new o(1).toRed(this),I=j.redNeg(),g=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new o(2*b*b).toRed(this);this.pow(b,g).cmp(I)!==0;)b.redIAdd(I);for(var k=this.pow(b,E),ve=this.pow(d,E.addn(1).iushrn(1)),he=this.pow(d,E),we=M;he.cmp(j)!==0;){for(var Oe=he,je=0;Oe.cmp(j)!==0;je++)Oe=Oe.redSqr();i(je<we);var L=this.pow(k,new o(1).iushln(we-je-1));ve=ve.redMul(L),k=L.redSqr(),he=he.redMul(k),we=je}return ve},q.prototype.invm=function(d){var m=d._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},q.prototype.pow=function(d,m){if(m.isZero())return new o(1).toRed(this);if(m.cmpn(1)===0)return d.clone();var S=4,E=new Array(1<<S);E[0]=new o(1).toRed(this),E[1]=d;for(var M=2;M<E.length;M++)E[M]=this.mul(E[M-1],d);var j=E[0],I=0,g=0,b=m.bitLength()%26;for(b===0&&(b=26),M=m.length-1;M>=0;M--){for(var k=m.words[M],ve=b-1;ve>=0;ve--){var he=k>>ve&1;if(j!==E[0]&&(j=this.sqr(j)),he===0&&I===0){g=0;continue}I<<=1,I|=he,g++,!(g!==S&&(M!==0||ve!==0))&&(j=this.mul(j,E[I]),g=0,I=0)}b=26}return j},q.prototype.convertTo=function(d){var m=d.umod(this.m);return m===d?m.clone():m},q.prototype.convertFrom=function(d){var m=d.clone();return m.red=null,m},o.mont=function(d){return new N(d)};function N(h){q.call(this,h),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)}s(N,q),N.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},N.prototype.convertFrom=function(d){var m=this.imod(d.mul(this.rinv));return m.red=null,m},N.prototype.imul=function(d,m){if(d.isZero()||m.isZero())return d.words[0]=0,d.length=1,d;var S=d.imul(m),E=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=S.isub(E).iushrn(this.shift),j=M;return M.cmp(this.m)>=0?j=M.isub(this.m):M.cmpn(0)<0&&(j=M.iadd(this.m)),j._forceRed(this)},N.prototype.mul=function(d,m){if(d.isZero()||m.isZero())return new o(0)._forceRed(this);var S=d.mul(m),E=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=S.isub(E).iushrn(this.shift),j=M;return M.cmp(this.m)>=0?j=M.isub(this.m):M.cmpn(0)<0&&(j=M.iadd(this.m)),j._forceRed(this)},N.prototype.invm=function(d){var m=this.imod(d._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(typeof t>"u"||t,e)}}),wo=9e15,rs=1e9,vf="0123456789abcdef",tl="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",rl="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",bf={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-wo,maxE:wo,crypto:!1},jg,Ii,mt=!0,nl="[DecimalError] ",ns=nl+"Invalid argument: ",Ng=nl+"Precision limit exceeded",kg=nl+"crypto unavailable",Dg="[object Decimal]",Lr=Math.floor,_r=Math.pow,L9=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,B9=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,U9=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Lg=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,jn=1e7,ot=7,F9=9007199254740991,$9=tl.length-1,yf=rl.length-1,Me={toStringTag:Dg};Me.absoluteValue=Me.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),tt(e)},Me.ceil=function(){return tt(new this.constructor(this),this.e+1,2)},Me.clampedTo=Me.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(ns+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)},Me.comparedTo=Me.cmp=function(e){var t,r,n,i,s=this,o=s.d,a=(e=new s.constructor(e)).d,c=s.s,l=e.s;if(!o||!a)return!c||!l?NaN:c!==l?c:o===a?0:!o^c<0?1:-1;if(!o[0]||!a[0])return o[0]?c:a[0]?-l:0;if(c!==l)return c;if(s.e!==e.e)return s.e>e.e^c<0?1:-1;for(n=o.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(o[t]!==a[t])return o[t]>a[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1},Me.cosine=Me.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())+ot,n.rounding=1,r=V9(n,zg(n,r)),n.precision=e,n.rounding=t,tt(Ii==2||Ii==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)},Me.cubeRoot=Me.cbrt=function(){var e,t,r,n,i,s,o,a,c,l,u=this,f=u.constructor;if(!u.isFinite()||u.isZero())return new f(u);for(mt=!1,s=u.s*_r(u.s*u,1/3),!s||Math.abs(s)==1/0?(r=Mr(u.d),e=u.e,(s=(e-r.length+1)%3)&&(r+=s==1||s==-2?"0":"00"),s=_r(r,1/3),e=Lr((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?r="5e"+e:(r=s.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new f(r),n.s=u.s):n=new f(s.toString()),o=(e=f.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),o+2,1),Mr(a.d).slice(0,o)===(r=Mr(n.d)).slice(0,o))if(r=r.slice(o-3,o+1),r=="9999"||!i&&r=="4999"){if(!i&&(tt(a,e+1,0),a.times(a).times(a).eq(u))){n=a;break}o+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(tt(n,e+1,1),t=!n.times(n).times(n).eq(u));break}return mt=!0,tt(n,e,f.rounding,t)},Me.decimalPlaces=Me.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Lr(this.e/ot))*ot,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},Me.dividedBy=Me.div=function(e){return Kt(this,new this.constructor(e))},Me.dividedToIntegerBy=Me.divToInt=function(e){var t=this,r=t.constructor;return tt(Kt(t,new r(e),0,1,1),r.precision,r.rounding)},Me.equals=Me.eq=function(e){return this.cmp(e)===0},Me.floor=function(){return tt(new this.constructor(this),this.e+1,3)},Me.greaterThan=Me.gt=function(e){return this.cmp(e)>0},Me.greaterThanOrEqualTo=Me.gte=function(e){var t=this.cmp(e);return t==1||t===0},Me.hyperbolicCosine=Me.cosh=function(){var e,t,r,n,i,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;r=o.precision,n=o.rounding,o.precision=r+Math.max(s.e,s.sd())+4,o.rounding=1,i=s.d.length,i<32?(e=Math.ceil(i/3),t=(1/al(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),s=xo(o,1,s.times(t),new o(1),!0);for(var c,l=e,u=new o(8);l--;)c=s.times(s),s=a.minus(c.times(u.minus(c.times(u))));return tt(s,o.precision=r,o.rounding=n,!0)},Me.hyperbolicSine=Me.sinh=function(){var e,t,r,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(t=s.precision,r=s.rounding,s.precision=t+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<3)i=xo(s,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=xo(s,2,i,i,!0);for(var o,a=new s(5),c=new s(16),l=new s(20);e--;)o=i.times(i),i=i.times(a.plus(o.times(c.times(o).plus(l))))}return s.precision=t,s.rounding=r,tt(i,t,r,!0)},Me.hyperbolicTangent=Me.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)},Me.inverseCosine=Me.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,s=r.rounding;return n!==-1?n===0?t.isNeg()?Nn(r,i,s):new r(0):new r(NaN):t.isZero()?Nn(r,i+4,s).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=Nn(r,i+4,s).times(.5),r.precision=i,r.rounding=s,e.minus(t))},Me.inverseHyperbolicCosine=Me.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,mt=!1,r=r.times(r).minus(1).sqrt().plus(r),mt=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},Me.inverseHyperbolicSine=Me.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,mt=!1,r=r.times(r).plus(1).sqrt().plus(r),mt=!0,n.precision=e,n.rounding=t,r.ln())},Me.inverseHyperbolicTangent=Me.atanh=function(){var e,t,r,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=s.precision,t=s.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?tt(new s(i),e,t,!0):(s.precision=r=n-i.e,i=Kt(i.plus(1),new s(1).minus(i),r+e,1),s.precision=e+4,s.rounding=1,i=i.ln(),s.precision=e,s.rounding=t,i.times(.5))):new s(NaN)},Me.inverseSine=Me.asin=function(){var e,t,r,n,i=this,s=i.constructor;return i.isZero()?new s(i):(t=i.abs().cmp(1),r=s.precision,n=s.rounding,t!==-1?t===0?(e=Nn(s,r+4,n).times(.5),e.s=i.s,e):new s(NaN):(s.precision=r+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=r,s.rounding=n,i.times(2)))},Me.inverseTangent=Me.atan=function(){var e,t,r,n,i,s,o,a,c,l=this,u=l.constructor,f=u.precision,p=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&f+4<=yf)return o=Nn(u,f+4,p).times(.25),o.s=l.s,o}else{if(!l.s)return new u(NaN);if(f+4<=yf)return o=Nn(u,f+4,p).times(.5),o.s=l.s,o}for(u.precision=a=f+10,u.rounding=1,r=Math.min(28,a/ot+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(mt=!1,t=Math.ceil(a/ot),n=1,c=l.times(l),o=new u(l),i=l;e!==-1;)if(i=i.times(c),s=o.minus(i.div(n+=2)),i=i.times(c),o=s.plus(i.div(n+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===s.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),mt=!0,tt(o,u.precision=f,u.rounding=p,!0)},Me.isFinite=function(){return!!this.d},Me.isInteger=Me.isInt=function(){return!!this.d&&Lr(this.e/ot)>this.d.length-2},Me.isNaN=function(){return!this.s},Me.isNegative=Me.isNeg=function(){return this.s<0},Me.isPositive=Me.isPos=function(){return this.s>0},Me.isZero=function(){return!!this.d&&this.d[0]===0},Me.lessThan=Me.lt=function(e){return this.cmp(e)<0},Me.lessThanOrEqualTo=Me.lte=function(e){return this.cmp(e)<1},Me.logarithm=Me.log=function(e){var t,r,n,i,s,o,a,c,l=this,u=l.constructor,f=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)s=!0;else{for(i=r[0];i%10===0;)i/=10;s=i!==1}if(mt=!1,a=f+y,o=ss(l,a),n=t?ol(u,a+10):ss(e,a),c=Kt(o,n,a,1),wa(c.d,i=f,p))do if(a+=10,o=ss(l,a),n=t?ol(u,a+10):ss(e,a),c=Kt(o,n,a,1),!s){+Mr(c.d).slice(i+1,i+15)+1==1e14&&(c=tt(c,f+1,0));break}while(wa(c.d,i+=10,p));return mt=!0,tt(c,f,p)},Me.minus=Me.sub=function(e){var t,r,n,i,s,o,a,c,l,u,f,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 mt?tt(e,a,c):e}if(r=Lr(e.e/ot),u=Lr(y.e/ot),l=l.slice(),s=u-r,s){for(f=s<0,f?(t=l,s=-s,o=p.length):(t=p,r=u,o=l.length),n=Math.max(Math.ceil(a/ot),o)+2,s>n&&(s=n,t.length=1),t.reverse(),n=s;n--;)t.push(0);t.reverse()}else{for(n=l.length,o=p.length,f=n<o,f&&(o=n),n=0;n<o;n++)if(l[n]!=p[n]){f=l[n]<p[n];break}s=0}for(f&&(t=l,l=p,p=t,e.s=-e.s),o=l.length,n=p.length-o;n>0;--n)l[o++]=0;for(n=p.length;n>s;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=jn-1;--l[i],l[n]+=jn}l[n]-=p[n]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=sl(l,r),mt?tt(e,a,c):e):new x(c===3?-0:0)},Me.modulo=Me.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]?tt(new n(r),n.precision,n.rounding):(mt=!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),mt=!0,r.minus(t))},Me.naturalExponential=Me.exp=function(){return wf(this)},Me.naturalLogarithm=Me.ln=function(){return ss(this)},Me.negated=Me.neg=function(){var e=new this.constructor(this);return e.s=-e.s,tt(e)},Me.plus=Me.add=function(e){var t,r,n,i,s,o,a,c,l,u,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return!f.s||!e.s?e=new p(NaN):f.d||(e=new p(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(l=f.d,u=e.d,a=p.precision,c=p.rounding,!l[0]||!u[0])return u[0]||(e=new p(f)),mt?tt(e,a,c):e;if(s=Lr(f.e/ot),n=Lr(e.e/ot),l=l.slice(),i=s-n,i){for(i<0?(r=l,i=-i,o=u.length):(r=u,n=s,o=l.length),s=Math.ceil(a/ot),o=s>o?s+1:o+1,i>o&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(o=l.length,i=u.length,o-i<0&&(i=o,r=u,u=l,l=r),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/jn|0,l[i]%=jn;for(t&&(l.unshift(t),++n),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=sl(l,n),mt?tt(e,a,c):e},Me.precision=Me.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ns+e);return r.d?(t=Bg(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},Me.round=function(){var e=this,t=e.constructor;return tt(new t(e),e.e+1,t.rounding)},Me.sine=Me.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())+ot,n.rounding=1,r=q9(n,zg(n,r)),n.precision=e,n.rounding=t,tt(Ii>2?r.neg():r,e,t,!0)):new n(NaN)},Me.squareRoot=Me.sqrt=function(){var e,t,r,n,i,s,o=this,a=o.d,c=o.e,l=o.s,u=o.constructor;if(l!==1||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?o:1/0);for(mt=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=Mr(a),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=Lr((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(s=n,n=s.plus(Kt(o,s,r+2,1)).times(.5),Mr(s.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&&(tt(s,c+1,0),s.times(s).eq(o))){n=s;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(tt(n,c+1,1),e=!n.times(n).eq(o));break}return mt=!0,tt(n,c,u.rounding,e)},Me.tangent=Me.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,tt(Ii==2||Ii==4?r.neg():r,e,t,!0)):new n(NaN)},Me.times=Me.mul=function(e){var t,r,n,i,s,o,a,c,l,u=this,f=u.constructor,p=u.d,y=(e=new f(e)).d;if(e.s*=u.s,!p||!p[0]||!y||!y[0])return new f(!e.s||p&&!p[0]&&!y||y&&!y[0]&&!p?NaN:!p||!y?e.s/0:e.s*0);for(r=Lr(u.e/ot)+Lr(e.e/ot),c=p.length,l=y.length,c<l&&(s=p,p=y,y=s,o=c,c=l,l=o),s=[],o=c+l,n=o;n--;)s.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)a=s[i]+y[n]*p[i-n-1]+t,s[i--]=a%jn|0,t=a/jn|0;s[i]=(s[i]+t)%jn|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=sl(s,r),mt?tt(e,f.precision,f.rounding):e},Me.toBinary=function(e,t){return Sf(this,2,e,t)},Me.toDecimalPlaces=Me.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Jr(e,0,rs),t===void 0?t=n.rounding:Jr(t,0,8),tt(r,e+r.e+1,t))},Me.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ni(n,!0):(Jr(e,0,rs),t===void 0?t=i.rounding:Jr(t,0,8),n=tt(new i(n),e+1,t),r=ni(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},Me.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?r=ni(i):(Jr(e,0,rs),t===void 0?t=s.rounding:Jr(t,0,8),n=tt(new s(i),e+i.e+1,t),r=ni(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},Me.toFraction=function(e){var t,r,n,i,s,o,a,c,l,u,f,p,y=this,x=y.d,v=y.constructor;if(!x)return new v(y);if(l=r=new v(1),n=c=new v(0),t=new v(n),s=t.e=Bg(x)-y.e-1,o=s%ot,t.d[0]=_r(10,o<0?ot+o:o),e==null)e=s>0?t:l;else{if(a=new v(e),!a.isInt()||a.lt(l))throw Error(ns+a);e=a.gt(t)?s>0?t:l:a}for(mt=!1,a=new v(Mr(x)),u=v.precision,v.precision=s=x.length*ot*2;f=Kt(a,t,0,1,1),i=r.plus(f.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(f.times(i)),c=i,i=t,t=a.minus(f.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,s,1).minus(y).abs().cmp(Kt(c,r,s,1).minus(y).abs())<1?[l,n]:[c,r],v.precision=u,mt=!0,p},Me.toHexadecimal=Me.toHex=function(e,t){return Sf(this,16,e,t)},Me.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:Jr(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]?(mt=!1,r=Kt(r,e,0,t,1).times(e),mt=!0,tt(r)):(e.s=r.s,r=e),r},Me.toNumber=function(){return+this},Me.toOctal=function(e,t){return Sf(this,8,e,t)},Me.toPower=Me.pow=function(e){var t,r,n,i,s,o,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(_r(+a,l));if(a=new c(a),a.eq(1))return a;if(n=c.precision,s=c.rounding,e.eq(1))return tt(a,n,s);if(t=Lr(e.e/ot),t>=e.d.length-1&&(r=l<0?-l:l)<=F9)return i=Ug(c,a,r,n),e.s<0?new c(1).div(i):tt(i,n,s);if(o=a.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=o,a}return r=_r(+a,l),t=r==0||!isFinite(r)?Lr(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?o/0:0):(mt=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),i=wf(e.times(ss(a,n+r)),n),i.d&&(i=tt(i,n+5,1),wa(i.d,n,s)&&(t=n+10,i=tt(wf(e.times(ss(a,t+r)),t),t+5,1),+Mr(i.d).slice(n+1,n+15)+1==1e14&&(i=tt(i,n+1,0)))),i.s=o,mt=!0,c.rounding=s,tt(i,n,s))},Me.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ni(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Jr(e,1,rs),t===void 0?t=i.rounding:Jr(t,0,8),n=tt(new i(n),e,t),r=ni(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},Me.toSignificantDigits=Me.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Jr(e,1,rs),t===void 0?t=n.rounding:Jr(t,0,8)),tt(new n(r),e,t)},Me.toString=function(){var e=this,t=e.constructor,r=ni(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},Me.truncated=Me.trunc=function(){return tt(new this.constructor(this),this.e+1,1)},Me.valueOf=Me.toJSON=function(){var e=this,t=e.constructor,r=ni(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,s="",o=e[0];if(i>0){for(s+=o,t=1;t<i;t++)n=e[t]+"",r=ot-n.length,r&&(s+=is(r)),s+=n;o=e[t],n=o+"",r=ot-n.length,r&&(s+=is(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}function Jr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ns+e)}function wa(e,t,r,n){var i,s,o,a;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=ot,i=0):(i=Math.ceil((t+1)/ot),t%=ot),s=_r(10,ot-t),a=e[i]%s|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),o=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):o=(r<4&&a+1==s||r>3&&a+1==s/2)&&(e[i+1]/s/100|0)==_r(10,t-2)-1||(a==s/2||a==0)&&(e[i+1]/s/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),o=(n||r<4)&&a==9999||!n&&r>3&&a==4999):o=((n||r<4)&&a+1==s||!n&&r>3&&a+1==s/2)&&(e[i+1]/s/1e3|0)==_r(10,t-3)-1,o}function il(e,t,r){for(var n,i=[0],s,o=0,a=e.length;o<a;){for(s=i.length;s--;)i[s]*=t;for(i[0]+=vf.indexOf(e.charAt(o++)),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 V9(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=xo(e,1,t.times(i),new e(1));for(var s=r;s--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}var Kt=function(){function e(n,i,s){var o,a=0,c=n.length;for(n=n.slice();c--;)o=n[c]*i+a,n[c]=o%s|0,a=o/s|0;return a&&n.unshift(a),n}function t(n,i,s,o){var a,c;if(s!=o)c=s>o?1:-1;else for(a=c=0;a<s;a++)if(n[a]!=i[a]){c=n[a]>i[a]?1:-1;break}return c}function r(n,i,s,o){for(var a=0;s--;)n[s]-=a,a=n[s]<i[s]?1:0,n[s]=a*o+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,o,a,c){var l,u,f,p,y,x,v,_,T,O,R,F,B,H,$,Z,ce,ne,de,q,N=n.constructor,h=n.s==i.s?1:-1,d=n.d,m=i.d;if(!d||!d[0]||!m||!m[0])return new N(!n.s||!i.s||(d?m&&d[0]==m[0]:!m)?NaN:d&&d[0]==0||!m?h*0:h/0);for(c?(y=1,u=n.e-i.e):(c=jn,y=ot,u=Lr(n.e/y)-Lr(i.e/y)),de=m.length,ce=d.length,T=new N(h),O=T.d=[],f=0;m[f]==(d[f]||0);f++);if(m[f]>(d[f]||0)&&u--,s==null?(H=s=N.precision,o=N.rounding):a?H=s+(n.e-i.e)+1:H=s,H<0)O.push(1),x=!0;else{if(H=H/y+2|0,f=0,de==1){for(p=0,m=m[0],H++;(f<ce||p)&&H--;f++)$=p*c+(d[f]||0),O[f]=$/m|0,p=$%m|0;x=p||f<ce}else{for(p=c/(m[0]+1)|0,p>1&&(m=e(m,p,c),d=e(d,p,c),de=m.length,ce=d.length),Z=de,R=d.slice(0,de),F=R.length;F<de;)R[F++]=0;q=m.slice(),q.unshift(0),ne=m[0],m[1]>=c/2&&++ne;do p=0,l=t(m,R,de,F),l<0?(B=R[0],de!=F&&(B=B*c+(R[1]||0)),p=B/ne|0,p>1?(p>=c&&(p=c-1),v=e(m,p,c),_=v.length,F=R.length,l=t(v,R,_,F),l==1&&(p--,r(v,de<_?q:m,_,c))):(p==0&&(l=p=1),v=m.slice()),_=v.length,_<F&&v.unshift(0),r(R,v,F,c),l==-1&&(F=R.length,l=t(m,R,de,F),l<1&&(p++,r(R,de<F?q:m,F,c))),F=R.length):l===0&&(p++,R=[0]),O[f++]=p,l&&R[0]?R[F++]=d[Z]||0:(R=[d[Z]],F=1);while((Z++<ce||R[0]!==void 0)&&H--);x=R[0]!==void 0}O[0]||O.shift()}if(y==1)T.e=u,jg=x;else{for(f=1,p=O[0];p>=10;p/=10)f++;T.e=f+u*y-1,tt(T,a?s+T.e+1:s,o,x)}return T}}();function tt(e,t,r,n){var i,s,o,a,c,l,u,f,p,y=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(i=1,a=f[0];a>=10;a/=10)i++;if(s=t-i,s<0)s+=ot,o=t,u=f[p=0],c=u/_r(10,i-o-1)%10|0;else if(p=Math.ceil((s+1)/ot),a=f.length,p>=a)if(n){for(;a++<=p;)f.push(0);u=c=0,i=1,s%=ot,o=s-ot+1}else break e;else{for(u=a=f[p],i=1;a>=10;a/=10)i++;s%=ot,o=s-ot+i,c=o<0?0:u/_r(10,i-o-1)%10|0}if(n=n||t<0||f[p+1]!==void 0||(o<0?u:u%_r(10,i-o-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(s>0?o>0?u/_r(10,i-o):0:f[p-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,l?(t-=e.e+1,f[0]=_r(10,(ot-t%ot)%ot),e.e=-t||0):f[0]=e.e=0,e;if(s==0?(f.length=p,a=1,p--):(f.length=p+1,a=_r(10,ot-s),f[p]=o>0?(u/_r(10,i-o)%_r(10,o)|0)*a:0),l)for(;;)if(p==0){for(s=1,o=f[0];o>=10;o/=10)s++;for(o=f[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(e.e++,f[0]==jn&&(f[0]=1));break}else{if(f[p]+=a,f[p]!=jn)break;f[p--]=0,a=1}for(s=f.length;f[--s]===0;)f.pop()}return mt&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e<y.minE&&(e.e=0,e.d=[0])),e}function ni(e,t,r){if(!e.isFinite())return Vg(e);var n,i=e.e,s=Mr(e.d),o=s.length;return t?(r&&(n=r-o)>0?s=s.charAt(0)+"."+s.slice(1)+is(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):i<0?(s="0."+is(-i-1)+s,r&&(n=r-o)>0&&(s+=is(n))):i>=o?(s+=is(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+is(n))):((n=i+1)<o&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(s+="."),s+=is(n))),s}function sl(e,t){var r=e[0];for(t*=ot;r>=10;r/=10)t++;return t}function ol(e,t,r){if(t>$9)throw mt=!0,r&&(e.precision=r),Error(Ng);return tt(new e(tl),t,1,!0)}function Nn(e,t,r){if(t>yf)throw Error(Ng);return tt(new e(rl),t,r,!0)}function Bg(e){var t=e.length-1,r=t*ot+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 is(e){for(var t="";e--;)t+="0";return t}function Ug(e,t,r,n){var i,s=new e(1),o=Math.ceil(n/ot+4);for(mt=!1;;){if(r%2&&(s=s.times(t),qg(s.d,o)&&(i=!0)),r=Lr(r/2),r===0){r=s.d.length-1,i&&s.d[r]===0&&++s.d[r];break}t=t.times(t),qg(t.d,o)}return mt=!0,s}function Fg(e){return e.d[e.d.length-1]&1}function $g(e,t,r){for(var n,i=new e(t[0]),s=0;++s<t.length;)if(n=new e(t[s]),n.s)i[r](n)&&(i=n);else{i=n;break}return i}function wf(e,t){var r,n,i,s,o,a,c,l=0,u=0,f=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?(mt=!1,c=x):c=t,a=new p(.03125);e.e>-2;)e=e.times(a),f+=5;for(n=Math.log(_r(2,f))/Math.LN10*2+5|0,c+=n,r=s=o=new p(1),p.precision=c;;){if(s=tt(s.times(e),c,1),r=r.times(++u),a=o.plus(Kt(s,r,c,1)),Mr(a.d).slice(0,c)===Mr(o.d).slice(0,c)){for(i=f;i--;)o=tt(o.times(o),c,1);if(t==null)if(l<3&&wa(o.d,c-n,y,l))p.precision=c+=10,r=s=a=new p(1),u=0,l++;else return tt(o,p.precision=x,y,mt=!0);else return p.precision=x,o}o=a}}function ss(e,t){var r,n,i,s,o,a,c,l,u,f,p,y=1,x=10,v=e,_=v.d,T=v.constructor,O=T.rounding,R=T.precision;if(v.s<0||!_||!_[0]||!v.e&&_[0]==1&&_.length==1)return new T(_&&!_[0]?-1/0:v.s!=1?NaN:_?0:v);if(t==null?(mt=!1,u=R):u=t,T.precision=u+=x,r=Mr(_),n=r.charAt(0),Math.abs(s=v.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=Mr(v.d),n=r.charAt(0),y++;s=v.e,n>1?(v=new T("0."+r),s++):v=new T(n+"."+r.slice(1))}else return l=ol(T,u+2,R).times(s+""),v=ss(new T(n+"."+r.slice(1)),u-x).plus(l),T.precision=R,t==null?tt(v,R,O,mt=!0):v;for(f=v,c=o=v=Kt(v.minus(1),v.plus(1),u,1),p=tt(v.times(v),u,1),i=3;;){if(o=tt(o.times(p),u,1),l=c.plus(Kt(o,new T(i),u,1)),Mr(l.d).slice(0,u)===Mr(c.d).slice(0,u))if(c=c.times(2),s!==0&&(c=c.plus(ol(T,u+2,R).times(s+""))),c=Kt(c,new T(y),u,1),t==null)if(wa(c.d,u-x,O,a))T.precision=u+=x,l=o=v=Kt(f.minus(1),f.plus(1),u,1),p=tt(v.times(v),u,1),i=a=1;else return tt(c,T.precision=R,O,mt=!0);else return T.precision=R,c;c=l,i+=2}}function Vg(e){return String(e.s*e.s/0)}function xf(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)%ot,r<0&&(n+=ot),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=ot;n<i;)e.d.push(+t.slice(n,n+=ot));t=t.slice(n),n=ot-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),mt&&(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 z9(e,t){var r,n,i,s,o,a,c,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Lg.test(t))return xf(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(B9.test(t))r=16,t=t.toLowerCase();else if(L9.test(t))r=2;else if(U9.test(t))r=8;else throw Error(ns+t);for(s=t.search(/p/i),s>0?(c=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),s=t.indexOf("."),o=s>=0,n=e.constructor,o&&(t=t.replace(".",""),a=t.length,s=a-s,i=Ug(n,new n(r),s,s*2)),l=il(t,r,jn),u=l.length-1,s=u;l[s]===0;--s)l.pop();return s<0?new n(e.s*0):(e.e=sl(l,u),e.d=l,mt=!1,o&&(e=Kt(e,i,a*4)),c&&(e=e.times(Math.abs(c)<54?_r(2,c):xa.pow(2,c))),mt=!0,e)}function q9(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:xo(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/al(5,r)),t=xo(e,2,t,t);for(var i,s=new e(5),o=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(s.plus(i.times(o.times(i).minus(a))));return t}function xo(e,t,r,n,i){var s,o,a,c,l=e.precision,u=Math.ceil(l/ot);for(mt=!1,c=r.times(r),a=new e(n);;){if(o=Kt(a.times(c),new e(t++*t++),l,1),a=i?n.plus(o):n.minus(o),n=Kt(o.times(c),new e(t++*t++),l,1),o=a.plus(n),o.d[u]!==void 0){for(s=u;o.d[s]===a.d[s]&&s--;);if(s==-1)break}s=a,a=n,n=o,o=s}return mt=!0,o.d.length=u+1,o}function al(e,t){for(var r=e;--t;)r*=e;return r}function zg(e,t){var r,n=t.s<0,i=Nn(e,e.precision,1),s=i.times(.5);if(t=t.abs(),t.lte(s))return Ii=n?4:1,t;if(r=t.divToInt(i),r.isZero())Ii=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(s))return Ii=Fg(r)?n?2:3:n?4:1,t;Ii=Fg(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Sf(e,t,r,n){var i,s,o,a,c,l,u,f,p,y=e.constructor,x=r!==void 0;if(x?(Jr(r,1,rs),n===void 0?n=y.rounding:Jr(n,0,8)):(r=y.precision,n=y.rounding),!e.isFinite())u=Vg(e);else{for(u=ni(e),o=u.indexOf("."),x?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,o>=0&&(u=u.replace(".",""),p=new y(1),p.e=u.length-o,p.d=il(ni(p),10,i),p.e=p.d.length),f=il(u,10,i),s=c=f.length;f[--c]==0;)f.pop();if(!f[0])u=x?"0p+0":"0";else{if(o<0?s--:(e=new y(e),e.d=f,e.e=s,e=Kt(e,p,r,n,0,i),f=e.d,s=e.e,l=jg),o=f[r],a=i/2,l=l||f[r+1]!==void 0,l=n<4?(o!==void 0||l)&&(n===0||n===(e.s<0?3:2)):o>a||o===a&&(n===4||l||n===6&&f[r-1]&1||n===(e.s<0?8:7)),f.length=r,l)for(;++f[--r]>i-1;)f[r]=0,r||(++s,f.unshift(1));for(c=f.length;!f[c-1];--c);for(o=0,u="";o<c;o++)u+=vf.charAt(f[o]);if(x){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)u+="0";for(f=il(u,i,t),c=f.length;!f[c-1];--c);for(o=1,u="1.";o<c;o++)u+=vf.charAt(f[o])}else u=u.charAt(0)+"."+u.slice(1);u=u+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)u="0"+u;u="0."+u}else if(++s>c)for(s-=c;s--;)u+="0";else s<c&&(u=u.slice(0,s)+"."+u.slice(s))}u=(t==16?"0x":t==2?"0b":t==8?"0o":"")+u}return e.s<0?"-"+u:u}function qg(e,t){if(e.length>t)return e.length=t,!0}function H9(e){return new this(e).abs()}function W9(e){return new this(e).acos()}function G9(e){return new this(e).acosh()}function K9(e,t){return new this(e).plus(t)}function Y9(e){return new this(e).asin()}function J9(e){return new this(e).asinh()}function X9(e){return new this(e).atan()}function Z9(e){return new this(e).atanh()}function Q9(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,s=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Nn(this,s,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Nn(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Nn(this,s,1).times(.5),r.s=e.s):t.s<0?(this.precision=s,this.rounding=1,r=this.atan(Kt(e,t,s,1)),t=Nn(this,s,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(Kt(e,t,s,1)),r}function e_(e){return new this(e).cbrt()}function t_(e){return tt(e=new this(e),e.e+1,2)}function r_(e,t,r){return new this(e).clamp(t,r)}function n_(e){if(!e||typeof e!="object")throw Error(nl+"Object expected");var t,r,n,i=e.defaults===!0,s=["precision",1,rs,"rounding",0,8,"toExpNeg",-wo,0,"toExpPos",0,wo,"maxE",0,wo,"minE",-wo,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(r=s[t],i&&(this[r]=bf[r]),(n=e[r])!==void 0)if(Lr(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(ns+r+": "+n);if(r="crypto",i&&(this[r]=bf[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(kg);else this[r]=!1;else throw Error(ns+r+": "+n);return this}function i_(e){return new this(e).cos()}function s_(e){return new this(e).cosh()}function Hg(e){var t,r,n;function i(s){var o,a,c,l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,Wg(s)){l.s=s.s,mt?!s.d||s.e>i.maxE?(l.e=NaN,l.d=null):s.e<i.minE?(l.e=0,l.d=[0]):(l.e=s.e,l.d=s.d.slice()):(l.e=s.e,l.d=s.d?s.d.slice():s.d);return}if(c=typeof s,c==="number"){if(s===0){l.s=1/s<0?-1:1,l.e=0,l.d=[0];return}if(s<0?(s=-s,l.s=-1):l.s=1,s===~~s&&s<1e7){for(o=0,a=s;a>=10;a/=10)o++;mt?o>i.maxE?(l.e=NaN,l.d=null):o<i.minE?(l.e=0,l.d=[0]):(l.e=o,l.d=[s]):(l.e=o,l.d=[s]);return}else if(s*0!==0){s||(l.s=NaN),l.e=NaN,l.d=null;return}return xf(l,s.toString())}else if(c!=="string")throw Error(ns+s);return(a=s.charCodeAt(0))===45?(s=s.slice(1),l.s=-1):(a===43&&(s=s.slice(1)),l.s=1),Lg.test(s)?xf(l,s):z9(l,s)}if(i.prototype=Me,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=n_,i.clone=Hg,i.isDecimal=Wg,i.abs=H9,i.acos=W9,i.acosh=G9,i.add=K9,i.asin=Y9,i.asinh=J9,i.atan=X9,i.atanh=Z9,i.atan2=Q9,i.cbrt=e_,i.ceil=t_,i.clamp=r_,i.cos=i_,i.cosh=s_,i.div=o_,i.exp=a_,i.floor=c_,i.hypot=l_,i.ln=u_,i.log=d_,i.log10=h_,i.log2=f_,i.max=p_,i.min=m_,i.mod=g_,i.mul=v_,i.pow=b_,i.random=y_,i.round=w_,i.sign=x_,i.sin=S_,i.sinh=__,i.sqrt=E_,i.sub=C_,i.sum=A_,i.tan=T_,i.tanh=M_,i.trunc=I_,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 o_(e,t){return new this(e).div(t)}function a_(e){return new this(e).exp()}function c_(e){return tt(e=new this(e),e.e+1,3)}function l_(){var e,t,r=new this(0);for(mt=!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 mt=!0,new this(1/0);r=t}return mt=!0,r.sqrt()}function Wg(e){return e instanceof xa||e&&e.toStringTag===Dg||!1}function u_(e){return new this(e).ln()}function d_(e,t){return new this(e).log(t)}function f_(e){return new this(e).log(2)}function h_(e){return new this(e).log(10)}function p_(){return $g(this,arguments,"lt")}function m_(){return $g(this,arguments,"gt")}function g_(e,t){return new this(e).mod(t)}function v_(e,t){return new this(e).mul(t)}function b_(e,t){return new this(e).pow(t)}function y_(e){var t,r,n,i,s=0,o=new this(1),a=[];if(e===void 0?e=this.precision:Jr(e,1,rs),n=Math.ceil(e/ot),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));s<n;)i=t[s],i>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);s<n;)i=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((t[s+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,s):(a.push(i%1e7),s+=4);s=n/4}else throw Error(kg);else for(;s<n;)a[s++]=Math.random()*1e7|0;for(n=a[--s],e%=ot,n&&e&&(i=_r(10,ot-e),a[s]=(n/i|0)*i);a[s]===0;s--)a.pop();if(s<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=ot)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<ot&&(r-=ot-n)}return o.e=r,o.d=a,o}function w_(e){return tt(e=new this(e),e.e+1,this.rounding)}function x_(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function S_(e){return new this(e).sin()}function __(e){return new this(e).sinh()}function E_(e){return new this(e).sqrt()}function C_(e,t){return new this(e).sub(t)}function A_(){var e=0,t=arguments,r=new this(t[e]);for(mt=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return mt=!0,tt(r,this.precision,this.rounding)}function T_(e){return new this(e).tan()}function M_(e){return new this(e).tanh()}function I_(e){return tt(e=new this(e),e.e+1,1)}Me[Symbol.for("nodejs.util.inspect.custom")]=Me.toString,Me[Symbol.toStringTag]="Decimal";var xa=Me.constructor=Hg(bf);tl=new xa(tl),rl=new xa(rl);var cl=xa,Yt=Fs($s()),_f=Fs($s()),O_=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 _f.default(e).mul(new _f.default(this.slippage)).div(new _f.default("1000000000000000000")).toString()}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];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 f=[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=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::aftermath::${c}`,typeArguments:[l,u,r.extendedDetails.aftermathLpSupplyType],arguments:f})})}},Gg="0x000000000000000000000000000000000000000000000000000000000000dee9",P_=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:Gg,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:`${Gg}::clob_v2::create_account`,typeArguments:[],arguments:[]}),isCreate:!0}})}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=yield this.getOrCreateAccountCap(t,e.client,e.signer),p=[t.object(r.id),n,f.accountCap,t.object(Ft)],y=Ir(e.publishedAtV2(),i),x=t.moveCall({target:`${y}::deepbook::${c}`,typeArguments:[l,u],arguments:p});return f.isCreate&&t.transferObjects([f.accountCap],e.signer),x})}},R_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(r.id),n],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::kriya_amm::${c}`,typeArguments:[l,u],arguments:f})})}},j_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(r.id),n,t.object(this.version),t.object(Ft)],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::kriya_clmm::${c}`,typeArguments:[l,u],arguments:f})})}},N_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.container),n],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::flowx_amm::${c}`,typeArguments:[l,u],arguments:f})})}},k_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.poolRegistry),t.pure.u64(r.feeRate*1e6),n,t.object(this.versioned),t.object(Ft)],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::flowx_clmm::${c}`,typeArguments:[l,u],arguments:f})})}},D_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];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 f=[t.object(r.id),n,t.object(Ft),t.object(this.versioned)],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::turbos::${c}`,typeArguments:[l,u,r.extendedDetails.turbosFeeType],arguments:f})})}},Kg=class{constructor(e,t){this.globalConfig=e===0?"0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f":"0x9774e359588ead122af1c7e7f64e14ade261cfeecdb5d0eb4a5b3b4c8ab8bd3e",this.partner=t??(e===0?"0x639b5e433da31739e800cd085f356e64cae222966d0f1b11bd9dc76b322ff58b":"0x1f5fa5c820f40d43fc47815ad06d95e40a1942ff72a732a92e8ef4aa8cde70a5")}flash_swap(e,t,r,n,i,s){const{direction:o,from:a,target:c}=r,[l,u,f]=o?["flash_swap_a2b",a,c]:["flash_swap_b2a",c,a],p=[t.object(this.globalConfig),t.object(r.id),t.object(this.partner),n,t.pure.bool(i),t.object(Ft)],y=Ir(e.publishedAtV2(),s),x=t.moveCall({target:`${y}::cetus::${l}`,typeArguments:[u,f],arguments:p});return{targetCoin:x[0],flashReceipt:x[1],payAmount:x[2]}}repay_flash_swap(e,t,r,n,i,s){const{direction:o,from:a,target:c}=r,[l,u,f]=o?["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=Ir(e.publishedAtV2(),s);return t.moveCall({target:`${y}::cetus::${l}`,typeArguments:[u,f],arguments:p})[0]}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.globalConfig),t.object(r.id),t.object(this.partner),n,t.object(Ft)],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::cetus::${c}`,typeArguments:[l,u],arguments:f})})}};function Yg(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 Jg(e){return e.split("::")[0]}function cn(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=cn(r),l=j9(R9({},c),{type_arguments:i.map(u=>cn(u).source_address)});return l.type_arguments=l.type_arguments.map(u=>ii.isSuiCoin(u)?u:cn(u).source_address),l.source_address=Yg(l.full_address,l.type_arguments),l}const s=r.split("::"),a={full_address:r,address:r===Zg||r===U_?"0x2":rn(s[0]),module:s[1],name:s[2],type_arguments:[],source_address:""};return a.full_address=`${a.address}::${a.module}::${a.name}`,a.source_address=Yg(a.full_address,a.type_arguments),a}catch{return{full_address:e,address:"",module:"",name:"",type_arguments:[],source_address:e}}}function Xg(e){return cn(e).source_address}var L_="0x2::coin::Coin",B_=/^0x2::coin::Coin<(.+)>$/,Zg="0x2::sui::SUI",U_="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",Qg="0x0000000000000000000000000000000000000005",ii=class xs{static getCoinTypeArg(t){const r=t.type.match(B_);return r?r[1]:null}static isSUI(t){const r=xs.getCoinTypeArg(t);return r?xs.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`${L_}<${t}>`}static getCoinAssets(t,r){const n=[];return r.forEach(i=>{Xg(i.coinAddress)===Xg(t)&&n.push(i)}),n}static isSuiCoin(t){return cn(t).full_address===Zg}static selectCoinObjectIdGreaterThanOrEqual(t,r,n=[]){const i=xs.selectCoinAssetGreaterThanOrEqual(t,r,n),s=i.selectedCoins.map(c=>c.coinObjectId),o=i.remainingCoins,a=i.selectedCoins.map(c=>c.balance.toString());return{objectArray:s,remainCoins:o,amountArray:a}}static selectCoinAssetGreaterThanOrEqual(t,r,n=[]){const i=xs.sortByBalance(t.filter(l=>!n.includes(l.coinObjectId))),s=xs.calculateTotalBalance(i);if(s<r)return{selectedCoins:[],remainingCoins:i};if(s===r)return{selectedCoins:i,remainingCoins:[]};let o=BigInt(0);const a=[],c=[...i];for(;o<s;){const l=r-o,u=c.findIndex(p=>p.balance>=l);if(u!==-1){a.push(c[u]),c.splice(u,1);break}const f=c.pop();f.balance>0&&(a.push(f),o+=f.balance)}return{selectedCoins:xs.sortByBalance(a),remainingCoins:xs.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 Ef(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 os(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 F_(e,t){e=os(e),t=os(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 ev(e,t){return e.moveCall({target:"0x2::coin::zero",typeArguments:[t]})}function Cf(e,t,r,n){const i=ii.getCoinAssets(n,t);if(r===BigInt(0))return ii.isSuiCoin(n)||i.length===0&&!ii.isSuiCoin(n)?{targetCoin:ev(e,n),isMintZeroCoin:!0,targetCoinAmount:0}:{targetCoin:e.object(i[0].coinObjectId),isMintZeroCoin:!1,targetCoinAmount:Number(i[0].balance.toString())};if(ii.calculateTotalBalance(i)<r)throw new AggregateError("Insufficient balance when build merge coin, coinType: "+n,"InsufficientBalance"+n);if(ii.isSuiCoin(n))return{targetCoin:e.splitCoins(e.gas,[e.pure.u64(r.toString())]),isMintZeroCoin:!0,targetCoinAmount:Number(r.toString())};let o=ii.sortByBalance(i);o.slice(0,3).reduce((p,y)=>p+y.balance,BigInt(0))<BigInt(r)&&(o=ii.sortByBalanceDes(i));let c=ii.selectCoinObjectIdGreaterThanOrEqual(o,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 $_(e){return!(!e.startsWith("0x")||e.length!==66)}var So=Fs($s()),as=Fs($s()),Sa=Fs($s()),Oi=new Sa.default(0);new Sa.default(1);var V_=new Sa.default(2);V_.pow(new Sa.default(128));var z_=new Sa.default("18446744073709551615"),bn=1e9;function q_(e,t,r){let n=Oi;return t?n=e.mul(new as.default(bn-r*bn)).div(new as.default(bn)):n=e.mul(new as.default(bn+r*bn)).div(new as.default(bn)),Number(n.toString())}function tv(e,t,r){let n=Oi;return t?n=e.mul(new as.default(bn-r*bn)).div(new as.default(bn)):n=e.mul(new as.default(bn+r*bn)).div(new as.default(bn)),n}function H_(e,t,r){return new cl(e).mul(cl.pow(2,-64)).pow(2).mul(cl.pow(10,t-r))}function W_(e,t,r,n){return ct(this,null,function*(){var i,s,o,a,c;const{from:l,target:u,amount:f,byAmountIn:p,pools:y}=t,x=os(l),v=os(u),_=new es,T=F_(x,v),O=n===0?"0xb2db7142fa83210a7d78d9c12ac49c043b3cbbd482224fea6e3da00aa5a5ae2d":"0x4f920e1ef6318cfba77e20a0538a419a5a504c14230169438b99aba485db40a6",R=T?x:v,F=T?v:x,B=[R,F];for(let I=0;I<y.length;I++){const g=[_.object(y[I]),_.pure.bool(T),_.pure.bool(p),_.pure.u64(f.toString())];_.moveCall({target:`${O}::fetcher_script::calculate_swap_result`,arguments:g,typeArguments:B})}if(!$_(r))throw new AggregateError("Aggregator package not set","InvalidWallet");const H=yield e.devInspectTransactionBlock({transactionBlock:_,sender:r});if(H.error!=null)throw new AggregateError("Aggregator package not set","SimulateError");const $=(i=H.events)==null?void 0:i.filter(I=>I.type.includes("CalculatedSwapResultEvent"));if($.length===0||$.length!==y.length)throw new AggregateError("Simulate event result error","simulateEventError");let Z=p?Oi:z_,ce=0;for(let I=0;I<$.length;I+=1)if(!$[I].parsedJson.data.is_exceed)if(t.byAmountIn){const g=new So.BN($[I].parsedJson.data.amount_out);g.gt(Z)&&(ce=I,Z=g)}else{const g=new So.BN($[I].parsedJson.data.amount_out);g.lt(Z)&&(ce=I,Z=g)}const ne=$[ce].parsedJson.data,de=ne.step_results[0].current_sqrt_price,[q,N]=yield Promise.all([e.getCoinMetadata({coinType:R}).then(I=>I==null?void 0:I.decimals),e.getCoinMetadata({coinType:F}).then(I=>I==null?void 0:I.decimals)]);if(q==null||N==null)throw new AggregateError("Simulate event result error","CannotGetDecimals");const h=H_(de,q,N),d=Number(ne.fee_rate)/1e6,m=new So.BN((s=ne.amount_in)!=null?s:0),S=new So.BN((o=ne.fee_amount)!=null?o:0),E=m.add(S),M={amountIn:E,amountOut:new So.BN((a=ne.amount_out)!=null?a:0),deviationRatio:0,routes:[{path:[{id:y[ce],direction:T,provider:"CETUS",from:x,target:v,feeRate:d,amountIn:ne.amount_in,amountOut:ne.amount_out,extendedDetails:{afterSqrtPrice:ne.after_sqrt_price}}],amountIn:E,amountOut:new So.BN((c=ne.amount_out)!=null?c:0),initialPrice:h}],insufficientLiquidity:!1,byAmountIn:t.byAmountIn};return{isExceed:ne.is_exceed,routeData:M}})}var G_=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:s}=r,o=s?"swap_a2b":"swap_b2a",a=[t.object(r.id),t.object("0x5"),n],c=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${c}::haedal::${o}`,typeArguments:[],arguments:a})})}},K_=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:s}=r;if(!s)throw new Error("Afsui not support b2a swap");const o="swap_a2b",a=[t.object(this.stakedSuiVault),t.object(this.safe),t.object("0x5"),t.object(this.referVault),t.object(this.validator),n],c=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${c}::afsui::${o}`,typeArguments:[],arguments:a})})}},Y_=class{constructor(e){if(e!==0)throw new Error("Volo only supported on mainnet");this.stakePool="0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5",this.metadata="0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s}=r,o=s?"swap_a2b":"swap_b2a",a=[t.object(this.stakePool),t.object(this.metadata),t.object("0x5"),n],c=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${c}::volo::${o}`,typeArguments:[],arguments:a})})}},J_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.dexInfo),n],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::bluemove::${c}`,typeArguments:[l,u],arguments:f})})}},X_=class{constructor(e){this.deepbookV3Config=e===0?"0x699d455ab8c5e02075b4345ea1f91be55bf46064ae6026cc2528e701ce3ac135":"0xe19b5d072346cae83a037d4e3c8492068a74410a74e5830b3a68012db38296aa"}swap(e,t,r,n,i,s){return ct(this,null,function*(){const{direction:o,from:a,target:c}=r,[l,u,f]=o?["swap_a2b_v2",a,c]:["swap_b2a_v2",c,a];let p;s?p=s:p=ev(t,e.deepbookv3DeepFeeType());const y=[t.object(this.deepbookV3Config),t.object(r.id),n,p,t.object(Ft)],x=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${x}::deepbookv3::${l}`,typeArguments:[u,f],arguments:y})})}},Z_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",o,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 f=[t.object(this.version),t.object(this.market),t.object(r.extendedDetails.scallopScoinTreasury),n,t.object(Ft)],p=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${p}::scallop::${c}`,typeArguments:[l,u],arguments:f})})}},rv=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:s,from:o,target:a}=r,[c,l]=s?["swap_a2b",a]:["swap_b2a",o],u=[t.object(r.id),t.object(this.sui_system_state),n],f=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${f}::suilend::${c}`,typeArguments:[l],arguments:u})})}},Q_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.globalConfig),t.object(r.id),n,t.object(Ft)],p=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${p}::bluefin::${c}`,typeArguments:[l,u],arguments:f})})}},eE=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];let f,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");f=r.extendedDetails.haedalPmmBasePriceSeed,p=r.extendedDetails.haedalPmmQuotePriceSeed;const y=this.pythPriceIDs.get(f),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 v=[t.object(r.id),t.object(y),t.object(x),n,t.object(Ft)],_=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${_}::haedalpmm::${c}`,typeArguments:[l,u],arguments:v})})}},tE=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:s,from:o,target:a}=r,[c,l]=s?["swap_a2b",a]:["swap_b2a",o],u=[t.object(r.id),t.object(this.sui_system_state),n],f=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${f}::alphafi::${c}`,typeArguments:[l],arguments:u})})}},rE=class{constructor(e){if(e!==0)throw new Error("Steamm only supported on mainnet");this.steammPublishedAt="0x5ef2a1bca239764c8381ba26b758833060eadb8903682e4fb15e58c6406e2488"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b_v2",o,a]:["swap_b2a_v2",a,o];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 f=[t.object(r.id),t.object(r.extendedDetails.steammBankA),t.object(r.extendedDetails.steammBankB),t.object(r.extendedDetails.steammLendingMarket),n,t.object(Ft)],p=Pi(e.publishedAtV2Extend2(),i),y=t.moveCall({target:`${p}::steamm_cpmm::${c}`,typeArguments:[r.extendedDetails.steammLendingMarketType,l,u,r.extendedDetails.steammBCoinAType,r.extendedDetails.steammBCoinBType,r.extendedDetails.steammLPToken],arguments:f});return nv(t,this.steammPublishedAt,r.extendedDetails.steammBankA,r.extendedDetails.steammLendingMarket,r.extendedDetails.steammLendingMarketType,l,r.extendedDetails.steammBCoinAType),nv(t,this.steammPublishedAt,r.extendedDetails.steammBankB,r.extendedDetails.steammLendingMarket,r.extendedDetails.steammLendingMarketType,u,r.extendedDetails.steammBCoinBType),y})}};function nv(e,t,r,n,i,s,o){if(s==="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"){const a=[e.object(r),e.object(n),e.object(Qg),e.object(Ft)];e.moveCall({target:`${t}::bank::rebalance_sui`,typeArguments:[i,o],arguments:a})}else{const a=[e.object(r),e.object(n),e.object(Ft)];e.moveCall({target:`${t}::bank::rebalance`,typeArguments:[i,s,o],arguments:a})}}var nE=class{constructor(e,t){if(e!==0)throw new Error("Steamm omm only supported on mainnet");this.pythPriceIDs=t,this.oraclePackageId="0xe84b649199654d18c38e727212f5d8dacfc3cf78d60d0a7fc85fd589f280eb2b"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,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]=s?["swap_a2b_v2",o,a]:["swap_b2a_v2",a,o],f=r.extendedDetails.steammOraclePythPriceSeedA,p=r.extendedDetails.steammOraclePythPriceSeedB,y=this.pythPriceIDs.get(f),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 v=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(Ft)]}),_=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(Ft)]}),T=[t.object(r.id),t.object(r.extendedDetails.steammBankA),t.object(r.extendedDetails.steammBankB),t.object(r.extendedDetails.steammLendingMarket),v,_,n,t.object(Ft)],O=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${O}::steamm_omm::${c}`,typeArguments:[r.extendedDetails.steammLendingMarketType,l,u,r.extendedDetails.steammBCoinAType,r.extendedDetails.steammBCoinBType,r.extendedDetails.steammLPToken],arguments:T})})}},iE="0x790f258062909e3a0ffc78b3c53ac2f62d7084c3bab95644bdeb05add7250001::super_sui::SUPER_SUI",sE="0xe44df51c0b21a27ab915fa1fe2ca610cd3eaa6d9666fe5e62b988bf7f0bd8722::musd::MUSD",oE="0xccd628c2334c5ed33e6c47d6c21bb664f8b6307b2ac32c2462a61f69a31ebcee::meth::METH",aE=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:s,from:o,target:a}=r,[c,l,u,f]=s?["swap_a2b","create_deposit_cap",o,a]:["swap_b2a","create_withdraw_cap",a,o];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 v=[f];r.extendedDetails.metastableCreateCapAllTypeParams&&v.push(u);const _=[t.object(x),t.object(r.id)];switch(f){case iE:{if(!r.extendedDetails.metastableRegistryId)throw new Error("Not found registry id for super sui");_.push(t.object(r.extendedDetails.metastableRegistryId));break}case sE:{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);_.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);_.push(t.object(B))}_.push(t.object(Ft));break}case oE:{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);_.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);_.push(t.object(B))}_.push(t.object(Ft));break}default:throw new Error("Invalid Metacoin: "+f)}const T=t.moveCall({target:`${p}::${y}::${l}`,typeArguments:v,arguments:_}),O=[t.object(r.id),t.object(this.versionID),T,n],R=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${R}::metastable::${c}`,typeArguments:[u,f],arguments:O})})}},cE=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];let f,p,y,x;if(r.extendedDetails==null)throw new Error("Extended details not supported in obric");if(r.extendedDetails.obricCoinAPriceSeed&&r.extendedDetails.obricCoinBPriceSeed)f=r.extendedDetails.obricCoinAPriceSeed,y=this.pythPriceIDs.get(f),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 v=[t.object(r.id),n,t.object(this.pythStateObjectId),t.object(y),t.object(x),t.object(Ft)],_=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${_}::obric::${c}`,typeArguments:[l,u],arguments:v})})}},lE=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:s}=r,o=s?"swap_a2b":"swap_b2a",a=[t.object(this.staking),t.object(r.id),n,t.object(this.validator)],c=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${c}::hawal::${o}`,typeArguments:[],arguments:a})})}},uE=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(r.id),n,t.object(this.version),t.object(Ft)],p=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${p}::momentum::${c}`,typeArguments:[l,u],arguments:f})})}},dE=class{constructor(e,t){if(e!==0)throw new Error("Steamm omm v2 only supported on mainnet");this.pythPriceIDs=t,this.oraclePackageId="0xe84b649199654d18c38e727212f5d8dacfc3cf78d60d0a7fc85fd589f280eb2b",this.steammPublishedAt="0x5ef2a1bca239764c8381ba26b758833060eadb8903682e4fb15e58c6406e2488"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,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]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=r.extendedDetails.steammOraclePythPriceSeedA,p=r.extendedDetails.steammOraclePythPriceSeedB,y=this.pythPriceIDs.get(f),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 v=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(Ft)]}),_=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(Ft)]}),T=[t.object(r.id),t.object(r.extendedDetails.steammBankA),t.object(r.extendedDetails.steammBankB),t.object(r.extendedDetails.steammLendingMarket),v,_,n,t.object(Ft)],O=Pi(e.publishedAtV2Extend2(),i),R=t.moveCall({target:`${O}::steamm_omm_v2::${c}`,typeArguments:[r.extendedDetails.steammLendingMarketType,l,u,r.extendedDetails.steammBCoinAType,r.extendedDetails.steammBCoinBType,r.extendedDetails.steammLPToken],arguments:T});return iv(t,this.steammPublishedAt,r.extendedDetails.steammBankA,r.extendedDetails.steammLendingMarket,r.extendedDetails.steammLendingMarketType,l,r.extendedDetails.steammBCoinAType),iv(t,this.steammPublishedAt,r.extendedDetails.steammBankB,r.extendedDetails.steammLendingMarket,r.extendedDetails.steammLendingMarketType,u,r.extendedDetails.steammBCoinBType),R})}};function iv(e,t,r,n,i,s,o){if(s==="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"){const a=[e.object(r),e.object(n),e.object(Qg),e.object(Ft)];e.moveCall({target:`${t}::bank::rebalance_sui`,typeArguments:[i,o],arguments:a})}else{const a=[e.object(r),e.object(n),e.object(Ft)];e.moveCall({target:`${t}::bank::rebalance`,typeArguments:[i,s,o],arguments:a})}}var fE=class{constructor(e){if(e!==0)throw new Error("Magma CLMM only supported on mainnet");this.globalConfig="0x4c4e1402401f72c7d8533d0ed8d5f8949da363c7a3319ccef261ffe153d32f8a"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.globalConfig),t.object(r.id),n,t.object(Ft)],p=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${p}::magma::${c}`,typeArguments:[l,u],arguments:f})})}},hE=class{constructor(e,t){if(e===1)throw new Error("Sevenk is not supported on testnet");this.pythPriceIDs=t,this.oraclePublishedAt="0x8c36ea167c5e6da8c3d60b4fc897416105dcb986471bd81cfbfd38720a4487c0"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];let f,p,y,x,v;if(r.extendedDetails==null)throw new Error("Extended details not supported haedal pmm");if(!r.extendedDetails.sevenkCoinAPriceSeed||!r.extendedDetails.sevenkCoinBPriceSeed||!r.extendedDetails.sevenkCoinAOracleId||!r.extendedDetails.sevenkCoinBOracleId||!r.extendedDetails.sevenkLPCapType)throw new Error("Base price seed or quote price seed not supported");f=r.extendedDetails.sevenkCoinAPriceSeed,p=r.extendedDetails.sevenkCoinBPriceSeed,y=r.extendedDetails.sevenkCoinAOracleId,x=r.extendedDetails.sevenkCoinBOracleId,v=r.extendedDetails.sevenkLPCapType;const _=this.pythPriceIDs.get(f),T=this.pythPriceIDs.get(p);if(!_||!T)throw new Error("Base price info object id or quote price info object id not found");const O=t.moveCall({target:`${this.oraclePublishedAt}::oracle::new_holder`,typeArguments:[],arguments:[]});t.moveCall({target:`${this.oraclePublishedAt}::pyth::get_price`,typeArguments:[],arguments:[t.object(y),O,t.object(_),t.object(Ft)]}),t.moveCall({target:`${this.oraclePublishedAt}::pyth::get_price`,typeArguments:[],arguments:[t.object(x),O,t.object(T),t.object(Ft)]});const R=[t.object(r.id),O,n],F=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${F}::sevenk::${c}`,typeArguments:[l,u,v],arguments:R})})}},pE=class{constructor(e,t){if(e===1)throw new Error("HaedalHMMV2 is not supported on testnet");this.pythPriceIDs=t}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];let f;if(r.extendedDetails==null)throw new Error("Extended details not supported haedal pmm");if(!r.extendedDetails.haedalHmmV2BasePriceSeed)throw new Error("Base price seed not supported");f=r.extendedDetails.haedalHmmV2BasePriceSeed;const p=this.pythPriceIDs.get(f);if(!p)throw new Error("Base price info object id not found");const y=[t.object(r.id),t.object(p),n,t.object(Ft)],x=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${x}::haedal_hmm_v2::${c}`,typeArguments:[l,u],arguments:y})})}},mE=class{constructor(e){this.globalConfig="0xe93baa80cb570b3a494cbf0621b2ba96bc993926d34dc92508c9446f9a05d615",this.rewarder="0xfb971d3a2fb98bde74e1c30ba15a3d8bef60a02789e59ae0b91660aeed3e64e1",this.stats="0x6822a33d1d971e040c32f7cc74507010d1fe786f7d06ab89135083ddb07d2dc2",this.price_provider="0x854b2d2c0381bb656ec962f8b443eb082654384cf97885359d1956c7d76e33c9"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.globalConfig),t.object(this.rewarder),t.object(r.id),n,t.object(this.stats),t.object(this.price_provider),t.object(Ft)],p=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${p}::fullsail::${c}`,typeArguments:[l,u],arguments:f})})}},sv="CETUS",gE="DEEPBOOK",vE="KRIYA",bE="FLOWX",yE="FLOWXV3",wE="KRIYAV3",ov="TURBOS",Af="AFTERMATH",xE="HAEDAL",SE="VOLO",_E="AFSUI",EE="BLUEMOVE",av="DEEPBOOKV3",cv="SCALLOP",CE="SUILEND",AE="BLUEFIN",Tf="HAEDALPMM",TE="ALPHAFI",ME="SPRINGSUI",lv="STEAMM",Mf="METASTABLE",If="OBRIC",IE="HAWAL",Of="STEAMM_OMM",OE="MOMENTUM",Pf="STEAMM_OMM_V2",PE="MAGMA",Rf="SEVENK",jf="HAEDALHMMV2",RE="FULLSAIL",jE="https://api-sui.cetus.zone/router_v2";function Nf(e){return Array.isArray(e.routers)}function kf(e){return Array.isArray(e.routers)}var uv=class i4{constructor(t){var r,n;this.endpoint=t.endpoint?BE(t.endpoint):jE,this.client=t.client||new js({url:zh("mainnet")}),this.signer=t.signer||"",this.env=t.env||0,this.allCoins=new Map;const i=i4.CONFIG[this.env];if(this.pythConnections=this.newPythClients((r=t.pythUrls)!=null?r:[]),this.pythClient=new ud.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 ud.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 o=this.allCoins.get(t);if(o)return o}const s=[];for(;;)try{const o=yield this.client.getCoins({owner:this.signer,coinType:t,cursor:n,limit:i});for(const a of o.data)s.push({coinAddress:cn(a.coinType).source_address,coinObjectId:a.coinObjectId,balance:BigInt(a.balance)});if(!o.hasNextPage)break;n=o.nextCursor}catch(o){console.error("getCoins error:",o);break}return this.allCoins.set(t,s),s})}findRouters(t){return ct(this,null,function*(){return UE(this.endpoint,this.apiKey,t,this.overlayFeeRate,this.overlayFeeReceiver)})}executeFlexibleInputSwap(t,r,n,i,s,o,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,f=[];for(let v=0;v<n.length-1;v++){if(n[v].path.length===0)throw new Error("Empty path");let T=t.splitCoins(r,[n[v].amountIn.toString()])[0];for(const O of n[v].path)T=yield this.newDex(O.provider,o,a).swap(this,t,O,T,l,c);f.push(T)}if(n[n.length-1].path.length===0)throw new Error("Empty path");let p=r;for(const v of n[n.length-1].path)p=yield this.newDex(v.provider,o,a).swap(this,t,v,p,l,c);f.push(p);const y=kn(this.publishedAtV2Extend(),l);return this.checkCoinThresholdAndMergeCoin(t,f,u,i,s,y)})}expectInputSwap(t,r,n,i,s,o,a,c,l){return ct(this,null,function*(){if(n.length===0)throw new Error("No router found");const u=n.map(O=>O.amountIn.toString()),f=n[0].path[0].from,p=n[0].path[n[0].path.length-1].target,y=t.splitCoins(r,u),x=[];for(let O=0;O<n.length;O++){if(n[O].path.length===0)throw new Error("Empty path");let R=y[O];for(const F of n[O].path)R=yield this.newDex(F.provider,o,a).swap(this,t,F,R,l,c);x.push(R)}const v=Ir(this.publishedAtV2(),l),_=kn(this.publishedAtV2Extend(),l);return this.transferOrDestoryCoin(t,r,f,v),this.checkCoinThresholdAndMergeCoin(t,x,p,i,s,_)})}expectOutputSwap(t,r,n,i,s){return ct(this,null,function*(){const o=[],a=[],c=[],l=new Kg(this.env,i),u=Ir(this.publishedAtV2(),s);for(let p=0;p<n.length;p++){const y=n[p];let x=t.pure.u64(y.amountOut.toString());for(let _=y.path.length-1;_>=0;_--){const T=y.path[_],O=l.flash_swap(this,t,T,x,!1);x=O.payAmount,o.unshift(O.targetCoin),a.unshift(O.flashReceipt)}let v=r;for(let _=0;_<y.path.length;_++){const T=y.path[_],O=l.repay_flash_swap(this,t,T,v,a[_]);v=o[_],_===0?r=O:this.transferOrDestoryCoin(t,O,T.from,u),_===y.path.length-1&&c.push(v)}}const f=n[0].path[0].from;if(this.transferOrDestoryCoin(t,r,f,u),c.length>1){const p=t.makeMoveVec({elements:c.slice(1)});t.moveCall({target:`${ua}::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 W_(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:s,deepbookv3DeepFee:o,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=Nf(t)?t.byAmountIn:t.routers.byAmountIn,u=c.reduce((H,$)=>H.add($.amountIn),new Yt.default(0)),f=c.reduce((H,$)=>H.add($.amountOut),new Yt.default(0));let p=new Yt.default(0);this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(l?p=f.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)):p=u.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)));const y=l?f.sub(p):f,x=l?u:u.add(p),v=tv(l?y:x,l,i),_=Nf(t)?void 0:t.routers.packages,T=Ir(this.publishedAtV2(),_),O=fv(c),R=O.length>0?yield this.updatePythPriceIDs(O,s):new Map;if(l)return yield this.expectInputSwap(s,n,c,f.toString(),v.toString(),R,a??this.partner,o,_);if(this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"){const H=s.splitCoins(n,[p.toString()]);s.transferObjects([H],this.overlayFeeReceiver)}const F=s.splitCoins(n,[v.sub(p).toString()]);return this.transferOrDestoryCoin(s,n,c[0].path[0].from,T),yield this.expectOutputSwap(s,F[0],c,a??this.partner)})}fixableRouterSwap(t){return ct(this,null,function*(){const{routers:r,inputCoin:n,slippage:i,txb:s,deepbookv3DeepFee:o,partner:a}=t,c=Array.isArray(r)?r:r.routes,l=t.routers.byAmountIn,u=c.reduce((F,B)=>F.add(B.amountIn),new Yt.default(0)),f=c.reduce((F,B)=>F.add(B.amountOut),new Yt.default(0));let p=0;this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(l?p=Number(f.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)).toString()):p=Number(u.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)).toString()));const y=l?f.sub(new Yt.default(p)):f,x=l?u:u.add(new Yt.default(p)),v=tv(l?y:x,l,i),_=Nf(t)?void 0:t.routers.packages,T=fv(c),O=T.length>0?yield this.updatePythPriceIDs(T,s):new Map;return l?yield this.executeFlexibleInputSwap(s,n,c,y.toString(),v.toString(),O,a??this.partner,o,_):yield this.expectOutputSwap(s,n,c,a??this.partner)})}fastRouterSwap(t){return ct(this,null,function*(){const{routers:r,slippage:n,txb:i,partner:s,refreshAllCoins:o,payDeepFeeAmount:a}=t,c=Array.isArray(r)?r:r.routes,l=c[0].path[0].from;let u=yield this.getCoins(l,o);const f=c[0].path[c[0].path.length-1].target,p=c.reduce((Z,ce)=>Z.add(ce.amountIn),new Yt.default(0)),y=c.reduce((Z,ce)=>Z.add(ce.amountOut),new Yt.default(0)),x=kf(t)?t.byAmountIn:t.routers.byAmountIn;let v=0;this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(x?v=Number(y.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)).toString()):v=Number(p.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)).toString()));const _=x?y.sub(new Yt.default(v)):y,T=x?p:p.add(new Yt.default(v)),O=q_(x?_:T,x,n),F=Cf(i,u,BigInt((x?T:O).toString()),l);let B;if(a&&a>0){let Z=yield this.getCoins(this.deepbookv3DeepFeeType());B=Cf(i,Z,BigInt(a),this.deepbookv3DeepFeeType()).targetCoin}const H=kf(t)?{routers:c,inputCoin:F.targetCoin,slippage:n,byAmountIn:x,txb:i,partner:s??this.partner,deepbookv3DeepFee:B}:{routers:t.routers,inputCoin:F.targetCoin,slippage:n,byAmountIn:x,txb:i,partner:s??this.partner,deepbookv3DeepFee:B},$=yield this.routerSwap(H);if(ii.isSuiCoin(f))i.mergeCoins(i.gas,[$]);else{let Z=yield this.getCoins(f,o);const ce=Cf(i,Z,BigInt(0),f),ne=kf(t)?void 0:t.routers.packages,de=Ir(this.publishedAtV2(),ne);i.mergeCoins(ce.targetCoin,[$]),ce.isMintZeroCoin&&this.transferOrDestoryCoin(i,ce.targetCoin,f,de)}})}publishedAtV2(){return this.env===0?"0x8ae871505a80d8bf6bf9c05906cda6edfeea460c85bebe2e26a4313f5e67874a":"0x52eae33adeb44de55cfb3f281d4cc9e02d976181c0952f5323648b5717b33934"}publishedAtV2Extend(){return this.env===0?"0xb39d6dddedd16ed8a40ce0b1e6b43c92acf0ff3fa2fac081fb82ef1b915c17b4":"0xabb6a81c8a216828e317719e06125de5bb2cb0fe8f9916ff8c023ca5be224c78"}publishedAtV2Extend2(){return this.env===0?"0x88142be0f2c6b0150980109a7386220b4c040a5c4d9a16d5f7dd0bbd0135ba12":"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,s,o){let a=r[0];if(r.length>1){let c=t.makeMoveVec({elements:r.slice(1)});t.moveCall({target:`${ua}::pay::join_vec`,typeArguments:[n],arguments:[r[0],c]}),a=r[0]}return this.overlayFeeRate===0||this.overlayFeeReceiver==="0x0"?t.moveCall({target:`${o}::utils::check_coin_threshold_v1`,typeArguments:[n],arguments:[a,t.pure.u64(i),t.pure.u64(s)]}):t.moveCall({target:`${o}::utils::check_coin_threshold_v2`,typeArguments:[n],arguments:[a,t.pure.u64(i),t.pure.u64(s),t.pure.u64(this.overlayFeeRate),t.pure.address(this.overlayFeeReceiver)]}),a}newDex(t,r,n){switch(t){case sv:return new Kg(this.env,n);case gE:return new P_(this.env);case av:return new X_(this.env);case vE:return new R_(this.env);case wE:return new j_(this.env);case bE:return new N_(this.env);case yE:return new k_(this.env);case ov:return new D_(this.env);case Af:return new O_(this.env);case xE:return new G_(this.env);case _E:return new K_(this.env);case SE:return new Y_(this.env);case EE:return new J_(this.env);case cv:return new Z_(this.env);case CE:return new rv(this.env);case ME:return new rv(this.env);case AE:return new Q_(this.env);case Tf:return new eE(this.env,r);case TE:return new tE(this.env);case lv:return new rE(this.env);case Of:return new nE(this.env,r);case Mf:return new aE(this.env,r);case If:return new cE(this.env,r);case IE:return new lE(this.env);case OE:return new uE(this.env);case Pf:return new dE(this.env,r);case PE:return new fE(this.env);case Rf:return new hE(this.env,r);case jf:return new pE(this.env,r);case RE:return new mE(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 VE(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 s=[];try{s=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 o=new Map;for(let a=0;a<t.length;a++)o.set(t[a],s[a]);return o})}};uv.CONFIG={1:{wormholeStateId:"0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790",pythStateId:"0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c"},0:{wormholeStateId:"0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c",pythStateId:"0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8"}};var dv=uv;function fv(e){const t=new Set;for(const r of e)for(const n of r.path)n.provider===Tf&&n.extendedDetails&&n.extendedDetails.haedalPmmBasePriceSeed&&n.extendedDetails.haedalPmmQuotePriceSeed&&(t.add(n.extendedDetails.haedalPmmBasePriceSeed),t.add(n.extendedDetails.haedalPmmQuotePriceSeed)),n.provider===Mf&&(n.extendedDetails&&n.extendedDetails.metastablePriceSeed&&t.add(n.extendedDetails.metastablePriceSeed),n.extendedDetails&&n.extendedDetails.metastableETHPriceSeed&&t.add(n.extendedDetails.metastableETHPriceSeed)),n.provider===If&&(n.extendedDetails&&n.extendedDetails.obricCoinAPriceSeed&&t.add(n.extendedDetails.obricCoinAPriceSeed),n.extendedDetails&&n.extendedDetails.obricCoinBPriceSeed&&t.add(n.extendedDetails.obricCoinBPriceSeed)),(n.provider===Of||n.provider===Pf)&&(n.extendedDetails&&n.extendedDetails.steammOraclePythPriceSeedA&&t.add(n.extendedDetails.steammOraclePythPriceSeedA),n.extendedDetails&&n.extendedDetails.steammOraclePythPriceSeedB&&t.add(n.extendedDetails.steammOraclePythPriceSeedB)),n.provider===Rf&&(n.extendedDetails&&n.extendedDetails.sevenkCoinAPriceSeed&&t.add(n.extendedDetails.sevenkCoinAPriceSeed),n.extendedDetails&&n.extendedDetails.sevenkCoinBPriceSeed&&t.add(n.extendedDetails.sevenkCoinBPriceSeed)),n.provider===jf&&n.extendedDetails&&n.extendedDetails.haedalHmmV2BasePriceSeed&&t.add(n.extendedDetails.haedalHmmV2BasePriceSeed);return Array.from(t)}function NE(e,t){let r=0;for(const s of e.routes)for(const o of s.path)o.extended_details&&o.extended_details.deepbookv3_deep_fee&&(r+=Number(o.extended_details.deepbookv3_deep_fee));let n;if(e.packages!=null){n=new Map;for(const[s,o]of Object.entries(e.packages))n.set(s,o)}return{amountIn:new Yt.default(e.amount_in.toString()),amountOut:new Yt.default(e.amount_out.toString()),deviationRatio:e.deviation_ratio?Number(e.deviation_ratio):void 0,byAmountIn:t,insufficientLiquidity:!1,routes:e.routes.map(s=>({path:s.path.map(o=>{var a,c,l,u,f,p,y,x,v,_,T,O,R,F,B,H,$,Z,ce,ne,de,q,N,h,d,m,S,E,M,j,I,g,b,k,ve,he;let we;o.provider===Af&&(we=o.extended_details.aftermath_pool_flatness===0?"v2":"v3");let Oe;return(o.provider===ov||o.provider===Af||o.provider===sv||o.provider===av||o.provider===cv||o.provider===Tf||o.provider===Mf||o.provider===If||o.provider===lv||o.provider===Of||o.provider===Pf||o.provider===Rf||o.provider===jf)&&(Oe={aftermathLpSupplyType:(a=o.extended_details)==null?void 0:a.aftermath_lp_supply_type,turbosFeeType:(c=o.extended_details)==null?void 0:c.turbos_fee_type,afterSqrtPrice:(l=o.extended_details)==null?void 0:l.after_sqrt_price,deepbookv3DeepFee:(u=o.extended_details)==null?void 0:u.deepbookv3_deep_fee,scallopScoinTreasury:(f=o.extended_details)==null?void 0:f.scallop_scoin_treasury,haedalPmmBasePriceSeed:(p=o.extended_details)==null?void 0:p.haedal_pmm_base_price_seed,haedalPmmQuotePriceSeed:(y=o.extended_details)==null?void 0:y.haedal_pmm_quote_price_seed,steammBankA:(x=o.extended_details)==null?void 0:x.steamm_bank_a,steammBankB:(v=o.extended_details)==null?void 0:v.steamm_bank_b,steammLendingMarket:(_=o.extended_details)==null?void 0:_.steamm_lending_market,steammLendingMarketType:(T=o.extended_details)==null?void 0:T.steamm_lending_market_type,steammBCoinAType:(O=o.extended_details)==null?void 0:O.steamm_btoken_a_type,steammBCoinBType:(R=o.extended_details)==null?void 0:R.steamm_btoken_b_type,steammLPToken:(F=o.extended_details)==null?void 0:F.steamm_lp_token_type,steammOracleRegistryId:(B=o.extended_details)==null?void 0:B.steamm_oracle_registry_id,steammOracleIndexA:(H=o.extended_details)==null?void 0:H.steamm_oracle_index_a,steammOracleIndexB:($=o.extended_details)==null?void 0:$.steamm_oracle_index_b,steammOraclePythPriceSeedA:(Z=o.extended_details)==null?void 0:Z.steamm_oracle_pyth_price_seed_a,steammOraclePythPriceSeedB:(ce=o.extended_details)==null?void 0:ce.steamm_oracle_pyth_price_seed_b,metastablePriceSeed:(ne=o.extended_details)==null?void 0:ne.metastable_price_seed,metastableETHPriceSeed:(de=o.extended_details)==null?void 0:de.metastable_eth_price_seed,metastableWhitelistedAppId:(q=o.extended_details)==null?void 0:q.metastable_whitelisted_app_id,metastableCreateCapPkgId:(N=o.extended_details)==null?void 0:N.metastable_create_cap_pkg_id,metastableCreateCapModule:(h=o.extended_details)==null?void 0:h.metastable_create_cap_module,metastableCreateCapAllTypeParams:(d=o.extended_details)==null?void 0:d.metastable_create_cap_all_type_params,metastableRegistryId:(m=o.extended_details)==null?void 0:m.metastable_registry_id,obricCoinAPriceSeed:(S=o.extended_details)==null?void 0:S.obric_coin_a_price_seed,obricCoinBPriceSeed:(E=o.extended_details)==null?void 0:E.obric_coin_b_price_seed,obricCoinAPriceId:(M=o.extended_details)==null?void 0:M.obric_coin_a_price_id,obricCoinBPriceId:(j=o.extended_details)==null?void 0:j.obric_coin_b_price_id,sevenkCoinAPriceSeed:(I=o.extended_details)==null?void 0:I.sevenk_coin_a_price_seed,sevenkCoinBPriceSeed:(g=o.extended_details)==null?void 0:g.sevenk_coin_b_price_seed,sevenkCoinAOracleId:(b=o.extended_details)==null?void 0:b.sevenk_oracle_config_a,sevenkCoinBOracleId:(k=o.extended_details)==null?void 0:k.sevenk_oracle_config_b,sevenkLPCapType:(ve=o.extended_details)==null?void 0:ve.sevenk_lp_cap_type,haedalHmmV2BasePriceSeed:(he=o.extended_details)==null?void 0:he.haedalhmmv2_base_price_seed}),{id:o.id,direction:o.direction,provider:o.provider,from:o.from,target:o.target,feeRate:o.fee_rate,amountIn:o.amount_in,amountOut:o.amount_out,extendedDetails:Oe,version:we}}),amountIn:new Yt.default(s.amount_in.toString()),amountOut:new Yt.default(s.amount_out.toString()),initialPrice:new cl(s.initial_price.toString())})),totalDeepFee:r,packages:n}}var Ft=Zp,kE="aggregator_v2",DE="aggregator_v2_extend",LE="aggregator_v2_extend2";function Ir(e,t){var r;return t instanceof Map&&(r=t.get(kE))!=null?r:e}function kn(e,t){var r;return t instanceof Map&&(r=t.get(DE))!=null?r:e}function Pi(e,t){var r;return t instanceof Map&&(r=t.get(LE))!=null?r:e}Fs($s());function BE(e){return e.endsWith("/find_routes")?e.replace("/find_routes",""):e}var ll=Fs($s()),hv=1001600;function UE(e,t,r,n,i){return ct(this,null,function*(){let s;if(r.liquidityChanges&&r.liquidityChanges.length>0?s=yield $E(e,r):s=yield FE(e,t,r),!s)return null;if(!s.ok){let c=10001;return s.status===429&&(c=10005),{amountIn:Oi,amountOut:Oi,routes:[],byAmountIn:r.byAmountIn,insufficientLiquidity:!1,deviationRatio:0,error:{code:c,msg:Ef(c)}}}const o=C9.parse(yield s.text()),a=o.msg==="liquidity is not enough";if(o.msg&&o.msg.indexOf("HoneyPot scam")>-1)return{amountIn:Oi,amountOut:Oi,routes:[],byAmountIn:r.byAmountIn,insufficientLiquidity:a,deviationRatio:0,error:{code:10004,msg:Ef(10004)}};if(o.data!=null){const c=NE(o.data,r.byAmountIn);if(n>0&&i!=="0x0")if(r.byAmountIn){const l=c.amountOut.mul(new ll.default(n)).div(new ll.default(1e6));c.overlayFee=Number(l.toString()),c.amountOut=c.amountOut.sub(l)}else{const l=c.amountIn.mul(new ll.default(n)).div(new ll.default(1e6));c.overlayFee=Number(l.toString()),c.amountIn=c.amountIn.add(l)}return c}return{amountIn:Oi,amountOut:Oi,routes:[],insufficientLiquidity:a,byAmountIn:r.byAmountIn,deviationRatio:0,error:{code:10003,msg:Ef(10003)}}})}function FE(e,t,r){return ct(this,null,function*(){try{const{from:n,target:i,amount:s,byAmountIn:o,depth:a,splitAlgorithm:c,splitFactor:l,splitCount:u,providers:f}=r,p=os(n),y=os(i);let x=`${e}/find_routes?from=${p}&target=${y}&amount=${s.toString()}&by_amount_in=${o}`;return a&&(x+=`&depth=${a}`),c&&(x+=`&split_algorithm=${c}`),l&&(x+=`&split_factor=${l}`),u&&(x+=`&split_count=${u}`),f&&f.length>0&&(x+=`&providers=${f.join(",")}`),t.length>0&&(x+=`&apiKey=${t}`),x+=`&v=${hv}`,yield fetch(x)}catch(n){return console.error(n),null}})}function $E(e,t){return ct(this,null,function*(){const{from:r,target:n,amount:i,byAmountIn:s,depth:o,splitAlgorithm:a,splitFactor:c,splitCount:l,providers:u,liquidityChanges:f}=t,p=os(r),y=os(n),x=`${e}/find_routes`,v=u==null?void 0:u.join(","),_={from:p,target:y,amount:Number(i.toString()),by_amount_in:s,depth:o,split_algorithm:a,split_factor:c,split_count:l,providers:v,liquidity_changes:f.map(T=>({pool:T.poolID,tick_lower:T.ticklower,tick_upper:T.tickUpper,delta_liquidity:T.deltaLiquidity})),v:hv};try{return yield fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)})}catch(T){return console.error("Error:",T),null}})}function VE(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 Df=(e=>(e[e.Mainnet=0]="Mainnet",e[e.Testnet=1]="Testnet",e))(Df||{});const pv="0x2::sui::SUI",zE="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";function mv(e){return dr(e).full_address===pv}function gv(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 dr(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={...dr(r),type_arguments:i.map(u=>dr(u).source_address)};return l.type_arguments=l.type_arguments.map(u=>mv(u)?u:dr(u).source_address),l.source_address=gv(l.full_address,l.type_arguments),l}const s=r.split("::"),a={full_address:r,address:r===pv||r===zE?"0x2":rn(s[0]),module:s[1],name:s[2],type_arguments:[],source_address:""};return a.full_address=`${a.address}::${a.module}::${a.name}`,a.source_address=gv(a.full_address,a.type_arguments),a}catch{return{full_address:e,address:"",module:"",name:"",type_arguments:[],source_address:e}}}function qE(e){return e.startsWith("0x")?`${e.slice(2)}`:e}const Ri=(e,t=!0)=>{const r=e.split("::"),n=r.shift();let i=rn(n);return t&&(i=qE(i)),`${i}::${r.join("::")}`};/*!
|
|
40
|
+
`+_+"}":"{"+T.join(",")+"}",i=_,x}}typeof r.stringify!="function"&&(r.stringify=function(u,f,p){var y;if(i="",s="",typeof p=="number")for(y=0;y<p;y+=1)s+=" ";else typeof p=="string"&&(s=p);if(a=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return l("",{"":u})})})()})(Sg);var b9=Sg.exports,el=null;const y9=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,w9=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;var x9=function(e){var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(e!=null){if(e.strict===!0&&(t.strict=!0),e.storeAsString===!0&&(t.storeAsString=!0),t.alwaysParseAsBig=e.alwaysParseAsBig===!0?e.alwaysParseAsBig:!1,t.useNativeBigInt=e.useNativeBigInt===!0?e.useNativeBigInt:!1,typeof e.constructorAction<"u")if(e.constructorAction==="error"||e.constructorAction==="ignore"||e.constructorAction==="preserve")t.constructorAction=e.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);if(typeof e.protoAction<"u")if(e.protoAction==="error"||e.protoAction==="ignore"||e.protoAction==="preserve")t.protoAction=e.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`)}var r,n,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
41
|
+
`,r:"\r",t:" "},s,o=function(v){throw{name:"SyntaxError",message:v,at:r,text:s}},a=function(v){return v&&v!==n&&o("Expected '"+v+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},c=function(){var v,_="";for(n==="-"&&(_="-",a("-"));n>="0"&&n<="9";)_+=n,a();if(n===".")for(_+=".";a()&&n>="0"&&n<="9";)_+=n;if(n==="e"||n==="E")for(_+=n,a(),(n==="-"||n==="+")&&(_+=n,a());n>="0"&&n<="9";)_+=n,a();if(v=+_,!isFinite(v))o("Bad number");else return el==null&&(el=Eg),_.length>15?t.storeAsString?_:t.useNativeBigInt?BigInt(_):new el(_):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(v):new el(v):v},l=function(){var v,_,T="",O;if(n==='"')for(var R=r;a();){if(n==='"')return r-1>R&&(T+=s.substring(R,r-1)),a(),T;if(n==="\\"){if(r-1>R&&(T+=s.substring(R,r-1)),a(),n==="u"){for(O=0,_=0;_<4&&(v=parseInt(a(),16),!!isFinite(v));_+=1)O=O*16+v;T+=String.fromCharCode(O)}else if(typeof i[n]=="string")T+=i[n];else break;R=r}}o("Bad string")},u=function(){for(;n&&n<=" ";)a()},f=function(){switch(n){case"t":return a("t"),a("r"),a("u"),a("e"),!0;case"f":return a("f"),a("a"),a("l"),a("s"),a("e"),!1;case"n":return a("n"),a("u"),a("l"),a("l"),null}o("Unexpected '"+n+"'")},p,y=function(){var v=[];if(n==="["){if(a("["),u(),n==="]")return a("]"),v;for(;n;){if(v.push(p()),u(),n==="]")return a("]"),v;a(","),u()}}o("Bad array")},x=function(){var v,_=Object.create(null);if(n==="{"){if(a("{"),u(),n==="}")return a("}"),_;for(;n;){if(v=l(),u(),a(":"),t.strict===!0&&Object.hasOwnProperty.call(_,v)&&o('Duplicate key "'+v+'"'),y9.test(v)===!0?t.protoAction==="error"?o("Object contains forbidden prototype property"):t.protoAction==="ignore"?p():_[v]=p():w9.test(v)===!0?t.constructorAction==="error"?o("Object contains forbidden constructor property"):t.constructorAction==="ignore"?p():_[v]=p():_[v]=p(),u(),n==="}")return a("}"),_;a(","),u()}}o("Bad object")};return p=function(){switch(u(),n){case"{":return x();case"[":return y();case'"':return l();case"-":return c();default:return n>="0"&&n<="9"?c():f()}},function(v,_){var T;return s=v+"",r=0,n=" ",T=p(),u(),n&&o("Syntax error"),typeof _=="function"?function O(R,F){var B,H=R[F];return H&&typeof H=="object"&&Object.keys(H).forEach(function($){B=O(H,$),B!==void 0?H[$]=B:delete H[$]}),_.call(R,F,H)}({"":T},""):T}},S9=x9,Cg=b9.stringify,Ag=S9;Qc.exports=function(e){return{parse:Ag(e),stringify:Cg}},Qc.exports.parse=Ag(),Qc.exports.stringify=Cg;var _9=Qc.exports;const E9=io(_9);var C9=Object.create,mf=Object.defineProperty,A9=Object.defineProperties,T9=Object.getOwnPropertyDescriptor,M9=Object.getOwnPropertyDescriptors,Tg=Object.getOwnPropertyNames,Mg=Object.getOwnPropertySymbols,I9=Object.getPrototypeOf,Ig=Object.prototype.hasOwnProperty,O9=Object.prototype.propertyIsEnumerable,Og=(e,t,r)=>t in e?mf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P9=(e,t)=>{for(var r in t||(t={}))Ig.call(t,r)&&Og(e,r,t[r]);if(Mg)for(var r of Mg(t))O9.call(t,r)&&Og(e,r,t[r]);return e},R9=(e,t)=>A9(e,M9(t)),j9=(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')}),N9=(e,t)=>function(){return t||(0,e[Tg(e)[0]])((t={exports:{}}).exports,t),t.exports},k9=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Tg(t))!Ig.call(e,i)&&i!==r&&mf(e,i,{get:()=>t[i],enumerable:!(n=T9(t,i))||n.enumerable});return e},$s=(e,t,r)=>(r=e!=null?C9(I9(e)):{},k9(!e||!e.__esModule?mf(r,"default",{value:e,enumerable:!0}):r,e)),ct=(e,t,r)=>new Promise((n,i)=>{var s=c=>{try{a(r.next(c))}catch(l){i(l)}},o=c=>{try{a(r.throw(c))}catch(l){i(l)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(s,o);a((r=r.apply(e,t)).next())}),Vs=N9({"node_modules/bn.js/lib/bn.js"(e,t){(function(r,n){function i(h,d){if(!h)throw new Error(d||"Assertion failed")}function s(h,d){h.super_=d;var m=function(){};m.prototype=d.prototype,h.prototype=new m,h.prototype.constructor=h}function o(h,d,m){if(o.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((d==="le"||d==="be")&&(m=d,d=10),this._init(h||0,d||10,m||"be"))}typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=j9("buffer").Buffer}catch{}o.isBN=function(d){return d instanceof o?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===o.wordSize&&Array.isArray(d.words)},o.max=function(d,m){return d.cmp(m)>0?d:m},o.min=function(d,m){return d.cmp(m)<0?d:m},o.prototype._init=function(d,m,S){if(typeof d=="number")return this._initNumber(d,m,S);if(typeof d=="object")return this._initArray(d,m,S);m==="hex"&&(m=16),i(m===(m|0)&&m>=2&&m<=36),d=d.toString().replace(/\s+/g,"");var E=0;d[0]==="-"&&(E++,this.negative=1),E<d.length&&(m===16?this._parseHex(d,E,S):(this._parseBase(d,m,E),S==="le"&&this._initArray(this.toArray(),m,S)))},o.prototype._initNumber=function(d,m,S){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(i(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),S==="le"&&this._initArray(this.toArray(),m,S)},o.prototype._initArray=function(d,m,S){if(i(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var M,j,I=0;if(S==="be")for(E=d.length-1,M=0;E>=0;E-=3)j=d[E]|d[E-1]<<8|d[E-2]<<16,this.words[M]|=j<<I&67108863,this.words[M+1]=j>>>26-I&67108863,I+=24,I>=26&&(I-=26,M++);else if(S==="le")for(E=0,M=0;E<d.length;E+=3)j=d[E]|d[E+1]<<8|d[E+2]<<16,this.words[M]|=j<<I&67108863,this.words[M+1]=j>>>26-I&67108863,I+=24,I>=26&&(I-=26,M++);return this._strip()};function c(h,d){var m=h.charCodeAt(d);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,d,m){var S=c(h,m);return m-1>=d&&(S|=c(h,m-1)<<4),S}o.prototype._parseHex=function(d,m,S){this.length=Math.ceil((d.length-m)/6),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var M=0,j=0,I;if(S==="be")for(E=d.length-1;E>=m;E-=2)I=l(d,m,E)<<M,this.words[j]|=I&67108863,M>=18?(M-=18,j+=1,this.words[j]|=I>>>26):M+=8;else{var g=d.length-m;for(E=g%2===0?m+1:m;E<d.length;E+=2)I=l(d,m,E)<<M,this.words[j]|=I&67108863,M>=18?(M-=18,j+=1,this.words[j]|=I>>>26):M+=8}this._strip()};function u(h,d,m,S){for(var E=0,M=0,j=Math.min(h.length,m),I=d;I<j;I++){var g=h.charCodeAt(I)-48;E*=S,g>=49?M=g-49+10:g>=17?M=g-17+10:M=g,i(g>=0&&M<S,"Invalid character"),E+=M}return E}o.prototype._parseBase=function(d,m,S){this.words=[0],this.length=1;for(var E=0,M=1;M<=67108863;M*=m)E++;E--,M=M/m|0;for(var j=d.length-S,I=j%E,g=Math.min(j,j-I)+S,b=0,k=S;k<g;k+=E)b=u(d,k,k+E,m),this.imuln(M),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b);if(I!==0){var ve=1;for(b=u(d,k,d.length,m),k=0;k<I;k++)ve*=m;this.imuln(ve),this.words[0]+b<67108864?this.words[0]+=b:this._iaddn(b)}this._strip()},o.prototype.copy=function(d){d.words=new Array(this.length);for(var m=0;m<this.length;m++)d.words[m]=this.words[m];d.length=this.length,d.negative=this.negative,d.red=this.red};function f(h,d){h.words=d.words,h.length=d.length,h.negative=d.negative,h.red=d.red}if(o.prototype._move=function(d){f(d,this)},o.prototype.clone=function(){var d=new o(null);return this.copy(d),d},o.prototype._expand=function(d){for(;this.length<d;)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")]=p}catch{o.prototype.inspect=p}else o.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],v=[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(d,m){d=d||10,m=m|0||1;var S;if(d===16||d==="hex"){S="";for(var E=0,M=0,j=0;j<this.length;j++){var I=this.words[j],g=((I<<E|M)&16777215).toString(16);M=I>>>24-E&16777215,E+=2,E>=26&&(E-=26,j--),M!==0||j!==this.length-1?S=y[6-g.length]+g+S:S=g+S}for(M!==0&&(S=M.toString(16)+S);S.length%m!==0;)S="0"+S;return this.negative!==0&&(S="-"+S),S}if(d===(d|0)&&d>=2&&d<=36){var b=x[d],k=v[d];S="";var ve=this.clone();for(ve.negative=0;!ve.isZero();){var he=ve.modrn(k).toString(d);ve=ve.idivn(k),ve.isZero()?S=he+S:S=y[b-he.length]+he+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")},o.prototype.toNumber=function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(d,m){return this.toArrayLike(a,d,m)}),o.prototype.toArray=function(d,m){return this.toArrayLike(Array,d,m)};var _=function(d,m){return d.allocUnsafe?d.allocUnsafe(m):new d(m)};o.prototype.toArrayLike=function(d,m,S){this._strip();var E=this.byteLength(),M=S||Math.max(1,E);i(E<=M,"byte array longer than desired length"),i(M>0,"Requested array length <= 0");var j=_(d,M),I=m==="le"?"LE":"BE";return this["_toArrayLike"+I](j,E),j},o.prototype._toArrayLikeLE=function(d,m){for(var S=0,E=0,M=0,j=0;M<this.length;M++){var I=this.words[M]<<j|E;d[S++]=I&255,S<d.length&&(d[S++]=I>>8&255),S<d.length&&(d[S++]=I>>16&255),j===6?(S<d.length&&(d[S++]=I>>24&255),E=0,j=0):(E=I>>>24,j+=2)}if(S<d.length)for(d[S++]=E;S<d.length;)d[S++]=0},o.prototype._toArrayLikeBE=function(d,m){for(var S=d.length-1,E=0,M=0,j=0;M<this.length;M++){var I=this.words[M]<<j|E;d[S--]=I&255,S>=0&&(d[S--]=I>>8&255),S>=0&&(d[S--]=I>>16&255),j===6?(S>=0&&(d[S--]=I>>24&255),E=0,j=0):(E=I>>>24,j+=2)}if(S>=0)for(d[S--]=E;S>=0;)d[S--]=0},Math.clz32?o.prototype._countBits=function(d){return 32-Math.clz32(d)}:o.prototype._countBits=function(d){var m=d,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},o.prototype._zeroBits=function(d){if(d===0)return 26;var m=d,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},o.prototype.bitLength=function(){var d=this.words[this.length-1],m=this._countBits(d);return(this.length-1)*26+m};function T(h){for(var d=new Array(h.bitLength()),m=0;m<d.length;m++){var S=m/26|0,E=m%26;d[m]=h.words[S]>>>E&1}return d}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var d=0,m=0;m<this.length;m++){var S=this._zeroBits(this.words[m]);if(d+=S,S!==26)break}return d},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},o.prototype.fromTwos=function(d){return this.testn(d-1)?this.notn(d).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(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var m=0;m<d.length;m++)this.words[m]=this.words[m]|d.words[m];return this._strip()},o.prototype.ior=function(d){return i((this.negative|d.negative)===0),this.iuor(d)},o.prototype.or=function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},o.prototype.uor=function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},o.prototype.iuand=function(d){var m;this.length>d.length?m=d:m=this;for(var S=0;S<m.length;S++)this.words[S]=this.words[S]&d.words[S];return this.length=m.length,this._strip()},o.prototype.iand=function(d){return i((this.negative|d.negative)===0),this.iuand(d)},o.prototype.and=function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},o.prototype.uand=function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},o.prototype.iuxor=function(d){var m,S;this.length>d.length?(m=this,S=d):(m=d,S=this);for(var E=0;E<S.length;E++)this.words[E]=m.words[E]^S.words[E];if(this!==m)for(;E<m.length;E++)this.words[E]=m.words[E];return this.length=m.length,this._strip()},o.prototype.ixor=function(d){return i((this.negative|d.negative)===0),this.iuxor(d)},o.prototype.xor=function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},o.prototype.uxor=function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},o.prototype.inotn=function(d){i(typeof d=="number"&&d>=0);var m=Math.ceil(d/26)|0,S=d%26;this._expand(m),S>0&&m--;for(var E=0;E<m;E++)this.words[E]=~this.words[E]&67108863;return S>0&&(this.words[E]=~this.words[E]&67108863>>26-S),this._strip()},o.prototype.notn=function(d){return this.clone().inotn(d)},o.prototype.setn=function(d,m){i(typeof d=="number"&&d>=0);var S=d/26|0,E=d%26;return this._expand(S+1),m?this.words[S]=this.words[S]|1<<E:this.words[S]=this.words[S]&~(1<<E),this._strip()},o.prototype.iadd=function(d){var m;if(this.negative!==0&&d.negative===0)return this.negative=0,m=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,m=this.isub(d),d.negative=1,m._normSign();var S,E;this.length>d.length?(S=this,E=d):(S=d,E=this);for(var M=0,j=0;j<E.length;j++)m=(S.words[j]|0)+(E.words[j]|0)+M,this.words[j]=m&67108863,M=m>>>26;for(;M!==0&&j<S.length;j++)m=(S.words[j]|0)+M,this.words[j]=m&67108863,M=m>>>26;if(this.length=S.length,M!==0)this.words[this.length]=M,this.length++;else if(S!==this)for(;j<S.length;j++)this.words[j]=S.words[j];return this},o.prototype.add=function(d){var m;return d.negative!==0&&this.negative===0?(d.negative=0,m=this.sub(d),d.negative^=1,m):d.negative===0&&this.negative!==0?(this.negative=0,m=d.sub(this),this.negative=1,m):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},o.prototype.isub=function(d){if(d.negative!==0){d.negative=0;var m=this.iadd(d);return d.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var S=this.cmp(d);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,M;S>0?(E=this,M=d):(E=d,M=this);for(var j=0,I=0;I<M.length;I++)m=(E.words[I]|0)-(M.words[I]|0)+j,j=m>>26,this.words[I]=m&67108863;for(;j!==0&&I<E.length;I++)m=(E.words[I]|0)+j,j=m>>26,this.words[I]=m&67108863;if(j===0&&I<E.length&&E!==this)for(;I<E.length;I++)this.words[I]=E.words[I];return this.length=Math.max(this.length,I),E!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(d){return this.clone().isub(d)};function O(h,d,m){m.negative=d.negative^h.negative;var S=h.length+d.length|0;m.length=S,S=S-1|0;var E=h.words[0]|0,M=d.words[0]|0,j=E*M,I=j&67108863,g=j/67108864|0;m.words[0]=I;for(var b=1;b<S;b++){for(var k=g>>>26,ve=g&67108863,he=Math.min(b,d.length-1),we=Math.max(0,b-h.length+1);we<=he;we++){var Oe=b-we|0;E=h.words[Oe]|0,M=d.words[we]|0,j=E*M+ve,k+=j/67108864|0,ve=j&67108863}m.words[b]=ve|0,g=k|0}return g!==0?m.words[b]=g|0:m.length--,m._strip()}var R=function(d,m,S){var E=d.words,M=m.words,j=S.words,I=0,g,b,k,ve=E[0]|0,he=ve&8191,we=ve>>>13,Oe=E[1]|0,je=Oe&8191,L=Oe>>>13,z=E[2]|0,G=z&8191,re=z>>>13,ee=E[3]|0,Q=ee&8191,fe=ee>>>13,W=E[4]|0,K=W&8191,te=W>>>13,oe=E[5]|0,pe=oe&8191,Se=oe>>>13,_e=E[6]|0,Ne=_e&8191,He=_e>>>13,Ge=E[7]|0,Re=Ge&8191,Ke=Ge>>>13,nt=E[8]|0,Qe=nt&8191,Mt=nt>>>13,jt=E[9]|0,Xe=jt&8191,St=jt>>>13,vt=M[0]|0,Ye=vt&8191,it=vt>>>13,Nt=M[1]|0,ft=Nt&8191,It=Nt>>>13,Pt=M[2]|0,st=Pt&8191,_t=Pt>>>13,kt=M[3]|0,pt=kt&8191,Ot=kt>>>13,qt=M[4]|0,D=qt&8191,C=qt>>>13,A=M[5]|0,V=A&8191,se=A>>>13,me=M[6]|0,be=me&8191,We=me>>>13,ut=M[7]|0,qe=ut&8191,J=ut>>>13,ye=M[8]|0,Ce=ye&8191,Ve=ye>>>13,et=M[9]|0,ze=et&8191,Je=et>>>13;S.negative=d.negative^m.negative,S.length=19,g=Math.imul(he,Ye),b=Math.imul(he,it),b=b+Math.imul(we,Ye)|0,k=Math.imul(we,it);var bt=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(bt>>>26)|0,bt&=67108863,g=Math.imul(je,Ye),b=Math.imul(je,it),b=b+Math.imul(L,Ye)|0,k=Math.imul(L,it),g=g+Math.imul(he,ft)|0,b=b+Math.imul(he,It)|0,b=b+Math.imul(we,ft)|0,k=k+Math.imul(we,It)|0;var rr=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(rr>>>26)|0,rr&=67108863,g=Math.imul(G,Ye),b=Math.imul(G,it),b=b+Math.imul(re,Ye)|0,k=Math.imul(re,it),g=g+Math.imul(je,ft)|0,b=b+Math.imul(je,It)|0,b=b+Math.imul(L,ft)|0,k=k+Math.imul(L,It)|0,g=g+Math.imul(he,st)|0,b=b+Math.imul(he,_t)|0,b=b+Math.imul(we,st)|0,k=k+Math.imul(we,_t)|0;var Bt=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,g=Math.imul(Q,Ye),b=Math.imul(Q,it),b=b+Math.imul(fe,Ye)|0,k=Math.imul(fe,it),g=g+Math.imul(G,ft)|0,b=b+Math.imul(G,It)|0,b=b+Math.imul(re,ft)|0,k=k+Math.imul(re,It)|0,g=g+Math.imul(je,st)|0,b=b+Math.imul(je,_t)|0,b=b+Math.imul(L,st)|0,k=k+Math.imul(L,_t)|0,g=g+Math.imul(he,pt)|0,b=b+Math.imul(he,Ot)|0,b=b+Math.imul(we,pt)|0,k=k+Math.imul(we,Ot)|0;var Vt=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,g=Math.imul(K,Ye),b=Math.imul(K,it),b=b+Math.imul(te,Ye)|0,k=Math.imul(te,it),g=g+Math.imul(Q,ft)|0,b=b+Math.imul(Q,It)|0,b=b+Math.imul(fe,ft)|0,k=k+Math.imul(fe,It)|0,g=g+Math.imul(G,st)|0,b=b+Math.imul(G,_t)|0,b=b+Math.imul(re,st)|0,k=k+Math.imul(re,_t)|0,g=g+Math.imul(je,pt)|0,b=b+Math.imul(je,Ot)|0,b=b+Math.imul(L,pt)|0,k=k+Math.imul(L,Ot)|0,g=g+Math.imul(he,D)|0,b=b+Math.imul(he,C)|0,b=b+Math.imul(we,D)|0,k=k+Math.imul(we,C)|0;var fr=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(fr>>>26)|0,fr&=67108863,g=Math.imul(pe,Ye),b=Math.imul(pe,it),b=b+Math.imul(Se,Ye)|0,k=Math.imul(Se,it),g=g+Math.imul(K,ft)|0,b=b+Math.imul(K,It)|0,b=b+Math.imul(te,ft)|0,k=k+Math.imul(te,It)|0,g=g+Math.imul(Q,st)|0,b=b+Math.imul(Q,_t)|0,b=b+Math.imul(fe,st)|0,k=k+Math.imul(fe,_t)|0,g=g+Math.imul(G,pt)|0,b=b+Math.imul(G,Ot)|0,b=b+Math.imul(re,pt)|0,k=k+Math.imul(re,Ot)|0,g=g+Math.imul(je,D)|0,b=b+Math.imul(je,C)|0,b=b+Math.imul(L,D)|0,k=k+Math.imul(L,C)|0,g=g+Math.imul(he,V)|0,b=b+Math.imul(he,se)|0,b=b+Math.imul(we,V)|0,k=k+Math.imul(we,se)|0;var Nr=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,g=Math.imul(Ne,Ye),b=Math.imul(Ne,it),b=b+Math.imul(He,Ye)|0,k=Math.imul(He,it),g=g+Math.imul(pe,ft)|0,b=b+Math.imul(pe,It)|0,b=b+Math.imul(Se,ft)|0,k=k+Math.imul(Se,It)|0,g=g+Math.imul(K,st)|0,b=b+Math.imul(K,_t)|0,b=b+Math.imul(te,st)|0,k=k+Math.imul(te,_t)|0,g=g+Math.imul(Q,pt)|0,b=b+Math.imul(Q,Ot)|0,b=b+Math.imul(fe,pt)|0,k=k+Math.imul(fe,Ot)|0,g=g+Math.imul(G,D)|0,b=b+Math.imul(G,C)|0,b=b+Math.imul(re,D)|0,k=k+Math.imul(re,C)|0,g=g+Math.imul(je,V)|0,b=b+Math.imul(je,se)|0,b=b+Math.imul(L,V)|0,k=k+Math.imul(L,se)|0,g=g+Math.imul(he,be)|0,b=b+Math.imul(he,We)|0,b=b+Math.imul(we,be)|0,k=k+Math.imul(we,We)|0;var mr=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(mr>>>26)|0,mr&=67108863,g=Math.imul(Re,Ye),b=Math.imul(Re,it),b=b+Math.imul(Ke,Ye)|0,k=Math.imul(Ke,it),g=g+Math.imul(Ne,ft)|0,b=b+Math.imul(Ne,It)|0,b=b+Math.imul(He,ft)|0,k=k+Math.imul(He,It)|0,g=g+Math.imul(pe,st)|0,b=b+Math.imul(pe,_t)|0,b=b+Math.imul(Se,st)|0,k=k+Math.imul(Se,_t)|0,g=g+Math.imul(K,pt)|0,b=b+Math.imul(K,Ot)|0,b=b+Math.imul(te,pt)|0,k=k+Math.imul(te,Ot)|0,g=g+Math.imul(Q,D)|0,b=b+Math.imul(Q,C)|0,b=b+Math.imul(fe,D)|0,k=k+Math.imul(fe,C)|0,g=g+Math.imul(G,V)|0,b=b+Math.imul(G,se)|0,b=b+Math.imul(re,V)|0,k=k+Math.imul(re,se)|0,g=g+Math.imul(je,be)|0,b=b+Math.imul(je,We)|0,b=b+Math.imul(L,be)|0,k=k+Math.imul(L,We)|0,g=g+Math.imul(he,qe)|0,b=b+Math.imul(he,J)|0,b=b+Math.imul(we,qe)|0,k=k+Math.imul(we,J)|0;var nr=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(nr>>>26)|0,nr&=67108863,g=Math.imul(Qe,Ye),b=Math.imul(Qe,it),b=b+Math.imul(Mt,Ye)|0,k=Math.imul(Mt,it),g=g+Math.imul(Re,ft)|0,b=b+Math.imul(Re,It)|0,b=b+Math.imul(Ke,ft)|0,k=k+Math.imul(Ke,It)|0,g=g+Math.imul(Ne,st)|0,b=b+Math.imul(Ne,_t)|0,b=b+Math.imul(He,st)|0,k=k+Math.imul(He,_t)|0,g=g+Math.imul(pe,pt)|0,b=b+Math.imul(pe,Ot)|0,b=b+Math.imul(Se,pt)|0,k=k+Math.imul(Se,Ot)|0,g=g+Math.imul(K,D)|0,b=b+Math.imul(K,C)|0,b=b+Math.imul(te,D)|0,k=k+Math.imul(te,C)|0,g=g+Math.imul(Q,V)|0,b=b+Math.imul(Q,se)|0,b=b+Math.imul(fe,V)|0,k=k+Math.imul(fe,se)|0,g=g+Math.imul(G,be)|0,b=b+Math.imul(G,We)|0,b=b+Math.imul(re,be)|0,k=k+Math.imul(re,We)|0,g=g+Math.imul(je,qe)|0,b=b+Math.imul(je,J)|0,b=b+Math.imul(L,qe)|0,k=k+Math.imul(L,J)|0,g=g+Math.imul(he,Ce)|0,b=b+Math.imul(he,Ve)|0,b=b+Math.imul(we,Ce)|0,k=k+Math.imul(we,Ve)|0;var Ar=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,g=Math.imul(Xe,Ye),b=Math.imul(Xe,it),b=b+Math.imul(St,Ye)|0,k=Math.imul(St,it),g=g+Math.imul(Qe,ft)|0,b=b+Math.imul(Qe,It)|0,b=b+Math.imul(Mt,ft)|0,k=k+Math.imul(Mt,It)|0,g=g+Math.imul(Re,st)|0,b=b+Math.imul(Re,_t)|0,b=b+Math.imul(Ke,st)|0,k=k+Math.imul(Ke,_t)|0,g=g+Math.imul(Ne,pt)|0,b=b+Math.imul(Ne,Ot)|0,b=b+Math.imul(He,pt)|0,k=k+Math.imul(He,Ot)|0,g=g+Math.imul(pe,D)|0,b=b+Math.imul(pe,C)|0,b=b+Math.imul(Se,D)|0,k=k+Math.imul(Se,C)|0,g=g+Math.imul(K,V)|0,b=b+Math.imul(K,se)|0,b=b+Math.imul(te,V)|0,k=k+Math.imul(te,se)|0,g=g+Math.imul(Q,be)|0,b=b+Math.imul(Q,We)|0,b=b+Math.imul(fe,be)|0,k=k+Math.imul(fe,We)|0,g=g+Math.imul(G,qe)|0,b=b+Math.imul(G,J)|0,b=b+Math.imul(re,qe)|0,k=k+Math.imul(re,J)|0,g=g+Math.imul(je,Ce)|0,b=b+Math.imul(je,Ve)|0,b=b+Math.imul(L,Ce)|0,k=k+Math.imul(L,Ve)|0,g=g+Math.imul(he,ze)|0,b=b+Math.imul(he,Je)|0,b=b+Math.imul(we,ze)|0,k=k+Math.imul(we,Je)|0;var Fn=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Fn>>>26)|0,Fn&=67108863,g=Math.imul(Xe,ft),b=Math.imul(Xe,It),b=b+Math.imul(St,ft)|0,k=Math.imul(St,It),g=g+Math.imul(Qe,st)|0,b=b+Math.imul(Qe,_t)|0,b=b+Math.imul(Mt,st)|0,k=k+Math.imul(Mt,_t)|0,g=g+Math.imul(Re,pt)|0,b=b+Math.imul(Re,Ot)|0,b=b+Math.imul(Ke,pt)|0,k=k+Math.imul(Ke,Ot)|0,g=g+Math.imul(Ne,D)|0,b=b+Math.imul(Ne,C)|0,b=b+Math.imul(He,D)|0,k=k+Math.imul(He,C)|0,g=g+Math.imul(pe,V)|0,b=b+Math.imul(pe,se)|0,b=b+Math.imul(Se,V)|0,k=k+Math.imul(Se,se)|0,g=g+Math.imul(K,be)|0,b=b+Math.imul(K,We)|0,b=b+Math.imul(te,be)|0,k=k+Math.imul(te,We)|0,g=g+Math.imul(Q,qe)|0,b=b+Math.imul(Q,J)|0,b=b+Math.imul(fe,qe)|0,k=k+Math.imul(fe,J)|0,g=g+Math.imul(G,Ce)|0,b=b+Math.imul(G,Ve)|0,b=b+Math.imul(re,Ce)|0,k=k+Math.imul(re,Ve)|0,g=g+Math.imul(je,ze)|0,b=b+Math.imul(je,Je)|0,b=b+Math.imul(L,ze)|0,k=k+Math.imul(L,Je)|0;var tn=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(tn>>>26)|0,tn&=67108863,g=Math.imul(Xe,st),b=Math.imul(Xe,_t),b=b+Math.imul(St,st)|0,k=Math.imul(St,_t),g=g+Math.imul(Qe,pt)|0,b=b+Math.imul(Qe,Ot)|0,b=b+Math.imul(Mt,pt)|0,k=k+Math.imul(Mt,Ot)|0,g=g+Math.imul(Re,D)|0,b=b+Math.imul(Re,C)|0,b=b+Math.imul(Ke,D)|0,k=k+Math.imul(Ke,C)|0,g=g+Math.imul(Ne,V)|0,b=b+Math.imul(Ne,se)|0,b=b+Math.imul(He,V)|0,k=k+Math.imul(He,se)|0,g=g+Math.imul(pe,be)|0,b=b+Math.imul(pe,We)|0,b=b+Math.imul(Se,be)|0,k=k+Math.imul(Se,We)|0,g=g+Math.imul(K,qe)|0,b=b+Math.imul(K,J)|0,b=b+Math.imul(te,qe)|0,k=k+Math.imul(te,J)|0,g=g+Math.imul(Q,Ce)|0,b=b+Math.imul(Q,Ve)|0,b=b+Math.imul(fe,Ce)|0,k=k+Math.imul(fe,Ve)|0,g=g+Math.imul(G,ze)|0,b=b+Math.imul(G,Je)|0,b=b+Math.imul(re,ze)|0,k=k+Math.imul(re,Je)|0;var $n=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+($n>>>26)|0,$n&=67108863,g=Math.imul(Xe,pt),b=Math.imul(Xe,Ot),b=b+Math.imul(St,pt)|0,k=Math.imul(St,Ot),g=g+Math.imul(Qe,D)|0,b=b+Math.imul(Qe,C)|0,b=b+Math.imul(Mt,D)|0,k=k+Math.imul(Mt,C)|0,g=g+Math.imul(Re,V)|0,b=b+Math.imul(Re,se)|0,b=b+Math.imul(Ke,V)|0,k=k+Math.imul(Ke,se)|0,g=g+Math.imul(Ne,be)|0,b=b+Math.imul(Ne,We)|0,b=b+Math.imul(He,be)|0,k=k+Math.imul(He,We)|0,g=g+Math.imul(pe,qe)|0,b=b+Math.imul(pe,J)|0,b=b+Math.imul(Se,qe)|0,k=k+Math.imul(Se,J)|0,g=g+Math.imul(K,Ce)|0,b=b+Math.imul(K,Ve)|0,b=b+Math.imul(te,Ce)|0,k=k+Math.imul(te,Ve)|0,g=g+Math.imul(Q,ze)|0,b=b+Math.imul(Q,Je)|0,b=b+Math.imul(fe,ze)|0,k=k+Math.imul(fe,Je)|0;var qi=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(qi>>>26)|0,qi&=67108863,g=Math.imul(Xe,D),b=Math.imul(Xe,C),b=b+Math.imul(St,D)|0,k=Math.imul(St,C),g=g+Math.imul(Qe,V)|0,b=b+Math.imul(Qe,se)|0,b=b+Math.imul(Mt,V)|0,k=k+Math.imul(Mt,se)|0,g=g+Math.imul(Re,be)|0,b=b+Math.imul(Re,We)|0,b=b+Math.imul(Ke,be)|0,k=k+Math.imul(Ke,We)|0,g=g+Math.imul(Ne,qe)|0,b=b+Math.imul(Ne,J)|0,b=b+Math.imul(He,qe)|0,k=k+Math.imul(He,J)|0,g=g+Math.imul(pe,Ce)|0,b=b+Math.imul(pe,Ve)|0,b=b+Math.imul(Se,Ce)|0,k=k+Math.imul(Se,Ve)|0,g=g+Math.imul(K,ze)|0,b=b+Math.imul(K,Je)|0,b=b+Math.imul(te,ze)|0,k=k+Math.imul(te,Je)|0;var Hi=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Hi>>>26)|0,Hi&=67108863,g=Math.imul(Xe,V),b=Math.imul(Xe,se),b=b+Math.imul(St,V)|0,k=Math.imul(St,se),g=g+Math.imul(Qe,be)|0,b=b+Math.imul(Qe,We)|0,b=b+Math.imul(Mt,be)|0,k=k+Math.imul(Mt,We)|0,g=g+Math.imul(Re,qe)|0,b=b+Math.imul(Re,J)|0,b=b+Math.imul(Ke,qe)|0,k=k+Math.imul(Ke,J)|0,g=g+Math.imul(Ne,Ce)|0,b=b+Math.imul(Ne,Ve)|0,b=b+Math.imul(He,Ce)|0,k=k+Math.imul(He,Ve)|0,g=g+Math.imul(pe,ze)|0,b=b+Math.imul(pe,Je)|0,b=b+Math.imul(Se,ze)|0,k=k+Math.imul(Se,Je)|0;var Vn=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Vn>>>26)|0,Vn&=67108863,g=Math.imul(Xe,be),b=Math.imul(Xe,We),b=b+Math.imul(St,be)|0,k=Math.imul(St,We),g=g+Math.imul(Qe,qe)|0,b=b+Math.imul(Qe,J)|0,b=b+Math.imul(Mt,qe)|0,k=k+Math.imul(Mt,J)|0,g=g+Math.imul(Re,Ce)|0,b=b+Math.imul(Re,Ve)|0,b=b+Math.imul(Ke,Ce)|0,k=k+Math.imul(Ke,Ve)|0,g=g+Math.imul(Ne,ze)|0,b=b+Math.imul(Ne,Je)|0,b=b+Math.imul(He,ze)|0,k=k+Math.imul(He,Je)|0;var Wi=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,g=Math.imul(Xe,qe),b=Math.imul(Xe,J),b=b+Math.imul(St,qe)|0,k=Math.imul(St,J),g=g+Math.imul(Qe,Ce)|0,b=b+Math.imul(Qe,Ve)|0,b=b+Math.imul(Mt,Ce)|0,k=k+Math.imul(Mt,Ve)|0,g=g+Math.imul(Re,ze)|0,b=b+Math.imul(Re,Je)|0,b=b+Math.imul(Ke,ze)|0,k=k+Math.imul(Ke,Je)|0;var Gi=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,g=Math.imul(Xe,Ce),b=Math.imul(Xe,Ve),b=b+Math.imul(St,Ce)|0,k=Math.imul(St,Ve),g=g+Math.imul(Qe,ze)|0,b=b+Math.imul(Qe,Je)|0,b=b+Math.imul(Mt,ze)|0,k=k+Math.imul(Mt,Je)|0;var U=(I+g|0)+((b&8191)<<13)|0;I=(k+(b>>>13)|0)+(U>>>26)|0,U&=67108863,g=Math.imul(Xe,ze),b=Math.imul(Xe,Je),b=b+Math.imul(St,ze)|0,k=Math.imul(St,Je);var ie=(I+g|0)+((b&8191)<<13)|0;return I=(k+(b>>>13)|0)+(ie>>>26)|0,ie&=67108863,j[0]=bt,j[1]=rr,j[2]=Bt,j[3]=Vt,j[4]=fr,j[5]=Nr,j[6]=mr,j[7]=nr,j[8]=Ar,j[9]=Fn,j[10]=tn,j[11]=$n,j[12]=qi,j[13]=Hi,j[14]=Vn,j[15]=Wi,j[16]=Gi,j[17]=U,j[18]=ie,I!==0&&(j[19]=I,S.length++),S};Math.imul||(R=O);function F(h,d,m){m.negative=d.negative^h.negative,m.length=h.length+d.length;for(var S=0,E=0,M=0;M<m.length-1;M++){var j=E;E=0;for(var I=S&67108863,g=Math.min(M,d.length-1),b=Math.max(0,M-h.length+1);b<=g;b++){var k=M-b,ve=h.words[k]|0,he=d.words[b]|0,we=ve*he,Oe=we&67108863;j=j+(we/67108864|0)|0,Oe=Oe+I|0,I=Oe&67108863,j=j+(Oe>>>26)|0,E+=j>>>26,j&=67108863}m.words[M]=I,S=j,j=E}return S!==0?m.words[M]=S:m.length--,m._strip()}function B(h,d,m){return F(h,d,m)}o.prototype.mulTo=function(d,m){var S,E=this.length+d.length;return this.length===10&&d.length===10?S=R(this,d,m):E<63?S=O(this,d,m):E<1024?S=F(this,d,m):S=B(this,d,m),S},o.prototype.mul=function(d){var m=new o(null);return m.words=new Array(this.length+d.length),this.mulTo(d,m)},o.prototype.mulf=function(d){var m=new o(null);return m.words=new Array(this.length+d.length),B(this,d,m)},o.prototype.imul=function(d){return this.clone().mulTo(d,this)},o.prototype.imuln=function(d){var m=d<0;m&&(d=-d),i(typeof d=="number"),i(d<67108864);for(var S=0,E=0;E<this.length;E++){var M=(this.words[E]|0)*d,j=(M&67108863)+(S&67108863);S>>=26,S+=M/67108864|0,S+=j>>>26,this.words[E]=j&67108863}return S!==0&&(this.words[E]=S,this.length++),m?this.ineg():this},o.prototype.muln=function(d){return this.clone().imuln(d)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(d){var m=T(d);if(m.length===0)return new o(1);for(var S=this,E=0;E<m.length&&m[E]===0;E++,S=S.sqr());if(++E<m.length)for(var M=S.sqr();E<m.length;E++,M=M.sqr())m[E]!==0&&(S=S.mul(M));return S},o.prototype.iushln=function(d){i(typeof d=="number"&&d>=0);var m=d%26,S=(d-m)/26,E=67108863>>>26-m<<26-m,M;if(m!==0){var j=0;for(M=0;M<this.length;M++){var I=this.words[M]&E,g=(this.words[M]|0)-I<<m;this.words[M]=g|j,j=I>>>26-m}j&&(this.words[M]=j,this.length++)}if(S!==0){for(M=this.length-1;M>=0;M--)this.words[M+S]=this.words[M];for(M=0;M<S;M++)this.words[M]=0;this.length+=S}return this._strip()},o.prototype.ishln=function(d){return i(this.negative===0),this.iushln(d)},o.prototype.iushrn=function(d,m,S){i(typeof d=="number"&&d>=0);var E;m?E=(m-m%26)/26:E=0;var M=d%26,j=Math.min((d-M)/26,this.length),I=67108863^67108863>>>M<<M,g=S;if(E-=j,E=Math.max(0,E),g){for(var b=0;b<j;b++)g.words[b]=this.words[b];g.length=j}if(j!==0)if(this.length>j)for(this.length-=j,b=0;b<this.length;b++)this.words[b]=this.words[b+j];else this.words[0]=0,this.length=1;var k=0;for(b=this.length-1;b>=0&&(k!==0||b>=E);b--){var ve=this.words[b]|0;this.words[b]=k<<26-M|ve>>>M,k=ve&I}return g&&k!==0&&(g.words[g.length++]=k),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(d,m,S){return i(this.negative===0),this.iushrn(d,m,S)},o.prototype.shln=function(d){return this.clone().ishln(d)},o.prototype.ushln=function(d){return this.clone().iushln(d)},o.prototype.shrn=function(d){return this.clone().ishrn(d)},o.prototype.ushrn=function(d){return this.clone().iushrn(d)},o.prototype.testn=function(d){i(typeof d=="number"&&d>=0);var m=d%26,S=(d-m)/26,E=1<<m;if(this.length<=S)return!1;var M=this.words[S];return!!(M&E)},o.prototype.imaskn=function(d){i(typeof d=="number"&&d>=0);var m=d%26,S=(d-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 E=67108863^67108863>>>m<<m;this.words[this.length-1]&=E}return this._strip()},o.prototype.maskn=function(d){return this.clone().imaskn(d)},o.prototype.iaddn=function(d){return i(typeof d=="number"),i(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<=d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},o.prototype._iaddn=function(d){this.words[0]+=d;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},o.prototype.isubn=function(d){if(i(typeof d=="number"),i(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,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()},o.prototype.addn=function(d){return this.clone().iaddn(d)},o.prototype.subn=function(d){return this.clone().isubn(d)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(d,m,S){var E=d.length+S,M;this._expand(E);var j,I=0;for(M=0;M<d.length;M++){j=(this.words[M+S]|0)+I;var g=(d.words[M]|0)*m;j-=g&67108863,I=(j>>26)-(g/67108864|0),this.words[M+S]=j&67108863}for(;M<this.length-S;M++)j=(this.words[M+S]|0)+I,I=j>>26,this.words[M+S]=j&67108863;if(I===0)return this._strip();for(i(I===-1),I=0,M=0;M<this.length;M++)j=-(this.words[M]|0)+I,I=j>>26,this.words[M]=j&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(d,m){var S=this.length-d.length,E=this.clone(),M=d,j=M.words[M.length-1]|0,I=this._countBits(j);S=26-I,S!==0&&(M=M.ushln(S),E.iushln(S),j=M.words[M.length-1]|0);var g=E.length-M.length,b;if(m!=="mod"){b=new o(null),b.length=g+1,b.words=new Array(b.length);for(var k=0;k<b.length;k++)b.words[k]=0}var ve=E.clone()._ishlnsubmul(M,1,g);ve.negative===0&&(E=ve,b&&(b.words[g]=1));for(var he=g-1;he>=0;he--){var we=(E.words[M.length+he]|0)*67108864+(E.words[M.length+he-1]|0);for(we=Math.min(we/j|0,67108863),E._ishlnsubmul(M,we,he);E.negative!==0;)we--,E.negative=0,E._ishlnsubmul(M,1,he),E.isZero()||(E.negative^=1);b&&(b.words[he]=we)}return b&&b._strip(),E._strip(),m!=="div"&&S!==0&&E.iushrn(S),{div:b||null,mod:E}},o.prototype.divmod=function(d,m,S){if(i(!d.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var E,M,j;return this.negative!==0&&d.negative===0?(j=this.neg().divmod(d,m),m!=="mod"&&(E=j.div.neg()),m!=="div"&&(M=j.mod.neg(),S&&M.negative!==0&&M.iadd(d)),{div:E,mod:M}):this.negative===0&&d.negative!==0?(j=this.divmod(d.neg(),m),m!=="mod"&&(E=j.div.neg()),{div:E,mod:j.mod}):this.negative&d.negative?(j=this.neg().divmod(d.neg(),m),m!=="div"&&(M=j.mod.neg(),S&&M.negative!==0&&M.isub(d)),{div:j.div,mod:M}):d.length>this.length||this.cmp(d)<0?{div:new o(0),mod:this}:d.length===1?m==="div"?{div:this.divn(d.words[0]),mod:null}:m==="mod"?{div:null,mod:new o(this.modrn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new o(this.modrn(d.words[0]))}:this._wordDiv(d,m)},o.prototype.div=function(d){return this.divmod(d,"div",!1).div},o.prototype.mod=function(d){return this.divmod(d,"mod",!1).mod},o.prototype.umod=function(d){return this.divmod(d,"mod",!0).mod},o.prototype.divRound=function(d){var m=this.divmod(d);if(m.mod.isZero())return m.div;var S=m.div.negative!==0?m.mod.isub(d):m.mod,E=d.ushrn(1),M=d.andln(1),j=S.cmp(E);return j<0||M===1&&j===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},o.prototype.modrn=function(d){var m=d<0;m&&(d=-d),i(d<=67108863);for(var S=(1<<26)%d,E=0,M=this.length-1;M>=0;M--)E=(S*E+(this.words[M]|0))%d;return m?-E:E},o.prototype.modn=function(d){return this.modrn(d)},o.prototype.idivn=function(d){var m=d<0;m&&(d=-d),i(d<=67108863);for(var S=0,E=this.length-1;E>=0;E--){var M=(this.words[E]|0)+S*67108864;this.words[E]=M/d|0,S=M%d}return this._strip(),m?this.ineg():this},o.prototype.divn=function(d){return this.clone().idivn(d)},o.prototype.egcd=function(d){i(d.negative===0),i(!d.isZero());var m=this,S=d.clone();m.negative!==0?m=m.umod(d):m=m.clone();for(var E=new o(1),M=new o(0),j=new o(0),I=new o(1),g=0;m.isEven()&&S.isEven();)m.iushrn(1),S.iushrn(1),++g;for(var b=S.clone(),k=m.clone();!m.isZero();){for(var ve=0,he=1;!(m.words[0]&he)&&ve<26;++ve,he<<=1);if(ve>0)for(m.iushrn(ve);ve-- >0;)(E.isOdd()||M.isOdd())&&(E.iadd(b),M.isub(k)),E.iushrn(1),M.iushrn(1);for(var we=0,Oe=1;!(S.words[0]&Oe)&&we<26;++we,Oe<<=1);if(we>0)for(S.iushrn(we);we-- >0;)(j.isOdd()||I.isOdd())&&(j.iadd(b),I.isub(k)),j.iushrn(1),I.iushrn(1);m.cmp(S)>=0?(m.isub(S),E.isub(j),M.isub(I)):(S.isub(m),j.isub(E),I.isub(M))}return{a:j,b:I,gcd:S.iushln(g)}},o.prototype._invmp=function(d){i(d.negative===0),i(!d.isZero());var m=this,S=d.clone();m.negative!==0?m=m.umod(d):m=m.clone();for(var E=new o(1),M=new o(0),j=S.clone();m.cmpn(1)>0&&S.cmpn(1)>0;){for(var I=0,g=1;!(m.words[0]&g)&&I<26;++I,g<<=1);if(I>0)for(m.iushrn(I);I-- >0;)E.isOdd()&&E.iadd(j),E.iushrn(1);for(var b=0,k=1;!(S.words[0]&k)&&b<26;++b,k<<=1);if(b>0)for(S.iushrn(b);b-- >0;)M.isOdd()&&M.iadd(j),M.iushrn(1);m.cmp(S)>=0?(m.isub(S),E.isub(M)):(S.isub(m),M.isub(E))}var ve;return m.cmpn(1)===0?ve=E:ve=M,ve.cmpn(0)<0&&ve.iadd(d),ve},o.prototype.gcd=function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var m=this.clone(),S=d.clone();m.negative=0,S.negative=0;for(var E=0;m.isEven()&&S.isEven();E++)m.iushrn(1),S.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;S.isEven();)S.iushrn(1);var M=m.cmp(S);if(M<0){var j=m;m=S,S=j}else if(M===0||S.cmpn(1)===0)break;m.isub(S)}while(!0);return S.iushln(E)},o.prototype.invm=function(d){return this.egcd(d).a.umod(d)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(d){return this.words[0]&d},o.prototype.bincn=function(d){i(typeof d=="number");var m=d%26,S=(d-m)/26,E=1<<m;if(this.length<=S)return this._expand(S+1),this.words[S]|=E,this;for(var M=E,j=S;M!==0&&j<this.length;j++){var I=this.words[j]|0;I+=M,M=I>>>26,I&=67108863,this.words[j]=I}return M!==0&&(this.words[j]=M,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(d){var m=d<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&&(d=-d),i(d<=67108863,"Number is too big");var E=this.words[0]|0;S=E===d?0:E<d?-1:1}return this.negative!==0?-S|0:S},o.prototype.cmp=function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var m=this.ucmp(d);return this.negative!==0?-m|0:m},o.prototype.ucmp=function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var m=0,S=this.length-1;S>=0;S--){var E=this.words[S]|0,M=d.words[S]|0;if(E!==M){E<M?m=-1:E>M&&(m=1);break}}return m},o.prototype.gtn=function(d){return this.cmpn(d)===1},o.prototype.gt=function(d){return this.cmp(d)===1},o.prototype.gten=function(d){return this.cmpn(d)>=0},o.prototype.gte=function(d){return this.cmp(d)>=0},o.prototype.ltn=function(d){return this.cmpn(d)===-1},o.prototype.lt=function(d){return this.cmp(d)===-1},o.prototype.lten=function(d){return this.cmpn(d)<=0},o.prototype.lte=function(d){return this.cmp(d)<=0},o.prototype.eqn=function(d){return this.cmpn(d)===0},o.prototype.eq=function(d){return this.cmp(d)===0},o.red=function(d){return new q(d)},o.prototype.toRed=function(d){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(d){return this.red=d,this},o.prototype.forceRed=function(d){return i(!this.red,"Already a number in reduction context"),this._forceRed(d)},o.prototype.redAdd=function(d){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},o.prototype.redIAdd=function(d){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},o.prototype.redSub=function(d){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},o.prototype.redISub=function(d){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},o.prototype.redShl=function(d){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},o.prototype.redMul=function(d){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},o.prototype.redIMul=function(d){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(d){return i(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)};var H={k256:null,p224:null,p192:null,p25519:null};function $(h,d){this.name=h,this.p=new o(d,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}$.prototype._tmp=function(){var d=new o(null);return d.words=new Array(Math.ceil(this.n/13)),d},$.prototype.ireduce=function(d){var m=d,S;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),S=m.bitLength();while(S>this.n);var E=S<this.n?-1:m.ucmp(this.p);return E===0?(m.words[0]=0,m.length=1):E>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},$.prototype.split=function(d,m){d.iushrn(this.n,0,m)},$.prototype.imulK=function(d){return d.imul(this.k)};function Z(){$.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(Z,$),Z.prototype.split=function(d,m){for(var S=4194303,E=Math.min(d.length,9),M=0;M<E;M++)m.words[M]=d.words[M];if(m.length=E,d.length<=9){d.words[0]=0,d.length=1;return}var j=d.words[9];for(m.words[m.length++]=j&S,M=10;M<d.length;M++){var I=d.words[M]|0;d.words[M-10]=(I&S)<<4|j>>>22,j=I}j>>>=22,d.words[M-10]=j,j===0&&d.length>10?d.length-=10:d.length-=9},Z.prototype.imulK=function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var m=0,S=0;S<d.length;S++){var E=d.words[S]|0;m+=E*977,d.words[S]=m&67108863,m=E*64+(m/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d};function ce(){$.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(ce,$);function ne(){$.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(ne,$);function de(){$.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(de,$),de.prototype.imulK=function(d){for(var m=0,S=0;S<d.length;S++){var E=(d.words[S]|0)*19+m,M=E&67108863;E>>>=26,d.words[S]=M,m=E}return m!==0&&(d.words[d.length++]=m),d},o._prime=function(d){if(H[d])return H[d];var m;if(d==="k256")m=new Z;else if(d==="p224")m=new ce;else if(d==="p192")m=new ne;else if(d==="p25519")m=new de;else throw new Error("Unknown prime "+d);return H[d]=m,m};function q(h){if(typeof h=="string"){var d=o._prime(h);this.m=d.p,this.prime=d}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}q.prototype._verify1=function(d){i(d.negative===0,"red works only with positives"),i(d.red,"red works only with red numbers")},q.prototype._verify2=function(d,m){i((d.negative|m.negative)===0,"red works only with positives"),i(d.red&&d.red===m.red,"red works only with red numbers")},q.prototype.imod=function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):(f(d,d.umod(this.m)._forceRed(this)),d)},q.prototype.neg=function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},q.prototype.add=function(d,m){this._verify2(d,m);var S=d.add(m);return S.cmp(this.m)>=0&&S.isub(this.m),S._forceRed(this)},q.prototype.iadd=function(d,m){this._verify2(d,m);var S=d.iadd(m);return S.cmp(this.m)>=0&&S.isub(this.m),S},q.prototype.sub=function(d,m){this._verify2(d,m);var S=d.sub(m);return S.cmpn(0)<0&&S.iadd(this.m),S._forceRed(this)},q.prototype.isub=function(d,m){this._verify2(d,m);var S=d.isub(m);return S.cmpn(0)<0&&S.iadd(this.m),S},q.prototype.shl=function(d,m){return this._verify1(d),this.imod(d.ushln(m))},q.prototype.imul=function(d,m){return this._verify2(d,m),this.imod(d.imul(m))},q.prototype.mul=function(d,m){return this._verify2(d,m),this.imod(d.mul(m))},q.prototype.isqr=function(d){return this.imul(d,d.clone())},q.prototype.sqr=function(d){return this.mul(d,d)},q.prototype.sqrt=function(d){if(d.isZero())return d.clone();var m=this.m.andln(3);if(i(m%2===1),m===3){var S=this.m.add(new o(1)).iushrn(2);return this.pow(d,S)}for(var E=this.m.subn(1),M=0;!E.isZero()&&E.andln(1)===0;)M++,E.iushrn(1);i(!E.isZero());var j=new o(1).toRed(this),I=j.redNeg(),g=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new o(2*b*b).toRed(this);this.pow(b,g).cmp(I)!==0;)b.redIAdd(I);for(var k=this.pow(b,E),ve=this.pow(d,E.addn(1).iushrn(1)),he=this.pow(d,E),we=M;he.cmp(j)!==0;){for(var Oe=he,je=0;Oe.cmp(j)!==0;je++)Oe=Oe.redSqr();i(je<we);var L=this.pow(k,new o(1).iushln(we-je-1));ve=ve.redMul(L),k=L.redSqr(),he=he.redMul(k),we=je}return ve},q.prototype.invm=function(d){var m=d._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},q.prototype.pow=function(d,m){if(m.isZero())return new o(1).toRed(this);if(m.cmpn(1)===0)return d.clone();var S=4,E=new Array(1<<S);E[0]=new o(1).toRed(this),E[1]=d;for(var M=2;M<E.length;M++)E[M]=this.mul(E[M-1],d);var j=E[0],I=0,g=0,b=m.bitLength()%26;for(b===0&&(b=26),M=m.length-1;M>=0;M--){for(var k=m.words[M],ve=b-1;ve>=0;ve--){var he=k>>ve&1;if(j!==E[0]&&(j=this.sqr(j)),he===0&&I===0){g=0;continue}I<<=1,I|=he,g++,!(g!==S&&(M!==0||ve!==0))&&(j=this.mul(j,E[I]),g=0,I=0)}b=26}return j},q.prototype.convertTo=function(d){var m=d.umod(this.m);return m===d?m.clone():m},q.prototype.convertFrom=function(d){var m=d.clone();return m.red=null,m},o.mont=function(d){return new N(d)};function N(h){q.call(this,h),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)}s(N,q),N.prototype.convertTo=function(d){return this.imod(d.ushln(this.shift))},N.prototype.convertFrom=function(d){var m=this.imod(d.mul(this.rinv));return m.red=null,m},N.prototype.imul=function(d,m){if(d.isZero()||m.isZero())return d.words[0]=0,d.length=1,d;var S=d.imul(m),E=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=S.isub(E).iushrn(this.shift),j=M;return M.cmp(this.m)>=0?j=M.isub(this.m):M.cmpn(0)<0&&(j=M.iadd(this.m)),j._forceRed(this)},N.prototype.mul=function(d,m){if(d.isZero()||m.isZero())return new o(0)._forceRed(this);var S=d.mul(m),E=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),M=S.isub(E).iushrn(this.shift),j=M;return M.cmp(this.m)>=0?j=M.isub(this.m):M.cmpn(0)<0&&(j=M.iadd(this.m)),j._forceRed(this)},N.prototype.invm=function(d){var m=this.imod(d._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(typeof t>"u"||t,e)}}),wo=9e15,rs=1e9,gf="0123456789abcdef",tl="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",rl="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",vf={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-wo,maxE:wo,crypto:!1},Pg,Ii,mt=!0,nl="[DecimalError] ",ns=nl+"Invalid argument: ",Rg=nl+"Precision limit exceeded",jg=nl+"crypto unavailable",Ng="[object Decimal]",Lr=Math.floor,_r=Math.pow,D9=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,L9=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,B9=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,kg=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,jn=1e7,ot=7,U9=9007199254740991,F9=tl.length-1,bf=rl.length-1,Me={toStringTag:Ng};Me.absoluteValue=Me.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),tt(e)},Me.ceil=function(){return tt(new this.constructor(this),this.e+1,2)},Me.clampedTo=Me.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(ns+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)},Me.comparedTo=Me.cmp=function(e){var t,r,n,i,s=this,o=s.d,a=(e=new s.constructor(e)).d,c=s.s,l=e.s;if(!o||!a)return!c||!l?NaN:c!==l?c:o===a?0:!o^c<0?1:-1;if(!o[0]||!a[0])return o[0]?c:a[0]?-l:0;if(c!==l)return c;if(s.e!==e.e)return s.e>e.e^c<0?1:-1;for(n=o.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(o[t]!==a[t])return o[t]>a[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1},Me.cosine=Me.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())+ot,n.rounding=1,r=$9(n,$g(n,r)),n.precision=e,n.rounding=t,tt(Ii==2||Ii==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)},Me.cubeRoot=Me.cbrt=function(){var e,t,r,n,i,s,o,a,c,l,u=this,f=u.constructor;if(!u.isFinite()||u.isZero())return new f(u);for(mt=!1,s=u.s*_r(u.s*u,1/3),!s||Math.abs(s)==1/0?(r=Mr(u.d),e=u.e,(s=(e-r.length+1)%3)&&(r+=s==1||s==-2?"0":"00"),s=_r(r,1/3),e=Lr((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?r="5e"+e:(r=s.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new f(r),n.s=u.s):n=new f(s.toString()),o=(e=f.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),o+2,1),Mr(a.d).slice(0,o)===(r=Mr(n.d)).slice(0,o))if(r=r.slice(o-3,o+1),r=="9999"||!i&&r=="4999"){if(!i&&(tt(a,e+1,0),a.times(a).times(a).eq(u))){n=a;break}o+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(tt(n,e+1,1),t=!n.times(n).times(n).eq(u));break}return mt=!0,tt(n,e,f.rounding,t)},Me.decimalPlaces=Me.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Lr(this.e/ot))*ot,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},Me.dividedBy=Me.div=function(e){return Kt(this,new this.constructor(e))},Me.dividedToIntegerBy=Me.divToInt=function(e){var t=this,r=t.constructor;return tt(Kt(t,new r(e),0,1,1),r.precision,r.rounding)},Me.equals=Me.eq=function(e){return this.cmp(e)===0},Me.floor=function(){return tt(new this.constructor(this),this.e+1,3)},Me.greaterThan=Me.gt=function(e){return this.cmp(e)>0},Me.greaterThanOrEqualTo=Me.gte=function(e){var t=this.cmp(e);return t==1||t===0},Me.hyperbolicCosine=Me.cosh=function(){var e,t,r,n,i,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;r=o.precision,n=o.rounding,o.precision=r+Math.max(s.e,s.sd())+4,o.rounding=1,i=s.d.length,i<32?(e=Math.ceil(i/3),t=(1/al(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),s=xo(o,1,s.times(t),new o(1),!0);for(var c,l=e,u=new o(8);l--;)c=s.times(s),s=a.minus(c.times(u.minus(c.times(u))));return tt(s,o.precision=r,o.rounding=n,!0)},Me.hyperbolicSine=Me.sinh=function(){var e,t,r,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(t=s.precision,r=s.rounding,s.precision=t+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<3)i=xo(s,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=xo(s,2,i,i,!0);for(var o,a=new s(5),c=new s(16),l=new s(20);e--;)o=i.times(i),i=i.times(a.plus(o.times(c.times(o).plus(l))))}return s.precision=t,s.rounding=r,tt(i,t,r,!0)},Me.hyperbolicTangent=Me.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)},Me.inverseCosine=Me.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,s=r.rounding;return n!==-1?n===0?t.isNeg()?Nn(r,i,s):new r(0):new r(NaN):t.isZero()?Nn(r,i+4,s).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=Nn(r,i+4,s).times(.5),r.precision=i,r.rounding=s,e.minus(t))},Me.inverseHyperbolicCosine=Me.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,mt=!1,r=r.times(r).minus(1).sqrt().plus(r),mt=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},Me.inverseHyperbolicSine=Me.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,mt=!1,r=r.times(r).plus(1).sqrt().plus(r),mt=!0,n.precision=e,n.rounding=t,r.ln())},Me.inverseHyperbolicTangent=Me.atanh=function(){var e,t,r,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=s.precision,t=s.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?tt(new s(i),e,t,!0):(s.precision=r=n-i.e,i=Kt(i.plus(1),new s(1).minus(i),r+e,1),s.precision=e+4,s.rounding=1,i=i.ln(),s.precision=e,s.rounding=t,i.times(.5))):new s(NaN)},Me.inverseSine=Me.asin=function(){var e,t,r,n,i=this,s=i.constructor;return i.isZero()?new s(i):(t=i.abs().cmp(1),r=s.precision,n=s.rounding,t!==-1?t===0?(e=Nn(s,r+4,n).times(.5),e.s=i.s,e):new s(NaN):(s.precision=r+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=r,s.rounding=n,i.times(2)))},Me.inverseTangent=Me.atan=function(){var e,t,r,n,i,s,o,a,c,l=this,u=l.constructor,f=u.precision,p=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&f+4<=bf)return o=Nn(u,f+4,p).times(.25),o.s=l.s,o}else{if(!l.s)return new u(NaN);if(f+4<=bf)return o=Nn(u,f+4,p).times(.5),o.s=l.s,o}for(u.precision=a=f+10,u.rounding=1,r=Math.min(28,a/ot+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(mt=!1,t=Math.ceil(a/ot),n=1,c=l.times(l),o=new u(l),i=l;e!==-1;)if(i=i.times(c),s=o.minus(i.div(n+=2)),i=i.times(c),o=s.plus(i.div(n+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===s.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),mt=!0,tt(o,u.precision=f,u.rounding=p,!0)},Me.isFinite=function(){return!!this.d},Me.isInteger=Me.isInt=function(){return!!this.d&&Lr(this.e/ot)>this.d.length-2},Me.isNaN=function(){return!this.s},Me.isNegative=Me.isNeg=function(){return this.s<0},Me.isPositive=Me.isPos=function(){return this.s>0},Me.isZero=function(){return!!this.d&&this.d[0]===0},Me.lessThan=Me.lt=function(e){return this.cmp(e)<0},Me.lessThanOrEqualTo=Me.lte=function(e){return this.cmp(e)<1},Me.logarithm=Me.log=function(e){var t,r,n,i,s,o,a,c,l=this,u=l.constructor,f=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)s=!0;else{for(i=r[0];i%10===0;)i/=10;s=i!==1}if(mt=!1,a=f+y,o=ss(l,a),n=t?ol(u,a+10):ss(e,a),c=Kt(o,n,a,1),xa(c.d,i=f,p))do if(a+=10,o=ss(l,a),n=t?ol(u,a+10):ss(e,a),c=Kt(o,n,a,1),!s){+Mr(c.d).slice(i+1,i+15)+1==1e14&&(c=tt(c,f+1,0));break}while(xa(c.d,i+=10,p));return mt=!0,tt(c,f,p)},Me.minus=Me.sub=function(e){var t,r,n,i,s,o,a,c,l,u,f,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 mt?tt(e,a,c):e}if(r=Lr(e.e/ot),u=Lr(y.e/ot),l=l.slice(),s=u-r,s){for(f=s<0,f?(t=l,s=-s,o=p.length):(t=p,r=u,o=l.length),n=Math.max(Math.ceil(a/ot),o)+2,s>n&&(s=n,t.length=1),t.reverse(),n=s;n--;)t.push(0);t.reverse()}else{for(n=l.length,o=p.length,f=n<o,f&&(o=n),n=0;n<o;n++)if(l[n]!=p[n]){f=l[n]<p[n];break}s=0}for(f&&(t=l,l=p,p=t,e.s=-e.s),o=l.length,n=p.length-o;n>0;--n)l[o++]=0;for(n=p.length;n>s;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=jn-1;--l[i],l[n]+=jn}l[n]-=p[n]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=sl(l,r),mt?tt(e,a,c):e):new x(c===3?-0:0)},Me.modulo=Me.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]?tt(new n(r),n.precision,n.rounding):(mt=!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),mt=!0,r.minus(t))},Me.naturalExponential=Me.exp=function(){return yf(this)},Me.naturalLogarithm=Me.ln=function(){return ss(this)},Me.negated=Me.neg=function(){var e=new this.constructor(this);return e.s=-e.s,tt(e)},Me.plus=Me.add=function(e){var t,r,n,i,s,o,a,c,l,u,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return!f.s||!e.s?e=new p(NaN):f.d||(e=new p(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(l=f.d,u=e.d,a=p.precision,c=p.rounding,!l[0]||!u[0])return u[0]||(e=new p(f)),mt?tt(e,a,c):e;if(s=Lr(f.e/ot),n=Lr(e.e/ot),l=l.slice(),i=s-n,i){for(i<0?(r=l,i=-i,o=u.length):(r=u,n=s,o=l.length),s=Math.ceil(a/ot),o=s>o?s+1:o+1,i>o&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(o=l.length,i=u.length,o-i<0&&(i=o,r=u,u=l,l=r),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/jn|0,l[i]%=jn;for(t&&(l.unshift(t),++n),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=sl(l,n),mt?tt(e,a,c):e},Me.precision=Me.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ns+e);return r.d?(t=Dg(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},Me.round=function(){var e=this,t=e.constructor;return tt(new t(e),e.e+1,t.rounding)},Me.sine=Me.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())+ot,n.rounding=1,r=z9(n,$g(n,r)),n.precision=e,n.rounding=t,tt(Ii>2?r.neg():r,e,t,!0)):new n(NaN)},Me.squareRoot=Me.sqrt=function(){var e,t,r,n,i,s,o=this,a=o.d,c=o.e,l=o.s,u=o.constructor;if(l!==1||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?o:1/0);for(mt=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=Mr(a),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=Lr((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(s=n,n=s.plus(Kt(o,s,r+2,1)).times(.5),Mr(s.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&&(tt(s,c+1,0),s.times(s).eq(o))){n=s;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(tt(n,c+1,1),e=!n.times(n).eq(o));break}return mt=!0,tt(n,c,u.rounding,e)},Me.tangent=Me.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,tt(Ii==2||Ii==4?r.neg():r,e,t,!0)):new n(NaN)},Me.times=Me.mul=function(e){var t,r,n,i,s,o,a,c,l,u=this,f=u.constructor,p=u.d,y=(e=new f(e)).d;if(e.s*=u.s,!p||!p[0]||!y||!y[0])return new f(!e.s||p&&!p[0]&&!y||y&&!y[0]&&!p?NaN:!p||!y?e.s/0:e.s*0);for(r=Lr(u.e/ot)+Lr(e.e/ot),c=p.length,l=y.length,c<l&&(s=p,p=y,y=s,o=c,c=l,l=o),s=[],o=c+l,n=o;n--;)s.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)a=s[i]+y[n]*p[i-n-1]+t,s[i--]=a%jn|0,t=a/jn|0;s[i]=(s[i]+t)%jn|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=sl(s,r),mt?tt(e,f.precision,f.rounding):e},Me.toBinary=function(e,t){return xf(this,2,e,t)},Me.toDecimalPlaces=Me.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Jr(e,0,rs),t===void 0?t=n.rounding:Jr(t,0,8),tt(r,e+r.e+1,t))},Me.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ni(n,!0):(Jr(e,0,rs),t===void 0?t=i.rounding:Jr(t,0,8),n=tt(new i(n),e+1,t),r=ni(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},Me.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?r=ni(i):(Jr(e,0,rs),t===void 0?t=s.rounding:Jr(t,0,8),n=tt(new s(i),e+i.e+1,t),r=ni(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},Me.toFraction=function(e){var t,r,n,i,s,o,a,c,l,u,f,p,y=this,x=y.d,v=y.constructor;if(!x)return new v(y);if(l=r=new v(1),n=c=new v(0),t=new v(n),s=t.e=Dg(x)-y.e-1,o=s%ot,t.d[0]=_r(10,o<0?ot+o:o),e==null)e=s>0?t:l;else{if(a=new v(e),!a.isInt()||a.lt(l))throw Error(ns+a);e=a.gt(t)?s>0?t:l:a}for(mt=!1,a=new v(Mr(x)),u=v.precision,v.precision=s=x.length*ot*2;f=Kt(a,t,0,1,1),i=r.plus(f.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(f.times(i)),c=i,i=t,t=a.minus(f.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,s,1).minus(y).abs().cmp(Kt(c,r,s,1).minus(y).abs())<1?[l,n]:[c,r],v.precision=u,mt=!0,p},Me.toHexadecimal=Me.toHex=function(e,t){return xf(this,16,e,t)},Me.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:Jr(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]?(mt=!1,r=Kt(r,e,0,t,1).times(e),mt=!0,tt(r)):(e.s=r.s,r=e),r},Me.toNumber=function(){return+this},Me.toOctal=function(e,t){return xf(this,8,e,t)},Me.toPower=Me.pow=function(e){var t,r,n,i,s,o,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(_r(+a,l));if(a=new c(a),a.eq(1))return a;if(n=c.precision,s=c.rounding,e.eq(1))return tt(a,n,s);if(t=Lr(e.e/ot),t>=e.d.length-1&&(r=l<0?-l:l)<=U9)return i=Lg(c,a,r,n),e.s<0?new c(1).div(i):tt(i,n,s);if(o=a.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=o,a}return r=_r(+a,l),t=r==0||!isFinite(r)?Lr(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?o/0:0):(mt=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),i=yf(e.times(ss(a,n+r)),n),i.d&&(i=tt(i,n+5,1),xa(i.d,n,s)&&(t=n+10,i=tt(yf(e.times(ss(a,t+r)),t),t+5,1),+Mr(i.d).slice(n+1,n+15)+1==1e14&&(i=tt(i,n+1,0)))),i.s=o,mt=!0,c.rounding=s,tt(i,n,s))},Me.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ni(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Jr(e,1,rs),t===void 0?t=i.rounding:Jr(t,0,8),n=tt(new i(n),e,t),r=ni(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},Me.toSignificantDigits=Me.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Jr(e,1,rs),t===void 0?t=n.rounding:Jr(t,0,8)),tt(new n(r),e,t)},Me.toString=function(){var e=this,t=e.constructor,r=ni(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},Me.truncated=Me.trunc=function(){return tt(new this.constructor(this),this.e+1,1)},Me.valueOf=Me.toJSON=function(){var e=this,t=e.constructor,r=ni(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,s="",o=e[0];if(i>0){for(s+=o,t=1;t<i;t++)n=e[t]+"",r=ot-n.length,r&&(s+=is(r)),s+=n;o=e[t],n=o+"",r=ot-n.length,r&&(s+=is(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}function Jr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ns+e)}function xa(e,t,r,n){var i,s,o,a;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=ot,i=0):(i=Math.ceil((t+1)/ot),t%=ot),s=_r(10,ot-t),a=e[i]%s|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),o=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):o=(r<4&&a+1==s||r>3&&a+1==s/2)&&(e[i+1]/s/100|0)==_r(10,t-2)-1||(a==s/2||a==0)&&(e[i+1]/s/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),o=(n||r<4)&&a==9999||!n&&r>3&&a==4999):o=((n||r<4)&&a+1==s||!n&&r>3&&a+1==s/2)&&(e[i+1]/s/1e3|0)==_r(10,t-3)-1,o}function il(e,t,r){for(var n,i=[0],s,o=0,a=e.length;o<a;){for(s=i.length;s--;)i[s]*=t;for(i[0]+=gf.indexOf(e.charAt(o++)),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 $9(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=xo(e,1,t.times(i),new e(1));for(var s=r;s--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}var Kt=function(){function e(n,i,s){var o,a=0,c=n.length;for(n=n.slice();c--;)o=n[c]*i+a,n[c]=o%s|0,a=o/s|0;return a&&n.unshift(a),n}function t(n,i,s,o){var a,c;if(s!=o)c=s>o?1:-1;else for(a=c=0;a<s;a++)if(n[a]!=i[a]){c=n[a]>i[a]?1:-1;break}return c}function r(n,i,s,o){for(var a=0;s--;)n[s]-=a,a=n[s]<i[s]?1:0,n[s]=a*o+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,o,a,c){var l,u,f,p,y,x,v,_,T,O,R,F,B,H,$,Z,ce,ne,de,q,N=n.constructor,h=n.s==i.s?1:-1,d=n.d,m=i.d;if(!d||!d[0]||!m||!m[0])return new N(!n.s||!i.s||(d?m&&d[0]==m[0]:!m)?NaN:d&&d[0]==0||!m?h*0:h/0);for(c?(y=1,u=n.e-i.e):(c=jn,y=ot,u=Lr(n.e/y)-Lr(i.e/y)),de=m.length,ce=d.length,T=new N(h),O=T.d=[],f=0;m[f]==(d[f]||0);f++);if(m[f]>(d[f]||0)&&u--,s==null?(H=s=N.precision,o=N.rounding):a?H=s+(n.e-i.e)+1:H=s,H<0)O.push(1),x=!0;else{if(H=H/y+2|0,f=0,de==1){for(p=0,m=m[0],H++;(f<ce||p)&&H--;f++)$=p*c+(d[f]||0),O[f]=$/m|0,p=$%m|0;x=p||f<ce}else{for(p=c/(m[0]+1)|0,p>1&&(m=e(m,p,c),d=e(d,p,c),de=m.length,ce=d.length),Z=de,R=d.slice(0,de),F=R.length;F<de;)R[F++]=0;q=m.slice(),q.unshift(0),ne=m[0],m[1]>=c/2&&++ne;do p=0,l=t(m,R,de,F),l<0?(B=R[0],de!=F&&(B=B*c+(R[1]||0)),p=B/ne|0,p>1?(p>=c&&(p=c-1),v=e(m,p,c),_=v.length,F=R.length,l=t(v,R,_,F),l==1&&(p--,r(v,de<_?q:m,_,c))):(p==0&&(l=p=1),v=m.slice()),_=v.length,_<F&&v.unshift(0),r(R,v,F,c),l==-1&&(F=R.length,l=t(m,R,de,F),l<1&&(p++,r(R,de<F?q:m,F,c))),F=R.length):l===0&&(p++,R=[0]),O[f++]=p,l&&R[0]?R[F++]=d[Z]||0:(R=[d[Z]],F=1);while((Z++<ce||R[0]!==void 0)&&H--);x=R[0]!==void 0}O[0]||O.shift()}if(y==1)T.e=u,Pg=x;else{for(f=1,p=O[0];p>=10;p/=10)f++;T.e=f+u*y-1,tt(T,a?s+T.e+1:s,o,x)}return T}}();function tt(e,t,r,n){var i,s,o,a,c,l,u,f,p,y=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(i=1,a=f[0];a>=10;a/=10)i++;if(s=t-i,s<0)s+=ot,o=t,u=f[p=0],c=u/_r(10,i-o-1)%10|0;else if(p=Math.ceil((s+1)/ot),a=f.length,p>=a)if(n){for(;a++<=p;)f.push(0);u=c=0,i=1,s%=ot,o=s-ot+1}else break e;else{for(u=a=f[p],i=1;a>=10;a/=10)i++;s%=ot,o=s-ot+i,c=o<0?0:u/_r(10,i-o-1)%10|0}if(n=n||t<0||f[p+1]!==void 0||(o<0?u:u%_r(10,i-o-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(s>0?o>0?u/_r(10,i-o):0:f[p-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,l?(t-=e.e+1,f[0]=_r(10,(ot-t%ot)%ot),e.e=-t||0):f[0]=e.e=0,e;if(s==0?(f.length=p,a=1,p--):(f.length=p+1,a=_r(10,ot-s),f[p]=o>0?(u/_r(10,i-o)%_r(10,o)|0)*a:0),l)for(;;)if(p==0){for(s=1,o=f[0];o>=10;o/=10)s++;for(o=f[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(e.e++,f[0]==jn&&(f[0]=1));break}else{if(f[p]+=a,f[p]!=jn)break;f[p--]=0,a=1}for(s=f.length;f[--s]===0;)f.pop()}return mt&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e<y.minE&&(e.e=0,e.d=[0])),e}function ni(e,t,r){if(!e.isFinite())return Fg(e);var n,i=e.e,s=Mr(e.d),o=s.length;return t?(r&&(n=r-o)>0?s=s.charAt(0)+"."+s.slice(1)+is(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):i<0?(s="0."+is(-i-1)+s,r&&(n=r-o)>0&&(s+=is(n))):i>=o?(s+=is(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+is(n))):((n=i+1)<o&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(s+="."),s+=is(n))),s}function sl(e,t){var r=e[0];for(t*=ot;r>=10;r/=10)t++;return t}function ol(e,t,r){if(t>F9)throw mt=!0,r&&(e.precision=r),Error(Rg);return tt(new e(tl),t,1,!0)}function Nn(e,t,r){if(t>bf)throw Error(Rg);return tt(new e(rl),t,r,!0)}function Dg(e){var t=e.length-1,r=t*ot+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 is(e){for(var t="";e--;)t+="0";return t}function Lg(e,t,r,n){var i,s=new e(1),o=Math.ceil(n/ot+4);for(mt=!1;;){if(r%2&&(s=s.times(t),Vg(s.d,o)&&(i=!0)),r=Lr(r/2),r===0){r=s.d.length-1,i&&s.d[r]===0&&++s.d[r];break}t=t.times(t),Vg(t.d,o)}return mt=!0,s}function Bg(e){return e.d[e.d.length-1]&1}function Ug(e,t,r){for(var n,i=new e(t[0]),s=0;++s<t.length;)if(n=new e(t[s]),n.s)i[r](n)&&(i=n);else{i=n;break}return i}function yf(e,t){var r,n,i,s,o,a,c,l=0,u=0,f=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?(mt=!1,c=x):c=t,a=new p(.03125);e.e>-2;)e=e.times(a),f+=5;for(n=Math.log(_r(2,f))/Math.LN10*2+5|0,c+=n,r=s=o=new p(1),p.precision=c;;){if(s=tt(s.times(e),c,1),r=r.times(++u),a=o.plus(Kt(s,r,c,1)),Mr(a.d).slice(0,c)===Mr(o.d).slice(0,c)){for(i=f;i--;)o=tt(o.times(o),c,1);if(t==null)if(l<3&&xa(o.d,c-n,y,l))p.precision=c+=10,r=s=a=new p(1),u=0,l++;else return tt(o,p.precision=x,y,mt=!0);else return p.precision=x,o}o=a}}function ss(e,t){var r,n,i,s,o,a,c,l,u,f,p,y=1,x=10,v=e,_=v.d,T=v.constructor,O=T.rounding,R=T.precision;if(v.s<0||!_||!_[0]||!v.e&&_[0]==1&&_.length==1)return new T(_&&!_[0]?-1/0:v.s!=1?NaN:_?0:v);if(t==null?(mt=!1,u=R):u=t,T.precision=u+=x,r=Mr(_),n=r.charAt(0),Math.abs(s=v.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=Mr(v.d),n=r.charAt(0),y++;s=v.e,n>1?(v=new T("0."+r),s++):v=new T(n+"."+r.slice(1))}else return l=ol(T,u+2,R).times(s+""),v=ss(new T(n+"."+r.slice(1)),u-x).plus(l),T.precision=R,t==null?tt(v,R,O,mt=!0):v;for(f=v,c=o=v=Kt(v.minus(1),v.plus(1),u,1),p=tt(v.times(v),u,1),i=3;;){if(o=tt(o.times(p),u,1),l=c.plus(Kt(o,new T(i),u,1)),Mr(l.d).slice(0,u)===Mr(c.d).slice(0,u))if(c=c.times(2),s!==0&&(c=c.plus(ol(T,u+2,R).times(s+""))),c=Kt(c,new T(y),u,1),t==null)if(xa(c.d,u-x,O,a))T.precision=u+=x,l=o=v=Kt(f.minus(1),f.plus(1),u,1),p=tt(v.times(v),u,1),i=a=1;else return tt(c,T.precision=R,O,mt=!0);else return T.precision=R,c;c=l,i+=2}}function Fg(e){return String(e.s*e.s/0)}function wf(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)%ot,r<0&&(n+=ot),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=ot;n<i;)e.d.push(+t.slice(n,n+=ot));t=t.slice(n),n=ot-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),mt&&(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 V9(e,t){var r,n,i,s,o,a,c,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),kg.test(t))return wf(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(L9.test(t))r=16,t=t.toLowerCase();else if(D9.test(t))r=2;else if(B9.test(t))r=8;else throw Error(ns+t);for(s=t.search(/p/i),s>0?(c=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),s=t.indexOf("."),o=s>=0,n=e.constructor,o&&(t=t.replace(".",""),a=t.length,s=a-s,i=Lg(n,new n(r),s,s*2)),l=il(t,r,jn),u=l.length-1,s=u;l[s]===0;--s)l.pop();return s<0?new n(e.s*0):(e.e=sl(l,u),e.d=l,mt=!1,o&&(e=Kt(e,i,a*4)),c&&(e=e.times(Math.abs(c)<54?_r(2,c):Sa.pow(2,c))),mt=!0,e)}function z9(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:xo(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/al(5,r)),t=xo(e,2,t,t);for(var i,s=new e(5),o=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(s.plus(i.times(o.times(i).minus(a))));return t}function xo(e,t,r,n,i){var s,o,a,c,l=e.precision,u=Math.ceil(l/ot);for(mt=!1,c=r.times(r),a=new e(n);;){if(o=Kt(a.times(c),new e(t++*t++),l,1),a=i?n.plus(o):n.minus(o),n=Kt(o.times(c),new e(t++*t++),l,1),o=a.plus(n),o.d[u]!==void 0){for(s=u;o.d[s]===a.d[s]&&s--;);if(s==-1)break}s=a,a=n,n=o,o=s}return mt=!0,o.d.length=u+1,o}function al(e,t){for(var r=e;--t;)r*=e;return r}function $g(e,t){var r,n=t.s<0,i=Nn(e,e.precision,1),s=i.times(.5);if(t=t.abs(),t.lte(s))return Ii=n?4:1,t;if(r=t.divToInt(i),r.isZero())Ii=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(s))return Ii=Bg(r)?n?2:3:n?4:1,t;Ii=Bg(r)?n?1:4:n?3:2}return t.minus(i).abs()}function xf(e,t,r,n){var i,s,o,a,c,l,u,f,p,y=e.constructor,x=r!==void 0;if(x?(Jr(r,1,rs),n===void 0?n=y.rounding:Jr(n,0,8)):(r=y.precision,n=y.rounding),!e.isFinite())u=Fg(e);else{for(u=ni(e),o=u.indexOf("."),x?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,o>=0&&(u=u.replace(".",""),p=new y(1),p.e=u.length-o,p.d=il(ni(p),10,i),p.e=p.d.length),f=il(u,10,i),s=c=f.length;f[--c]==0;)f.pop();if(!f[0])u=x?"0p+0":"0";else{if(o<0?s--:(e=new y(e),e.d=f,e.e=s,e=Kt(e,p,r,n,0,i),f=e.d,s=e.e,l=Pg),o=f[r],a=i/2,l=l||f[r+1]!==void 0,l=n<4?(o!==void 0||l)&&(n===0||n===(e.s<0?3:2)):o>a||o===a&&(n===4||l||n===6&&f[r-1]&1||n===(e.s<0?8:7)),f.length=r,l)for(;++f[--r]>i-1;)f[r]=0,r||(++s,f.unshift(1));for(c=f.length;!f[c-1];--c);for(o=0,u="";o<c;o++)u+=gf.charAt(f[o]);if(x){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)u+="0";for(f=il(u,i,t),c=f.length;!f[c-1];--c);for(o=1,u="1.";o<c;o++)u+=gf.charAt(f[o])}else u=u.charAt(0)+"."+u.slice(1);u=u+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)u="0"+u;u="0."+u}else if(++s>c)for(s-=c;s--;)u+="0";else s<c&&(u=u.slice(0,s)+"."+u.slice(s))}u=(t==16?"0x":t==2?"0b":t==8?"0o":"")+u}return e.s<0?"-"+u:u}function Vg(e,t){if(e.length>t)return e.length=t,!0}function q9(e){return new this(e).abs()}function H9(e){return new this(e).acos()}function W9(e){return new this(e).acosh()}function G9(e,t){return new this(e).plus(t)}function K9(e){return new this(e).asin()}function Y9(e){return new this(e).asinh()}function J9(e){return new this(e).atan()}function X9(e){return new this(e).atanh()}function Z9(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,s=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=Nn(this,s,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?Nn(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=Nn(this,s,1).times(.5),r.s=e.s):t.s<0?(this.precision=s,this.rounding=1,r=this.atan(Kt(e,t,s,1)),t=Nn(this,s,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(Kt(e,t,s,1)),r}function Q9(e){return new this(e).cbrt()}function e_(e){return tt(e=new this(e),e.e+1,2)}function t_(e,t,r){return new this(e).clamp(t,r)}function r_(e){if(!e||typeof e!="object")throw Error(nl+"Object expected");var t,r,n,i=e.defaults===!0,s=["precision",1,rs,"rounding",0,8,"toExpNeg",-wo,0,"toExpPos",0,wo,"maxE",0,wo,"minE",-wo,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(r=s[t],i&&(this[r]=vf[r]),(n=e[r])!==void 0)if(Lr(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(ns+r+": "+n);if(r="crypto",i&&(this[r]=vf[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(jg);else this[r]=!1;else throw Error(ns+r+": "+n);return this}function n_(e){return new this(e).cos()}function i_(e){return new this(e).cosh()}function zg(e){var t,r,n;function i(s){var o,a,c,l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,qg(s)){l.s=s.s,mt?!s.d||s.e>i.maxE?(l.e=NaN,l.d=null):s.e<i.minE?(l.e=0,l.d=[0]):(l.e=s.e,l.d=s.d.slice()):(l.e=s.e,l.d=s.d?s.d.slice():s.d);return}if(c=typeof s,c==="number"){if(s===0){l.s=1/s<0?-1:1,l.e=0,l.d=[0];return}if(s<0?(s=-s,l.s=-1):l.s=1,s===~~s&&s<1e7){for(o=0,a=s;a>=10;a/=10)o++;mt?o>i.maxE?(l.e=NaN,l.d=null):o<i.minE?(l.e=0,l.d=[0]):(l.e=o,l.d=[s]):(l.e=o,l.d=[s]);return}else if(s*0!==0){s||(l.s=NaN),l.e=NaN,l.d=null;return}return wf(l,s.toString())}else if(c!=="string")throw Error(ns+s);return(a=s.charCodeAt(0))===45?(s=s.slice(1),l.s=-1):(a===43&&(s=s.slice(1)),l.s=1),kg.test(s)?wf(l,s):V9(l,s)}if(i.prototype=Me,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=r_,i.clone=zg,i.isDecimal=qg,i.abs=q9,i.acos=H9,i.acosh=W9,i.add=G9,i.asin=K9,i.asinh=Y9,i.atan=J9,i.atanh=X9,i.atan2=Z9,i.cbrt=Q9,i.ceil=e_,i.clamp=t_,i.cos=n_,i.cosh=i_,i.div=s_,i.exp=o_,i.floor=a_,i.hypot=c_,i.ln=l_,i.log=u_,i.log10=f_,i.log2=d_,i.max=h_,i.min=p_,i.mod=m_,i.mul=g_,i.pow=v_,i.random=b_,i.round=y_,i.sign=w_,i.sin=x_,i.sinh=S_,i.sqrt=__,i.sub=E_,i.sum=C_,i.tan=A_,i.tanh=T_,i.trunc=M_,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 s_(e,t){return new this(e).div(t)}function o_(e){return new this(e).exp()}function a_(e){return tt(e=new this(e),e.e+1,3)}function c_(){var e,t,r=new this(0);for(mt=!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 mt=!0,new this(1/0);r=t}return mt=!0,r.sqrt()}function qg(e){return e instanceof Sa||e&&e.toStringTag===Ng||!1}function l_(e){return new this(e).ln()}function u_(e,t){return new this(e).log(t)}function d_(e){return new this(e).log(2)}function f_(e){return new this(e).log(10)}function h_(){return Ug(this,arguments,"lt")}function p_(){return Ug(this,arguments,"gt")}function m_(e,t){return new this(e).mod(t)}function g_(e,t){return new this(e).mul(t)}function v_(e,t){return new this(e).pow(t)}function b_(e){var t,r,n,i,s=0,o=new this(1),a=[];if(e===void 0?e=this.precision:Jr(e,1,rs),n=Math.ceil(e/ot),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));s<n;)i=t[s],i>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);s<n;)i=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((t[s+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,s):(a.push(i%1e7),s+=4);s=n/4}else throw Error(jg);else for(;s<n;)a[s++]=Math.random()*1e7|0;for(n=a[--s],e%=ot,n&&e&&(i=_r(10,ot-e),a[s]=(n/i|0)*i);a[s]===0;s--)a.pop();if(s<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=ot)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<ot&&(r-=ot-n)}return o.e=r,o.d=a,o}function y_(e){return tt(e=new this(e),e.e+1,this.rounding)}function w_(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function x_(e){return new this(e).sin()}function S_(e){return new this(e).sinh()}function __(e){return new this(e).sqrt()}function E_(e,t){return new this(e).sub(t)}function C_(){var e=0,t=arguments,r=new this(t[e]);for(mt=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return mt=!0,tt(r,this.precision,this.rounding)}function A_(e){return new this(e).tan()}function T_(e){return new this(e).tanh()}function M_(e){return tt(e=new this(e),e.e+1,1)}Me[Symbol.for("nodejs.util.inspect.custom")]=Me.toString,Me[Symbol.toStringTag]="Decimal";var Sa=Me.constructor=zg(vf);tl=new Sa(tl),rl=new Sa(rl);var cl=Sa,Yt=$s(Vs()),Sf=$s(Vs()),I_=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 Sf.default(e).mul(new Sf.default(this.slippage)).div(new Sf.default("1000000000000000000")).toString()}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];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 f=[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=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::aftermath::${c}`,typeArguments:[l,u,r.extendedDetails.aftermathLpSupplyType],arguments:f})})}},Hg="0x000000000000000000000000000000000000000000000000000000000000dee9",O_=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:Hg,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:`${Hg}::clob_v2::create_account`,typeArguments:[],arguments:[]}),isCreate:!0}})}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=yield this.getOrCreateAccountCap(t,e.client,e.signer),p=[t.object(r.id),n,f.accountCap,t.object(Ft)],y=Ir(e.publishedAtV2(),i),x=t.moveCall({target:`${y}::deepbook::${c}`,typeArguments:[l,u],arguments:p});return f.isCreate&&t.transferObjects([f.accountCap],e.signer),x})}},P_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(r.id),n],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::kriya_amm::${c}`,typeArguments:[l,u],arguments:f})})}},R_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(r.id),n,t.object(this.version),t.object(Ft)],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::kriya_clmm::${c}`,typeArguments:[l,u],arguments:f})})}},j_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.container),n],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::flowx_amm::${c}`,typeArguments:[l,u],arguments:f})})}},N_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.poolRegistry),t.pure.u64(r.feeRate*1e6),n,t.object(this.versioned),t.object(Ft)],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::flowx_clmm::${c}`,typeArguments:[l,u],arguments:f})})}},k_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];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 f=[t.object(r.id),n,t.object(Ft),t.object(this.versioned)],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::turbos::${c}`,typeArguments:[l,u,r.extendedDetails.turbosFeeType],arguments:f})})}},Wg=class{constructor(e,t){this.globalConfig=e===0?"0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f":"0x9774e359588ead122af1c7e7f64e14ade261cfeecdb5d0eb4a5b3b4c8ab8bd3e",this.partner=t??(e===0?"0x639b5e433da31739e800cd085f356e64cae222966d0f1b11bd9dc76b322ff58b":"0x1f5fa5c820f40d43fc47815ad06d95e40a1942ff72a732a92e8ef4aa8cde70a5")}flash_swap(e,t,r,n,i,s){const{direction:o,from:a,target:c}=r,[l,u,f]=o?["flash_swap_a2b",a,c]:["flash_swap_b2a",c,a],p=[t.object(this.globalConfig),t.object(r.id),t.object(this.partner),n,t.pure.bool(i),t.object(Ft)],y=Ir(e.publishedAtV2(),s),x=t.moveCall({target:`${y}::cetus::${l}`,typeArguments:[u,f],arguments:p});return{targetCoin:x[0],flashReceipt:x[1],payAmount:x[2]}}repay_flash_swap(e,t,r,n,i,s){const{direction:o,from:a,target:c}=r,[l,u,f]=o?["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=Ir(e.publishedAtV2(),s);return t.moveCall({target:`${y}::cetus::${l}`,typeArguments:[u,f],arguments:p})[0]}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.globalConfig),t.object(r.id),t.object(this.partner),n,t.object(Ft)],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::cetus::${c}`,typeArguments:[l,u],arguments:f})})}};function Gg(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 Kg(e){return e.split("::")[0]}function cn(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=cn(r),l=R9(P9({},c),{type_arguments:i.map(u=>cn(u).source_address)});return l.type_arguments=l.type_arguments.map(u=>ii.isSuiCoin(u)?u:cn(u).source_address),l.source_address=Gg(l.full_address,l.type_arguments),l}const s=r.split("::"),a={full_address:r,address:r===Jg||r===B_?"0x2":rn(s[0]),module:s[1],name:s[2],type_arguments:[],source_address:""};return a.full_address=`${a.address}::${a.module}::${a.name}`,a.source_address=Gg(a.full_address,a.type_arguments),a}catch{return{full_address:e,address:"",module:"",name:"",type_arguments:[],source_address:e}}}function Yg(e){return cn(e).source_address}var D_="0x2::coin::Coin",L_=/^0x2::coin::Coin<(.+)>$/,Jg="0x2::sui::SUI",B_="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",Xg="0x0000000000000000000000000000000000000005",ii=class Ss{static getCoinTypeArg(t){const r=t.type.match(L_);return r?r[1]:null}static isSUI(t){const r=Ss.getCoinTypeArg(t);return r?Ss.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`${D_}<${t}>`}static getCoinAssets(t,r){const n=[];return r.forEach(i=>{Yg(i.coinAddress)===Yg(t)&&n.push(i)}),n}static isSuiCoin(t){return cn(t).full_address===Jg}static selectCoinObjectIdGreaterThanOrEqual(t,r,n=[]){const i=Ss.selectCoinAssetGreaterThanOrEqual(t,r,n),s=i.selectedCoins.map(c=>c.coinObjectId),o=i.remainingCoins,a=i.selectedCoins.map(c=>c.balance.toString());return{objectArray:s,remainCoins:o,amountArray:a}}static selectCoinAssetGreaterThanOrEqual(t,r,n=[]){const i=Ss.sortByBalance(t.filter(l=>!n.includes(l.coinObjectId))),s=Ss.calculateTotalBalance(i);if(s<r)return{selectedCoins:[],remainingCoins:i};if(s===r)return{selectedCoins:i,remainingCoins:[]};let o=BigInt(0);const a=[],c=[...i];for(;o<s;){const l=r-o,u=c.findIndex(p=>p.balance>=l);if(u!==-1){a.push(c[u]),c.splice(u,1);break}const f=c.pop();f.balance>0&&(a.push(f),o+=f.balance)}return{selectedCoins:Ss.sortByBalance(a),remainingCoins:Ss.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 _f(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 os(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 U_(e,t){e=os(e),t=os(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 Zg(e,t){return e.moveCall({target:"0x2::coin::zero",typeArguments:[t]})}function Ef(e,t,r,n){const i=ii.getCoinAssets(n,t);if(r===BigInt(0))return ii.isSuiCoin(n)||i.length===0&&!ii.isSuiCoin(n)?{targetCoin:Zg(e,n),isMintZeroCoin:!0,targetCoinAmount:0}:{targetCoin:e.object(i[0].coinObjectId),isMintZeroCoin:!1,targetCoinAmount:Number(i[0].balance.toString())};if(ii.calculateTotalBalance(i)<r)throw new AggregateError("Insufficient balance when build merge coin, coinType: "+n,"InsufficientBalance"+n);if(ii.isSuiCoin(n))return{targetCoin:e.splitCoins(e.gas,[e.pure.u64(r.toString())]),isMintZeroCoin:!0,targetCoinAmount:Number(r.toString())};let o=ii.sortByBalance(i);o.slice(0,3).reduce((p,y)=>p+y.balance,BigInt(0))<BigInt(r)&&(o=ii.sortByBalanceDes(i));let c=ii.selectCoinObjectIdGreaterThanOrEqual(o,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 F_(e){return!(!e.startsWith("0x")||e.length!==66)}var So=$s(Vs()),as=$s(Vs()),_a=$s(Vs()),Oi=new _a.default(0);new _a.default(1);var $_=new _a.default(2);$_.pow(new _a.default(128));var V_=new _a.default("18446744073709551615"),bn=1e9;function z_(e,t,r){let n=Oi;return t?n=e.mul(new as.default(bn-r*bn)).div(new as.default(bn)):n=e.mul(new as.default(bn+r*bn)).div(new as.default(bn)),Number(n.toString())}function Qg(e,t,r){let n=Oi;return t?n=e.mul(new as.default(bn-r*bn)).div(new as.default(bn)):n=e.mul(new as.default(bn+r*bn)).div(new as.default(bn)),n}function q_(e,t,r){return new cl(e).mul(cl.pow(2,-64)).pow(2).mul(cl.pow(10,t-r))}function H_(e,t,r,n){return ct(this,null,function*(){var i,s,o,a,c;const{from:l,target:u,amount:f,byAmountIn:p,pools:y}=t,x=os(l),v=os(u),_=new es,T=U_(x,v),O=n===0?"0xb2db7142fa83210a7d78d9c12ac49c043b3cbbd482224fea6e3da00aa5a5ae2d":"0x4f920e1ef6318cfba77e20a0538a419a5a504c14230169438b99aba485db40a6",R=T?x:v,F=T?v:x,B=[R,F];for(let I=0;I<y.length;I++){const g=[_.object(y[I]),_.pure.bool(T),_.pure.bool(p),_.pure.u64(f.toString())];_.moveCall({target:`${O}::fetcher_script::calculate_swap_result`,arguments:g,typeArguments:B})}if(!F_(r))throw new AggregateError("Aggregator package not set","InvalidWallet");const H=yield e.devInspectTransactionBlock({transactionBlock:_,sender:r});if(H.error!=null)throw new AggregateError("Aggregator package not set","SimulateError");const $=(i=H.events)==null?void 0:i.filter(I=>I.type.includes("CalculatedSwapResultEvent"));if($.length===0||$.length!==y.length)throw new AggregateError("Simulate event result error","simulateEventError");let Z=p?Oi:V_,ce=0;for(let I=0;I<$.length;I+=1)if(!$[I].parsedJson.data.is_exceed)if(t.byAmountIn){const g=new So.BN($[I].parsedJson.data.amount_out);g.gt(Z)&&(ce=I,Z=g)}else{const g=new So.BN($[I].parsedJson.data.amount_out);g.lt(Z)&&(ce=I,Z=g)}const ne=$[ce].parsedJson.data,de=ne.step_results[0].current_sqrt_price,[q,N]=yield Promise.all([e.getCoinMetadata({coinType:R}).then(I=>I==null?void 0:I.decimals),e.getCoinMetadata({coinType:F}).then(I=>I==null?void 0:I.decimals)]);if(q==null||N==null)throw new AggregateError("Simulate event result error","CannotGetDecimals");const h=q_(de,q,N),d=Number(ne.fee_rate)/1e6,m=new So.BN((s=ne.amount_in)!=null?s:0),S=new So.BN((o=ne.fee_amount)!=null?o:0),E=m.add(S),M={amountIn:E,amountOut:new So.BN((a=ne.amount_out)!=null?a:0),deviationRatio:0,routes:[{path:[{id:y[ce],direction:T,provider:"CETUS",from:x,target:v,feeRate:d,amountIn:ne.amount_in,amountOut:ne.amount_out,extendedDetails:{afterSqrtPrice:ne.after_sqrt_price}}],amountIn:E,amountOut:new So.BN((c=ne.amount_out)!=null?c:0),initialPrice:h}],insufficientLiquidity:!1,byAmountIn:t.byAmountIn};return{isExceed:ne.is_exceed,routeData:M}})}var W_=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:s}=r,o=s?"swap_a2b":"swap_b2a",a=[t.object(r.id),t.object("0x5"),n],c=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${c}::haedal::${o}`,typeArguments:[],arguments:a})})}},G_=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:s}=r;if(!s)throw new Error("Afsui not support b2a swap");const o="swap_a2b",a=[t.object(this.stakedSuiVault),t.object(this.safe),t.object("0x5"),t.object(this.referVault),t.object(this.validator),n],c=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${c}::afsui::${o}`,typeArguments:[],arguments:a})})}},K_=class{constructor(e){if(e!==0)throw new Error("Volo only supported on mainnet");this.stakePool="0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5",this.metadata="0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s}=r,o=s?"swap_a2b":"swap_b2a",a=[t.object(this.stakePool),t.object(this.metadata),t.object("0x5"),n],c=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${c}::volo::${o}`,typeArguments:[],arguments:a})})}},Y_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.dexInfo),n],p=Ir(e.publishedAtV2(),i);return t.moveCall({target:`${p}::bluemove::${c}`,typeArguments:[l,u],arguments:f})})}},J_=class{constructor(e){this.deepbookV3Config=e===0?"0x699d455ab8c5e02075b4345ea1f91be55bf46064ae6026cc2528e701ce3ac135":"0xe19b5d072346cae83a037d4e3c8492068a74410a74e5830b3a68012db38296aa"}swap(e,t,r,n,i,s){return ct(this,null,function*(){const{direction:o,from:a,target:c}=r,[l,u,f]=o?["swap_a2b_v2",a,c]:["swap_b2a_v2",c,a];let p;s?p=s:p=Zg(t,e.deepbookv3DeepFeeType());const y=[t.object(this.deepbookV3Config),t.object(r.id),n,p,t.object(Ft)],x=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${x}::deepbookv3::${l}`,typeArguments:[u,f],arguments:y})})}},X_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",o,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 f=[t.object(this.version),t.object(this.market),t.object(r.extendedDetails.scallopScoinTreasury),n,t.object(Ft)],p=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${p}::scallop::${c}`,typeArguments:[l,u],arguments:f})})}},ev=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:s,from:o,target:a}=r,[c,l]=s?["swap_a2b",a]:["swap_b2a",o],u=[t.object(r.id),t.object(this.sui_system_state),n],f=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${f}::suilend::${c}`,typeArguments:[l],arguments:u})})}},Z_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.globalConfig),t.object(r.id),n,t.object(Ft)],p=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${p}::bluefin::${c}`,typeArguments:[l,u],arguments:f})})}},Q_=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];let f,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");f=r.extendedDetails.haedalPmmBasePriceSeed,p=r.extendedDetails.haedalPmmQuotePriceSeed;const y=this.pythPriceIDs.get(f),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 v=[t.object(r.id),t.object(y),t.object(x),n,t.object(Ft)],_=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${_}::haedalpmm::${c}`,typeArguments:[l,u],arguments:v})})}},eE=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:s,from:o,target:a}=r,[c,l]=s?["swap_a2b",a]:["swap_b2a",o],u=[t.object(r.id),t.object(this.sui_system_state),n],f=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${f}::alphafi::${c}`,typeArguments:[l],arguments:u})})}},tE=class{constructor(e){if(e!==0)throw new Error("Steamm only supported on mainnet");this.steammPublishedAt="0x5ef2a1bca239764c8381ba26b758833060eadb8903682e4fb15e58c6406e2488"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b_v2",o,a]:["swap_b2a_v2",a,o];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 f=[t.object(r.id),t.object(r.extendedDetails.steammBankA),t.object(r.extendedDetails.steammBankB),t.object(r.extendedDetails.steammLendingMarket),n,t.object(Ft)],p=Pi(e.publishedAtV2Extend2(),i),y=t.moveCall({target:`${p}::steamm_cpmm::${c}`,typeArguments:[r.extendedDetails.steammLendingMarketType,l,u,r.extendedDetails.steammBCoinAType,r.extendedDetails.steammBCoinBType,r.extendedDetails.steammLPToken],arguments:f});return tv(t,this.steammPublishedAt,r.extendedDetails.steammBankA,r.extendedDetails.steammLendingMarket,r.extendedDetails.steammLendingMarketType,l,r.extendedDetails.steammBCoinAType),tv(t,this.steammPublishedAt,r.extendedDetails.steammBankB,r.extendedDetails.steammLendingMarket,r.extendedDetails.steammLendingMarketType,u,r.extendedDetails.steammBCoinBType),y})}};function tv(e,t,r,n,i,s,o){if(s==="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"){const a=[e.object(r),e.object(n),e.object(Xg),e.object(Ft)];e.moveCall({target:`${t}::bank::rebalance_sui`,typeArguments:[i,o],arguments:a})}else{const a=[e.object(r),e.object(n),e.object(Ft)];e.moveCall({target:`${t}::bank::rebalance`,typeArguments:[i,s,o],arguments:a})}}var rE=class{constructor(e,t){if(e!==0)throw new Error("Steamm omm only supported on mainnet");this.pythPriceIDs=t,this.oraclePackageId="0xe84b649199654d18c38e727212f5d8dacfc3cf78d60d0a7fc85fd589f280eb2b"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,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]=s?["swap_a2b_v2",o,a]:["swap_b2a_v2",a,o],f=r.extendedDetails.steammOraclePythPriceSeedA,p=r.extendedDetails.steammOraclePythPriceSeedB,y=this.pythPriceIDs.get(f),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 v=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(Ft)]}),_=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(Ft)]}),T=[t.object(r.id),t.object(r.extendedDetails.steammBankA),t.object(r.extendedDetails.steammBankB),t.object(r.extendedDetails.steammLendingMarket),v,_,n,t.object(Ft)],O=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${O}::steamm_omm::${c}`,typeArguments:[r.extendedDetails.steammLendingMarketType,l,u,r.extendedDetails.steammBCoinAType,r.extendedDetails.steammBCoinBType,r.extendedDetails.steammLPToken],arguments:T})})}},nE="0x790f258062909e3a0ffc78b3c53ac2f62d7084c3bab95644bdeb05add7250001::super_sui::SUPER_SUI",iE="0xe44df51c0b21a27ab915fa1fe2ca610cd3eaa6d9666fe5e62b988bf7f0bd8722::musd::MUSD",sE="0xccd628c2334c5ed33e6c47d6c21bb664f8b6307b2ac32c2462a61f69a31ebcee::meth::METH",oE=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:s,from:o,target:a}=r,[c,l,u,f]=s?["swap_a2b","create_deposit_cap",o,a]:["swap_b2a","create_withdraw_cap",a,o];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 v=[f];r.extendedDetails.metastableCreateCapAllTypeParams&&v.push(u);const _=[t.object(x),t.object(r.id)];switch(f){case nE:{if(!r.extendedDetails.metastableRegistryId)throw new Error("Not found registry id for super sui");_.push(t.object(r.extendedDetails.metastableRegistryId));break}case iE:{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);_.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);_.push(t.object(B))}_.push(t.object(Ft));break}case sE:{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);_.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);_.push(t.object(B))}_.push(t.object(Ft));break}default:throw new Error("Invalid Metacoin: "+f)}const T=t.moveCall({target:`${p}::${y}::${l}`,typeArguments:v,arguments:_}),O=[t.object(r.id),t.object(this.versionID),T,n],R=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${R}::metastable::${c}`,typeArguments:[u,f],arguments:O})})}},aE=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];let f,p,y,x;if(r.extendedDetails==null)throw new Error("Extended details not supported in obric");if(r.extendedDetails.obricCoinAPriceSeed&&r.extendedDetails.obricCoinBPriceSeed)f=r.extendedDetails.obricCoinAPriceSeed,y=this.pythPriceIDs.get(f),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 v=[t.object(r.id),n,t.object(this.pythStateObjectId),t.object(y),t.object(x),t.object(Ft)],_=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${_}::obric::${c}`,typeArguments:[l,u],arguments:v})})}},cE=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:s}=r,o=s?"swap_a2b":"swap_b2a",a=[t.object(this.staking),t.object(r.id),n,t.object(this.validator)],c=kn(e.publishedAtV2Extend(),i);return t.moveCall({target:`${c}::hawal::${o}`,typeArguments:[],arguments:a})})}},lE=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:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(r.id),n,t.object(this.version),t.object(Ft)],p=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${p}::momentum::${c}`,typeArguments:[l,u],arguments:f})})}},uE=class{constructor(e,t){if(e!==0)throw new Error("Steamm omm v2 only supported on mainnet");this.pythPriceIDs=t,this.oraclePackageId="0xe84b649199654d18c38e727212f5d8dacfc3cf78d60d0a7fc85fd589f280eb2b",this.steammPublishedAt="0x5ef2a1bca239764c8381ba26b758833060eadb8903682e4fb15e58c6406e2488"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,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]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=r.extendedDetails.steammOraclePythPriceSeedA,p=r.extendedDetails.steammOraclePythPriceSeedB,y=this.pythPriceIDs.get(f),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 v=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(Ft)]}),_=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(Ft)]}),T=[t.object(r.id),t.object(r.extendedDetails.steammBankA),t.object(r.extendedDetails.steammBankB),t.object(r.extendedDetails.steammLendingMarket),v,_,n,t.object(Ft)],O=Pi(e.publishedAtV2Extend2(),i),R=t.moveCall({target:`${O}::steamm_omm_v2::${c}`,typeArguments:[r.extendedDetails.steammLendingMarketType,l,u,r.extendedDetails.steammBCoinAType,r.extendedDetails.steammBCoinBType,r.extendedDetails.steammLPToken],arguments:T});return rv(t,this.steammPublishedAt,r.extendedDetails.steammBankA,r.extendedDetails.steammLendingMarket,r.extendedDetails.steammLendingMarketType,l,r.extendedDetails.steammBCoinAType),rv(t,this.steammPublishedAt,r.extendedDetails.steammBankB,r.extendedDetails.steammLendingMarket,r.extendedDetails.steammLendingMarketType,u,r.extendedDetails.steammBCoinBType),R})}};function rv(e,t,r,n,i,s,o){if(s==="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"){const a=[e.object(r),e.object(n),e.object(Xg),e.object(Ft)];e.moveCall({target:`${t}::bank::rebalance_sui`,typeArguments:[i,o],arguments:a})}else{const a=[e.object(r),e.object(n),e.object(Ft)];e.moveCall({target:`${t}::bank::rebalance`,typeArguments:[i,s,o],arguments:a})}}var dE=class{constructor(e){if(e!==0)throw new Error("Magma CLMM only supported on mainnet");this.globalConfig="0x4c4e1402401f72c7d8533d0ed8d5f8949da363c7a3319ccef261ffe153d32f8a"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.globalConfig),t.object(r.id),n,t.object(Ft)],p=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${p}::magma::${c}`,typeArguments:[l,u],arguments:f})})}},fE=class{constructor(e,t){if(e===1)throw new Error("Sevenk is not supported on testnet");this.pythPriceIDs=t,this.oraclePublishedAt="0x8c36ea167c5e6da8c3d60b4fc897416105dcb986471bd81cfbfd38720a4487c0"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];let f,p,y,x,v;if(r.extendedDetails==null)throw new Error("Extended details not supported haedal pmm");if(!r.extendedDetails.sevenkCoinAPriceSeed||!r.extendedDetails.sevenkCoinBPriceSeed||!r.extendedDetails.sevenkCoinAOracleId||!r.extendedDetails.sevenkCoinBOracleId||!r.extendedDetails.sevenkLPCapType)throw new Error("Base price seed or quote price seed not supported");f=r.extendedDetails.sevenkCoinAPriceSeed,p=r.extendedDetails.sevenkCoinBPriceSeed,y=r.extendedDetails.sevenkCoinAOracleId,x=r.extendedDetails.sevenkCoinBOracleId,v=r.extendedDetails.sevenkLPCapType;const _=this.pythPriceIDs.get(f),T=this.pythPriceIDs.get(p);if(!_||!T)throw new Error("Base price info object id or quote price info object id not found");const O=t.moveCall({target:`${this.oraclePublishedAt}::oracle::new_holder`,typeArguments:[],arguments:[]});t.moveCall({target:`${this.oraclePublishedAt}::pyth::get_price`,typeArguments:[],arguments:[t.object(y),O,t.object(_),t.object(Ft)]}),t.moveCall({target:`${this.oraclePublishedAt}::pyth::get_price`,typeArguments:[],arguments:[t.object(x),O,t.object(T),t.object(Ft)]});const R=[t.object(r.id),O,n],F=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${F}::sevenk::${c}`,typeArguments:[l,u,v],arguments:R})})}},hE=class{constructor(e,t){if(e===1)throw new Error("HaedalHMMV2 is not supported on testnet");this.pythPriceIDs=t}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o];let f;if(r.extendedDetails==null)throw new Error("Extended details not supported haedal pmm");if(!r.extendedDetails.haedalHmmV2BasePriceSeed)throw new Error("Base price seed not supported");f=r.extendedDetails.haedalHmmV2BasePriceSeed;const p=this.pythPriceIDs.get(f);if(!p)throw new Error("Base price info object id not found");const y=[t.object(r.id),t.object(p),n,t.object(Ft)],x=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${x}::haedal_hmm_v2::${c}`,typeArguments:[l,u],arguments:y})})}},pE=class{constructor(e){this.globalConfig="0xe93baa80cb570b3a494cbf0621b2ba96bc993926d34dc92508c9446f9a05d615",this.rewarder="0xfb971d3a2fb98bde74e1c30ba15a3d8bef60a02789e59ae0b91660aeed3e64e1",this.stats="0x6822a33d1d971e040c32f7cc74507010d1fe786f7d06ab89135083ddb07d2dc2",this.price_provider="0x854b2d2c0381bb656ec962f8b443eb082654384cf97885359d1956c7d76e33c9"}swap(e,t,r,n,i){return ct(this,null,function*(){const{direction:s,from:o,target:a}=r,[c,l,u]=s?["swap_a2b",o,a]:["swap_b2a",a,o],f=[t.object(this.globalConfig),t.object(this.rewarder),t.object(r.id),n,t.object(this.stats),t.object(this.price_provider),t.object(Ft)],p=Pi(e.publishedAtV2Extend2(),i);return t.moveCall({target:`${p}::fullsail::${c}`,typeArguments:[l,u],arguments:f})})}},nv="CETUS",mE="DEEPBOOK",gE="KRIYA",vE="FLOWX",bE="FLOWXV3",yE="KRIYAV3",iv="TURBOS",Cf="AFTERMATH",wE="HAEDAL",xE="VOLO",SE="AFSUI",_E="BLUEMOVE",sv="DEEPBOOKV3",ov="SCALLOP",EE="SUILEND",CE="BLUEFIN",Af="HAEDALPMM",AE="ALPHAFI",TE="SPRINGSUI",av="STEAMM",Tf="METASTABLE",Mf="OBRIC",ME="HAWAL",If="STEAMM_OMM",IE="MOMENTUM",Of="STEAMM_OMM_V2",OE="MAGMA",Pf="SEVENK",Rf="HAEDALHMMV2",PE="FULLSAIL",RE="https://api-sui.cetus.zone/router_v2";function jf(e){return Array.isArray(e.routers)}function Nf(e){return Array.isArray(e.routers)}var cv=class i4{constructor(t){var r,n;this.endpoint=t.endpoint?LE(t.endpoint):RE,this.client=t.client||new Ns({url:Vh("mainnet")}),this.signer=t.signer||"",this.env=t.env||0,this.allCoins=new Map;const i=i4.CONFIG[this.env];if(this.pythConnections=this.newPythClients((r=t.pythUrls)!=null?r:[]),this.pythClient=new ud.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 ud.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 o=this.allCoins.get(t);if(o)return o}const s=[];for(;;)try{const o=yield this.client.getCoins({owner:this.signer,coinType:t,cursor:n,limit:i});for(const a of o.data)s.push({coinAddress:cn(a.coinType).source_address,coinObjectId:a.coinObjectId,balance:BigInt(a.balance)});if(!o.hasNextPage)break;n=o.nextCursor}catch(o){console.error("getCoins error:",o);break}return this.allCoins.set(t,s),s})}findRouters(t){return ct(this,null,function*(){return BE(this.endpoint,this.apiKey,t,this.overlayFeeRate,this.overlayFeeReceiver)})}executeFlexibleInputSwap(t,r,n,i,s,o,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,f=[];for(let v=0;v<n.length-1;v++){if(n[v].path.length===0)throw new Error("Empty path");let T=t.splitCoins(r,[n[v].amountIn.toString()])[0];for(const O of n[v].path)T=yield this.newDex(O.provider,o,a).swap(this,t,O,T,l,c);f.push(T)}if(n[n.length-1].path.length===0)throw new Error("Empty path");let p=r;for(const v of n[n.length-1].path)p=yield this.newDex(v.provider,o,a).swap(this,t,v,p,l,c);f.push(p);const y=kn(this.publishedAtV2Extend(),l);return this.checkCoinThresholdAndMergeCoin(t,f,u,i,s,y)})}expectInputSwap(t,r,n,i,s,o,a,c,l){return ct(this,null,function*(){if(n.length===0)throw new Error("No router found");const u=n.map(O=>O.amountIn.toString()),f=n[0].path[0].from,p=n[0].path[n[0].path.length-1].target,y=t.splitCoins(r,u),x=[];for(let O=0;O<n.length;O++){if(n[O].path.length===0)throw new Error("Empty path");let R=y[O];for(const F of n[O].path)R=yield this.newDex(F.provider,o,a).swap(this,t,F,R,l,c);x.push(R)}const v=Ir(this.publishedAtV2(),l),_=kn(this.publishedAtV2Extend(),l);return this.transferOrDestoryCoin(t,r,f,v),this.checkCoinThresholdAndMergeCoin(t,x,p,i,s,_)})}expectOutputSwap(t,r,n,i,s){return ct(this,null,function*(){const o=[],a=[],c=[],l=new Wg(this.env,i),u=Ir(this.publishedAtV2(),s);for(let p=0;p<n.length;p++){const y=n[p];let x=t.pure.u64(y.amountOut.toString());for(let _=y.path.length-1;_>=0;_--){const T=y.path[_],O=l.flash_swap(this,t,T,x,!1);x=O.payAmount,o.unshift(O.targetCoin),a.unshift(O.flashReceipt)}let v=r;for(let _=0;_<y.path.length;_++){const T=y.path[_],O=l.repay_flash_swap(this,t,T,v,a[_]);v=o[_],_===0?r=O:this.transferOrDestoryCoin(t,O,T.from,u),_===y.path.length-1&&c.push(v)}}const f=n[0].path[0].from;if(this.transferOrDestoryCoin(t,r,f,u),c.length>1){const p=t.makeMoveVec({elements:c.slice(1)});t.moveCall({target:`${ua}::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 H_(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:s,deepbookv3DeepFee:o,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=jf(t)?t.byAmountIn:t.routers.byAmountIn,u=c.reduce((H,$)=>H.add($.amountIn),new Yt.default(0)),f=c.reduce((H,$)=>H.add($.amountOut),new Yt.default(0));let p=new Yt.default(0);this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(l?p=f.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)):p=u.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)));const y=l?f.sub(p):f,x=l?u:u.add(p),v=Qg(l?y:x,l,i),_=jf(t)?void 0:t.routers.packages,T=Ir(this.publishedAtV2(),_),O=uv(c),R=O.length>0?yield this.updatePythPriceIDs(O,s):new Map;if(l)return yield this.expectInputSwap(s,n,c,f.toString(),v.toString(),R,a??this.partner,o,_);if(this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"){const H=s.splitCoins(n,[p.toString()]);s.transferObjects([H],this.overlayFeeReceiver)}const F=s.splitCoins(n,[v.sub(p).toString()]);return this.transferOrDestoryCoin(s,n,c[0].path[0].from,T),yield this.expectOutputSwap(s,F[0],c,a??this.partner)})}fixableRouterSwap(t){return ct(this,null,function*(){const{routers:r,inputCoin:n,slippage:i,txb:s,deepbookv3DeepFee:o,partner:a}=t,c=Array.isArray(r)?r:r.routes,l=t.routers.byAmountIn,u=c.reduce((F,B)=>F.add(B.amountIn),new Yt.default(0)),f=c.reduce((F,B)=>F.add(B.amountOut),new Yt.default(0));let p=0;this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(l?p=Number(f.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)).toString()):p=Number(u.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)).toString()));const y=l?f.sub(new Yt.default(p)):f,x=l?u:u.add(new Yt.default(p)),v=Qg(l?y:x,l,i),_=jf(t)?void 0:t.routers.packages,T=uv(c),O=T.length>0?yield this.updatePythPriceIDs(T,s):new Map;return l?yield this.executeFlexibleInputSwap(s,n,c,y.toString(),v.toString(),O,a??this.partner,o,_):yield this.expectOutputSwap(s,n,c,a??this.partner)})}fastRouterSwap(t){return ct(this,null,function*(){const{routers:r,slippage:n,txb:i,partner:s,refreshAllCoins:o,payDeepFeeAmount:a}=t,c=Array.isArray(r)?r:r.routes,l=c[0].path[0].from;let u=yield this.getCoins(l,o);const f=c[0].path[c[0].path.length-1].target,p=c.reduce((Z,ce)=>Z.add(ce.amountIn),new Yt.default(0)),y=c.reduce((Z,ce)=>Z.add(ce.amountOut),new Yt.default(0)),x=Nf(t)?t.byAmountIn:t.routers.byAmountIn;let v=0;this.overlayFeeRate>0&&this.overlayFeeReceiver!=="0x0"&&(x?v=Number(y.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)).toString()):v=Number(p.mul(new Yt.default(this.overlayFeeRate)).div(new Yt.default(1e6)).toString()));const _=x?y.sub(new Yt.default(v)):y,T=x?p:p.add(new Yt.default(v)),O=z_(x?_:T,x,n),F=Ef(i,u,BigInt((x?T:O).toString()),l);let B;if(a&&a>0){let Z=yield this.getCoins(this.deepbookv3DeepFeeType());B=Ef(i,Z,BigInt(a),this.deepbookv3DeepFeeType()).targetCoin}const H=Nf(t)?{routers:c,inputCoin:F.targetCoin,slippage:n,byAmountIn:x,txb:i,partner:s??this.partner,deepbookv3DeepFee:B}:{routers:t.routers,inputCoin:F.targetCoin,slippage:n,byAmountIn:x,txb:i,partner:s??this.partner,deepbookv3DeepFee:B},$=yield this.routerSwap(H);if(ii.isSuiCoin(f))i.mergeCoins(i.gas,[$]);else{let Z=yield this.getCoins(f,o);const ce=Ef(i,Z,BigInt(0),f),ne=Nf(t)?void 0:t.routers.packages,de=Ir(this.publishedAtV2(),ne);i.mergeCoins(ce.targetCoin,[$]),ce.isMintZeroCoin&&this.transferOrDestoryCoin(i,ce.targetCoin,f,de)}})}publishedAtV2(){return this.env===0?"0x8ae871505a80d8bf6bf9c05906cda6edfeea460c85bebe2e26a4313f5e67874a":"0x52eae33adeb44de55cfb3f281d4cc9e02d976181c0952f5323648b5717b33934"}publishedAtV2Extend(){return this.env===0?"0xb39d6dddedd16ed8a40ce0b1e6b43c92acf0ff3fa2fac081fb82ef1b915c17b4":"0xabb6a81c8a216828e317719e06125de5bb2cb0fe8f9916ff8c023ca5be224c78"}publishedAtV2Extend2(){return this.env===0?"0x88142be0f2c6b0150980109a7386220b4c040a5c4d9a16d5f7dd0bbd0135ba12":"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,s,o){let a=r[0];if(r.length>1){let c=t.makeMoveVec({elements:r.slice(1)});t.moveCall({target:`${ua}::pay::join_vec`,typeArguments:[n],arguments:[r[0],c]}),a=r[0]}return this.overlayFeeRate===0||this.overlayFeeReceiver==="0x0"?t.moveCall({target:`${o}::utils::check_coin_threshold_v1`,typeArguments:[n],arguments:[a,t.pure.u64(i),t.pure.u64(s)]}):t.moveCall({target:`${o}::utils::check_coin_threshold_v2`,typeArguments:[n],arguments:[a,t.pure.u64(i),t.pure.u64(s),t.pure.u64(this.overlayFeeRate),t.pure.address(this.overlayFeeReceiver)]}),a}newDex(t,r,n){switch(t){case nv:return new Wg(this.env,n);case mE:return new O_(this.env);case sv:return new J_(this.env);case gE:return new P_(this.env);case yE:return new R_(this.env);case vE:return new j_(this.env);case bE:return new N_(this.env);case iv:return new k_(this.env);case Cf:return new I_(this.env);case wE:return new W_(this.env);case SE:return new G_(this.env);case xE:return new K_(this.env);case _E:return new Y_(this.env);case ov:return new X_(this.env);case EE:return new ev(this.env);case TE:return new ev(this.env);case CE:return new Z_(this.env);case Af:return new Q_(this.env,r);case AE:return new eE(this.env);case av:return new tE(this.env);case If:return new rE(this.env,r);case Tf:return new oE(this.env,r);case Mf:return new aE(this.env,r);case ME:return new cE(this.env);case IE:return new lE(this.env);case Of:return new uE(this.env,r);case OE:return new dE(this.env);case Pf:return new fE(this.env,r);case Rf:return new hE(this.env,r);case PE:return new pE(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 $E(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 s=[];try{s=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 o=new Map;for(let a=0;a<t.length;a++)o.set(t[a],s[a]);return o})}};cv.CONFIG={1:{wormholeStateId:"0x31358d198147da50db32eda2562951d53973a0c0ad5ed738e9b17d88b213d790",pythStateId:"0x243759059f4c3111179da5878c12f68d612c21a8d54d85edc86164bb18be1c7c"},0:{wormholeStateId:"0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c",pythStateId:"0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8"}};var lv=cv;function uv(e){const t=new Set;for(const r of e)for(const n of r.path)n.provider===Af&&n.extendedDetails&&n.extendedDetails.haedalPmmBasePriceSeed&&n.extendedDetails.haedalPmmQuotePriceSeed&&(t.add(n.extendedDetails.haedalPmmBasePriceSeed),t.add(n.extendedDetails.haedalPmmQuotePriceSeed)),n.provider===Tf&&(n.extendedDetails&&n.extendedDetails.metastablePriceSeed&&t.add(n.extendedDetails.metastablePriceSeed),n.extendedDetails&&n.extendedDetails.metastableETHPriceSeed&&t.add(n.extendedDetails.metastableETHPriceSeed)),n.provider===Mf&&(n.extendedDetails&&n.extendedDetails.obricCoinAPriceSeed&&t.add(n.extendedDetails.obricCoinAPriceSeed),n.extendedDetails&&n.extendedDetails.obricCoinBPriceSeed&&t.add(n.extendedDetails.obricCoinBPriceSeed)),(n.provider===If||n.provider===Of)&&(n.extendedDetails&&n.extendedDetails.steammOraclePythPriceSeedA&&t.add(n.extendedDetails.steammOraclePythPriceSeedA),n.extendedDetails&&n.extendedDetails.steammOraclePythPriceSeedB&&t.add(n.extendedDetails.steammOraclePythPriceSeedB)),n.provider===Pf&&(n.extendedDetails&&n.extendedDetails.sevenkCoinAPriceSeed&&t.add(n.extendedDetails.sevenkCoinAPriceSeed),n.extendedDetails&&n.extendedDetails.sevenkCoinBPriceSeed&&t.add(n.extendedDetails.sevenkCoinBPriceSeed)),n.provider===Rf&&n.extendedDetails&&n.extendedDetails.haedalHmmV2BasePriceSeed&&t.add(n.extendedDetails.haedalHmmV2BasePriceSeed);return Array.from(t)}function jE(e,t){let r=0;for(const s of e.routes)for(const o of s.path)o.extended_details&&o.extended_details.deepbookv3_deep_fee&&(r+=Number(o.extended_details.deepbookv3_deep_fee));let n;if(e.packages!=null){n=new Map;for(const[s,o]of Object.entries(e.packages))n.set(s,o)}return{amountIn:new Yt.default(e.amount_in.toString()),amountOut:new Yt.default(e.amount_out.toString()),deviationRatio:e.deviation_ratio?Number(e.deviation_ratio):void 0,byAmountIn:t,insufficientLiquidity:!1,routes:e.routes.map(s=>({path:s.path.map(o=>{var a,c,l,u,f,p,y,x,v,_,T,O,R,F,B,H,$,Z,ce,ne,de,q,N,h,d,m,S,E,M,j,I,g,b,k,ve,he;let we;o.provider===Cf&&(we=o.extended_details.aftermath_pool_flatness===0?"v2":"v3");let Oe;return(o.provider===iv||o.provider===Cf||o.provider===nv||o.provider===sv||o.provider===ov||o.provider===Af||o.provider===Tf||o.provider===Mf||o.provider===av||o.provider===If||o.provider===Of||o.provider===Pf||o.provider===Rf)&&(Oe={aftermathLpSupplyType:(a=o.extended_details)==null?void 0:a.aftermath_lp_supply_type,turbosFeeType:(c=o.extended_details)==null?void 0:c.turbos_fee_type,afterSqrtPrice:(l=o.extended_details)==null?void 0:l.after_sqrt_price,deepbookv3DeepFee:(u=o.extended_details)==null?void 0:u.deepbookv3_deep_fee,scallopScoinTreasury:(f=o.extended_details)==null?void 0:f.scallop_scoin_treasury,haedalPmmBasePriceSeed:(p=o.extended_details)==null?void 0:p.haedal_pmm_base_price_seed,haedalPmmQuotePriceSeed:(y=o.extended_details)==null?void 0:y.haedal_pmm_quote_price_seed,steammBankA:(x=o.extended_details)==null?void 0:x.steamm_bank_a,steammBankB:(v=o.extended_details)==null?void 0:v.steamm_bank_b,steammLendingMarket:(_=o.extended_details)==null?void 0:_.steamm_lending_market,steammLendingMarketType:(T=o.extended_details)==null?void 0:T.steamm_lending_market_type,steammBCoinAType:(O=o.extended_details)==null?void 0:O.steamm_btoken_a_type,steammBCoinBType:(R=o.extended_details)==null?void 0:R.steamm_btoken_b_type,steammLPToken:(F=o.extended_details)==null?void 0:F.steamm_lp_token_type,steammOracleRegistryId:(B=o.extended_details)==null?void 0:B.steamm_oracle_registry_id,steammOracleIndexA:(H=o.extended_details)==null?void 0:H.steamm_oracle_index_a,steammOracleIndexB:($=o.extended_details)==null?void 0:$.steamm_oracle_index_b,steammOraclePythPriceSeedA:(Z=o.extended_details)==null?void 0:Z.steamm_oracle_pyth_price_seed_a,steammOraclePythPriceSeedB:(ce=o.extended_details)==null?void 0:ce.steamm_oracle_pyth_price_seed_b,metastablePriceSeed:(ne=o.extended_details)==null?void 0:ne.metastable_price_seed,metastableETHPriceSeed:(de=o.extended_details)==null?void 0:de.metastable_eth_price_seed,metastableWhitelistedAppId:(q=o.extended_details)==null?void 0:q.metastable_whitelisted_app_id,metastableCreateCapPkgId:(N=o.extended_details)==null?void 0:N.metastable_create_cap_pkg_id,metastableCreateCapModule:(h=o.extended_details)==null?void 0:h.metastable_create_cap_module,metastableCreateCapAllTypeParams:(d=o.extended_details)==null?void 0:d.metastable_create_cap_all_type_params,metastableRegistryId:(m=o.extended_details)==null?void 0:m.metastable_registry_id,obricCoinAPriceSeed:(S=o.extended_details)==null?void 0:S.obric_coin_a_price_seed,obricCoinBPriceSeed:(E=o.extended_details)==null?void 0:E.obric_coin_b_price_seed,obricCoinAPriceId:(M=o.extended_details)==null?void 0:M.obric_coin_a_price_id,obricCoinBPriceId:(j=o.extended_details)==null?void 0:j.obric_coin_b_price_id,sevenkCoinAPriceSeed:(I=o.extended_details)==null?void 0:I.sevenk_coin_a_price_seed,sevenkCoinBPriceSeed:(g=o.extended_details)==null?void 0:g.sevenk_coin_b_price_seed,sevenkCoinAOracleId:(b=o.extended_details)==null?void 0:b.sevenk_oracle_config_a,sevenkCoinBOracleId:(k=o.extended_details)==null?void 0:k.sevenk_oracle_config_b,sevenkLPCapType:(ve=o.extended_details)==null?void 0:ve.sevenk_lp_cap_type,haedalHmmV2BasePriceSeed:(he=o.extended_details)==null?void 0:he.haedalhmmv2_base_price_seed}),{id:o.id,direction:o.direction,provider:o.provider,from:o.from,target:o.target,feeRate:o.fee_rate,amountIn:o.amount_in,amountOut:o.amount_out,extendedDetails:Oe,version:we}}),amountIn:new Yt.default(s.amount_in.toString()),amountOut:new Yt.default(s.amount_out.toString()),initialPrice:new cl(s.initial_price.toString())})),totalDeepFee:r,packages:n}}var Ft=Xp,NE="aggregator_v2",kE="aggregator_v2_extend",DE="aggregator_v2_extend2";function Ir(e,t){var r;return t instanceof Map&&(r=t.get(NE))!=null?r:e}function kn(e,t){var r;return t instanceof Map&&(r=t.get(kE))!=null?r:e}function Pi(e,t){var r;return t instanceof Map&&(r=t.get(DE))!=null?r:e}$s(Vs());function LE(e){return e.endsWith("/find_routes")?e.replace("/find_routes",""):e}var ll=$s(Vs()),dv=1001600;function BE(e,t,r,n,i){return ct(this,null,function*(){let s;if(r.liquidityChanges&&r.liquidityChanges.length>0?s=yield FE(e,r):s=yield UE(e,t,r),!s)return null;if(!s.ok){let c=10001;return s.status===429&&(c=10005),{amountIn:Oi,amountOut:Oi,routes:[],byAmountIn:r.byAmountIn,insufficientLiquidity:!1,deviationRatio:0,error:{code:c,msg:_f(c)}}}const o=E9.parse(yield s.text()),a=o.msg==="liquidity is not enough";if(o.msg&&o.msg.indexOf("HoneyPot scam")>-1)return{amountIn:Oi,amountOut:Oi,routes:[],byAmountIn:r.byAmountIn,insufficientLiquidity:a,deviationRatio:0,error:{code:10004,msg:_f(10004)}};if(o.data!=null){const c=jE(o.data,r.byAmountIn);if(n>0&&i!=="0x0")if(r.byAmountIn){const l=c.amountOut.mul(new ll.default(n)).div(new ll.default(1e6));c.overlayFee=Number(l.toString()),c.amountOut=c.amountOut.sub(l)}else{const l=c.amountIn.mul(new ll.default(n)).div(new ll.default(1e6));c.overlayFee=Number(l.toString()),c.amountIn=c.amountIn.add(l)}return c}return{amountIn:Oi,amountOut:Oi,routes:[],insufficientLiquidity:a,byAmountIn:r.byAmountIn,deviationRatio:0,error:{code:10003,msg:_f(10003)}}})}function UE(e,t,r){return ct(this,null,function*(){try{const{from:n,target:i,amount:s,byAmountIn:o,depth:a,splitAlgorithm:c,splitFactor:l,splitCount:u,providers:f}=r,p=os(n),y=os(i);let x=`${e}/find_routes?from=${p}&target=${y}&amount=${s.toString()}&by_amount_in=${o}`;return a&&(x+=`&depth=${a}`),c&&(x+=`&split_algorithm=${c}`),l&&(x+=`&split_factor=${l}`),u&&(x+=`&split_count=${u}`),f&&f.length>0&&(x+=`&providers=${f.join(",")}`),t.length>0&&(x+=`&apiKey=${t}`),x+=`&v=${dv}`,yield fetch(x)}catch(n){return console.error(n),null}})}function FE(e,t){return ct(this,null,function*(){const{from:r,target:n,amount:i,byAmountIn:s,depth:o,splitAlgorithm:a,splitFactor:c,splitCount:l,providers:u,liquidityChanges:f}=t,p=os(r),y=os(n),x=`${e}/find_routes`,v=u==null?void 0:u.join(","),_={from:p,target:y,amount:Number(i.toString()),by_amount_in:s,depth:o,split_algorithm:a,split_factor:c,split_count:l,providers:v,liquidity_changes:f.map(T=>({pool:T.poolID,tick_lower:T.ticklower,tick_upper:T.tickUpper,delta_liquidity:T.deltaLiquidity})),v:dv};try{return yield fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_)})}catch(T){return console.error("Error:",T),null}})}function $E(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 kf=(e=>(e[e.Mainnet=0]="Mainnet",e[e.Testnet=1]="Testnet",e))(kf||{});const fv="0x2::sui::SUI",VE="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";function hv(e){return dr(e).full_address===fv}function pv(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 dr(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={...dr(r),type_arguments:i.map(u=>dr(u).source_address)};return l.type_arguments=l.type_arguments.map(u=>hv(u)?u:dr(u).source_address),l.source_address=pv(l.full_address,l.type_arguments),l}const s=r.split("::"),a={full_address:r,address:r===fv||r===VE?"0x2":rn(s[0]),module:s[1],name:s[2],type_arguments:[],source_address:""};return a.full_address=`${a.address}::${a.module}::${a.name}`,a.source_address=pv(a.full_address,a.type_arguments),a}catch{return{full_address:e,address:"",module:"",name:"",type_arguments:[],source_address:e}}}function zE(e){return e.startsWith("0x")?`${e.slice(2)}`:e}const Ri=(e,t=!0)=>{const r=e.split("::"),n=r.shift();let i=rn(n);return t&&(i=zE(i)),`${i}::${r.join("::")}`};/*!
|
|
42
42
|
* decimal.js v10.5.0
|
|
43
43
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
44
44
|
* https://github.com/MikeMcl/decimal.js
|
|
45
45
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
46
46
|
* MIT Licence
|
|
47
|
-
*/var _o=9e15,cs=1e9,Lf="0123456789abcdef",ul="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",dl="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Bf={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-_o,maxE:_o,crypto:!1},vv,ji,gt=!0,fl="[DecimalError] ",ls=fl+"Invalid argument: ",bv=fl+"Precision limit exceeded",yv=fl+"crypto unavailable",wv="[object Decimal]",Br=Math.floor,Er=Math.pow,HE=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,WE=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,GE=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,xv=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Dn=1e7,at=7,KE=9007199254740991,YE=ul.length-1,Uf=dl.length-1,Ie={toStringTag:wv};Ie.absoluteValue=Ie.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),rt(e)},Ie.ceil=function(){return rt(new this.constructor(this),this.e+1,2)},Ie.clampedTo=Ie.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(ls+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)},Ie.comparedTo=Ie.cmp=function(e){var t,r,n,i,s=this,o=s.d,a=(e=new s.constructor(e)).d,c=s.s,l=e.s;if(!o||!a)return!c||!l?NaN:c!==l?c:o===a?0:!o^c<0?1:-1;if(!o[0]||!a[0])return o[0]?c:a[0]?-l:0;if(c!==l)return c;if(s.e!==e.e)return s.e>e.e^c<0?1:-1;for(n=o.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(o[t]!==a[t])return o[t]>a[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1},Ie.cosine=Ie.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())+at,n.rounding=1,r=JE(n,Tv(n,r)),n.precision=e,n.rounding=t,rt(ji==2||ji==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)},Ie.cubeRoot=Ie.cbrt=function(){var e,t,r,n,i,s,o,a,c,l,u=this,f=u.constructor;if(!u.isFinite()||u.isZero())return new f(u);for(gt=!1,s=u.s*Er(u.s*u,1/3),!s||Math.abs(s)==1/0?(r=Or(u.d),e=u.e,(s=(e-r.length+1)%3)&&(r+=s==1||s==-2?"0":"00"),s=Er(r,1/3),e=Br((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?r="5e"+e:(r=s.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new f(r),n.s=u.s):n=new f(s.toString()),o=(e=f.precision)+3;;)if(a=n,c=a.times(a).times(a),l=c.plus(u),n=Jt(l.plus(u).times(a),l.plus(c),o+2,1),Or(a.d).slice(0,o)===(r=Or(n.d)).slice(0,o))if(r=r.slice(o-3,o+1),r=="9999"||!i&&r=="4999"){if(!i&&(rt(a,e+1,0),a.times(a).times(a).eq(u))){n=a;break}o+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(rt(n,e+1,1),t=!n.times(n).times(n).eq(u));break}return gt=!0,rt(n,e,f.rounding,t)},Ie.decimalPlaces=Ie.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Br(this.e/at))*at,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},Ie.dividedBy=Ie.div=function(e){return Jt(this,new this.constructor(e))},Ie.dividedToIntegerBy=Ie.divToInt=function(e){var t=this,r=t.constructor;return rt(Jt(t,new r(e),0,1,1),r.precision,r.rounding)},Ie.equals=Ie.eq=function(e){return this.cmp(e)===0},Ie.floor=function(){return rt(new this.constructor(this),this.e+1,3)},Ie.greaterThan=Ie.gt=function(e){return this.cmp(e)>0},Ie.greaterThanOrEqualTo=Ie.gte=function(e){var t=this.cmp(e);return t==1||t===0},Ie.hyperbolicCosine=Ie.cosh=function(){var e,t,r,n,i,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;r=o.precision,n=o.rounding,o.precision=r+Math.max(s.e,s.sd())+4,o.rounding=1,i=s.d.length,i<32?(e=Math.ceil(i/3),t=(1/vl(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),s=Eo(o,1,s.times(t),new o(1),!0);for(var c,l=e,u=new o(8);l--;)c=s.times(s),s=a.minus(c.times(u.minus(c.times(u))));return rt(s,o.precision=r,o.rounding=n,!0)},Ie.hyperbolicSine=Ie.sinh=function(){var e,t,r,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(t=s.precision,r=s.rounding,s.precision=t+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<3)i=Eo(s,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/vl(5,e)),i=Eo(s,2,i,i,!0);for(var o,a=new s(5),c=new s(16),l=new s(20);e--;)o=i.times(i),i=i.times(a.plus(o.times(c.times(o).plus(l))))}return s.precision=t,s.rounding=r,rt(i,t,r,!0)},Ie.hyperbolicTangent=Ie.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,Jt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},Ie.inverseCosine=Ie.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()?oi(t,n,i):new t(0):new t(NaN):e.isZero()?oi(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))},Ie.inverseHyperbolicCosine=Ie.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,gt=!1,r=r.times(r).minus(1).sqrt().plus(r),gt=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},Ie.inverseHyperbolicSine=Ie.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,gt=!1,r=r.times(r).plus(1).sqrt().plus(r),gt=!0,n.precision=e,n.rounding=t,r.ln())},Ie.inverseHyperbolicTangent=Ie.atanh=function(){var e,t,r,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=s.precision,t=s.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?rt(new s(i),e,t,!0):(s.precision=r=n-i.e,i=Jt(i.plus(1),new s(1).minus(i),r+e,1),s.precision=e+4,s.rounding=1,i=i.ln(),s.precision=e,s.rounding=t,i.times(.5))):new s(NaN)},Ie.inverseSine=Ie.asin=function(){var e,t,r,n,i=this,s=i.constructor;return i.isZero()?new s(i):(t=i.abs().cmp(1),r=s.precision,n=s.rounding,t!==-1?t===0?(e=oi(s,r+4,n).times(.5),e.s=i.s,e):new s(NaN):(s.precision=r+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=r,s.rounding=n,i.times(2)))},Ie.inverseTangent=Ie.atan=function(){var e,t,r,n,i,s,o,a,c,l=this,u=l.constructor,f=u.precision,p=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&f+4<=Uf)return o=oi(u,f+4,p).times(.25),o.s=l.s,o}else{if(!l.s)return new u(NaN);if(f+4<=Uf)return o=oi(u,f+4,p).times(.5),o.s=l.s,o}for(u.precision=a=f+10,u.rounding=1,r=Math.min(28,a/at+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(gt=!1,t=Math.ceil(a/at),n=1,c=l.times(l),o=new u(l),i=l;e!==-1;)if(i=i.times(c),s=o.minus(i.div(n+=2)),i=i.times(c),o=s.plus(i.div(n+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===s.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),gt=!0,rt(o,u.precision=f,u.rounding=p,!0)},Ie.isFinite=function(){return!!this.d},Ie.isInteger=Ie.isInt=function(){return!!this.d&&Br(this.e/at)>this.d.length-2},Ie.isNaN=function(){return!this.s},Ie.isNegative=Ie.isNeg=function(){return this.s<0},Ie.isPositive=Ie.isPos=function(){return this.s>0},Ie.isZero=function(){return!!this.d&&this.d[0]===0},Ie.lessThan=Ie.lt=function(e){return this.cmp(e)<0},Ie.lessThanOrEqualTo=Ie.lte=function(e){return this.cmp(e)<1},Ie.logarithm=Ie.log=function(e){var t,r,n,i,s,o,a,c,l=this,u=l.constructor,f=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)s=!0;else{for(i=r[0];i%10===0;)i/=10;s=i!==1}if(gt=!1,a=f+y,o=ds(l,a),n=t?ml(u,a+10):ds(e,a),c=Jt(o,n,a,1),_a(c.d,i=f,p))do if(a+=10,o=ds(l,a),n=t?ml(u,a+10):ds(e,a),c=Jt(o,n,a,1),!s){+Or(c.d).slice(i+1,i+15)+1==1e14&&(c=rt(c,f+1,0));break}while(_a(c.d,i+=10,p));return gt=!0,rt(c,f,p)},Ie.minus=Ie.sub=function(e){var t,r,n,i,s,o,a,c,l,u,f,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 gt?rt(e,a,c):e}if(r=Br(e.e/at),u=Br(y.e/at),l=l.slice(),s=u-r,s){for(f=s<0,f?(t=l,s=-s,o=p.length):(t=p,r=u,o=l.length),n=Math.max(Math.ceil(a/at),o)+2,s>n&&(s=n,t.length=1),t.reverse(),n=s;n--;)t.push(0);t.reverse()}else{for(n=l.length,o=p.length,f=n<o,f&&(o=n),n=0;n<o;n++)if(l[n]!=p[n]){f=l[n]<p[n];break}s=0}for(f&&(t=l,l=p,p=t,e.s=-e.s),o=l.length,n=p.length-o;n>0;--n)l[o++]=0;for(n=p.length;n>s;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=Dn-1;--l[i],l[n]+=Dn}l[n]-=p[n]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=pl(l,r),gt?rt(e,a,c):e):new x(c===3?-0:0)},Ie.modulo=Ie.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]?rt(new n(r),n.precision,n.rounding):(gt=!1,n.modulo==9?(t=Jt(r,e.abs(),0,3,1),t.s*=e.s):t=Jt(r,e,0,n.modulo,1),t=t.times(e),gt=!0,r.minus(t))},Ie.naturalExponential=Ie.exp=function(){return Ff(this)},Ie.naturalLogarithm=Ie.ln=function(){return ds(this)},Ie.negated=Ie.neg=function(){var e=new this.constructor(this);return e.s=-e.s,rt(e)},Ie.plus=Ie.add=function(e){var t,r,n,i,s,o,a,c,l,u,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return!f.s||!e.s?e=new p(NaN):f.d||(e=new p(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(l=f.d,u=e.d,a=p.precision,c=p.rounding,!l[0]||!u[0])return u[0]||(e=new p(f)),gt?rt(e,a,c):e;if(s=Br(f.e/at),n=Br(e.e/at),l=l.slice(),i=s-n,i){for(i<0?(r=l,i=-i,o=u.length):(r=u,n=s,o=l.length),s=Math.ceil(a/at),o=s>o?s+1:o+1,i>o&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(o=l.length,i=u.length,o-i<0&&(i=o,r=u,u=l,l=r),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/Dn|0,l[i]%=Dn;for(t&&(l.unshift(t),++n),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=pl(l,n),gt?rt(e,a,c):e},Ie.precision=Ie.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ls+e);return r.d?(t=Sv(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},Ie.round=function(){var e=this,t=e.constructor;return rt(new t(e),e.e+1,t.rounding)},Ie.sine=Ie.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())+at,n.rounding=1,r=ZE(n,Tv(n,r)),n.precision=e,n.rounding=t,rt(ji>2?r.neg():r,e,t,!0)):new n(NaN)},Ie.squareRoot=Ie.sqrt=function(){var e,t,r,n,i,s,o=this,a=o.d,c=o.e,l=o.s,u=o.constructor;if(l!==1||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?o:1/0);for(gt=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=Or(a),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=Br((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(s=n,n=s.plus(Jt(o,s,r+2,1)).times(.5),Or(s.d).slice(0,r)===(t=Or(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(rt(s,c+1,0),s.times(s).eq(o))){n=s;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(rt(n,c+1,1),e=!n.times(n).eq(o));break}return gt=!0,rt(n,c,u.rounding,e)},Ie.tangent=Ie.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=Jt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,rt(ji==2||ji==4?r.neg():r,e,t,!0)):new n(NaN)},Ie.times=Ie.mul=function(e){var t,r,n,i,s,o,a,c,l,u=this,f=u.constructor,p=u.d,y=(e=new f(e)).d;if(e.s*=u.s,!p||!p[0]||!y||!y[0])return new f(!e.s||p&&!p[0]&&!y||y&&!y[0]&&!p?NaN:!p||!y?e.s/0:e.s*0);for(r=Br(u.e/at)+Br(e.e/at),c=p.length,l=y.length,c<l&&(s=p,p=y,y=s,o=c,c=l,l=o),s=[],o=c+l,n=o;n--;)s.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)a=s[i]+y[n]*p[i-n-1]+t,s[i--]=a%Dn|0,t=a/Dn|0;s[i]=(s[i]+t)%Dn|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=pl(s,r),gt?rt(e,f.precision,f.rounding):e},Ie.toBinary=function(e,t){return $f(this,2,e,t)},Ie.toDecimalPlaces=Ie.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Xr(e,0,cs),t===void 0?t=n.rounding:Xr(t,0,8),rt(r,e+r.e+1,t))},Ie.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=si(n,!0):(Xr(e,0,cs),t===void 0?t=i.rounding:Xr(t,0,8),n=rt(new i(n),e+1,t),r=si(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},Ie.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?r=si(i):(Xr(e,0,cs),t===void 0?t=s.rounding:Xr(t,0,8),n=rt(new s(i),e+i.e+1,t),r=si(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},Ie.toFraction=function(e){var t,r,n,i,s,o,a,c,l,u,f,p,y=this,x=y.d,v=y.constructor;if(!x)return new v(y);if(l=r=new v(1),n=c=new v(0),t=new v(n),s=t.e=Sv(x)-y.e-1,o=s%at,t.d[0]=Er(10,o<0?at+o:o),e==null)e=s>0?t:l;else{if(a=new v(e),!a.isInt()||a.lt(l))throw Error(ls+a);e=a.gt(t)?s>0?t:l:a}for(gt=!1,a=new v(Or(x)),u=v.precision,v.precision=s=x.length*at*2;f=Jt(a,t,0,1,1),i=r.plus(f.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(f.times(i)),c=i,i=t,t=a.minus(f.times(i)),a=i;return i=Jt(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=Jt(l,n,s,1).minus(y).abs().cmp(Jt(c,r,s,1).minus(y).abs())<1?[l,n]:[c,r],v.precision=u,gt=!0,p},Ie.toHexadecimal=Ie.toHex=function(e,t){return $f(this,16,e,t)},Ie.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:Xr(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]?(gt=!1,r=Jt(r,e,0,t,1).times(e),gt=!0,rt(r)):(e.s=r.s,r=e),r},Ie.toNumber=function(){return+this},Ie.toOctal=function(e,t){return $f(this,8,e,t)},Ie.toPower=Ie.pow=function(e){var t,r,n,i,s,o,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(Er(+a,l));if(a=new c(a),a.eq(1))return a;if(n=c.precision,s=c.rounding,e.eq(1))return rt(a,n,s);if(t=Br(e.e/at),t>=e.d.length-1&&(r=l<0?-l:l)<=KE)return i=_v(c,a,r,n),e.s<0?new c(1).div(i):rt(i,n,s);if(o=a.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=o,a}return r=Er(+a,l),t=r==0||!isFinite(r)?Br(l*(Math.log("0."+Or(a.d))/Math.LN10+a.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(gt=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Ff(e.times(ds(a,n+r)),n),i.d&&(i=rt(i,n+5,1),_a(i.d,n,s)&&(t=n+10,i=rt(Ff(e.times(ds(a,t+r)),t),t+5,1),+Or(i.d).slice(n+1,n+15)+1==1e14&&(i=rt(i,n+1,0)))),i.s=o,gt=!0,c.rounding=s,rt(i,n,s))},Ie.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=si(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Xr(e,1,cs),t===void 0?t=i.rounding:Xr(t,0,8),n=rt(new i(n),e,t),r=si(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},Ie.toSignificantDigits=Ie.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Xr(e,1,cs),t===void 0?t=n.rounding:Xr(t,0,8)),rt(new n(r),e,t)},Ie.toString=function(){var e=this,t=e.constructor,r=si(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},Ie.truncated=Ie.trunc=function(){return rt(new this.constructor(this),this.e+1,1)},Ie.valueOf=Ie.toJSON=function(){var e=this,t=e.constructor,r=si(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Or(e){var t,r,n,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;t<i;t++)n=e[t]+"",r=at-n.length,r&&(s+=us(r)),s+=n;o=e[t],n=o+"",r=at-n.length,r&&(s+=us(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}function Xr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ls+e)}function _a(e,t,r,n){var i,s,o,a;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=at,i=0):(i=Math.ceil((t+1)/at),t%=at),s=Er(10,at-t),a=e[i]%s|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),o=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):o=(r<4&&a+1==s||r>3&&a+1==s/2)&&(e[i+1]/s/100|0)==Er(10,t-2)-1||(a==s/2||a==0)&&(e[i+1]/s/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),o=(n||r<4)&&a==9999||!n&&r>3&&a==4999):o=((n||r<4)&&a+1==s||!n&&r>3&&a+1==s/2)&&(e[i+1]/s/1e3|0)==Er(10,t-3)-1,o}function hl(e,t,r){for(var n,i=[0],s,o=0,a=e.length;o<a;){for(s=i.length;s--;)i[s]*=t;for(i[0]+=Lf.indexOf(e.charAt(o++)),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 JE(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/vl(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=Eo(e,1,t.times(i),new e(1));for(var s=r;s--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}var Jt=function(){function e(n,i,s){var o,a=0,c=n.length;for(n=n.slice();c--;)o=n[c]*i+a,n[c]=o%s|0,a=o/s|0;return a&&n.unshift(a),n}function t(n,i,s,o){var a,c;if(s!=o)c=s>o?1:-1;else for(a=c=0;a<s;a++)if(n[a]!=i[a]){c=n[a]>i[a]?1:-1;break}return c}function r(n,i,s,o){for(var a=0;s--;)n[s]-=a,a=n[s]<i[s]?1:0,n[s]=a*o+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,o,a,c){var l,u,f,p,y,x,v,_,T,O,R,F,B,H,$,Z,ce,ne,de,q,N=n.constructor,h=n.s==i.s?1:-1,d=n.d,m=i.d;if(!d||!d[0]||!m||!m[0])return new N(!n.s||!i.s||(d?m&&d[0]==m[0]:!m)?NaN:d&&d[0]==0||!m?h*0:h/0);for(c?(y=1,u=n.e-i.e):(c=Dn,y=at,u=Br(n.e/y)-Br(i.e/y)),de=m.length,ce=d.length,T=new N(h),O=T.d=[],f=0;m[f]==(d[f]||0);f++);if(m[f]>(d[f]||0)&&u--,s==null?(H=s=N.precision,o=N.rounding):a?H=s+(n.e-i.e)+1:H=s,H<0)O.push(1),x=!0;else{if(H=H/y+2|0,f=0,de==1){for(p=0,m=m[0],H++;(f<ce||p)&&H--;f++)$=p*c+(d[f]||0),O[f]=$/m|0,p=$%m|0;x=p||f<ce}else{for(p=c/(m[0]+1)|0,p>1&&(m=e(m,p,c),d=e(d,p,c),de=m.length,ce=d.length),Z=de,R=d.slice(0,de),F=R.length;F<de;)R[F++]=0;q=m.slice(),q.unshift(0),ne=m[0],m[1]>=c/2&&++ne;do p=0,l=t(m,R,de,F),l<0?(B=R[0],de!=F&&(B=B*c+(R[1]||0)),p=B/ne|0,p>1?(p>=c&&(p=c-1),v=e(m,p,c),_=v.length,F=R.length,l=t(v,R,_,F),l==1&&(p--,r(v,de<_?q:m,_,c))):(p==0&&(l=p=1),v=m.slice()),_=v.length,_<F&&v.unshift(0),r(R,v,F,c),l==-1&&(F=R.length,l=t(m,R,de,F),l<1&&(p++,r(R,de<F?q:m,F,c))),F=R.length):l===0&&(p++,R=[0]),O[f++]=p,l&&R[0]?R[F++]=d[Z]||0:(R=[d[Z]],F=1);while((Z++<ce||R[0]!==void 0)&&H--);x=R[0]!==void 0}O[0]||O.shift()}if(y==1)T.e=u,vv=x;else{for(f=1,p=O[0];p>=10;p/=10)f++;T.e=f+u*y-1,rt(T,a?s+T.e+1:s,o,x)}return T}}();function rt(e,t,r,n){var i,s,o,a,c,l,u,f,p,y=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(i=1,a=f[0];a>=10;a/=10)i++;if(s=t-i,s<0)s+=at,o=t,u=f[p=0],c=u/Er(10,i-o-1)%10|0;else if(p=Math.ceil((s+1)/at),a=f.length,p>=a)if(n){for(;a++<=p;)f.push(0);u=c=0,i=1,s%=at,o=s-at+1}else break e;else{for(u=a=f[p],i=1;a>=10;a/=10)i++;s%=at,o=s-at+i,c=o<0?0:u/Er(10,i-o-1)%10|0}if(n=n||t<0||f[p+1]!==void 0||(o<0?u:u%Er(10,i-o-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(s>0?o>0?u/Er(10,i-o):0:f[p-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,l?(t-=e.e+1,f[0]=Er(10,(at-t%at)%at),e.e=-t||0):f[0]=e.e=0,e;if(s==0?(f.length=p,a=1,p--):(f.length=p+1,a=Er(10,at-s),f[p]=o>0?(u/Er(10,i-o)%Er(10,o)|0)*a:0),l)for(;;)if(p==0){for(s=1,o=f[0];o>=10;o/=10)s++;for(o=f[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(e.e++,f[0]==Dn&&(f[0]=1));break}else{if(f[p]+=a,f[p]!=Dn)break;f[p--]=0,a=1}for(s=f.length;f[--s]===0;)f.pop()}return gt&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e<y.minE&&(e.e=0,e.d=[0])),e}function si(e,t,r){if(!e.isFinite())return Av(e);var n,i=e.e,s=Or(e.d),o=s.length;return t?(r&&(n=r-o)>0?s=s.charAt(0)+"."+s.slice(1)+us(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):i<0?(s="0."+us(-i-1)+s,r&&(n=r-o)>0&&(s+=us(n))):i>=o?(s+=us(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+us(n))):((n=i+1)<o&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(s+="."),s+=us(n))),s}function pl(e,t){var r=e[0];for(t*=at;r>=10;r/=10)t++;return t}function ml(e,t,r){if(t>YE)throw gt=!0,r&&(e.precision=r),Error(bv);return rt(new e(ul),t,1,!0)}function oi(e,t,r){if(t>Uf)throw Error(bv);return rt(new e(dl),t,r,!0)}function Sv(e){var t=e.length-1,r=t*at+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 us(e){for(var t="";e--;)t+="0";return t}function _v(e,t,r,n){var i,s=new e(1),o=Math.ceil(n/at+4);for(gt=!1;;){if(r%2&&(s=s.times(t),Mv(s.d,o)&&(i=!0)),r=Br(r/2),r===0){r=s.d.length-1,i&&s.d[r]===0&&++s.d[r];break}t=t.times(t),Mv(t.d,o)}return gt=!0,s}function Ev(e){return e.d[e.d.length-1]&1}function Cv(e,t,r){for(var n,i,s=new e(t[0]),o=0;++o<t.length;){if(i=new e(t[o]),!i.s){s=i;break}n=s.cmp(i),(n===r||n===0&&s.s===r)&&(s=i)}return s}function Ff(e,t){var r,n,i,s,o,a,c,l=0,u=0,f=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?(gt=!1,c=x):c=t,a=new p(.03125);e.e>-2;)e=e.times(a),f+=5;for(n=Math.log(Er(2,f))/Math.LN10*2+5|0,c+=n,r=s=o=new p(1),p.precision=c;;){if(s=rt(s.times(e),c,1),r=r.times(++u),a=o.plus(Jt(s,r,c,1)),Or(a.d).slice(0,c)===Or(o.d).slice(0,c)){for(i=f;i--;)o=rt(o.times(o),c,1);if(t==null)if(l<3&&_a(o.d,c-n,y,l))p.precision=c+=10,r=s=a=new p(1),u=0,l++;else return rt(o,p.precision=x,y,gt=!0);else return p.precision=x,o}o=a}}function ds(e,t){var r,n,i,s,o,a,c,l,u,f,p,y=1,x=10,v=e,_=v.d,T=v.constructor,O=T.rounding,R=T.precision;if(v.s<0||!_||!_[0]||!v.e&&_[0]==1&&_.length==1)return new T(_&&!_[0]?-1/0:v.s!=1?NaN:_?0:v);if(t==null?(gt=!1,u=R):u=t,T.precision=u+=x,r=Or(_),n=r.charAt(0),Math.abs(s=v.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=Or(v.d),n=r.charAt(0),y++;s=v.e,n>1?(v=new T("0."+r),s++):v=new T(n+"."+r.slice(1))}else return l=ml(T,u+2,R).times(s+""),v=ds(new T(n+"."+r.slice(1)),u-x).plus(l),T.precision=R,t==null?rt(v,R,O,gt=!0):v;for(f=v,c=o=v=Jt(v.minus(1),v.plus(1),u,1),p=rt(v.times(v),u,1),i=3;;){if(o=rt(o.times(p),u,1),l=c.plus(Jt(o,new T(i),u,1)),Or(l.d).slice(0,u)===Or(c.d).slice(0,u))if(c=c.times(2),s!==0&&(c=c.plus(ml(T,u+2,R).times(s+""))),c=Jt(c,new T(y),u,1),t==null)if(_a(c.d,u-x,O,a))T.precision=u+=x,l=o=v=Jt(f.minus(1),f.plus(1),u,1),p=rt(v.times(v),u,1),i=a=1;else return rt(c,T.precision=R,O,gt=!0);else return T.precision=R,c;c=l,i+=2}}function Av(e){return String(e.s*e.s/0)}function gl(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)%at,r<0&&(n+=at),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=at;n<i;)e.d.push(+t.slice(n,n+=at));t=t.slice(n),n=at-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),gt&&(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 XE(e,t){var r,n,i,s,o,a,c,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),xv.test(t))return gl(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(WE.test(t))r=16,t=t.toLowerCase();else if(HE.test(t))r=2;else if(GE.test(t))r=8;else throw Error(ls+t);for(s=t.search(/p/i),s>0?(c=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),s=t.indexOf("."),o=s>=0,n=e.constructor,o&&(t=t.replace(".",""),a=t.length,s=a-s,i=_v(n,new n(r),s,s*2)),l=hl(t,r,Dn),u=l.length-1,s=u;l[s]===0;--s)l.pop();return s<0?new n(e.s*0):(e.e=pl(l,u),e.d=l,gt=!1,o&&(e=Jt(e,i,a*4)),c&&(e=e.times(Math.abs(c)<54?Er(2,c):$r.pow(2,c))),gt=!0,e)}function ZE(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Eo(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/vl(5,r)),t=Eo(e,2,t,t);for(var i,s=new e(5),o=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(s.plus(i.times(o.times(i).minus(a))));return t}function Eo(e,t,r,n,i){var s,o,a,c,l=e.precision,u=Math.ceil(l/at);for(gt=!1,c=r.times(r),a=new e(n);;){if(o=Jt(a.times(c),new e(t++*t++),l,1),a=i?n.plus(o):n.minus(o),n=Jt(o.times(c),new e(t++*t++),l,1),o=a.plus(n),o.d[u]!==void 0){for(s=u;o.d[s]===a.d[s]&&s--;);if(s==-1)break}s=a,a=n,n=o,o=s}return gt=!0,o.d.length=u+1,o}function vl(e,t){for(var r=e;--t;)r*=e;return r}function Tv(e,t){var r,n=t.s<0,i=oi(e,e.precision,1),s=i.times(.5);if(t=t.abs(),t.lte(s))return ji=n?4:1,t;if(r=t.divToInt(i),r.isZero())ji=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(s))return ji=Ev(r)?n?2:3:n?4:1,t;ji=Ev(r)?n?1:4:n?3:2}return t.minus(i).abs()}function $f(e,t,r,n){var i,s,o,a,c,l,u,f,p,y=e.constructor,x=r!==void 0;if(x?(Xr(r,1,cs),n===void 0?n=y.rounding:Xr(n,0,8)):(r=y.precision,n=y.rounding),!e.isFinite())u=Av(e);else{for(u=si(e),o=u.indexOf("."),x?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,o>=0&&(u=u.replace(".",""),p=new y(1),p.e=u.length-o,p.d=hl(si(p),10,i),p.e=p.d.length),f=hl(u,10,i),s=c=f.length;f[--c]==0;)f.pop();if(!f[0])u=x?"0p+0":"0";else{if(o<0?s--:(e=new y(e),e.d=f,e.e=s,e=Jt(e,p,r,n,0,i),f=e.d,s=e.e,l=vv),o=f[r],a=i/2,l=l||f[r+1]!==void 0,l=n<4?(o!==void 0||l)&&(n===0||n===(e.s<0?3:2)):o>a||o===a&&(n===4||l||n===6&&f[r-1]&1||n===(e.s<0?8:7)),f.length=r,l)for(;++f[--r]>i-1;)f[r]=0,r||(++s,f.unshift(1));for(c=f.length;!f[c-1];--c);for(o=0,u="";o<c;o++)u+=Lf.charAt(f[o]);if(x){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)u+="0";for(f=hl(u,i,t),c=f.length;!f[c-1];--c);for(o=1,u="1.";o<c;o++)u+=Lf.charAt(f[o])}else u=u.charAt(0)+"."+u.slice(1);u=u+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)u="0"+u;u="0."+u}else if(++s>c)for(s-=c;s--;)u+="0";else s<c&&(u=u.slice(0,s)+"."+u.slice(s))}u=(t==16?"0x":t==2?"0b":t==8?"0o":"")+u}return e.s<0?"-"+u:u}function Mv(e,t){if(e.length>t)return e.length=t,!0}function QE(e){return new this(e).abs()}function eC(e){return new this(e).acos()}function tC(e){return new this(e).acosh()}function rC(e,t){return new this(e).plus(t)}function nC(e){return new this(e).asin()}function iC(e){return new this(e).asinh()}function sC(e){return new this(e).atan()}function oC(e){return new this(e).atanh()}function aC(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,s=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=oi(this,s,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?oi(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=oi(this,s,1).times(.5),r.s=e.s):t.s<0?(this.precision=s,this.rounding=1,r=this.atan(Jt(e,t,s,1)),t=oi(this,s,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(Jt(e,t,s,1)),r}function cC(e){return new this(e).cbrt()}function lC(e){return rt(e=new this(e),e.e+1,2)}function uC(e,t,r){return new this(e).clamp(t,r)}function dC(e){if(!e||typeof e!="object")throw Error(fl+"Object expected");var t,r,n,i=e.defaults===!0,s=["precision",1,cs,"rounding",0,8,"toExpNeg",-_o,0,"toExpPos",0,_o,"maxE",0,_o,"minE",-_o,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(r=s[t],i&&(this[r]=Bf[r]),(n=e[r])!==void 0)if(Br(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(ls+r+": "+n);if(r="crypto",i&&(this[r]=Bf[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(yv);else this[r]=!1;else throw Error(ls+r+": "+n);return this}function fC(e){return new this(e).cos()}function hC(e){return new this(e).cosh()}function Iv(e){var t,r,n;function i(s){var o,a,c,l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,Ov(s)){l.s=s.s,gt?!s.d||s.e>i.maxE?(l.e=NaN,l.d=null):s.e<i.minE?(l.e=0,l.d=[0]):(l.e=s.e,l.d=s.d.slice()):(l.e=s.e,l.d=s.d?s.d.slice():s.d);return}if(c=typeof s,c==="number"){if(s===0){l.s=1/s<0?-1:1,l.e=0,l.d=[0];return}if(s<0?(s=-s,l.s=-1):l.s=1,s===~~s&&s<1e7){for(o=0,a=s;a>=10;a/=10)o++;gt?o>i.maxE?(l.e=NaN,l.d=null):o<i.minE?(l.e=0,l.d=[0]):(l.e=o,l.d=[s]):(l.e=o,l.d=[s]);return}if(s*0!==0){s||(l.s=NaN),l.e=NaN,l.d=null;return}return gl(l,s.toString())}if(c==="string")return(a=s.charCodeAt(0))===45?(s=s.slice(1),l.s=-1):(a===43&&(s=s.slice(1)),l.s=1),xv.test(s)?gl(l,s):XE(l,s);if(c==="bigint")return s<0?(s=-s,l.s=-1):l.s=1,gl(l,s.toString());throw Error(ls+s)}if(i.prototype=Ie,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=dC,i.clone=Iv,i.isDecimal=Ov,i.abs=QE,i.acos=eC,i.acosh=tC,i.add=rC,i.asin=nC,i.asinh=iC,i.atan=sC,i.atanh=oC,i.atan2=aC,i.cbrt=cC,i.ceil=lC,i.clamp=uC,i.cos=fC,i.cosh=hC,i.div=pC,i.exp=mC,i.floor=gC,i.hypot=vC,i.ln=bC,i.log=yC,i.log10=xC,i.log2=wC,i.max=SC,i.min=_C,i.mod=EC,i.mul=CC,i.pow=AC,i.random=TC,i.round=MC,i.sign=IC,i.sin=OC,i.sinh=PC,i.sqrt=RC,i.sub=jC,i.sum=NC,i.tan=kC,i.tanh=DC,i.trunc=LC,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 pC(e,t){return new this(e).div(t)}function mC(e){return new this(e).exp()}function gC(e){return rt(e=new this(e),e.e+1,3)}function vC(){var e,t,r=new this(0);for(gt=!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 gt=!0,new this(1/0);r=t}return gt=!0,r.sqrt()}function Ov(e){return e instanceof $r||e&&e.toStringTag===wv||!1}function bC(e){return new this(e).ln()}function yC(e,t){return new this(e).log(t)}function wC(e){return new this(e).log(2)}function xC(e){return new this(e).log(10)}function SC(){return Cv(this,arguments,-1)}function _C(){return Cv(this,arguments,1)}function EC(e,t){return new this(e).mod(t)}function CC(e,t){return new this(e).mul(t)}function AC(e,t){return new this(e).pow(t)}function TC(e){var t,r,n,i,s=0,o=new this(1),a=[];if(e===void 0?e=this.precision:Xr(e,1,cs),n=Math.ceil(e/at),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));s<n;)i=t[s],i>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);s<n;)i=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((t[s+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,s):(a.push(i%1e7),s+=4);s=n/4}else throw Error(yv);else for(;s<n;)a[s++]=Math.random()*1e7|0;for(n=a[--s],e%=at,n&&e&&(i=Er(10,at-e),a[s]=(n/i|0)*i);a[s]===0;s--)a.pop();if(s<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=at)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<at&&(r-=at-n)}return o.e=r,o.d=a,o}function MC(e){return rt(e=new this(e),e.e+1,this.rounding)}function IC(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function OC(e){return new this(e).sin()}function PC(e){return new this(e).sinh()}function RC(e){return new this(e).sqrt()}function jC(e,t){return new this(e).sub(t)}function NC(){var e=0,t=arguments,r=new this(t[e]);for(gt=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return gt=!0,rt(r,this.precision,this.rounding)}function kC(e){return new this(e).tan()}function DC(e){return new this(e).tanh()}function LC(e){return rt(e=new this(e),e.e+1,1)}Ie[Symbol.for("nodejs.util.inspect.custom")]=Ie.toString,Ie[Symbol.toStringTag]="Decimal";var $r=Ie.constructor=Iv(Bf);ul=new $r(ul),dl=new $r(dl),$r.config({precision:256,rounding:$r.ROUND_DOWN,toExpNeg:-256,toExpPos:256});const Ur=(e,t,r,n=$r.ROUND_HALF_DOWN)=>{if(e==="∞")return"∞";if(e!=="0"&&!e||Ue(e).equals(0))return"0";if(t!==void 0){const l=Vs(e,t,n);if(!Ue(l).equals(0))return r?l:Co(l)}const i=Ue(e).toString(),s=i.split("."),o=s[0],a=s[1];let c;if(Ue(o).gt(0))!a||Ue(o.length).gte(9)?c=Vs(i,0,n):Ue(o.length).gte(4)?c=Vs(i,2,n):c=Vs(i,4,n);else{Vs(i,6,n);const l=FC(a);if(l<6)c=Vs(i,l+6,n);else{if(l>30)return"0";c=Vs(i,9+(l-6),n)}}return r||Ue(o).lt(1)?c:Co(c)},Pv=(e,t,r,n)=>{try{if(e===void 0||e==="--")return"$--";const i=Ur(e,t,!0,$r.ROUND_DOWN).toString();if(Ue(i).equals(0))return"$0";const s=i.startsWith("-");let o=n?i:Co(i).toString();return o.includes("e")&&(o=n?i:Co(i).toString()),!r&&Number(i)<Math.pow(10,-t)?s?`-$${o.slice(1)}`:`<$${Math.pow(10,-t).toFixed(t)}`:s?`-$${o.slice(1)}`:`$${o}`}catch{return"$--"}},BC=(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(),s=n<0;let o=i;if(i.toLowerCase().includes("e")){const a=i.match(/(\d+?)(?:\.(\d*))?e([+-])(\d+)/),c=a[1],l=a[2],u=a[3],f=a[4];let p="",y=l?l.substr(f):"";if(y&&(y=`.${y}`),u!=="-"){for(let x=0;x<f;x+=1){const v=l[x]||"0";p+=v}o=c+p+y}else{let x="0";for(let v=0;v<f;v+=1)p=(c[c.length-v-1]||"0")+p;c.length>f&&(x=c.substr(0,c.length-f)),o=`${x}.${p}${l}`}}if(t&&r){let a=`${o.split(".")[0]}.`;const c=o.split(".")[1]||"";for(let l=0;l<t;l+=1)a+=c[l]||"0";o=a}if(o.length>14){const a=o.split(".");a[0].length>14?o=`${a[0].slice(0,14)}+`:(o=o.slice(0,13),o.indexOf(".")===12&&(o=o.slice(0,12)))}return`${s?"-":""}${o}`},Ue=e=>$r.isDecimal(e)?e:new $r(typeof e>"u"||e==="undefined"||!e?0:e);function UC(e,t){return t===void 0?"":Ue(e==null?void 0:e.toString()).div(Math.pow(10,t)).toString()}const Vs=(e,t,r)=>Ue(e).toDP(t,r).toString(),Co=e=>{const[t,r]=e.split(".");let n="";for(let i=t.length-1,s=0;i>=0;i--,s++)n=t[i]+n,s%3===2&&i!==0&&(n=","+n);return r?`${n}.${r}`:n};function FC(e){let t=0;if(e)for(;t<e.length;){if(Ue(e[t]).gt(0))return t+1;t++}return 0}function $C(e,t){const r=Rv(Ue(t));return Number(Ue(e).mul(r))}function VC(e,t){const r=Rv(Ue(t));return Number(Ue(e).div(r))}function Rv(e){return Ue(10).pow(Ue(e).abs())}function Vf(e,t){const r=VC(e,t);return zC(r.toString(),Number(t))}function zC(e,t=9){if(e===void 0)return"";const r=e.toLowerCase();if(r.includes("e")){if(r.includes("+"))return BC(r,t);const[n,i]=r.split("e");let s=n;const o=Math.abs(parseInt(i,10));let a="",c=s.length;if(n.includes(".")){const[l,u]=n.split(".");s=l+u,c=l.length}for(let l=0;l<o-c;l++)a+="0";return`0.${a}${s}`.slice(0,t+2)}return e}function bl(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}const zs=(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):"",zf=(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(!zf(e[i],t[i]))return!1;return!0};function jv(e){return!e||Object.keys(e).length===0}function Nv(e){var t;return((t=e.split("::"))==null?void 0:t.length)===3}const kv=async e=>new Promise(t=>{setTimeout(()=>{t(1)},e)});function qC(e,t,r=!1){var a;const n=e.balanceChanges,i=(a=e.effects)==null?void 0:a.gasUsed,s={};let o="0";return i&&(o=Ue(i.computationCost).add(i.storageCost).sub(i.storageRebate).mul(-1).toFixed(0)),n&&n.forEach(c=>{const l=cn(c.coinType).full_address;if(c.owner.AddressOwner===t){const u=cn(l).full_address===yc;let f=c.amount;u&&(f=r?f:Ue(f).sub(o).toFixed(0));const p={coinType:l,amount:f};s[l]=p}}),s}function Dv(e,t){if(t){const r=e[cn(t.coin_type).full_address];if(r)return Vf(Ue(r.amount).abs().toFixed(0),t.decimals)}}function Ct(e){return`https://archive.cetus.zone/assets/terminal${e}`}const yn=(e,t=10)=>e&&(e==null?void 0:e.length)>t&&Ue(t).gt(0)?`${e.slice(0,t)}...`:e,yl=(e,t)=>Ri(e||"")===Ri(t||""),HC=e=>e===null||typeof e!="object"||Array.isArray(e)?!1:Object.keys(e).length>0;function Lv(e){return cn(e).source_address}const WC=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 s=new AbortController,o=setTimeout(()=>{s.abort()},r);try{const a=await fetch(i,{signal:s.signal});if(clearTimeout(o),!a.ok)throw new Error("Request failed");const c=await a.json();return(c==null?void 0:c.data)||c}catch(a){throw clearTimeout(o),a.name==="AbortError"?new Error("request time out"):a}},GC=async function(e,t,r=3e4){const n=new AbortController,i=setTimeout(()=>{n.abort()},r);try{const s=await fetch(e,{body:JSON.stringify(t),method:"POST",signal:n.signal});if(clearTimeout(i),!s.ok)throw new Error("Request failed");return s.json()}catch(s){throw clearTimeout(i),s.name==="AbortError"?new Error("request time out"):s}},qf="tokenMap",Bv="trustedTokenList",Uv="collectTokenMap",Fv="importTokenList";function wl(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 $v={exports:{}};/*!
|
|
47
|
+
*/var _o=9e15,cs=1e9,Df="0123456789abcdef",ul="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",dl="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Lf={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-_o,maxE:_o,crypto:!1},mv,ji,gt=!0,fl="[DecimalError] ",ls=fl+"Invalid argument: ",gv=fl+"Precision limit exceeded",vv=fl+"crypto unavailable",bv="[object Decimal]",Br=Math.floor,Er=Math.pow,qE=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,HE=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,WE=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,yv=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Dn=1e7,at=7,GE=9007199254740991,KE=ul.length-1,Bf=dl.length-1,Ie={toStringTag:bv};Ie.absoluteValue=Ie.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),rt(e)},Ie.ceil=function(){return rt(new this.constructor(this),this.e+1,2)},Ie.clampedTo=Ie.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(ls+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)},Ie.comparedTo=Ie.cmp=function(e){var t,r,n,i,s=this,o=s.d,a=(e=new s.constructor(e)).d,c=s.s,l=e.s;if(!o||!a)return!c||!l?NaN:c!==l?c:o===a?0:!o^c<0?1:-1;if(!o[0]||!a[0])return o[0]?c:a[0]?-l:0;if(c!==l)return c;if(s.e!==e.e)return s.e>e.e^c<0?1:-1;for(n=o.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(o[t]!==a[t])return o[t]>a[t]^c<0?1:-1;return n===i?0:n>i^c<0?1:-1},Ie.cosine=Ie.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())+at,n.rounding=1,r=YE(n,Cv(n,r)),n.precision=e,n.rounding=t,rt(ji==2||ji==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)},Ie.cubeRoot=Ie.cbrt=function(){var e,t,r,n,i,s,o,a,c,l,u=this,f=u.constructor;if(!u.isFinite()||u.isZero())return new f(u);for(gt=!1,s=u.s*Er(u.s*u,1/3),!s||Math.abs(s)==1/0?(r=Or(u.d),e=u.e,(s=(e-r.length+1)%3)&&(r+=s==1||s==-2?"0":"00"),s=Er(r,1/3),e=Br((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?r="5e"+e:(r=s.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new f(r),n.s=u.s):n=new f(s.toString()),o=(e=f.precision)+3;;)if(a=n,c=a.times(a).times(a),l=c.plus(u),n=Jt(l.plus(u).times(a),l.plus(c),o+2,1),Or(a.d).slice(0,o)===(r=Or(n.d)).slice(0,o))if(r=r.slice(o-3,o+1),r=="9999"||!i&&r=="4999"){if(!i&&(rt(a,e+1,0),a.times(a).times(a).eq(u))){n=a;break}o+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(rt(n,e+1,1),t=!n.times(n).times(n).eq(u));break}return gt=!0,rt(n,e,f.rounding,t)},Ie.decimalPlaces=Ie.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-Br(this.e/at))*at,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},Ie.dividedBy=Ie.div=function(e){return Jt(this,new this.constructor(e))},Ie.dividedToIntegerBy=Ie.divToInt=function(e){var t=this,r=t.constructor;return rt(Jt(t,new r(e),0,1,1),r.precision,r.rounding)},Ie.equals=Ie.eq=function(e){return this.cmp(e)===0},Ie.floor=function(){return rt(new this.constructor(this),this.e+1,3)},Ie.greaterThan=Ie.gt=function(e){return this.cmp(e)>0},Ie.greaterThanOrEqualTo=Ie.gte=function(e){var t=this.cmp(e);return t==1||t===0},Ie.hyperbolicCosine=Ie.cosh=function(){var e,t,r,n,i,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;r=o.precision,n=o.rounding,o.precision=r+Math.max(s.e,s.sd())+4,o.rounding=1,i=s.d.length,i<32?(e=Math.ceil(i/3),t=(1/vl(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),s=Eo(o,1,s.times(t),new o(1),!0);for(var c,l=e,u=new o(8);l--;)c=s.times(s),s=a.minus(c.times(u.minus(c.times(u))));return rt(s,o.precision=r,o.rounding=n,!0)},Ie.hyperbolicSine=Ie.sinh=function(){var e,t,r,n,i=this,s=i.constructor;if(!i.isFinite()||i.isZero())return new s(i);if(t=s.precision,r=s.rounding,s.precision=t+Math.max(i.e,i.sd())+4,s.rounding=1,n=i.d.length,n<3)i=Eo(s,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/vl(5,e)),i=Eo(s,2,i,i,!0);for(var o,a=new s(5),c=new s(16),l=new s(20);e--;)o=i.times(i),i=i.times(a.plus(o.times(c.times(o).plus(l))))}return s.precision=t,s.rounding=r,rt(i,t,r,!0)},Ie.hyperbolicTangent=Ie.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,Jt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},Ie.inverseCosine=Ie.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()?oi(t,n,i):new t(0):new t(NaN):e.isZero()?oi(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))},Ie.inverseHyperbolicCosine=Ie.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,gt=!1,r=r.times(r).minus(1).sqrt().plus(r),gt=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},Ie.inverseHyperbolicSine=Ie.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,gt=!1,r=r.times(r).plus(1).sqrt().plus(r),gt=!0,n.precision=e,n.rounding=t,r.ln())},Ie.inverseHyperbolicTangent=Ie.atanh=function(){var e,t,r,n,i=this,s=i.constructor;return i.isFinite()?i.e>=0?new s(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=s.precision,t=s.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?rt(new s(i),e,t,!0):(s.precision=r=n-i.e,i=Jt(i.plus(1),new s(1).minus(i),r+e,1),s.precision=e+4,s.rounding=1,i=i.ln(),s.precision=e,s.rounding=t,i.times(.5))):new s(NaN)},Ie.inverseSine=Ie.asin=function(){var e,t,r,n,i=this,s=i.constructor;return i.isZero()?new s(i):(t=i.abs().cmp(1),r=s.precision,n=s.rounding,t!==-1?t===0?(e=oi(s,r+4,n).times(.5),e.s=i.s,e):new s(NaN):(s.precision=r+6,s.rounding=1,i=i.div(new s(1).minus(i.times(i)).sqrt().plus(1)).atan(),s.precision=r,s.rounding=n,i.times(2)))},Ie.inverseTangent=Ie.atan=function(){var e,t,r,n,i,s,o,a,c,l=this,u=l.constructor,f=u.precision,p=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&f+4<=Bf)return o=oi(u,f+4,p).times(.25),o.s=l.s,o}else{if(!l.s)return new u(NaN);if(f+4<=Bf)return o=oi(u,f+4,p).times(.5),o.s=l.s,o}for(u.precision=a=f+10,u.rounding=1,r=Math.min(28,a/at+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(gt=!1,t=Math.ceil(a/at),n=1,c=l.times(l),o=new u(l),i=l;e!==-1;)if(i=i.times(c),s=o.minus(i.div(n+=2)),i=i.times(c),o=s.plus(i.div(n+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===s.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),gt=!0,rt(o,u.precision=f,u.rounding=p,!0)},Ie.isFinite=function(){return!!this.d},Ie.isInteger=Ie.isInt=function(){return!!this.d&&Br(this.e/at)>this.d.length-2},Ie.isNaN=function(){return!this.s},Ie.isNegative=Ie.isNeg=function(){return this.s<0},Ie.isPositive=Ie.isPos=function(){return this.s>0},Ie.isZero=function(){return!!this.d&&this.d[0]===0},Ie.lessThan=Ie.lt=function(e){return this.cmp(e)<0},Ie.lessThanOrEqualTo=Ie.lte=function(e){return this.cmp(e)<1},Ie.logarithm=Ie.log=function(e){var t,r,n,i,s,o,a,c,l=this,u=l.constructor,f=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)s=!0;else{for(i=r[0];i%10===0;)i/=10;s=i!==1}if(gt=!1,a=f+y,o=ds(l,a),n=t?ml(u,a+10):ds(e,a),c=Jt(o,n,a,1),Ea(c.d,i=f,p))do if(a+=10,o=ds(l,a),n=t?ml(u,a+10):ds(e,a),c=Jt(o,n,a,1),!s){+Or(c.d).slice(i+1,i+15)+1==1e14&&(c=rt(c,f+1,0));break}while(Ea(c.d,i+=10,p));return gt=!0,rt(c,f,p)},Ie.minus=Ie.sub=function(e){var t,r,n,i,s,o,a,c,l,u,f,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 gt?rt(e,a,c):e}if(r=Br(e.e/at),u=Br(y.e/at),l=l.slice(),s=u-r,s){for(f=s<0,f?(t=l,s=-s,o=p.length):(t=p,r=u,o=l.length),n=Math.max(Math.ceil(a/at),o)+2,s>n&&(s=n,t.length=1),t.reverse(),n=s;n--;)t.push(0);t.reverse()}else{for(n=l.length,o=p.length,f=n<o,f&&(o=n),n=0;n<o;n++)if(l[n]!=p[n]){f=l[n]<p[n];break}s=0}for(f&&(t=l,l=p,p=t,e.s=-e.s),o=l.length,n=p.length-o;n>0;--n)l[o++]=0;for(n=p.length;n>s;){if(l[--n]<p[n]){for(i=n;i&&l[--i]===0;)l[i]=Dn-1;--l[i],l[n]+=Dn}l[n]-=p[n]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(e.d=l,e.e=pl(l,r),gt?rt(e,a,c):e):new x(c===3?-0:0)},Ie.modulo=Ie.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]?rt(new n(r),n.precision,n.rounding):(gt=!1,n.modulo==9?(t=Jt(r,e.abs(),0,3,1),t.s*=e.s):t=Jt(r,e,0,n.modulo,1),t=t.times(e),gt=!0,r.minus(t))},Ie.naturalExponential=Ie.exp=function(){return Uf(this)},Ie.naturalLogarithm=Ie.ln=function(){return ds(this)},Ie.negated=Ie.neg=function(){var e=new this.constructor(this);return e.s=-e.s,rt(e)},Ie.plus=Ie.add=function(e){var t,r,n,i,s,o,a,c,l,u,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return!f.s||!e.s?e=new p(NaN):f.d||(e=new p(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(l=f.d,u=e.d,a=p.precision,c=p.rounding,!l[0]||!u[0])return u[0]||(e=new p(f)),gt?rt(e,a,c):e;if(s=Br(f.e/at),n=Br(e.e/at),l=l.slice(),i=s-n,i){for(i<0?(r=l,i=-i,o=u.length):(r=u,n=s,o=l.length),s=Math.ceil(a/at),o=s>o?s+1:o+1,i>o&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(o=l.length,i=u.length,o-i<0&&(i=o,r=u,u=l,l=r),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/Dn|0,l[i]%=Dn;for(t&&(l.unshift(t),++n),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=pl(l,n),gt?rt(e,a,c):e},Ie.precision=Ie.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ls+e);return r.d?(t=wv(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},Ie.round=function(){var e=this,t=e.constructor;return rt(new t(e),e.e+1,t.rounding)},Ie.sine=Ie.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())+at,n.rounding=1,r=XE(n,Cv(n,r)),n.precision=e,n.rounding=t,rt(ji>2?r.neg():r,e,t,!0)):new n(NaN)},Ie.squareRoot=Ie.sqrt=function(){var e,t,r,n,i,s,o=this,a=o.d,c=o.e,l=o.s,u=o.constructor;if(l!==1||!a||!a[0])return new u(!l||l<0&&(!a||a[0])?NaN:a?o:1/0);for(gt=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=Or(a),(t.length+c)%2==0&&(t+="0"),l=Math.sqrt(t),c=Br((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(s=n,n=s.plus(Jt(o,s,r+2,1)).times(.5),Or(s.d).slice(0,r)===(t=Or(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(rt(s,c+1,0),s.times(s).eq(o))){n=s;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(rt(n,c+1,1),e=!n.times(n).eq(o));break}return gt=!0,rt(n,c,u.rounding,e)},Ie.tangent=Ie.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=Jt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,rt(ji==2||ji==4?r.neg():r,e,t,!0)):new n(NaN)},Ie.times=Ie.mul=function(e){var t,r,n,i,s,o,a,c,l,u=this,f=u.constructor,p=u.d,y=(e=new f(e)).d;if(e.s*=u.s,!p||!p[0]||!y||!y[0])return new f(!e.s||p&&!p[0]&&!y||y&&!y[0]&&!p?NaN:!p||!y?e.s/0:e.s*0);for(r=Br(u.e/at)+Br(e.e/at),c=p.length,l=y.length,c<l&&(s=p,p=y,y=s,o=c,c=l,l=o),s=[],o=c+l,n=o;n--;)s.push(0);for(n=l;--n>=0;){for(t=0,i=c+n;i>n;)a=s[i]+y[n]*p[i-n-1]+t,s[i--]=a%Dn|0,t=a/Dn|0;s[i]=(s[i]+t)%Dn|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=pl(s,r),gt?rt(e,f.precision,f.rounding):e},Ie.toBinary=function(e,t){return Ff(this,2,e,t)},Ie.toDecimalPlaces=Ie.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Xr(e,0,cs),t===void 0?t=n.rounding:Xr(t,0,8),rt(r,e+r.e+1,t))},Ie.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=si(n,!0):(Xr(e,0,cs),t===void 0?t=i.rounding:Xr(t,0,8),n=rt(new i(n),e+1,t),r=si(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},Ie.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?r=si(i):(Xr(e,0,cs),t===void 0?t=s.rounding:Xr(t,0,8),n=rt(new s(i),e+i.e+1,t),r=si(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},Ie.toFraction=function(e){var t,r,n,i,s,o,a,c,l,u,f,p,y=this,x=y.d,v=y.constructor;if(!x)return new v(y);if(l=r=new v(1),n=c=new v(0),t=new v(n),s=t.e=wv(x)-y.e-1,o=s%at,t.d[0]=Er(10,o<0?at+o:o),e==null)e=s>0?t:l;else{if(a=new v(e),!a.isInt()||a.lt(l))throw Error(ls+a);e=a.gt(t)?s>0?t:l:a}for(gt=!1,a=new v(Or(x)),u=v.precision,v.precision=s=x.length*at*2;f=Jt(a,t,0,1,1),i=r.plus(f.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=c.plus(f.times(i)),c=i,i=t,t=a.minus(f.times(i)),a=i;return i=Jt(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=Jt(l,n,s,1).minus(y).abs().cmp(Jt(c,r,s,1).minus(y).abs())<1?[l,n]:[c,r],v.precision=u,gt=!0,p},Ie.toHexadecimal=Ie.toHex=function(e,t){return Ff(this,16,e,t)},Ie.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:Xr(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]?(gt=!1,r=Jt(r,e,0,t,1).times(e),gt=!0,rt(r)):(e.s=r.s,r=e),r},Ie.toNumber=function(){return+this},Ie.toOctal=function(e,t){return Ff(this,8,e,t)},Ie.toPower=Ie.pow=function(e){var t,r,n,i,s,o,a=this,c=a.constructor,l=+(e=new c(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new c(Er(+a,l));if(a=new c(a),a.eq(1))return a;if(n=c.precision,s=c.rounding,e.eq(1))return rt(a,n,s);if(t=Br(e.e/at),t>=e.d.length-1&&(r=l<0?-l:l)<=GE)return i=xv(c,a,r,n),e.s<0?new c(1).div(i):rt(i,n,s);if(o=a.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=o,a}return r=Er(+a,l),t=r==0||!isFinite(r)?Br(l*(Math.log("0."+Or(a.d))/Math.LN10+a.e+1)):new c(r+"").e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(gt=!1,c.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Uf(e.times(ds(a,n+r)),n),i.d&&(i=rt(i,n+5,1),Ea(i.d,n,s)&&(t=n+10,i=rt(Uf(e.times(ds(a,t+r)),t),t+5,1),+Or(i.d).slice(n+1,n+15)+1==1e14&&(i=rt(i,n+1,0)))),i.s=o,gt=!0,c.rounding=s,rt(i,n,s))},Ie.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=si(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Xr(e,1,cs),t===void 0?t=i.rounding:Xr(t,0,8),n=rt(new i(n),e,t),r=si(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},Ie.toSignificantDigits=Ie.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Xr(e,1,cs),t===void 0?t=n.rounding:Xr(t,0,8)),rt(new n(r),e,t)},Ie.toString=function(){var e=this,t=e.constructor,r=si(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},Ie.truncated=Ie.trunc=function(){return rt(new this.constructor(this),this.e+1,1)},Ie.valueOf=Ie.toJSON=function(){var e=this,t=e.constructor,r=si(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Or(e){var t,r,n,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;t<i;t++)n=e[t]+"",r=at-n.length,r&&(s+=us(r)),s+=n;o=e[t],n=o+"",r=at-n.length,r&&(s+=us(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}function Xr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ls+e)}function Ea(e,t,r,n){var i,s,o,a;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=at,i=0):(i=Math.ceil((t+1)/at),t%=at),s=Er(10,at-t),a=e[i]%s|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),o=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):o=(r<4&&a+1==s||r>3&&a+1==s/2)&&(e[i+1]/s/100|0)==Er(10,t-2)-1||(a==s/2||a==0)&&(e[i+1]/s/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),o=(n||r<4)&&a==9999||!n&&r>3&&a==4999):o=((n||r<4)&&a+1==s||!n&&r>3&&a+1==s/2)&&(e[i+1]/s/1e3|0)==Er(10,t-3)-1,o}function hl(e,t,r){for(var n,i=[0],s,o=0,a=e.length;o<a;){for(s=i.length;s--;)i[s]*=t;for(i[0]+=Df.indexOf(e.charAt(o++)),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 YE(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/vl(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=Eo(e,1,t.times(i),new e(1));for(var s=r;s--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}var Jt=function(){function e(n,i,s){var o,a=0,c=n.length;for(n=n.slice();c--;)o=n[c]*i+a,n[c]=o%s|0,a=o/s|0;return a&&n.unshift(a),n}function t(n,i,s,o){var a,c;if(s!=o)c=s>o?1:-1;else for(a=c=0;a<s;a++)if(n[a]!=i[a]){c=n[a]>i[a]?1:-1;break}return c}function r(n,i,s,o){for(var a=0;s--;)n[s]-=a,a=n[s]<i[s]?1:0,n[s]=a*o+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,o,a,c){var l,u,f,p,y,x,v,_,T,O,R,F,B,H,$,Z,ce,ne,de,q,N=n.constructor,h=n.s==i.s?1:-1,d=n.d,m=i.d;if(!d||!d[0]||!m||!m[0])return new N(!n.s||!i.s||(d?m&&d[0]==m[0]:!m)?NaN:d&&d[0]==0||!m?h*0:h/0);for(c?(y=1,u=n.e-i.e):(c=Dn,y=at,u=Br(n.e/y)-Br(i.e/y)),de=m.length,ce=d.length,T=new N(h),O=T.d=[],f=0;m[f]==(d[f]||0);f++);if(m[f]>(d[f]||0)&&u--,s==null?(H=s=N.precision,o=N.rounding):a?H=s+(n.e-i.e)+1:H=s,H<0)O.push(1),x=!0;else{if(H=H/y+2|0,f=0,de==1){for(p=0,m=m[0],H++;(f<ce||p)&&H--;f++)$=p*c+(d[f]||0),O[f]=$/m|0,p=$%m|0;x=p||f<ce}else{for(p=c/(m[0]+1)|0,p>1&&(m=e(m,p,c),d=e(d,p,c),de=m.length,ce=d.length),Z=de,R=d.slice(0,de),F=R.length;F<de;)R[F++]=0;q=m.slice(),q.unshift(0),ne=m[0],m[1]>=c/2&&++ne;do p=0,l=t(m,R,de,F),l<0?(B=R[0],de!=F&&(B=B*c+(R[1]||0)),p=B/ne|0,p>1?(p>=c&&(p=c-1),v=e(m,p,c),_=v.length,F=R.length,l=t(v,R,_,F),l==1&&(p--,r(v,de<_?q:m,_,c))):(p==0&&(l=p=1),v=m.slice()),_=v.length,_<F&&v.unshift(0),r(R,v,F,c),l==-1&&(F=R.length,l=t(m,R,de,F),l<1&&(p++,r(R,de<F?q:m,F,c))),F=R.length):l===0&&(p++,R=[0]),O[f++]=p,l&&R[0]?R[F++]=d[Z]||0:(R=[d[Z]],F=1);while((Z++<ce||R[0]!==void 0)&&H--);x=R[0]!==void 0}O[0]||O.shift()}if(y==1)T.e=u,mv=x;else{for(f=1,p=O[0];p>=10;p/=10)f++;T.e=f+u*y-1,rt(T,a?s+T.e+1:s,o,x)}return T}}();function rt(e,t,r,n){var i,s,o,a,c,l,u,f,p,y=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(i=1,a=f[0];a>=10;a/=10)i++;if(s=t-i,s<0)s+=at,o=t,u=f[p=0],c=u/Er(10,i-o-1)%10|0;else if(p=Math.ceil((s+1)/at),a=f.length,p>=a)if(n){for(;a++<=p;)f.push(0);u=c=0,i=1,s%=at,o=s-at+1}else break e;else{for(u=a=f[p],i=1;a>=10;a/=10)i++;s%=at,o=s-at+i,c=o<0?0:u/Er(10,i-o-1)%10|0}if(n=n||t<0||f[p+1]!==void 0||(o<0?u:u%Er(10,i-o-1)),l=r<4?(c||n)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||n||r==6&&(s>0?o>0?u/Er(10,i-o):0:f[p-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,l?(t-=e.e+1,f[0]=Er(10,(at-t%at)%at),e.e=-t||0):f[0]=e.e=0,e;if(s==0?(f.length=p,a=1,p--):(f.length=p+1,a=Er(10,at-s),f[p]=o>0?(u/Er(10,i-o)%Er(10,o)|0)*a:0),l)for(;;)if(p==0){for(s=1,o=f[0];o>=10;o/=10)s++;for(o=f[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(e.e++,f[0]==Dn&&(f[0]=1));break}else{if(f[p]+=a,f[p]!=Dn)break;f[p--]=0,a=1}for(s=f.length;f[--s]===0;)f.pop()}return gt&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e<y.minE&&(e.e=0,e.d=[0])),e}function si(e,t,r){if(!e.isFinite())return Ev(e);var n,i=e.e,s=Or(e.d),o=s.length;return t?(r&&(n=r-o)>0?s=s.charAt(0)+"."+s.slice(1)+us(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):i<0?(s="0."+us(-i-1)+s,r&&(n=r-o)>0&&(s+=us(n))):i>=o?(s+=us(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+us(n))):((n=i+1)<o&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(s+="."),s+=us(n))),s}function pl(e,t){var r=e[0];for(t*=at;r>=10;r/=10)t++;return t}function ml(e,t,r){if(t>KE)throw gt=!0,r&&(e.precision=r),Error(gv);return rt(new e(ul),t,1,!0)}function oi(e,t,r){if(t>Bf)throw Error(gv);return rt(new e(dl),t,r,!0)}function wv(e){var t=e.length-1,r=t*at+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 us(e){for(var t="";e--;)t+="0";return t}function xv(e,t,r,n){var i,s=new e(1),o=Math.ceil(n/at+4);for(gt=!1;;){if(r%2&&(s=s.times(t),Av(s.d,o)&&(i=!0)),r=Br(r/2),r===0){r=s.d.length-1,i&&s.d[r]===0&&++s.d[r];break}t=t.times(t),Av(t.d,o)}return gt=!0,s}function Sv(e){return e.d[e.d.length-1]&1}function _v(e,t,r){for(var n,i,s=new e(t[0]),o=0;++o<t.length;){if(i=new e(t[o]),!i.s){s=i;break}n=s.cmp(i),(n===r||n===0&&s.s===r)&&(s=i)}return s}function Uf(e,t){var r,n,i,s,o,a,c,l=0,u=0,f=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?(gt=!1,c=x):c=t,a=new p(.03125);e.e>-2;)e=e.times(a),f+=5;for(n=Math.log(Er(2,f))/Math.LN10*2+5|0,c+=n,r=s=o=new p(1),p.precision=c;;){if(s=rt(s.times(e),c,1),r=r.times(++u),a=o.plus(Jt(s,r,c,1)),Or(a.d).slice(0,c)===Or(o.d).slice(0,c)){for(i=f;i--;)o=rt(o.times(o),c,1);if(t==null)if(l<3&&Ea(o.d,c-n,y,l))p.precision=c+=10,r=s=a=new p(1),u=0,l++;else return rt(o,p.precision=x,y,gt=!0);else return p.precision=x,o}o=a}}function ds(e,t){var r,n,i,s,o,a,c,l,u,f,p,y=1,x=10,v=e,_=v.d,T=v.constructor,O=T.rounding,R=T.precision;if(v.s<0||!_||!_[0]||!v.e&&_[0]==1&&_.length==1)return new T(_&&!_[0]?-1/0:v.s!=1?NaN:_?0:v);if(t==null?(gt=!1,u=R):u=t,T.precision=u+=x,r=Or(_),n=r.charAt(0),Math.abs(s=v.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=Or(v.d),n=r.charAt(0),y++;s=v.e,n>1?(v=new T("0."+r),s++):v=new T(n+"."+r.slice(1))}else return l=ml(T,u+2,R).times(s+""),v=ds(new T(n+"."+r.slice(1)),u-x).plus(l),T.precision=R,t==null?rt(v,R,O,gt=!0):v;for(f=v,c=o=v=Jt(v.minus(1),v.plus(1),u,1),p=rt(v.times(v),u,1),i=3;;){if(o=rt(o.times(p),u,1),l=c.plus(Jt(o,new T(i),u,1)),Or(l.d).slice(0,u)===Or(c.d).slice(0,u))if(c=c.times(2),s!==0&&(c=c.plus(ml(T,u+2,R).times(s+""))),c=Jt(c,new T(y),u,1),t==null)if(Ea(c.d,u-x,O,a))T.precision=u+=x,l=o=v=Jt(f.minus(1),f.plus(1),u,1),p=rt(v.times(v),u,1),i=a=1;else return rt(c,T.precision=R,O,gt=!0);else return T.precision=R,c;c=l,i+=2}}function Ev(e){return String(e.s*e.s/0)}function gl(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)%at,r<0&&(n+=at),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=at;n<i;)e.d.push(+t.slice(n,n+=at));t=t.slice(n),n=at-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),gt&&(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 JE(e,t){var r,n,i,s,o,a,c,l,u;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),yv.test(t))return gl(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(HE.test(t))r=16,t=t.toLowerCase();else if(qE.test(t))r=2;else if(WE.test(t))r=8;else throw Error(ls+t);for(s=t.search(/p/i),s>0?(c=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),s=t.indexOf("."),o=s>=0,n=e.constructor,o&&(t=t.replace(".",""),a=t.length,s=a-s,i=xv(n,new n(r),s,s*2)),l=hl(t,r,Dn),u=l.length-1,s=u;l[s]===0;--s)l.pop();return s<0?new n(e.s*0):(e.e=pl(l,u),e.d=l,gt=!1,o&&(e=Jt(e,i,a*4)),c&&(e=e.times(Math.abs(c)<54?Er(2,c):Ur.pow(2,c))),gt=!0,e)}function XE(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Eo(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/vl(5,r)),t=Eo(e,2,t,t);for(var i,s=new e(5),o=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(s.plus(i.times(o.times(i).minus(a))));return t}function Eo(e,t,r,n,i){var s,o,a,c,l=e.precision,u=Math.ceil(l/at);for(gt=!1,c=r.times(r),a=new e(n);;){if(o=Jt(a.times(c),new e(t++*t++),l,1),a=i?n.plus(o):n.minus(o),n=Jt(o.times(c),new e(t++*t++),l,1),o=a.plus(n),o.d[u]!==void 0){for(s=u;o.d[s]===a.d[s]&&s--;);if(s==-1)break}s=a,a=n,n=o,o=s}return gt=!0,o.d.length=u+1,o}function vl(e,t){for(var r=e;--t;)r*=e;return r}function Cv(e,t){var r,n=t.s<0,i=oi(e,e.precision,1),s=i.times(.5);if(t=t.abs(),t.lte(s))return ji=n?4:1,t;if(r=t.divToInt(i),r.isZero())ji=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(s))return ji=Sv(r)?n?2:3:n?4:1,t;ji=Sv(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Ff(e,t,r,n){var i,s,o,a,c,l,u,f,p,y=e.constructor,x=r!==void 0;if(x?(Xr(r,1,cs),n===void 0?n=y.rounding:Xr(n,0,8)):(r=y.precision,n=y.rounding),!e.isFinite())u=Ev(e);else{for(u=si(e),o=u.indexOf("."),x?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,o>=0&&(u=u.replace(".",""),p=new y(1),p.e=u.length-o,p.d=hl(si(p),10,i),p.e=p.d.length),f=hl(u,10,i),s=c=f.length;f[--c]==0;)f.pop();if(!f[0])u=x?"0p+0":"0";else{if(o<0?s--:(e=new y(e),e.d=f,e.e=s,e=Jt(e,p,r,n,0,i),f=e.d,s=e.e,l=mv),o=f[r],a=i/2,l=l||f[r+1]!==void 0,l=n<4?(o!==void 0||l)&&(n===0||n===(e.s<0?3:2)):o>a||o===a&&(n===4||l||n===6&&f[r-1]&1||n===(e.s<0?8:7)),f.length=r,l)for(;++f[--r]>i-1;)f[r]=0,r||(++s,f.unshift(1));for(c=f.length;!f[c-1];--c);for(o=0,u="";o<c;o++)u+=Df.charAt(f[o]);if(x){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)u+="0";for(f=hl(u,i,t),c=f.length;!f[c-1];--c);for(o=1,u="1.";o<c;o++)u+=Df.charAt(f[o])}else u=u.charAt(0)+"."+u.slice(1);u=u+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)u="0"+u;u="0."+u}else if(++s>c)for(s-=c;s--;)u+="0";else s<c&&(u=u.slice(0,s)+"."+u.slice(s))}u=(t==16?"0x":t==2?"0b":t==8?"0o":"")+u}return e.s<0?"-"+u:u}function Av(e,t){if(e.length>t)return e.length=t,!0}function ZE(e){return new this(e).abs()}function QE(e){return new this(e).acos()}function eC(e){return new this(e).acosh()}function tC(e,t){return new this(e).plus(t)}function rC(e){return new this(e).asin()}function nC(e){return new this(e).asinh()}function iC(e){return new this(e).atan()}function sC(e){return new this(e).atanh()}function oC(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,s=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=oi(this,s,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?oi(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=oi(this,s,1).times(.5),r.s=e.s):t.s<0?(this.precision=s,this.rounding=1,r=this.atan(Jt(e,t,s,1)),t=oi(this,s,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(Jt(e,t,s,1)),r}function aC(e){return new this(e).cbrt()}function cC(e){return rt(e=new this(e),e.e+1,2)}function lC(e,t,r){return new this(e).clamp(t,r)}function uC(e){if(!e||typeof e!="object")throw Error(fl+"Object expected");var t,r,n,i=e.defaults===!0,s=["precision",1,cs,"rounding",0,8,"toExpNeg",-_o,0,"toExpPos",0,_o,"maxE",0,_o,"minE",-_o,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(r=s[t],i&&(this[r]=Lf[r]),(n=e[r])!==void 0)if(Br(n)===n&&n>=s[t+1]&&n<=s[t+2])this[r]=n;else throw Error(ls+r+": "+n);if(r="crypto",i&&(this[r]=Lf[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(vv);else this[r]=!1;else throw Error(ls+r+": "+n);return this}function dC(e){return new this(e).cos()}function fC(e){return new this(e).cosh()}function Tv(e){var t,r,n;function i(s){var o,a,c,l=this;if(!(l instanceof i))return new i(s);if(l.constructor=i,Mv(s)){l.s=s.s,gt?!s.d||s.e>i.maxE?(l.e=NaN,l.d=null):s.e<i.minE?(l.e=0,l.d=[0]):(l.e=s.e,l.d=s.d.slice()):(l.e=s.e,l.d=s.d?s.d.slice():s.d);return}if(c=typeof s,c==="number"){if(s===0){l.s=1/s<0?-1:1,l.e=0,l.d=[0];return}if(s<0?(s=-s,l.s=-1):l.s=1,s===~~s&&s<1e7){for(o=0,a=s;a>=10;a/=10)o++;gt?o>i.maxE?(l.e=NaN,l.d=null):o<i.minE?(l.e=0,l.d=[0]):(l.e=o,l.d=[s]):(l.e=o,l.d=[s]);return}if(s*0!==0){s||(l.s=NaN),l.e=NaN,l.d=null;return}return gl(l,s.toString())}if(c==="string")return(a=s.charCodeAt(0))===45?(s=s.slice(1),l.s=-1):(a===43&&(s=s.slice(1)),l.s=1),yv.test(s)?gl(l,s):JE(l,s);if(c==="bigint")return s<0?(s=-s,l.s=-1):l.s=1,gl(l,s.toString());throw Error(ls+s)}if(i.prototype=Ie,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=uC,i.clone=Tv,i.isDecimal=Mv,i.abs=ZE,i.acos=QE,i.acosh=eC,i.add=tC,i.asin=rC,i.asinh=nC,i.atan=iC,i.atanh=sC,i.atan2=oC,i.cbrt=aC,i.ceil=cC,i.clamp=lC,i.cos=dC,i.cosh=fC,i.div=hC,i.exp=pC,i.floor=mC,i.hypot=gC,i.ln=vC,i.log=bC,i.log10=wC,i.log2=yC,i.max=xC,i.min=SC,i.mod=_C,i.mul=EC,i.pow=CC,i.random=AC,i.round=TC,i.sign=MC,i.sin=IC,i.sinh=OC,i.sqrt=PC,i.sub=RC,i.sum=jC,i.tan=NC,i.tanh=kC,i.trunc=DC,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 hC(e,t){return new this(e).div(t)}function pC(e){return new this(e).exp()}function mC(e){return rt(e=new this(e),e.e+1,3)}function gC(){var e,t,r=new this(0);for(gt=!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 gt=!0,new this(1/0);r=t}return gt=!0,r.sqrt()}function Mv(e){return e instanceof Ur||e&&e.toStringTag===bv||!1}function vC(e){return new this(e).ln()}function bC(e,t){return new this(e).log(t)}function yC(e){return new this(e).log(2)}function wC(e){return new this(e).log(10)}function xC(){return _v(this,arguments,-1)}function SC(){return _v(this,arguments,1)}function _C(e,t){return new this(e).mod(t)}function EC(e,t){return new this(e).mul(t)}function CC(e,t){return new this(e).pow(t)}function AC(e){var t,r,n,i,s=0,o=new this(1),a=[];if(e===void 0?e=this.precision:Xr(e,1,cs),n=Math.ceil(e/at),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));s<n;)i=t[s],i>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);s<n;)i=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((t[s+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,s):(a.push(i%1e7),s+=4);s=n/4}else throw Error(vv);else for(;s<n;)a[s++]=Math.random()*1e7|0;for(n=a[--s],e%=at,n&&e&&(i=Er(10,at-e),a[s]=(n/i|0)*i);a[s]===0;s--)a.pop();if(s<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=at)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<at&&(r-=at-n)}return o.e=r,o.d=a,o}function TC(e){return rt(e=new this(e),e.e+1,this.rounding)}function MC(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function IC(e){return new this(e).sin()}function OC(e){return new this(e).sinh()}function PC(e){return new this(e).sqrt()}function RC(e,t){return new this(e).sub(t)}function jC(){var e=0,t=arguments,r=new this(t[e]);for(gt=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return gt=!0,rt(r,this.precision,this.rounding)}function NC(e){return new this(e).tan()}function kC(e){return new this(e).tanh()}function DC(e){return rt(e=new this(e),e.e+1,1)}Ie[Symbol.for("nodejs.util.inspect.custom")]=Ie.toString,Ie[Symbol.toStringTag]="Decimal";var Ur=Ie.constructor=Tv(Lf);ul=new Ur(ul),dl=new Ur(dl),Ur.config({precision:256,rounding:Ur.ROUND_DOWN,toExpNeg:-256,toExpPos:256});const Fr=(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=fs(e,t,n);if(!Be(l).equals(0))return r?l:Co(l)}const i=Be(e).toString(),s=i.split("."),o=s[0],a=s[1];let c;if(Be(o).gt(0))!a||Be(o.length).gte(9)?c=fs(i,0,n):Be(o.length).gte(4)?c=fs(i,2,n):c=fs(i,4,n);else{fs(i,6,n);const l=Ov(a);if(l<6)c=fs(i,l+6,n);else{if(l>30)return"0";c=fs(i,9+(l-6),n)}}return r||Be(o).lt(1)?c:Co(c)},Iv=(e,t,r,n)=>{try{if(e===void 0||e==="--")return"$--";const i=Fr(e,t,!0,Ur.ROUND_DOWN).toString();if(Be(i).equals(0))return"$0";const s=i.startsWith("-");let o=n?i:Co(i).toString();return o.includes("e")&&(o=n?i:Co(i).toString()),!r&&Number(i)<Math.pow(10,-t)?s?`-$${o.slice(1)}`:`<$${Math.pow(10,-t).toFixed(t)}`:s?`-$${o.slice(1)}`:`$${o}`}catch{return"$--"}},LC=(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(),s=n<0;let o=i;if(i.toLowerCase().includes("e")){const a=i.match(/(\d+?)(?:\.(\d*))?e([+-])(\d+)/),c=a[1],l=a[2],u=a[3],f=a[4];let p="",y=l?l.substr(f):"";if(y&&(y=`.${y}`),u!=="-"){for(let x=0;x<f;x+=1){const v=l[x]||"0";p+=v}o=c+p+y}else{let x="0";for(let v=0;v<f;v+=1)p=(c[c.length-v-1]||"0")+p;c.length>f&&(x=c.substr(0,c.length-f)),o=`${x}.${p}${l}`}}if(t&&r){let a=`${o.split(".")[0]}.`;const c=o.split(".")[1]||"";for(let l=0;l<t;l+=1)a+=c[l]||"0";o=a}if(o.length>14){const a=o.split(".");a[0].length>14?o=`${a[0].slice(0,14)}+`:(o=o.slice(0,13),o.indexOf(".")===12&&(o=o.slice(0,12)))}return`${s?"-":""}${o}`},BC=(e,t=2)=>{if(e==="∞")return"∞";if(e!=="0"&&!e)return"0";if(Be(e).gte(.01))return e;if(e=Rv(e.toString(),t),Be(e).equals(0))return"0";const r=Be(e).toString(),i=r.split(".")[1],s=Ov(i);return fs(r,s+t,Ur.ROUND_HALF_DOWN)},UC=e=>`${Be(e).mul(100).toString()}%`,Be=e=>Ur.isDecimal(e)?e:new Ur(typeof e>"u"||e==="undefined"||!e?0:e);function FC(e,t){return t===void 0?"":Be(e==null?void 0:e.toString()).div(Math.pow(10,t)).toString()}const fs=(e,t,r)=>Be(e).toDP(t,r).toString(),Co=e=>{const[t,r]=e.split(".");let n="";for(let i=t.length-1,s=0;i>=0;i--,s++)n=t[i]+n,s%3===2&&i!==0&&(n=","+n);return r?`${n}.${r}`:n};function Ov(e){let t=0;if(e)for(;t<e.length;){if(Be(e[t]).gt(0))return t+1;t++}return 0}function $C(e,t){const r=Pv(Be(t));return Number(Be(e).mul(r))}function VC(e,t){const r=Pv(Be(t));return Number(Be(e).div(r))}function Pv(e){return Be(10).pow(Be(e).abs())}function $f(e,t){const r=VC(e,t);return Rv(r.toString(),Number(t))}function Rv(e,t=9){if(e===void 0)return"";const r=e.toLowerCase();if(r.includes("e")){if(r.includes("+"))return LC(r,t);const[n,i]=r.split("e");let s=n;const o=Math.abs(parseInt(i,10));let a="",c=s.length;if(n.includes(".")){const[l,u]=n.split(".");s=l+u,c=l.length}for(let l=0;l<o-c;l++)a+="0";return`0.${a}${s}`.slice(0,t+2)}return e}function bl(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}const zs=(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):"",Vf=(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(!Vf(e[i],t[i]))return!1;return!0};function jv(e){return!e||Object.keys(e).length===0}function Nv(e){var t;return((t=e.split("::"))==null?void 0:t.length)===3}const kv=async e=>new Promise(t=>{setTimeout(()=>{t(1)},e)});function zC(e,t,r=!1){var a;const n=e.balanceChanges,i=(a=e.effects)==null?void 0:a.gasUsed,s={};let o="0";return i&&(o=Be(i.computationCost).add(i.storageCost).sub(i.storageRebate).mul(-1).toFixed(0)),n&&n.forEach(c=>{const l=cn(c.coinType).full_address;if(c.owner.AddressOwner===t){const u=cn(l).full_address===wc;let f=c.amount;u&&(f=r?f:Be(f).sub(o).toFixed(0));const p={coinType:l,amount:f};s[l]=p}}),s}function Dv(e,t){if(t){const r=e[cn(t.coin_type).full_address];if(r)return $f(Be(r.amount).abs().toFixed(0),t.decimals)}}function Ct(e){return`https://archive.cetus.zone/assets/terminal${e}`}const yn=(e,t=10)=>e&&(e==null?void 0:e.length)>t&&Be(t).gt(0)?`${e.slice(0,t)}...`:e,yl=(e,t)=>Ri(e||"")===Ri(t||""),qC=e=>e===null||typeof e!="object"||Array.isArray(e)?!1:Object.keys(e).length>0;function Lv(e){return cn(e).source_address}const HC=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 s=new AbortController,o=setTimeout(()=>{s.abort()},r);try{const a=await fetch(i,{signal:s.signal});if(clearTimeout(o),!a.ok)throw new Error("Request failed");const c=await a.json();return(c==null?void 0:c.data)||c}catch(a){throw clearTimeout(o),a.name==="AbortError"?new Error("request time out"):a}},WC=async function(e,t,r=3e4){const n=new AbortController,i=setTimeout(()=>{n.abort()},r);try{const s=await fetch(e,{body:JSON.stringify(t),method:"POST",signal:n.signal});if(clearTimeout(i),!s.ok)throw new Error("Request failed");return s.json()}catch(s){throw clearTimeout(i),s.name==="AbortError"?new Error("request time out"):s}},zf="tokenMap",Bv="trustedTokenList",Uv="collectTokenMap",Fv="importTokenList";function wl(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 $v={exports:{}};/*!
|
|
48
48
|
localForage -- Offline Storage, Improved
|
|
49
49
|
Version 1.10.0
|
|
50
50
|
https://localforage.github.io/localForage
|
|
51
51
|
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
52
|
-
*/(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,s){function o(l,u){if(!i[l]){if(!n[l]){var f=typeof wl=="function"&&wl;if(!u&&f)return f(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 v=n[l][1][x];return o(v||x)},y,y.exports,r,n,i,s)}return i[l].exports}for(var a=typeof wl=="function"&&wl,c=0;c<s.length;c++)o(s[c]);return o}({1:[function(r,n,i){(function(s){var o=s.MutationObserver||s.WebKitMutationObserver,a;if(o){var c=0,l=new o(x),u=s.document.createTextNode("");l.observe(u,{characterData:!0}),a=function(){u.data=c=++c%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var f=new s.MessageChannel;f.port1.onmessage=x,a=function(){f.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?a=function(){var _=s.document.createElement("script");_.onreadystatechange=function(){x(),_.onreadystatechange=null,_.parentNode.removeChild(_),_=null},s.document.documentElement.appendChild(_)}:a=function(){setTimeout(x,0)};var p,y=[];function x(){p=!0;for(var _,T,O=y.length;O;){for(T=y,y=[],_=-1;++_<O;)T[_]();O=y.length}p=!1}n.exports=v;function v(_){y.push(_)===1&&!p&&a()}}).call(this,typeof Cr<"u"?Cr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,n,i){var s=r(1);function o(){}var a={},c=["REJECTED"],l=["FULFILLED"],u=["PENDING"];n.exports=f;function f(B){if(typeof B!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,B!==o&&v(this,B)}f.prototype.catch=function(B){return this.then(null,B)},f.prototype.then=function(B,H){if(typeof B!="function"&&this.state===l||typeof H!="function"&&this.state===c)return this;var $=new this.constructor(o);if(this.state!==u){var Z=this.state===l?B:H;y($,Z,this.outcome)}else this.queue.push(new p($,B,H));return $};function p(B,H,$){this.promise=B,typeof H=="function"&&(this.onFulfilled=H,this.callFulfilled=this.otherCallFulfilled),typeof $=="function"&&(this.onRejected=$,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,H,$){s(function(){var Z;try{Z=H($)}catch(ce){return a.reject(B,ce)}Z===B?a.reject(B,new TypeError("Cannot resolve promise with itself")):a.resolve(B,Z)})}a.resolve=function(B,H){var $=_(x,H);if($.status==="error")return a.reject(B,$.value);var Z=$.value;if(Z)v(B,Z);else{B.state=l,B.outcome=H;for(var ce=-1,ne=B.queue.length;++ce<ne;)B.queue[ce].callFulfilled(H)}return B},a.reject=function(B,H){B.state=c,B.outcome=H;for(var $=-1,Z=B.queue.length;++$<Z;)B.queue[$].callRejected(H);return B};function x(B){var H=B&&B.then;if(B&&(typeof B=="object"||typeof B=="function")&&typeof H=="function")return function(){H.apply(B,arguments)}}function v(B,H){var $=!1;function Z(q){$||($=!0,a.reject(B,q))}function ce(q){$||($=!0,a.resolve(B,q))}function ne(){H(ce,Z)}var de=_(ne);de.status==="error"&&Z(de.value)}function _(B,H){var $={};try{$.value=B(H),$.status="success"}catch(Z){$.status="error",$.value=Z}return $}f.resolve=T;function T(B){return B instanceof this?B:a.resolve(new this(o),B)}f.reject=O;function O(B){var H=new this(o);return a.reject(H,B)}f.all=R;function R(B){var H=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $=B.length,Z=!1;if(!$)return this.resolve([]);for(var ce=new Array($),ne=0,de=-1,q=new this(o);++de<$;)N(B[de],de);return q;function N(h,d){H.resolve(h).then(m,function(S){Z||(Z=!0,a.reject(q,S))});function m(S){ce[d]=S,++ne===$&&!Z&&(Z=!0,a.resolve(q,ce))}}}f.race=F;function F(B){var H=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $=B.length,Z=!1;if(!$)return this.resolve([]);for(var ce=-1,ne=new this(o);++ce<$;)de(B[ce]);return ne;function de(q){H.resolve(q).then(function(N){Z||(Z=!0,a.resolve(ne,N))},function(N){Z||(Z=!0,a.reject(ne,N))})}}},{1:1}],3:[function(r,n,i){(function(s){typeof s.Promise!="function"&&(s.Promise=r(2))}).call(this,typeof Cr<"u"?Cr:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,n,i){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U};function o(U,ie){if(!(U instanceof ie))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 U=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),ie=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!U||ie)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function u(U,ie){U=U||[],ie=ie||{};try{return new Blob(U,ie)}catch(ae){if(ae.name!=="TypeError")throw ae;for(var Y=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,ue=new Y,ge=0;ge<U.length;ge+=1)ue.append(U[ge]);return ue.getBlob(ie.type)}}typeof Promise>"u"&&r(3);var f=Promise;function p(U,ie){ie&&U.then(function(Y){ie(null,Y)},function(Y){ie(Y)})}function y(U,ie,Y){typeof ie=="function"&&U.then(ie),typeof Y=="function"&&U.catch(Y)}function x(U){return typeof U!="string"&&(console.warn(U+" used as a key, but it is not a string."),U=String(U)),U}function v(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var _="local-forage-detect-blob-support",T=void 0,O={},R=Object.prototype.toString,F="readonly",B="readwrite";function H(U){for(var ie=U.length,Y=new ArrayBuffer(ie),ue=new Uint8Array(Y),ge=0;ge<ie;ge++)ue[ge]=U.charCodeAt(ge);return Y}function $(U){return new f(function(ie){var Y=U.transaction(_,B),ue=u([""]);Y.objectStore(_).put(ue,"key"),Y.onabort=function(ge){ge.preventDefault(),ge.stopPropagation(),ie(!1)},Y.oncomplete=function(){var ge=navigator.userAgent.match(/Chrome\/(\d+)/),ae=navigator.userAgent.match(/Edge\//);ie(ae||!ge||parseInt(ge[1],10)>=43)}}).catch(function(){return!1})}function Z(U){return typeof T=="boolean"?f.resolve(T):$(U).then(function(ie){return T=ie,T})}function ce(U){var ie=O[U.name],Y={};Y.promise=new f(function(ue,ge){Y.resolve=ue,Y.reject=ge}),ie.deferredOperations.push(Y),ie.dbReady?ie.dbReady=ie.dbReady.then(function(){return Y.promise}):ie.dbReady=Y.promise}function ne(U){var ie=O[U.name],Y=ie.deferredOperations.pop();if(Y)return Y.resolve(),Y.promise}function de(U,ie){var Y=O[U.name],ue=Y.deferredOperations.pop();if(ue)return ue.reject(ie),ue.promise}function q(U,ie){return new f(function(Y,ue){if(O[U.name]=O[U.name]||g(),U.db)if(ie)ce(U),U.db.close();else return Y(U.db);var ge=[U.name];ie&&ge.push(U.version);var ae=c.open.apply(c,ge);ie&&(ae.onupgradeneeded=function(Ae){var Pe=ae.result;try{Pe.createObjectStore(U.storeName),Ae.oldVersion<=1&&Pe.createObjectStore(_)}catch(ke){if(ke.name==="ConstraintError")console.warn('The database "'+U.name+'" has been upgraded from version '+Ae.oldVersion+" to version "+Ae.newVersion+', but the storage "'+U.storeName+'" already exists.');else throw ke}}),ae.onerror=function(Ae){Ae.preventDefault(),ue(ae.error)},ae.onsuccess=function(){var Ae=ae.result;Ae.onversionchange=function(Pe){Pe.target.close()},Y(Ae),ne(U)}})}function N(U){return q(U,!1)}function h(U){return q(U,!0)}function d(U,ie){if(!U.db)return!0;var Y=!U.db.objectStoreNames.contains(U.storeName),ue=U.version<U.db.version,ge=U.version>U.db.version;if(ue&&(U.version!==ie&&console.warn('The database "'+U.name+`" can't be downgraded from version `+U.db.version+" to version "+U.version+"."),U.version=U.db.version),ge||Y){if(Y){var ae=U.db.version+1;ae>U.version&&(U.version=ae)}return!0}return!1}function m(U){return new f(function(ie,Y){var ue=new FileReader;ue.onerror=Y,ue.onloadend=function(ge){var ae=btoa(ge.target.result||"");ie({__local_forage_encoded_blob:!0,data:ae,type:U.type})},ue.readAsBinaryString(U)})}function S(U){var ie=H(atob(U.data));return u([ie],{type:U.type})}function E(U){return U&&U.__local_forage_encoded_blob}function M(U){var ie=this,Y=ie._initReady().then(function(){var ue=O[ie._dbInfo.name];if(ue&&ue.dbReady)return ue.dbReady});return y(Y,U,U),Y}function j(U){ce(U);for(var ie=O[U.name],Y=ie.forages,ue=0;ue<Y.length;ue++){var ge=Y[ue];ge._dbInfo.db&&(ge._dbInfo.db.close(),ge._dbInfo.db=null)}return U.db=null,N(U).then(function(ae){return U.db=ae,d(U)?h(U):ae}).then(function(ae){U.db=ie.db=ae;for(var Ae=0;Ae<Y.length;Ae++)Y[Ae]._dbInfo.db=ae}).catch(function(ae){throw de(U,ae),ae})}function I(U,ie,Y,ue){ue===void 0&&(ue=1);try{var ge=U.db.transaction(U.storeName,ie);Y(null,ge)}catch(ae){if(ue>0&&(!U.db||ae.name==="InvalidStateError"||ae.name==="NotFoundError"))return f.resolve().then(function(){if(!U.db||ae.name==="NotFoundError"&&!U.db.objectStoreNames.contains(U.storeName)&&U.version<=U.db.version)return U.db&&(U.version=U.db.version+1),h(U)}).then(function(){return j(U).then(function(){I(U,ie,Y,ue-1)})}).catch(Y);Y(ae)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function b(U){var ie=this,Y={db:null};if(U)for(var ue in U)Y[ue]=U[ue];var ge=O[Y.name];ge||(ge=g(),O[Y.name]=ge),ge.forages.push(ie),ie._initReady||(ie._initReady=ie.ready,ie.ready=M);var ae=[];function Ae(){return f.resolve()}for(var Pe=0;Pe<ge.forages.length;Pe++){var ke=ge.forages[Pe];ke!==ie&&ae.push(ke._initReady().catch(Ae))}var De=ge.forages.slice(0);return f.all(ae).then(function(){return Y.db=ge.db,N(Y)}).then(function(Le){return Y.db=Le,d(Y,ie._defaultConfig.version)?h(Y):Le}).then(function(Le){Y.db=ge.db=Le,ie._dbInfo=Y;for(var Ze=0;Ze<De.length;Ze++){var Tt=De[Ze];Tt!==ie&&(Tt._dbInfo.db=Y.db,Tt._dbInfo.version=Y.version)}})}function k(U,ie){var Y=this;U=x(U);var ue=new f(function(ge,ae){Y.ready().then(function(){I(Y._dbInfo,F,function(Ae,Pe){if(Ae)return ae(Ae);try{var ke=Pe.objectStore(Y._dbInfo.storeName),De=ke.get(U);De.onsuccess=function(){var Le=De.result;Le===void 0&&(Le=null),E(Le)&&(Le=S(Le)),ge(Le)},De.onerror=function(){ae(De.error)}}catch(Le){ae(Le)}})}).catch(ae)});return p(ue,ie),ue}function ve(U,ie){var Y=this,ue=new f(function(ge,ae){Y.ready().then(function(){I(Y._dbInfo,F,function(Ae,Pe){if(Ae)return ae(Ae);try{var ke=Pe.objectStore(Y._dbInfo.storeName),De=ke.openCursor(),Le=1;De.onsuccess=function(){var Ze=De.result;if(Ze){var Tt=Ze.value;E(Tt)&&(Tt=S(Tt));var zt=U(Tt,Ze.key,Le++);zt!==void 0?ge(zt):Ze.continue()}else ge()},De.onerror=function(){ae(De.error)}}catch(Ze){ae(Ze)}})}).catch(ae)});return p(ue,ie),ue}function he(U,ie,Y){var ue=this;U=x(U);var ge=new f(function(ae,Ae){var Pe;ue.ready().then(function(){return Pe=ue._dbInfo,R.call(ie)==="[object Blob]"?Z(Pe.db).then(function(ke){return ke?ie:m(ie)}):ie}).then(function(ke){I(ue._dbInfo,B,function(De,Le){if(De)return Ae(De);try{var Ze=Le.objectStore(ue._dbInfo.storeName);ke===null&&(ke=void 0);var Tt=Ze.put(ke,U);Le.oncomplete=function(){ke===void 0&&(ke=null),ae(ke)},Le.onabort=Le.onerror=function(){var zt=Tt.error?Tt.error:Tt.transaction.error;Ae(zt)}}catch(zt){Ae(zt)}})}).catch(Ae)});return p(ge,Y),ge}function we(U,ie){var Y=this;U=x(U);var ue=new f(function(ge,ae){Y.ready().then(function(){I(Y._dbInfo,B,function(Ae,Pe){if(Ae)return ae(Ae);try{var ke=Pe.objectStore(Y._dbInfo.storeName),De=ke.delete(U);Pe.oncomplete=function(){ge()},Pe.onerror=function(){ae(De.error)},Pe.onabort=function(){var Le=De.error?De.error:De.transaction.error;ae(Le)}}catch(Le){ae(Le)}})}).catch(ae)});return p(ue,ie),ue}function Oe(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){I(ie._dbInfo,B,function(ae,Ae){if(ae)return ge(ae);try{var Pe=Ae.objectStore(ie._dbInfo.storeName),ke=Pe.clear();Ae.oncomplete=function(){ue()},Ae.onabort=Ae.onerror=function(){var De=ke.error?ke.error:ke.transaction.error;ge(De)}}catch(De){ge(De)}})}).catch(ge)});return p(Y,U),Y}function je(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){I(ie._dbInfo,F,function(ae,Ae){if(ae)return ge(ae);try{var Pe=Ae.objectStore(ie._dbInfo.storeName),ke=Pe.count();ke.onsuccess=function(){ue(ke.result)},ke.onerror=function(){ge(ke.error)}}catch(De){ge(De)}})}).catch(ge)});return p(Y,U),Y}function L(U,ie){var Y=this,ue=new f(function(ge,ae){if(U<0){ge(null);return}Y.ready().then(function(){I(Y._dbInfo,F,function(Ae,Pe){if(Ae)return ae(Ae);try{var ke=Pe.objectStore(Y._dbInfo.storeName),De=!1,Le=ke.openKeyCursor();Le.onsuccess=function(){var Ze=Le.result;if(!Ze){ge(null);return}U===0||De?ge(Ze.key):(De=!0,Ze.advance(U))},Le.onerror=function(){ae(Le.error)}}catch(Ze){ae(Ze)}})}).catch(ae)});return p(ue,ie),ue}function z(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){I(ie._dbInfo,F,function(ae,Ae){if(ae)return ge(ae);try{var Pe=Ae.objectStore(ie._dbInfo.storeName),ke=Pe.openKeyCursor(),De=[];ke.onsuccess=function(){var Le=ke.result;if(!Le){ue(De);return}De.push(Le.key),Le.continue()},ke.onerror=function(){ge(ke.error)}}catch(Le){ge(Le)}})}).catch(ge)});return p(Y,U),Y}function G(U,ie){ie=v.apply(this,arguments);var Y=this.config();U=typeof U!="function"&&U||{},U.name||(U.name=U.name||Y.name,U.storeName=U.storeName||Y.storeName);var ue=this,ge;if(!U.name)ge=f.reject("Invalid arguments");else{var ae=U.name===Y.name&&ue._dbInfo.db,Ae=ae?f.resolve(ue._dbInfo.db):N(U).then(function(Pe){var ke=O[U.name],De=ke.forages;ke.db=Pe;for(var Le=0;Le<De.length;Le++)De[Le]._dbInfo.db=Pe;return Pe});U.storeName?ge=Ae.then(function(Pe){if(Pe.objectStoreNames.contains(U.storeName)){var ke=Pe.version+1;ce(U);var De=O[U.name],Le=De.forages;Pe.close();for(var Ze=0;Ze<Le.length;Ze++){var Tt=Le[Ze];Tt._dbInfo.db=null,Tt._dbInfo.version=ke}var zt=new f(function(Ht,br){var gr=c.open(U.name,ke);gr.onerror=function(Sn){var ic=gr.result;ic.close(),br(Sn)},gr.onupgradeneeded=function(){var Sn=gr.result;Sn.deleteObjectStore(U.storeName)},gr.onsuccess=function(){var Sn=gr.result;Sn.close(),Ht(Sn)}});return zt.then(function(Ht){De.db=Ht;for(var br=0;br<Le.length;br++){var gr=Le[br];gr._dbInfo.db=Ht,ne(gr._dbInfo)}}).catch(function(Ht){throw(de(U,Ht)||f.resolve()).catch(function(){}),Ht})}}):ge=Ae.then(function(Pe){ce(U);var ke=O[U.name],De=ke.forages;Pe.close();for(var Le=0;Le<De.length;Le++){var Ze=De[Le];Ze._dbInfo.db=null}var Tt=new f(function(zt,Ht){var br=c.deleteDatabase(U.name);br.onerror=function(){var gr=br.result;gr&&gr.close(),Ht(br.error)},br.onblocked=function(){console.warn('dropInstance blocked for database "'+U.name+'" until all open connections are closed')},br.onsuccess=function(){var gr=br.result;gr&&gr.close(),zt(gr)}});return Tt.then(function(zt){ke.db=zt;for(var Ht=0;Ht<De.length;Ht++){var br=De[Ht];ne(br._dbInfo)}}).catch(function(zt){throw(de(U,zt)||f.resolve()).catch(function(){}),zt})})}return p(ge,ie),ge}var re={_driver:"asyncStorage",_initStorage:b,_support:l(),iterate:ve,getItem:k,setItem:he,removeItem:we,clear:Oe,length:je,key:L,keys:z,dropInstance:G};function ee(){return typeof openDatabase=="function"}var Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fe="~~local_forage_type~",W=/^~~local_forage_type~([^~]+)~/,K="__lfsc__:",te=K.length,oe="arbf",pe="blob",Se="si08",_e="ui08",Ne="uic8",He="si16",Ge="si32",Re="ur16",Ke="ui32",nt="fl32",Qe="fl64",Mt=te+oe.length,jt=Object.prototype.toString;function Xe(U){var ie=U.length*.75,Y=U.length,ue,ge=0,ae,Ae,Pe,ke;U[U.length-1]==="="&&(ie--,U[U.length-2]==="="&&ie--);var De=new ArrayBuffer(ie),Le=new Uint8Array(De);for(ue=0;ue<Y;ue+=4)ae=Q.indexOf(U[ue]),Ae=Q.indexOf(U[ue+1]),Pe=Q.indexOf(U[ue+2]),ke=Q.indexOf(U[ue+3]),Le[ge++]=ae<<2|Ae>>4,Le[ge++]=(Ae&15)<<4|Pe>>2,Le[ge++]=(Pe&3)<<6|ke&63;return De}function St(U){var ie=new Uint8Array(U),Y="",ue;for(ue=0;ue<ie.length;ue+=3)Y+=Q[ie[ue]>>2],Y+=Q[(ie[ue]&3)<<4|ie[ue+1]>>4],Y+=Q[(ie[ue+1]&15)<<2|ie[ue+2]>>6],Y+=Q[ie[ue+2]&63];return ie.length%3===2?Y=Y.substring(0,Y.length-1)+"=":ie.length%3===1&&(Y=Y.substring(0,Y.length-2)+"=="),Y}function vt(U,ie){var Y="";if(U&&(Y=jt.call(U)),U&&(Y==="[object ArrayBuffer]"||U.buffer&&jt.call(U.buffer)==="[object ArrayBuffer]")){var ue,ge=K;U instanceof ArrayBuffer?(ue=U,ge+=oe):(ue=U.buffer,Y==="[object Int8Array]"?ge+=Se:Y==="[object Uint8Array]"?ge+=_e:Y==="[object Uint8ClampedArray]"?ge+=Ne:Y==="[object Int16Array]"?ge+=He:Y==="[object Uint16Array]"?ge+=Re:Y==="[object Int32Array]"?ge+=Ge:Y==="[object Uint32Array]"?ge+=Ke:Y==="[object Float32Array]"?ge+=nt:Y==="[object Float64Array]"?ge+=Qe:ie(new Error("Failed to get type for BinaryArray"))),ie(ge+St(ue))}else if(Y==="[object Blob]"){var ae=new FileReader;ae.onload=function(){var Ae=fe+U.type+"~"+St(this.result);ie(K+pe+Ae)},ae.readAsArrayBuffer(U)}else try{ie(JSON.stringify(U))}catch(Ae){console.error("Couldn't convert value into a JSON string: ",U),ie(null,Ae)}}function Ye(U){if(U.substring(0,te)!==K)return JSON.parse(U);var ie=U.substring(Mt),Y=U.substring(te,Mt),ue;if(Y===pe&&W.test(ie)){var ge=ie.match(W);ue=ge[1],ie=ie.substring(ge[0].length)}var ae=Xe(ie);switch(Y){case oe:return ae;case pe:return u([ae],{type:ue});case Se:return new Int8Array(ae);case _e:return new Uint8Array(ae);case Ne:return new Uint8ClampedArray(ae);case He:return new Int16Array(ae);case Re:return new Uint16Array(ae);case Ge:return new Int32Array(ae);case Ke:return new Uint32Array(ae);case nt:return new Float32Array(ae);case Qe:return new Float64Array(ae);default:throw new Error("Unkown type: "+Y)}}var it={serialize:vt,deserialize:Ye,stringToBuffer:Xe,bufferToString:St};function Nt(U,ie,Y,ue){U.executeSql("CREATE TABLE IF NOT EXISTS "+ie.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],Y,ue)}function ft(U){var ie=this,Y={db:null};if(U)for(var ue in U)Y[ue]=typeof U[ue]!="string"?U[ue].toString():U[ue];var ge=new f(function(ae,Ae){try{Y.db=openDatabase(Y.name,String(Y.version),Y.description,Y.size)}catch(Pe){return Ae(Pe)}Y.db.transaction(function(Pe){Nt(Pe,Y,function(){ie._dbInfo=Y,ae()},function(ke,De){Ae(De)})},Ae)});return Y.serializer=it,ge}function It(U,ie,Y,ue,ge,ae){U.executeSql(Y,ue,ge,function(Ae,Pe){Pe.code===Pe.SYNTAX_ERR?Ae.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[ie.storeName],function(ke,De){De.rows.length?ae(ke,Pe):Nt(ke,ie,function(){ke.executeSql(Y,ue,ge,ae)},ae)},ae):ae(Ae,Pe)},ae)}function Pt(U,ie){var Y=this;U=x(U);var ue=new f(function(ge,ae){Y.ready().then(function(){var Ae=Y._dbInfo;Ae.db.transaction(function(Pe){It(Pe,Ae,"SELECT * FROM "+Ae.storeName+" WHERE key = ? LIMIT 1",[U],function(ke,De){var Le=De.rows.length?De.rows.item(0).value:null;Le&&(Le=Ae.serializer.deserialize(Le)),ge(Le)},function(ke,De){ae(De)})})}).catch(ae)});return p(ue,ie),ue}function st(U,ie){var Y=this,ue=new f(function(ge,ae){Y.ready().then(function(){var Ae=Y._dbInfo;Ae.db.transaction(function(Pe){It(Pe,Ae,"SELECT * FROM "+Ae.storeName,[],function(ke,De){for(var Le=De.rows,Ze=Le.length,Tt=0;Tt<Ze;Tt++){var zt=Le.item(Tt),Ht=zt.value;if(Ht&&(Ht=Ae.serializer.deserialize(Ht)),Ht=U(Ht,zt.key,Tt+1),Ht!==void 0){ge(Ht);return}}ge()},function(ke,De){ae(De)})})}).catch(ae)});return p(ue,ie),ue}function _t(U,ie,Y,ue){var ge=this;U=x(U);var ae=new f(function(Ae,Pe){ge.ready().then(function(){ie===void 0&&(ie=null);var ke=ie,De=ge._dbInfo;De.serializer.serialize(ie,function(Le,Ze){Ze?Pe(Ze):De.db.transaction(function(Tt){It(Tt,De,"INSERT OR REPLACE INTO "+De.storeName+" (key, value) VALUES (?, ?)",[U,Le],function(){Ae(ke)},function(zt,Ht){Pe(Ht)})},function(Tt){if(Tt.code===Tt.QUOTA_ERR){if(ue>0){Ae(_t.apply(ge,[U,ke,Y,ue-1]));return}Pe(Tt)}})})}).catch(Pe)});return p(ae,Y),ae}function kt(U,ie,Y){return _t.apply(this,[U,ie,Y,1])}function pt(U,ie){var Y=this;U=x(U);var ue=new f(function(ge,ae){Y.ready().then(function(){var Ae=Y._dbInfo;Ae.db.transaction(function(Pe){It(Pe,Ae,"DELETE FROM "+Ae.storeName+" WHERE key = ?",[U],function(){ge()},function(ke,De){ae(De)})})}).catch(ae)});return p(ue,ie),ue}function Ot(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){var ae=ie._dbInfo;ae.db.transaction(function(Ae){It(Ae,ae,"DELETE FROM "+ae.storeName,[],function(){ue()},function(Pe,ke){ge(ke)})})}).catch(ge)});return p(Y,U),Y}function qt(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){var ae=ie._dbInfo;ae.db.transaction(function(Ae){It(Ae,ae,"SELECT COUNT(key) as c FROM "+ae.storeName,[],function(Pe,ke){var De=ke.rows.item(0).c;ue(De)},function(Pe,ke){ge(ke)})})}).catch(ge)});return p(Y,U),Y}function D(U,ie){var Y=this,ue=new f(function(ge,ae){Y.ready().then(function(){var Ae=Y._dbInfo;Ae.db.transaction(function(Pe){It(Pe,Ae,"SELECT key FROM "+Ae.storeName+" WHERE id = ? LIMIT 1",[U+1],function(ke,De){var Le=De.rows.length?De.rows.item(0).key:null;ge(Le)},function(ke,De){ae(De)})})}).catch(ae)});return p(ue,ie),ue}function C(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){var ae=ie._dbInfo;ae.db.transaction(function(Ae){It(Ae,ae,"SELECT key FROM "+ae.storeName,[],function(Pe,ke){for(var De=[],Le=0;Le<ke.rows.length;Le++)De.push(ke.rows.item(Le).key);ue(De)},function(Pe,ke){ge(ke)})})}).catch(ge)});return p(Y,U),Y}function A(U){return new f(function(ie,Y){U.transaction(function(ue){ue.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(ge,ae){for(var Ae=[],Pe=0;Pe<ae.rows.length;Pe++)Ae.push(ae.rows.item(Pe).name);ie({db:U,storeNames:Ae})},function(ge,ae){Y(ae)})},function(ue){Y(ue)})})}function V(U,ie){ie=v.apply(this,arguments);var Y=this.config();U=typeof U!="function"&&U||{},U.name||(U.name=U.name||Y.name,U.storeName=U.storeName||Y.storeName);var ue=this,ge;return U.name?ge=new f(function(ae){var Ae;U.name===Y.name?Ae=ue._dbInfo.db:Ae=openDatabase(U.name,"","",0),U.storeName?ae({db:Ae,storeNames:[U.storeName]}):ae(A(Ae))}).then(function(ae){return new f(function(Ae,Pe){ae.db.transaction(function(ke){function De(zt){return new f(function(Ht,br){ke.executeSql("DROP TABLE IF EXISTS "+zt,[],function(){Ht()},function(gr,Sn){br(Sn)})})}for(var Le=[],Ze=0,Tt=ae.storeNames.length;Ze<Tt;Ze++)Le.push(De(ae.storeNames[Ze]));f.all(Le).then(function(){Ae()}).catch(function(zt){Pe(zt)})},function(ke){Pe(ke)})})}):ge=f.reject("Invalid arguments"),p(ge,ie),ge}var se={_driver:"webSQLStorage",_initStorage:ft,_support:ee(),iterate:st,getItem:Pt,setItem:kt,removeItem:pt,clear:Ot,length:qt,key:D,keys:C,dropInstance:V};function me(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function be(U,ie){var Y=U.name+"/";return U.storeName!==ie.storeName&&(Y+=U.storeName+"/"),Y}function We(){var U="_localforage_support_test";try{return localStorage.setItem(U,!0),localStorage.removeItem(U),!1}catch{return!0}}function ut(){return!We()||localStorage.length>0}function qe(U){var ie=this,Y={};if(U)for(var ue in U)Y[ue]=U[ue];return Y.keyPrefix=be(U,ie._defaultConfig),ut()?(ie._dbInfo=Y,Y.serializer=it,f.resolve()):f.reject()}function J(U){var ie=this,Y=ie.ready().then(function(){for(var ue=ie._dbInfo.keyPrefix,ge=localStorage.length-1;ge>=0;ge--){var ae=localStorage.key(ge);ae.indexOf(ue)===0&&localStorage.removeItem(ae)}});return p(Y,U),Y}function ye(U,ie){var Y=this;U=x(U);var ue=Y.ready().then(function(){var ge=Y._dbInfo,ae=localStorage.getItem(ge.keyPrefix+U);return ae&&(ae=ge.serializer.deserialize(ae)),ae});return p(ue,ie),ue}function Ce(U,ie){var Y=this,ue=Y.ready().then(function(){for(var ge=Y._dbInfo,ae=ge.keyPrefix,Ae=ae.length,Pe=localStorage.length,ke=1,De=0;De<Pe;De++){var Le=localStorage.key(De);if(Le.indexOf(ae)===0){var Ze=localStorage.getItem(Le);if(Ze&&(Ze=ge.serializer.deserialize(Ze)),Ze=U(Ze,Le.substring(Ae),ke++),Ze!==void 0)return Ze}}});return p(ue,ie),ue}function Ve(U,ie){var Y=this,ue=Y.ready().then(function(){var ge=Y._dbInfo,ae;try{ae=localStorage.key(U)}catch{ae=null}return ae&&(ae=ae.substring(ge.keyPrefix.length)),ae});return p(ue,ie),ue}function et(U){var ie=this,Y=ie.ready().then(function(){for(var ue=ie._dbInfo,ge=localStorage.length,ae=[],Ae=0;Ae<ge;Ae++){var Pe=localStorage.key(Ae);Pe.indexOf(ue.keyPrefix)===0&&ae.push(Pe.substring(ue.keyPrefix.length))}return ae});return p(Y,U),Y}function ze(U){var ie=this,Y=ie.keys().then(function(ue){return ue.length});return p(Y,U),Y}function Je(U,ie){var Y=this;U=x(U);var ue=Y.ready().then(function(){var ge=Y._dbInfo;localStorage.removeItem(ge.keyPrefix+U)});return p(ue,ie),ue}function bt(U,ie,Y){var ue=this;U=x(U);var ge=ue.ready().then(function(){ie===void 0&&(ie=null);var ae=ie;return new f(function(Ae,Pe){var ke=ue._dbInfo;ke.serializer.serialize(ie,function(De,Le){if(Le)Pe(Le);else try{localStorage.setItem(ke.keyPrefix+U,De),Ae(ae)}catch(Ze){(Ze.name==="QuotaExceededError"||Ze.name==="NS_ERROR_DOM_QUOTA_REACHED")&&Pe(Ze),Pe(Ze)}})})});return p(ge,Y),ge}function rr(U,ie){if(ie=v.apply(this,arguments),U=typeof U!="function"&&U||{},!U.name){var Y=this.config();U.name=U.name||Y.name,U.storeName=U.storeName||Y.storeName}var ue=this,ge;return U.name?ge=new f(function(ae){U.storeName?ae(be(U,ue._defaultConfig)):ae(U.name+"/")}).then(function(ae){for(var Ae=localStorage.length-1;Ae>=0;Ae--){var Pe=localStorage.key(Ae);Pe.indexOf(ae)===0&&localStorage.removeItem(Pe)}}):ge=f.reject("Invalid arguments"),p(ge,ie),ge}var Bt={_driver:"localStorageWrapper",_initStorage:qe,_support:me(),iterate:Ce,getItem:ye,setItem:bt,removeItem:Je,clear:J,length:ze,key:Ve,keys:et,dropInstance:rr},Vt=function(ie,Y){return ie===Y||typeof ie=="number"&&typeof Y=="number"&&isNaN(ie)&&isNaN(Y)},fr=function(ie,Y){for(var ue=ie.length,ge=0;ge<ue;){if(Vt(ie[ge],Y))return!0;ge++}return!1},Nr=Array.isArray||function(U){return Object.prototype.toString.call(U)==="[object Array]"},mr={},nr={},Ar={INDEXEDDB:re,WEBSQL:se,LOCALSTORAGE:Bt},Fn=[Ar.INDEXEDDB._driver,Ar.WEBSQL._driver,Ar.LOCALSTORAGE._driver],tn=["dropInstance"],$n=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tn),qi={description:"",driver:Fn.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Hi(U,ie){U[ie]=function(){var Y=arguments;return U.ready().then(function(){return U[ie].apply(U,Y)})}}function Vn(){for(var U=1;U<arguments.length;U++){var ie=arguments[U];if(ie)for(var Y in ie)ie.hasOwnProperty(Y)&&(Nr(ie[Y])?arguments[0][Y]=ie[Y].slice():arguments[0][Y]=ie[Y])}return arguments[0]}var Wi=function(){function U(ie){o(this,U);for(var Y in Ar)if(Ar.hasOwnProperty(Y)){var ue=Ar[Y],ge=ue._driver;this[Y]=ge,mr[ge]||this.defineDriver(ue)}this._defaultConfig=Vn({},qi),this._config=Vn({},this._defaultConfig,ie),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return U.prototype.config=function(Y){if((typeof Y>"u"?"undefined":s(Y))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var ue in Y){if(ue==="storeName"&&(Y[ue]=Y[ue].replace(/\W/g,"_")),ue==="version"&&typeof Y[ue]!="number")return new Error("Database version must be a number.");this._config[ue]=Y[ue]}return"driver"in Y&&Y.driver?this.setDriver(this._config.driver):!0}else return typeof Y=="string"?this._config[Y]:this._config},U.prototype.defineDriver=function(Y,ue,ge){var ae=new f(function(Ae,Pe){try{var ke=Y._driver,De=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!Y._driver){Pe(De);return}for(var Le=$n.concat("_initStorage"),Ze=0,Tt=Le.length;Ze<Tt;Ze++){var zt=Le[Ze],Ht=!fr(tn,zt);if((Ht||Y[zt])&&typeof Y[zt]!="function"){Pe(De);return}}var br=function(){for(var ic=function(xU){return function(){var SU=new Error("Method "+xU+" is not implemented by the current driver"),e4=f.reject(SU);return p(e4,arguments[arguments.length-1]),e4}},_h=0,wU=tn.length;_h<wU;_h++){var Eh=tn[_h];Y[Eh]||(Y[Eh]=ic(Eh))}};br();var gr=function(ic){mr[ke]&&console.info("Redefining LocalForage driver: "+ke),mr[ke]=Y,nr[ke]=ic,Ae()};"_support"in Y?Y._support&&typeof Y._support=="function"?Y._support().then(gr,Pe):gr(!!Y._support):gr(!0)}catch(Sn){Pe(Sn)}});return y(ae,ue,ge),ae},U.prototype.driver=function(){return this._driver||null},U.prototype.getDriver=function(Y,ue,ge){var ae=mr[Y]?f.resolve(mr[Y]):f.reject(new Error("Driver not found."));return y(ae,ue,ge),ae},U.prototype.getSerializer=function(Y){var ue=f.resolve(it);return y(ue,Y),ue},U.prototype.ready=function(Y){var ue=this,ge=ue._driverSet.then(function(){return ue._ready===null&&(ue._ready=ue._initDriver()),ue._ready});return y(ge,Y,Y),ge},U.prototype.setDriver=function(Y,ue,ge){var ae=this;Nr(Y)||(Y=[Y]);var Ae=this._getSupportedDrivers(Y);function Pe(){ae._config.driver=ae.driver()}function ke(Ze){return ae._extend(Ze),Pe(),ae._ready=ae._initStorage(ae._config),ae._ready}function De(Ze){return function(){var Tt=0;function zt(){for(;Tt<Ze.length;){var Ht=Ze[Tt];return Tt++,ae._dbInfo=null,ae._ready=null,ae.getDriver(Ht).then(ke).catch(zt)}Pe();var br=new Error("No available storage method found.");return ae._driverSet=f.reject(br),ae._driverSet}return zt()}}var Le=this._driverSet!==null?this._driverSet.catch(function(){return f.resolve()}):f.resolve();return this._driverSet=Le.then(function(){var Ze=Ae[0];return ae._dbInfo=null,ae._ready=null,ae.getDriver(Ze).then(function(Tt){ae._driver=Tt._driver,Pe(),ae._wrapLibraryMethodsWithReady(),ae._initDriver=De(Ae)})}).catch(function(){Pe();var Ze=new Error("No available storage method found.");return ae._driverSet=f.reject(Ze),ae._driverSet}),y(this._driverSet,ue,ge),this._driverSet},U.prototype.supports=function(Y){return!!nr[Y]},U.prototype._extend=function(Y){Vn(this,Y)},U.prototype._getSupportedDrivers=function(Y){for(var ue=[],ge=0,ae=Y.length;ge<ae;ge++){var Ae=Y[ge];this.supports(Ae)&&ue.push(Ae)}return ue},U.prototype._wrapLibraryMethodsWithReady=function(){for(var Y=0,ue=$n.length;Y<ue;Y++)Hi(this,$n[Y])},U.prototype.createInstance=function(Y){return new U(Y)},U}(),Gi=new Wi;n.exports=Gi},{3:3}]},{},[4])(4)})})($v);var KC=$v.exports;const Ea=io(KC);Ea.config({name:"CetusSite",storeName:"tokens"});class Ni{static async setItem(t,r){try{await Ea.setItem(t,r)}catch(n){console.error(`Failed to set item with key "${t}"`,n)}}static async getItem(t){try{return await Ea.getItem(t)}catch(r){return console.error(`Failed to get item with key "${t}"`,r),null}}static async removeItem(t){try{await Ea.removeItem(t)}catch(r){console.error(`Failed to remove item with key "${t}"`,r)}}static async clear(){try{await Ea.clear()}catch(t){console.error("Failed to clear storage",t)}}}const xl=[{name:"SuiVision",link:"https://suivision.xyz",img:Ct("/images/logo_suivision@2x.png"),isCustom:!1},{name:"Suiscan",link:"https://suiscan.xyz/mainnet",img:Ct("/images/logo_suiscan@2x.png"),isCustom:!1}],Ca=[{name:"Sui Fullnode",link:"https://fullnode.mainnet.sui.io",isCustom:!1},{name:"Custom RPC URL",link:"",isCustom:!0}],YC=[{display:"0.1",value:"0.001"},{display:"0.5",value:"0.005"},{display:"1",value:"0.01"}],Ao={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"}}["mainnet"],JC="0x45f3c0814d7be4aa5fbd32d7e3c40f3c062a2b63eaf5ec4f8c1539b5987b11af",XC=Ct("/images/birdeye-logo.png"),ZC=Ct("/images/img-logo@2x.png"),QC=Ct("/images/logo_CoinGecko@2x.png"),eA=Ct("/images/logo_pyth.png");var Aa=(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.STEAMM_OMM_V2="STEAMM_OMM_V2",e.MAGMA="MAGMA",e.SEVENK="SEVENK",e.HAWAL="HAWAL",e.HAEDALHMMV2="HAEDALHMMV2",e.FULLSAIL="FULLSAIL",e))(Aa||{});const Vv={pyth:"Pyth Network",coingecko:"CoinGecko",birdeye:"Birdeye",Cetus:"Cetus"},tA={pyth:eA,coingecko:QC,birdeye:XC,Cetus:ZC},$t={CETUS:Ct("/images/aggregator-source/cetus.png"),KRIYA:Ct("/images/aggregator-source/kriya.png"),FLOWX:Ct("/images/aggregator-source/flowx.png"),AFTERMATH:Ct("/images/aggregator-source/aftermath.png"),TURBOS:Ct("/images/aggregator-source/turbos.png"),HAEDAL:Ct("/images/aggregator-source/haedal.png"),VOLO:Ct("/images/aggregator-source/volo.png"),AFSUI:Ct("/images/aggregator-source/aftermath.png"),BLUEMOVE:Ct("/images/aggregator-source/bluemove.png"),KRIYAV3:Ct("/images/aggregator-source/kriya.png"),FLOWXV3:Ct("/images/aggregator-source/flowx.png"),DEEPBOOKV3:Ct("/images/aggregator-source/deepbook.png"),SCALLOP:Ct("/images/aggregator-source/scallop.png"),SPRINGSUI:Ct("/images/aggregator-source/suilend.png"),BLUEFIN:Ct("/images/aggregator-source/bluefin.png"),HAEDALPMM:Ct("/images/aggregator-source/haedal.png"),ALPHAFI:Ct("/images/aggregator-source/stSui.png"),STEAMM:Ct("/images/aggregator-source/steamm.png"),OBRIC:Ct("/images/aggregator-source/obric.png"),METASTABLE:Ct("/images/aggregator-source/metastable.png"),MOMENTUM:Ct("/images/aggregator-source/momentum.png"),STEAMM_OMM:Ct("/images/aggregator-source/steamm.png"),STEAMM_OMM_V2:Ct("/images/aggregator-source/steamm.png"),MAGMA:Ct("/images/aggregator-source/magma.png"),SEVENK:Ct("/images/aggregator-source/7k.png"),HAWAL:Ct("/images/aggregator-source/haedal.png"),HAEDALHMMV2:Ct("/images/aggregator-source/haedal.png"),FULLSAIL:Ct("/images/aggregator-source/fullsail.png")},zv={CETUS:{name:"Cetus",id:"CETUS",logo:$t.CETUS,type:"dex",sort:100},DEEPBOOKV3:{name:"DeepBook V3",id:"DEEPBOOKV3",logo:$t.DEEPBOOKV3,type:"dex",sort:99},KRIYA:{name:"Kriya V2",id:"KRIYA",logo:$t.KRIYA,type:"dex",sort:98},KRIYAV3:{name:"Kriya V3",id:"KRIYAV3",logo:$t.KRIYA,type:"dex",sort:97},FLOWX:{name:"FlowX V2",id:"FLOWX",logo:$t.FLOWX,type:"dex",sort:96},FLOWXV3:{name:"FlowX V3",id:"FLOWXV3",logo:$t.FLOWX,type:"dex",sort:95},AFTERMATH:{name:"Aftermath",id:"AFTERMATH",logo:$t.AFTERMATH,type:"dex",sort:94},TURBOS:{name:"Turbos",id:"TURBOS",logo:$t.TURBOS,type:"dex",sort:93},HAEDAL:{name:"Haedal LSD",id:"HAEDAL",logo:$t.HAEDAL,type:"other",sort:92},HAWAL:{name:"Haedal LSD",id:"HAWAL",logo:$t.HAEDAL,type:"other",sort:90},HAEDALPMM:{name:"Haedal HMM",id:"HAEDALPMM",logo:$t.HAEDALPMM,type:"other",sort:92},HAEDALHMMV2:{name:"Haedal HMM",id:"HAEDALHMMV2",logo:$t.HAEDALHMMV2,type:"other",sort:88},VOLO:{name:"Volo",id:"VOLO",logo:$t.VOLO,type:"other",sort:91},AFSUI:{name:"Aftermath LSD",id:"AFSUI",logo:$t.AFTERMATH,type:"other",sort:90},BLUEMOVE:{name:"BlueMove",id:"BLUEMOVE",logo:$t.BLUEMOVE,type:"dex",sort:80},BLUEFIN:{name:"Bluefin",id:"BLUEFIN",logo:$t.BLUEFIN,sort:79,type:"dex"},MOMENTUM:{name:"Momentum",id:"MOMENTUM",logo:$t.MOMENTUM,sort:68,type:"dex"},SCALLOP:{name:"Scallop",id:"SCALLOP",logo:$t.SCALLOP,type:"other",sort:70},SPRINGSUI:{name:"SpringSui",id:"SPRINGSUI",logo:$t.SPRINGSUI,type:"other",sort:60},ALPHAFI:{name:"stSUI",id:"ALPHAFI",logo:$t.ALPHAFI,type:"other",sort:50},STEAMM:{name:"STEAMM CPMM",id:"STEAMM",logo:$t.STEAMM,sort:76,type:"dex"},STEAMM_OMM:{name:"STEAMM OMM",id:"STEAMM_OMM",logo:$t.STEAMM_OMM,sort:75,type:"dex"},STEAMM_OMM_V2:{name:"STEAMM OMM",id:"STEAMM_OMM_V2",logo:$t.STEAMM_OMM_V2,sort:74,type:"dex"},METASTABLE:{name:"Metastable",id:"METASTABLE",logo:$t.METASTABLE,sort:77,type:"dex"},OBRIC:{name:"Obric",id:"OBRIC",logo:$t.OBRIC,sort:76,type:"dex"},MAGMA:{name:"Magma",id:"MAGMA",logo:$t.MAGMA,sort:67,type:"dex"},SEVENK:{name:"7K Spot",id:"SEVENK",logo:$t.SEVENK,sort:66,type:"dex"},FULLSAIL:{name:"Full Sail",id:"FULLSAIL",logo:$t.FULLSAIL,sort:65,type:"dex"}},qv=e=>{let t;const r=new Set,n=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),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},rA=e=>e?qv(e):qv,nA=e=>e;function iA(e,t=nA){const r=le.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return le.useDebugValue(r),r}const Hv=e=>{const t=rA(e),r=n=>iA(t,n);return Object.assign(r,t),r},ki=e=>e?Hv(e):Hv;function sA(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,t==null?void 0:t.reviver),a=(s=r.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>r.setItem(i,JSON.stringify(s,t==null?void 0:t.replacer)),removeItem:i=>r.removeItem(i)}}const Hf=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return Hf(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Hf(n)(r)}}}},Vr=ki(((e,t)=>(r,n,i)=>{let s={storage:sA(()=>localStorage),partialize:v=>v,version:0,merge:(v,_)=>({..._,...v}),...t},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...v)},n,i);const u=()=>{const v=s.partialize({...n()});return l.setItem(s.name,{state:v,version:s.version})},f=i.setState;i.setState=(v,_)=>{f(v,_),u()};const p=e((...v)=>{r(...v),u()},n,i);i.getInitialState=()=>p;let y;const x=()=>{var v,_;if(!l)return;o=!1,a.forEach(O=>{var R;return O((R=n())!=null?R:p)});const T=((_=s.onRehydrateStorage)==null?void 0:_.call(s,(v=n())!=null?v:p))||void 0;return Hf(l.getItem.bind(l))(s.name).then(O=>{if(O)if(typeof O.version=="number"&&O.version!==s.version){if(s.migrate){const R=s.migrate(O.state,O.version);return R instanceof Promise?R.then(F=>[!0,F]):[!0,R]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,O.state];return[!1,void 0]}).then(O=>{var R;const[F,B]=O;if(y=s.merge(B,(R=n())!=null?R:p),r(y,!0),F)return u()}).then(()=>{T==null||T(y,void 0),y=n(),o=!0,c.forEach(O=>O(y))}).catch(O=>{T==null||T(void 0,O)})};return i.persist={setOptions:v=>{s={...s,...v},v.storage&&(l=v.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>x(),hasHydrated:()=>o,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},s.skipHydration||x(),y||p})((e,t)=>({ignoreWarnTokenMap:{},currentExplorer:xl[0].link,setCurrentExplorer:r=>{e(()=>({currentExplorer:r}))},rpcList:Ca,setRpcList:r=>{e(()=>({rpcList:[...r]}))},currentRpc:Ca[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(Aa),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}))},transactionMode:"Default",setTransctionMode:r=>{e(()=>({transactionMode:r}))},maxCapForGas:"0.5",setMaxCapForGas:r=>{e(()=>({maxCapForGas:r}))},customGasPrice:"1500",setCustomGasPrice:r=>{e(()=>({customGasPrice:r}))},setIgnoreWarnToken:r=>{const n=t().ignoreWarnTokenMap;n[Ri(r)]=!0,e(()=>({ignoreWarnTokenMap:{...n}}))}}),{name:"useGlobalStore",partialize:e=>{const{currentExplorer:t,currentRpc:r,slippage:n,customRpc:i,providers:s,mevProtect:o,ignoreWarnTokenMap:a,transactionMode:c,maxCapForGas:l,customGasPrice:u}=e;return{currentExplorer:t,currentRpc:r,slippage:n,customRpc:i,providers:s,mevProtect:o,ignoreWarnTokenMap:a,transactionMode:c,maxCapForGas:l,customGasPrice:u}}}));function To(){const{currentExplorer:e}=Vr();return{getExplorerUrl:(r,n="account",i=e)=>{let s;return i.includes("suivision")?s=`${i}/${aA(n)}/${r}`:s=`${i}/${oA(n)}/${r}`,s}}}const oA=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"}},aA=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 Wv(e){const{text:t,keywords:r,onKeywordClick:n,text_highlight_color:i="var(--cs-primary)",text_size:s="12px",text_color:o="var(--cs-text-secondary)"}=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 f=r.includes(l);return w.jsx("span",{style:{lineHeight:"20px",fontSize:s,color:f?i:o,cursor:"pointer",whiteSpace:"inherit"},onClick:()=>n(l),children:l},u)})})}function Wf({size:e="24px",strokeWidth:t="10",color:r="var(--cs-primary)",emptyColor:n="transparent",gapPercentage:i=.5}){const s=50-parseFloat(t),o=2*Math.PI*s,a=o*i,c=o-a;return w.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100",children:[w.jsx("circle",{cx:"50",cy:"50",r:s,fill:"none",stroke:n,strokeWidth:t}),w.jsx("circle",{cx:"50",cy:"50",r:s,fill:"none",stroke:r,strokeWidth:t,strokeDasharray:`${c} ${a}`,strokeDashoffset:"0",strokeLinecap:"round",style:{animation:"dash 0.5s linear infinite"}}),w.jsx("style",{children:`
|
|
52
|
+
*/(function(e,t){(function(r){e.exports=r()})(function(){return function r(n,i,s){function o(l,u){if(!i[l]){if(!n[l]){var f=typeof wl=="function"&&wl;if(!u&&f)return f(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 v=n[l][1][x];return o(v||x)},y,y.exports,r,n,i,s)}return i[l].exports}for(var a=typeof wl=="function"&&wl,c=0;c<s.length;c++)o(s[c]);return o}({1:[function(r,n,i){(function(s){var o=s.MutationObserver||s.WebKitMutationObserver,a;if(o){var c=0,l=new o(x),u=s.document.createTextNode("");l.observe(u,{characterData:!0}),a=function(){u.data=c=++c%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var f=new s.MessageChannel;f.port1.onmessage=x,a=function(){f.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?a=function(){var _=s.document.createElement("script");_.onreadystatechange=function(){x(),_.onreadystatechange=null,_.parentNode.removeChild(_),_=null},s.document.documentElement.appendChild(_)}:a=function(){setTimeout(x,0)};var p,y=[];function x(){p=!0;for(var _,T,O=y.length;O;){for(T=y,y=[],_=-1;++_<O;)T[_]();O=y.length}p=!1}n.exports=v;function v(_){y.push(_)===1&&!p&&a()}}).call(this,typeof Cr<"u"?Cr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,n,i){var s=r(1);function o(){}var a={},c=["REJECTED"],l=["FULFILLED"],u=["PENDING"];n.exports=f;function f(B){if(typeof B!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,B!==o&&v(this,B)}f.prototype.catch=function(B){return this.then(null,B)},f.prototype.then=function(B,H){if(typeof B!="function"&&this.state===l||typeof H!="function"&&this.state===c)return this;var $=new this.constructor(o);if(this.state!==u){var Z=this.state===l?B:H;y($,Z,this.outcome)}else this.queue.push(new p($,B,H));return $};function p(B,H,$){this.promise=B,typeof H=="function"&&(this.onFulfilled=H,this.callFulfilled=this.otherCallFulfilled),typeof $=="function"&&(this.onRejected=$,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,H,$){s(function(){var Z;try{Z=H($)}catch(ce){return a.reject(B,ce)}Z===B?a.reject(B,new TypeError("Cannot resolve promise with itself")):a.resolve(B,Z)})}a.resolve=function(B,H){var $=_(x,H);if($.status==="error")return a.reject(B,$.value);var Z=$.value;if(Z)v(B,Z);else{B.state=l,B.outcome=H;for(var ce=-1,ne=B.queue.length;++ce<ne;)B.queue[ce].callFulfilled(H)}return B},a.reject=function(B,H){B.state=c,B.outcome=H;for(var $=-1,Z=B.queue.length;++$<Z;)B.queue[$].callRejected(H);return B};function x(B){var H=B&&B.then;if(B&&(typeof B=="object"||typeof B=="function")&&typeof H=="function")return function(){H.apply(B,arguments)}}function v(B,H){var $=!1;function Z(q){$||($=!0,a.reject(B,q))}function ce(q){$||($=!0,a.resolve(B,q))}function ne(){H(ce,Z)}var de=_(ne);de.status==="error"&&Z(de.value)}function _(B,H){var $={};try{$.value=B(H),$.status="success"}catch(Z){$.status="error",$.value=Z}return $}f.resolve=T;function T(B){return B instanceof this?B:a.resolve(new this(o),B)}f.reject=O;function O(B){var H=new this(o);return a.reject(H,B)}f.all=R;function R(B){var H=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $=B.length,Z=!1;if(!$)return this.resolve([]);for(var ce=new Array($),ne=0,de=-1,q=new this(o);++de<$;)N(B[de],de);return q;function N(h,d){H.resolve(h).then(m,function(S){Z||(Z=!0,a.reject(q,S))});function m(S){ce[d]=S,++ne===$&&!Z&&(Z=!0,a.resolve(q,ce))}}}f.race=F;function F(B){var H=this;if(Object.prototype.toString.call(B)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $=B.length,Z=!1;if(!$)return this.resolve([]);for(var ce=-1,ne=new this(o);++ce<$;)de(B[ce]);return ne;function de(q){H.resolve(q).then(function(N){Z||(Z=!0,a.resolve(ne,N))},function(N){Z||(Z=!0,a.reject(ne,N))})}}},{1:1}],3:[function(r,n,i){(function(s){typeof s.Promise!="function"&&(s.Promise=r(2))}).call(this,typeof Cr<"u"?Cr:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,n,i){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U};function o(U,ie){if(!(U instanceof ie))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 U=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),ie=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!U||ie)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function u(U,ie){U=U||[],ie=ie||{};try{return new Blob(U,ie)}catch(ae){if(ae.name!=="TypeError")throw ae;for(var Y=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,ue=new Y,ge=0;ge<U.length;ge+=1)ue.append(U[ge]);return ue.getBlob(ie.type)}}typeof Promise>"u"&&r(3);var f=Promise;function p(U,ie){ie&&U.then(function(Y){ie(null,Y)},function(Y){ie(Y)})}function y(U,ie,Y){typeof ie=="function"&&U.then(ie),typeof Y=="function"&&U.catch(Y)}function x(U){return typeof U!="string"&&(console.warn(U+" used as a key, but it is not a string."),U=String(U)),U}function v(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var _="local-forage-detect-blob-support",T=void 0,O={},R=Object.prototype.toString,F="readonly",B="readwrite";function H(U){for(var ie=U.length,Y=new ArrayBuffer(ie),ue=new Uint8Array(Y),ge=0;ge<ie;ge++)ue[ge]=U.charCodeAt(ge);return Y}function $(U){return new f(function(ie){var Y=U.transaction(_,B),ue=u([""]);Y.objectStore(_).put(ue,"key"),Y.onabort=function(ge){ge.preventDefault(),ge.stopPropagation(),ie(!1)},Y.oncomplete=function(){var ge=navigator.userAgent.match(/Chrome\/(\d+)/),ae=navigator.userAgent.match(/Edge\//);ie(ae||!ge||parseInt(ge[1],10)>=43)}}).catch(function(){return!1})}function Z(U){return typeof T=="boolean"?f.resolve(T):$(U).then(function(ie){return T=ie,T})}function ce(U){var ie=O[U.name],Y={};Y.promise=new f(function(ue,ge){Y.resolve=ue,Y.reject=ge}),ie.deferredOperations.push(Y),ie.dbReady?ie.dbReady=ie.dbReady.then(function(){return Y.promise}):ie.dbReady=Y.promise}function ne(U){var ie=O[U.name],Y=ie.deferredOperations.pop();if(Y)return Y.resolve(),Y.promise}function de(U,ie){var Y=O[U.name],ue=Y.deferredOperations.pop();if(ue)return ue.reject(ie),ue.promise}function q(U,ie){return new f(function(Y,ue){if(O[U.name]=O[U.name]||g(),U.db)if(ie)ce(U),U.db.close();else return Y(U.db);var ge=[U.name];ie&&ge.push(U.version);var ae=c.open.apply(c,ge);ie&&(ae.onupgradeneeded=function(Ae){var Pe=ae.result;try{Pe.createObjectStore(U.storeName),Ae.oldVersion<=1&&Pe.createObjectStore(_)}catch(ke){if(ke.name==="ConstraintError")console.warn('The database "'+U.name+'" has been upgraded from version '+Ae.oldVersion+" to version "+Ae.newVersion+', but the storage "'+U.storeName+'" already exists.');else throw ke}}),ae.onerror=function(Ae){Ae.preventDefault(),ue(ae.error)},ae.onsuccess=function(){var Ae=ae.result;Ae.onversionchange=function(Pe){Pe.target.close()},Y(Ae),ne(U)}})}function N(U){return q(U,!1)}function h(U){return q(U,!0)}function d(U,ie){if(!U.db)return!0;var Y=!U.db.objectStoreNames.contains(U.storeName),ue=U.version<U.db.version,ge=U.version>U.db.version;if(ue&&(U.version!==ie&&console.warn('The database "'+U.name+`" can't be downgraded from version `+U.db.version+" to version "+U.version+"."),U.version=U.db.version),ge||Y){if(Y){var ae=U.db.version+1;ae>U.version&&(U.version=ae)}return!0}return!1}function m(U){return new f(function(ie,Y){var ue=new FileReader;ue.onerror=Y,ue.onloadend=function(ge){var ae=btoa(ge.target.result||"");ie({__local_forage_encoded_blob:!0,data:ae,type:U.type})},ue.readAsBinaryString(U)})}function S(U){var ie=H(atob(U.data));return u([ie],{type:U.type})}function E(U){return U&&U.__local_forage_encoded_blob}function M(U){var ie=this,Y=ie._initReady().then(function(){var ue=O[ie._dbInfo.name];if(ue&&ue.dbReady)return ue.dbReady});return y(Y,U,U),Y}function j(U){ce(U);for(var ie=O[U.name],Y=ie.forages,ue=0;ue<Y.length;ue++){var ge=Y[ue];ge._dbInfo.db&&(ge._dbInfo.db.close(),ge._dbInfo.db=null)}return U.db=null,N(U).then(function(ae){return U.db=ae,d(U)?h(U):ae}).then(function(ae){U.db=ie.db=ae;for(var Ae=0;Ae<Y.length;Ae++)Y[Ae]._dbInfo.db=ae}).catch(function(ae){throw de(U,ae),ae})}function I(U,ie,Y,ue){ue===void 0&&(ue=1);try{var ge=U.db.transaction(U.storeName,ie);Y(null,ge)}catch(ae){if(ue>0&&(!U.db||ae.name==="InvalidStateError"||ae.name==="NotFoundError"))return f.resolve().then(function(){if(!U.db||ae.name==="NotFoundError"&&!U.db.objectStoreNames.contains(U.storeName)&&U.version<=U.db.version)return U.db&&(U.version=U.db.version+1),h(U)}).then(function(){return j(U).then(function(){I(U,ie,Y,ue-1)})}).catch(Y);Y(ae)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function b(U){var ie=this,Y={db:null};if(U)for(var ue in U)Y[ue]=U[ue];var ge=O[Y.name];ge||(ge=g(),O[Y.name]=ge),ge.forages.push(ie),ie._initReady||(ie._initReady=ie.ready,ie.ready=M);var ae=[];function Ae(){return f.resolve()}for(var Pe=0;Pe<ge.forages.length;Pe++){var ke=ge.forages[Pe];ke!==ie&&ae.push(ke._initReady().catch(Ae))}var De=ge.forages.slice(0);return f.all(ae).then(function(){return Y.db=ge.db,N(Y)}).then(function(Le){return Y.db=Le,d(Y,ie._defaultConfig.version)?h(Y):Le}).then(function(Le){Y.db=ge.db=Le,ie._dbInfo=Y;for(var Ze=0;Ze<De.length;Ze++){var Tt=De[Ze];Tt!==ie&&(Tt._dbInfo.db=Y.db,Tt._dbInfo.version=Y.version)}})}function k(U,ie){var Y=this;U=x(U);var ue=new f(function(ge,ae){Y.ready().then(function(){I(Y._dbInfo,F,function(Ae,Pe){if(Ae)return ae(Ae);try{var ke=Pe.objectStore(Y._dbInfo.storeName),De=ke.get(U);De.onsuccess=function(){var Le=De.result;Le===void 0&&(Le=null),E(Le)&&(Le=S(Le)),ge(Le)},De.onerror=function(){ae(De.error)}}catch(Le){ae(Le)}})}).catch(ae)});return p(ue,ie),ue}function ve(U,ie){var Y=this,ue=new f(function(ge,ae){Y.ready().then(function(){I(Y._dbInfo,F,function(Ae,Pe){if(Ae)return ae(Ae);try{var ke=Pe.objectStore(Y._dbInfo.storeName),De=ke.openCursor(),Le=1;De.onsuccess=function(){var Ze=De.result;if(Ze){var Tt=Ze.value;E(Tt)&&(Tt=S(Tt));var zt=U(Tt,Ze.key,Le++);zt!==void 0?ge(zt):Ze.continue()}else ge()},De.onerror=function(){ae(De.error)}}catch(Ze){ae(Ze)}})}).catch(ae)});return p(ue,ie),ue}function he(U,ie,Y){var ue=this;U=x(U);var ge=new f(function(ae,Ae){var Pe;ue.ready().then(function(){return Pe=ue._dbInfo,R.call(ie)==="[object Blob]"?Z(Pe.db).then(function(ke){return ke?ie:m(ie)}):ie}).then(function(ke){I(ue._dbInfo,B,function(De,Le){if(De)return Ae(De);try{var Ze=Le.objectStore(ue._dbInfo.storeName);ke===null&&(ke=void 0);var Tt=Ze.put(ke,U);Le.oncomplete=function(){ke===void 0&&(ke=null),ae(ke)},Le.onabort=Le.onerror=function(){var zt=Tt.error?Tt.error:Tt.transaction.error;Ae(zt)}}catch(zt){Ae(zt)}})}).catch(Ae)});return p(ge,Y),ge}function we(U,ie){var Y=this;U=x(U);var ue=new f(function(ge,ae){Y.ready().then(function(){I(Y._dbInfo,B,function(Ae,Pe){if(Ae)return ae(Ae);try{var ke=Pe.objectStore(Y._dbInfo.storeName),De=ke.delete(U);Pe.oncomplete=function(){ge()},Pe.onerror=function(){ae(De.error)},Pe.onabort=function(){var Le=De.error?De.error:De.transaction.error;ae(Le)}}catch(Le){ae(Le)}})}).catch(ae)});return p(ue,ie),ue}function Oe(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){I(ie._dbInfo,B,function(ae,Ae){if(ae)return ge(ae);try{var Pe=Ae.objectStore(ie._dbInfo.storeName),ke=Pe.clear();Ae.oncomplete=function(){ue()},Ae.onabort=Ae.onerror=function(){var De=ke.error?ke.error:ke.transaction.error;ge(De)}}catch(De){ge(De)}})}).catch(ge)});return p(Y,U),Y}function je(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){I(ie._dbInfo,F,function(ae,Ae){if(ae)return ge(ae);try{var Pe=Ae.objectStore(ie._dbInfo.storeName),ke=Pe.count();ke.onsuccess=function(){ue(ke.result)},ke.onerror=function(){ge(ke.error)}}catch(De){ge(De)}})}).catch(ge)});return p(Y,U),Y}function L(U,ie){var Y=this,ue=new f(function(ge,ae){if(U<0){ge(null);return}Y.ready().then(function(){I(Y._dbInfo,F,function(Ae,Pe){if(Ae)return ae(Ae);try{var ke=Pe.objectStore(Y._dbInfo.storeName),De=!1,Le=ke.openKeyCursor();Le.onsuccess=function(){var Ze=Le.result;if(!Ze){ge(null);return}U===0||De?ge(Ze.key):(De=!0,Ze.advance(U))},Le.onerror=function(){ae(Le.error)}}catch(Ze){ae(Ze)}})}).catch(ae)});return p(ue,ie),ue}function z(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){I(ie._dbInfo,F,function(ae,Ae){if(ae)return ge(ae);try{var Pe=Ae.objectStore(ie._dbInfo.storeName),ke=Pe.openKeyCursor(),De=[];ke.onsuccess=function(){var Le=ke.result;if(!Le){ue(De);return}De.push(Le.key),Le.continue()},ke.onerror=function(){ge(ke.error)}}catch(Le){ge(Le)}})}).catch(ge)});return p(Y,U),Y}function G(U,ie){ie=v.apply(this,arguments);var Y=this.config();U=typeof U!="function"&&U||{},U.name||(U.name=U.name||Y.name,U.storeName=U.storeName||Y.storeName);var ue=this,ge;if(!U.name)ge=f.reject("Invalid arguments");else{var ae=U.name===Y.name&&ue._dbInfo.db,Ae=ae?f.resolve(ue._dbInfo.db):N(U).then(function(Pe){var ke=O[U.name],De=ke.forages;ke.db=Pe;for(var Le=0;Le<De.length;Le++)De[Le]._dbInfo.db=Pe;return Pe});U.storeName?ge=Ae.then(function(Pe){if(Pe.objectStoreNames.contains(U.storeName)){var ke=Pe.version+1;ce(U);var De=O[U.name],Le=De.forages;Pe.close();for(var Ze=0;Ze<Le.length;Ze++){var Tt=Le[Ze];Tt._dbInfo.db=null,Tt._dbInfo.version=ke}var zt=new f(function(Ht,br){var gr=c.open(U.name,ke);gr.onerror=function(Sn){var sc=gr.result;sc.close(),br(Sn)},gr.onupgradeneeded=function(){var Sn=gr.result;Sn.deleteObjectStore(U.storeName)},gr.onsuccess=function(){var Sn=gr.result;Sn.close(),Ht(Sn)}});return zt.then(function(Ht){De.db=Ht;for(var br=0;br<Le.length;br++){var gr=Le[br];gr._dbInfo.db=Ht,ne(gr._dbInfo)}}).catch(function(Ht){throw(de(U,Ht)||f.resolve()).catch(function(){}),Ht})}}):ge=Ae.then(function(Pe){ce(U);var ke=O[U.name],De=ke.forages;Pe.close();for(var Le=0;Le<De.length;Le++){var Ze=De[Le];Ze._dbInfo.db=null}var Tt=new f(function(zt,Ht){var br=c.deleteDatabase(U.name);br.onerror=function(){var gr=br.result;gr&&gr.close(),Ht(br.error)},br.onblocked=function(){console.warn('dropInstance blocked for database "'+U.name+'" until all open connections are closed')},br.onsuccess=function(){var gr=br.result;gr&&gr.close(),zt(gr)}});return Tt.then(function(zt){ke.db=zt;for(var Ht=0;Ht<De.length;Ht++){var br=De[Ht];ne(br._dbInfo)}}).catch(function(zt){throw(de(U,zt)||f.resolve()).catch(function(){}),zt})})}return p(ge,ie),ge}var re={_driver:"asyncStorage",_initStorage:b,_support:l(),iterate:ve,getItem:k,setItem:he,removeItem:we,clear:Oe,length:je,key:L,keys:z,dropInstance:G};function ee(){return typeof openDatabase=="function"}var Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fe="~~local_forage_type~",W=/^~~local_forage_type~([^~]+)~/,K="__lfsc__:",te=K.length,oe="arbf",pe="blob",Se="si08",_e="ui08",Ne="uic8",He="si16",Ge="si32",Re="ur16",Ke="ui32",nt="fl32",Qe="fl64",Mt=te+oe.length,jt=Object.prototype.toString;function Xe(U){var ie=U.length*.75,Y=U.length,ue,ge=0,ae,Ae,Pe,ke;U[U.length-1]==="="&&(ie--,U[U.length-2]==="="&&ie--);var De=new ArrayBuffer(ie),Le=new Uint8Array(De);for(ue=0;ue<Y;ue+=4)ae=Q.indexOf(U[ue]),Ae=Q.indexOf(U[ue+1]),Pe=Q.indexOf(U[ue+2]),ke=Q.indexOf(U[ue+3]),Le[ge++]=ae<<2|Ae>>4,Le[ge++]=(Ae&15)<<4|Pe>>2,Le[ge++]=(Pe&3)<<6|ke&63;return De}function St(U){var ie=new Uint8Array(U),Y="",ue;for(ue=0;ue<ie.length;ue+=3)Y+=Q[ie[ue]>>2],Y+=Q[(ie[ue]&3)<<4|ie[ue+1]>>4],Y+=Q[(ie[ue+1]&15)<<2|ie[ue+2]>>6],Y+=Q[ie[ue+2]&63];return ie.length%3===2?Y=Y.substring(0,Y.length-1)+"=":ie.length%3===1&&(Y=Y.substring(0,Y.length-2)+"=="),Y}function vt(U,ie){var Y="";if(U&&(Y=jt.call(U)),U&&(Y==="[object ArrayBuffer]"||U.buffer&&jt.call(U.buffer)==="[object ArrayBuffer]")){var ue,ge=K;U instanceof ArrayBuffer?(ue=U,ge+=oe):(ue=U.buffer,Y==="[object Int8Array]"?ge+=Se:Y==="[object Uint8Array]"?ge+=_e:Y==="[object Uint8ClampedArray]"?ge+=Ne:Y==="[object Int16Array]"?ge+=He:Y==="[object Uint16Array]"?ge+=Re:Y==="[object Int32Array]"?ge+=Ge:Y==="[object Uint32Array]"?ge+=Ke:Y==="[object Float32Array]"?ge+=nt:Y==="[object Float64Array]"?ge+=Qe:ie(new Error("Failed to get type for BinaryArray"))),ie(ge+St(ue))}else if(Y==="[object Blob]"){var ae=new FileReader;ae.onload=function(){var Ae=fe+U.type+"~"+St(this.result);ie(K+pe+Ae)},ae.readAsArrayBuffer(U)}else try{ie(JSON.stringify(U))}catch(Ae){console.error("Couldn't convert value into a JSON string: ",U),ie(null,Ae)}}function Ye(U){if(U.substring(0,te)!==K)return JSON.parse(U);var ie=U.substring(Mt),Y=U.substring(te,Mt),ue;if(Y===pe&&W.test(ie)){var ge=ie.match(W);ue=ge[1],ie=ie.substring(ge[0].length)}var ae=Xe(ie);switch(Y){case oe:return ae;case pe:return u([ae],{type:ue});case Se:return new Int8Array(ae);case _e:return new Uint8Array(ae);case Ne:return new Uint8ClampedArray(ae);case He:return new Int16Array(ae);case Re:return new Uint16Array(ae);case Ge:return new Int32Array(ae);case Ke:return new Uint32Array(ae);case nt:return new Float32Array(ae);case Qe:return new Float64Array(ae);default:throw new Error("Unkown type: "+Y)}}var it={serialize:vt,deserialize:Ye,stringToBuffer:Xe,bufferToString:St};function Nt(U,ie,Y,ue){U.executeSql("CREATE TABLE IF NOT EXISTS "+ie.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],Y,ue)}function ft(U){var ie=this,Y={db:null};if(U)for(var ue in U)Y[ue]=typeof U[ue]!="string"?U[ue].toString():U[ue];var ge=new f(function(ae,Ae){try{Y.db=openDatabase(Y.name,String(Y.version),Y.description,Y.size)}catch(Pe){return Ae(Pe)}Y.db.transaction(function(Pe){Nt(Pe,Y,function(){ie._dbInfo=Y,ae()},function(ke,De){Ae(De)})},Ae)});return Y.serializer=it,ge}function It(U,ie,Y,ue,ge,ae){U.executeSql(Y,ue,ge,function(Ae,Pe){Pe.code===Pe.SYNTAX_ERR?Ae.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[ie.storeName],function(ke,De){De.rows.length?ae(ke,Pe):Nt(ke,ie,function(){ke.executeSql(Y,ue,ge,ae)},ae)},ae):ae(Ae,Pe)},ae)}function Pt(U,ie){var Y=this;U=x(U);var ue=new f(function(ge,ae){Y.ready().then(function(){var Ae=Y._dbInfo;Ae.db.transaction(function(Pe){It(Pe,Ae,"SELECT * FROM "+Ae.storeName+" WHERE key = ? LIMIT 1",[U],function(ke,De){var Le=De.rows.length?De.rows.item(0).value:null;Le&&(Le=Ae.serializer.deserialize(Le)),ge(Le)},function(ke,De){ae(De)})})}).catch(ae)});return p(ue,ie),ue}function st(U,ie){var Y=this,ue=new f(function(ge,ae){Y.ready().then(function(){var Ae=Y._dbInfo;Ae.db.transaction(function(Pe){It(Pe,Ae,"SELECT * FROM "+Ae.storeName,[],function(ke,De){for(var Le=De.rows,Ze=Le.length,Tt=0;Tt<Ze;Tt++){var zt=Le.item(Tt),Ht=zt.value;if(Ht&&(Ht=Ae.serializer.deserialize(Ht)),Ht=U(Ht,zt.key,Tt+1),Ht!==void 0){ge(Ht);return}}ge()},function(ke,De){ae(De)})})}).catch(ae)});return p(ue,ie),ue}function _t(U,ie,Y,ue){var ge=this;U=x(U);var ae=new f(function(Ae,Pe){ge.ready().then(function(){ie===void 0&&(ie=null);var ke=ie,De=ge._dbInfo;De.serializer.serialize(ie,function(Le,Ze){Ze?Pe(Ze):De.db.transaction(function(Tt){It(Tt,De,"INSERT OR REPLACE INTO "+De.storeName+" (key, value) VALUES (?, ?)",[U,Le],function(){Ae(ke)},function(zt,Ht){Pe(Ht)})},function(Tt){if(Tt.code===Tt.QUOTA_ERR){if(ue>0){Ae(_t.apply(ge,[U,ke,Y,ue-1]));return}Pe(Tt)}})})}).catch(Pe)});return p(ae,Y),ae}function kt(U,ie,Y){return _t.apply(this,[U,ie,Y,1])}function pt(U,ie){var Y=this;U=x(U);var ue=new f(function(ge,ae){Y.ready().then(function(){var Ae=Y._dbInfo;Ae.db.transaction(function(Pe){It(Pe,Ae,"DELETE FROM "+Ae.storeName+" WHERE key = ?",[U],function(){ge()},function(ke,De){ae(De)})})}).catch(ae)});return p(ue,ie),ue}function Ot(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){var ae=ie._dbInfo;ae.db.transaction(function(Ae){It(Ae,ae,"DELETE FROM "+ae.storeName,[],function(){ue()},function(Pe,ke){ge(ke)})})}).catch(ge)});return p(Y,U),Y}function qt(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){var ae=ie._dbInfo;ae.db.transaction(function(Ae){It(Ae,ae,"SELECT COUNT(key) as c FROM "+ae.storeName,[],function(Pe,ke){var De=ke.rows.item(0).c;ue(De)},function(Pe,ke){ge(ke)})})}).catch(ge)});return p(Y,U),Y}function D(U,ie){var Y=this,ue=new f(function(ge,ae){Y.ready().then(function(){var Ae=Y._dbInfo;Ae.db.transaction(function(Pe){It(Pe,Ae,"SELECT key FROM "+Ae.storeName+" WHERE id = ? LIMIT 1",[U+1],function(ke,De){var Le=De.rows.length?De.rows.item(0).key:null;ge(Le)},function(ke,De){ae(De)})})}).catch(ae)});return p(ue,ie),ue}function C(U){var ie=this,Y=new f(function(ue,ge){ie.ready().then(function(){var ae=ie._dbInfo;ae.db.transaction(function(Ae){It(Ae,ae,"SELECT key FROM "+ae.storeName,[],function(Pe,ke){for(var De=[],Le=0;Le<ke.rows.length;Le++)De.push(ke.rows.item(Le).key);ue(De)},function(Pe,ke){ge(ke)})})}).catch(ge)});return p(Y,U),Y}function A(U){return new f(function(ie,Y){U.transaction(function(ue){ue.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(ge,ae){for(var Ae=[],Pe=0;Pe<ae.rows.length;Pe++)Ae.push(ae.rows.item(Pe).name);ie({db:U,storeNames:Ae})},function(ge,ae){Y(ae)})},function(ue){Y(ue)})})}function V(U,ie){ie=v.apply(this,arguments);var Y=this.config();U=typeof U!="function"&&U||{},U.name||(U.name=U.name||Y.name,U.storeName=U.storeName||Y.storeName);var ue=this,ge;return U.name?ge=new f(function(ae){var Ae;U.name===Y.name?Ae=ue._dbInfo.db:Ae=openDatabase(U.name,"","",0),U.storeName?ae({db:Ae,storeNames:[U.storeName]}):ae(A(Ae))}).then(function(ae){return new f(function(Ae,Pe){ae.db.transaction(function(ke){function De(zt){return new f(function(Ht,br){ke.executeSql("DROP TABLE IF EXISTS "+zt,[],function(){Ht()},function(gr,Sn){br(Sn)})})}for(var Le=[],Ze=0,Tt=ae.storeNames.length;Ze<Tt;Ze++)Le.push(De(ae.storeNames[Ze]));f.all(Le).then(function(){Ae()}).catch(function(zt){Pe(zt)})},function(ke){Pe(ke)})})}):ge=f.reject("Invalid arguments"),p(ge,ie),ge}var se={_driver:"webSQLStorage",_initStorage:ft,_support:ee(),iterate:st,getItem:Pt,setItem:kt,removeItem:pt,clear:Ot,length:qt,key:D,keys:C,dropInstance:V};function me(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function be(U,ie){var Y=U.name+"/";return U.storeName!==ie.storeName&&(Y+=U.storeName+"/"),Y}function We(){var U="_localforage_support_test";try{return localStorage.setItem(U,!0),localStorage.removeItem(U),!1}catch{return!0}}function ut(){return!We()||localStorage.length>0}function qe(U){var ie=this,Y={};if(U)for(var ue in U)Y[ue]=U[ue];return Y.keyPrefix=be(U,ie._defaultConfig),ut()?(ie._dbInfo=Y,Y.serializer=it,f.resolve()):f.reject()}function J(U){var ie=this,Y=ie.ready().then(function(){for(var ue=ie._dbInfo.keyPrefix,ge=localStorage.length-1;ge>=0;ge--){var ae=localStorage.key(ge);ae.indexOf(ue)===0&&localStorage.removeItem(ae)}});return p(Y,U),Y}function ye(U,ie){var Y=this;U=x(U);var ue=Y.ready().then(function(){var ge=Y._dbInfo,ae=localStorage.getItem(ge.keyPrefix+U);return ae&&(ae=ge.serializer.deserialize(ae)),ae});return p(ue,ie),ue}function Ce(U,ie){var Y=this,ue=Y.ready().then(function(){for(var ge=Y._dbInfo,ae=ge.keyPrefix,Ae=ae.length,Pe=localStorage.length,ke=1,De=0;De<Pe;De++){var Le=localStorage.key(De);if(Le.indexOf(ae)===0){var Ze=localStorage.getItem(Le);if(Ze&&(Ze=ge.serializer.deserialize(Ze)),Ze=U(Ze,Le.substring(Ae),ke++),Ze!==void 0)return Ze}}});return p(ue,ie),ue}function Ve(U,ie){var Y=this,ue=Y.ready().then(function(){var ge=Y._dbInfo,ae;try{ae=localStorage.key(U)}catch{ae=null}return ae&&(ae=ae.substring(ge.keyPrefix.length)),ae});return p(ue,ie),ue}function et(U){var ie=this,Y=ie.ready().then(function(){for(var ue=ie._dbInfo,ge=localStorage.length,ae=[],Ae=0;Ae<ge;Ae++){var Pe=localStorage.key(Ae);Pe.indexOf(ue.keyPrefix)===0&&ae.push(Pe.substring(ue.keyPrefix.length))}return ae});return p(Y,U),Y}function ze(U){var ie=this,Y=ie.keys().then(function(ue){return ue.length});return p(Y,U),Y}function Je(U,ie){var Y=this;U=x(U);var ue=Y.ready().then(function(){var ge=Y._dbInfo;localStorage.removeItem(ge.keyPrefix+U)});return p(ue,ie),ue}function bt(U,ie,Y){var ue=this;U=x(U);var ge=ue.ready().then(function(){ie===void 0&&(ie=null);var ae=ie;return new f(function(Ae,Pe){var ke=ue._dbInfo;ke.serializer.serialize(ie,function(De,Le){if(Le)Pe(Le);else try{localStorage.setItem(ke.keyPrefix+U,De),Ae(ae)}catch(Ze){(Ze.name==="QuotaExceededError"||Ze.name==="NS_ERROR_DOM_QUOTA_REACHED")&&Pe(Ze),Pe(Ze)}})})});return p(ge,Y),ge}function rr(U,ie){if(ie=v.apply(this,arguments),U=typeof U!="function"&&U||{},!U.name){var Y=this.config();U.name=U.name||Y.name,U.storeName=U.storeName||Y.storeName}var ue=this,ge;return U.name?ge=new f(function(ae){U.storeName?ae(be(U,ue._defaultConfig)):ae(U.name+"/")}).then(function(ae){for(var Ae=localStorage.length-1;Ae>=0;Ae--){var Pe=localStorage.key(Ae);Pe.indexOf(ae)===0&&localStorage.removeItem(Pe)}}):ge=f.reject("Invalid arguments"),p(ge,ie),ge}var Bt={_driver:"localStorageWrapper",_initStorage:qe,_support:me(),iterate:Ce,getItem:ye,setItem:bt,removeItem:Je,clear:J,length:ze,key:Ve,keys:et,dropInstance:rr},Vt=function(ie,Y){return ie===Y||typeof ie=="number"&&typeof Y=="number"&&isNaN(ie)&&isNaN(Y)},fr=function(ie,Y){for(var ue=ie.length,ge=0;ge<ue;){if(Vt(ie[ge],Y))return!0;ge++}return!1},Nr=Array.isArray||function(U){return Object.prototype.toString.call(U)==="[object Array]"},mr={},nr={},Ar={INDEXEDDB:re,WEBSQL:se,LOCALSTORAGE:Bt},Fn=[Ar.INDEXEDDB._driver,Ar.WEBSQL._driver,Ar.LOCALSTORAGE._driver],tn=["dropInstance"],$n=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(tn),qi={description:"",driver:Fn.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Hi(U,ie){U[ie]=function(){var Y=arguments;return U.ready().then(function(){return U[ie].apply(U,Y)})}}function Vn(){for(var U=1;U<arguments.length;U++){var ie=arguments[U];if(ie)for(var Y in ie)ie.hasOwnProperty(Y)&&(Nr(ie[Y])?arguments[0][Y]=ie[Y].slice():arguments[0][Y]=ie[Y])}return arguments[0]}var Wi=function(){function U(ie){o(this,U);for(var Y in Ar)if(Ar.hasOwnProperty(Y)){var ue=Ar[Y],ge=ue._driver;this[Y]=ge,mr[ge]||this.defineDriver(ue)}this._defaultConfig=Vn({},qi),this._config=Vn({},this._defaultConfig,ie),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return U.prototype.config=function(Y){if((typeof Y>"u"?"undefined":s(Y))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var ue in Y){if(ue==="storeName"&&(Y[ue]=Y[ue].replace(/\W/g,"_")),ue==="version"&&typeof Y[ue]!="number")return new Error("Database version must be a number.");this._config[ue]=Y[ue]}return"driver"in Y&&Y.driver?this.setDriver(this._config.driver):!0}else return typeof Y=="string"?this._config[Y]:this._config},U.prototype.defineDriver=function(Y,ue,ge){var ae=new f(function(Ae,Pe){try{var ke=Y._driver,De=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!Y._driver){Pe(De);return}for(var Le=$n.concat("_initStorage"),Ze=0,Tt=Le.length;Ze<Tt;Ze++){var zt=Le[Ze],Ht=!fr(tn,zt);if((Ht||Y[zt])&&typeof Y[zt]!="function"){Pe(De);return}}var br=function(){for(var sc=function(wU){return function(){var xU=new Error("Method "+wU+" is not implemented by the current driver"),e4=f.reject(xU);return p(e4,arguments[arguments.length-1]),e4}},Sh=0,yU=tn.length;Sh<yU;Sh++){var _h=tn[Sh];Y[_h]||(Y[_h]=sc(_h))}};br();var gr=function(sc){mr[ke]&&console.info("Redefining LocalForage driver: "+ke),mr[ke]=Y,nr[ke]=sc,Ae()};"_support"in Y?Y._support&&typeof Y._support=="function"?Y._support().then(gr,Pe):gr(!!Y._support):gr(!0)}catch(Sn){Pe(Sn)}});return y(ae,ue,ge),ae},U.prototype.driver=function(){return this._driver||null},U.prototype.getDriver=function(Y,ue,ge){var ae=mr[Y]?f.resolve(mr[Y]):f.reject(new Error("Driver not found."));return y(ae,ue,ge),ae},U.prototype.getSerializer=function(Y){var ue=f.resolve(it);return y(ue,Y),ue},U.prototype.ready=function(Y){var ue=this,ge=ue._driverSet.then(function(){return ue._ready===null&&(ue._ready=ue._initDriver()),ue._ready});return y(ge,Y,Y),ge},U.prototype.setDriver=function(Y,ue,ge){var ae=this;Nr(Y)||(Y=[Y]);var Ae=this._getSupportedDrivers(Y);function Pe(){ae._config.driver=ae.driver()}function ke(Ze){return ae._extend(Ze),Pe(),ae._ready=ae._initStorage(ae._config),ae._ready}function De(Ze){return function(){var Tt=0;function zt(){for(;Tt<Ze.length;){var Ht=Ze[Tt];return Tt++,ae._dbInfo=null,ae._ready=null,ae.getDriver(Ht).then(ke).catch(zt)}Pe();var br=new Error("No available storage method found.");return ae._driverSet=f.reject(br),ae._driverSet}return zt()}}var Le=this._driverSet!==null?this._driverSet.catch(function(){return f.resolve()}):f.resolve();return this._driverSet=Le.then(function(){var Ze=Ae[0];return ae._dbInfo=null,ae._ready=null,ae.getDriver(Ze).then(function(Tt){ae._driver=Tt._driver,Pe(),ae._wrapLibraryMethodsWithReady(),ae._initDriver=De(Ae)})}).catch(function(){Pe();var Ze=new Error("No available storage method found.");return ae._driverSet=f.reject(Ze),ae._driverSet}),y(this._driverSet,ue,ge),this._driverSet},U.prototype.supports=function(Y){return!!nr[Y]},U.prototype._extend=function(Y){Vn(this,Y)},U.prototype._getSupportedDrivers=function(Y){for(var ue=[],ge=0,ae=Y.length;ge<ae;ge++){var Ae=Y[ge];this.supports(Ae)&&ue.push(Ae)}return ue},U.prototype._wrapLibraryMethodsWithReady=function(){for(var Y=0,ue=$n.length;Y<ue;Y++)Hi(this,$n[Y])},U.prototype.createInstance=function(Y){return new U(Y)},U}(),Gi=new Wi;n.exports=Gi},{3:3}]},{},[4])(4)})})($v);var GC=$v.exports;const Ca=io(GC);Ca.config({name:"CetusSite",storeName:"tokens"});class Ni{static async setItem(t,r){try{await Ca.setItem(t,r)}catch(n){console.error(`Failed to set item with key "${t}"`,n)}}static async getItem(t){try{return await Ca.getItem(t)}catch(r){return console.error(`Failed to get item with key "${t}"`,r),null}}static async removeItem(t){try{await Ca.removeItem(t)}catch(r){console.error(`Failed to remove item with key "${t}"`,r)}}static async clear(){try{await Ca.clear()}catch(t){console.error("Failed to clear storage",t)}}}const xl=[{name:"SuiVision",link:"https://suivision.xyz",img:Ct("/images/logo_suivision@2x.png"),isCustom:!1},{name:"Suiscan",link:"https://suiscan.xyz/mainnet",img:Ct("/images/logo_suiscan@2x.png"),isCustom:!1}],Aa=[{name:"Sui Fullnode",link:"https://fullnode.mainnet.sui.io",isCustom:!1},{name:"Custom RPC URL",link:"",isCustom:!0}],KC=[{display:"0.1",value:"0.001"},{display:"0.5",value:"0.005"},{display:"1",value:"0.01"}],Ao={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"}}["mainnet"],YC="0x45f3c0814d7be4aa5fbd32d7e3c40f3c062a2b63eaf5ec4f8c1539b5987b11af",JC=Ct("/images/birdeye-logo.png"),XC=Ct("/images/img-logo@2x.png"),ZC=Ct("/images/logo_CoinGecko@2x.png"),QC=Ct("/images/logo_pyth.png");var Ta=(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.STEAMM_OMM_V2="STEAMM_OMM_V2",e.MAGMA="MAGMA",e.SEVENK="SEVENK",e.HAWAL="HAWAL",e.HAEDALHMMV2="HAEDALHMMV2",e.FULLSAIL="FULLSAIL",e))(Ta||{});const Vv={pyth:"Pyth Network",coingecko:"CoinGecko",birdeye:"Birdeye",Cetus:"Cetus"},eA={pyth:QC,coingecko:ZC,birdeye:JC,Cetus:XC},$t={CETUS:Ct("/images/aggregator-source/cetus.png"),KRIYA:Ct("/images/aggregator-source/kriya.png"),FLOWX:Ct("/images/aggregator-source/flowx.png"),AFTERMATH:Ct("/images/aggregator-source/aftermath.png"),TURBOS:Ct("/images/aggregator-source/turbos.png"),HAEDAL:Ct("/images/aggregator-source/haedal.png"),VOLO:Ct("/images/aggregator-source/volo.png"),AFSUI:Ct("/images/aggregator-source/aftermath.png"),BLUEMOVE:Ct("/images/aggregator-source/bluemove.png"),KRIYAV3:Ct("/images/aggregator-source/kriya.png"),FLOWXV3:Ct("/images/aggregator-source/flowx.png"),DEEPBOOKV3:Ct("/images/aggregator-source/deepbook.png"),SCALLOP:Ct("/images/aggregator-source/scallop.png"),SPRINGSUI:Ct("/images/aggregator-source/suilend.png"),BLUEFIN:Ct("/images/aggregator-source/bluefin.png"),HAEDALPMM:Ct("/images/aggregator-source/haedal.png"),ALPHAFI:Ct("/images/aggregator-source/stSui.png"),STEAMM:Ct("/images/aggregator-source/steamm.png"),OBRIC:Ct("/images/aggregator-source/obric.png"),METASTABLE:Ct("/images/aggregator-source/metastable.png"),MOMENTUM:Ct("/images/aggregator-source/momentum.png"),STEAMM_OMM:Ct("/images/aggregator-source/steamm.png"),STEAMM_OMM_V2:Ct("/images/aggregator-source/steamm.png"),MAGMA:Ct("/images/aggregator-source/magma.png"),SEVENK:Ct("/images/aggregator-source/7k.png"),HAWAL:Ct("/images/aggregator-source/haedal.png"),HAEDALHMMV2:Ct("/images/aggregator-source/haedal.png"),FULLSAIL:Ct("/images/aggregator-source/fullsail.png")},zv={CETUS:{name:"Cetus",id:"CETUS",logo:$t.CETUS,type:"dex",sort:100},DEEPBOOKV3:{name:"DeepBook V3",id:"DEEPBOOKV3",logo:$t.DEEPBOOKV3,type:"dex",sort:99},KRIYA:{name:"Kriya V2",id:"KRIYA",logo:$t.KRIYA,type:"dex",sort:98},KRIYAV3:{name:"Kriya V3",id:"KRIYAV3",logo:$t.KRIYA,type:"dex",sort:97},FLOWX:{name:"FlowX V2",id:"FLOWX",logo:$t.FLOWX,type:"dex",sort:96},FLOWXV3:{name:"FlowX V3",id:"FLOWXV3",logo:$t.FLOWX,type:"dex",sort:95},AFTERMATH:{name:"Aftermath",id:"AFTERMATH",logo:$t.AFTERMATH,type:"dex",sort:94},TURBOS:{name:"Turbos",id:"TURBOS",logo:$t.TURBOS,type:"dex",sort:93},HAEDAL:{name:"Haedal LSD",id:"HAEDAL",logo:$t.HAEDAL,type:"other",sort:92},HAWAL:{name:"Haedal LSD",id:"HAWAL",logo:$t.HAEDAL,type:"other",sort:90},HAEDALPMM:{name:"Haedal HMM",id:"HAEDALPMM",logo:$t.HAEDALPMM,type:"other",sort:92},HAEDALHMMV2:{name:"Haedal HMM",id:"HAEDALHMMV2",logo:$t.HAEDALHMMV2,type:"other",sort:88},VOLO:{name:"Volo",id:"VOLO",logo:$t.VOLO,type:"other",sort:91},AFSUI:{name:"Aftermath LSD",id:"AFSUI",logo:$t.AFTERMATH,type:"other",sort:90},BLUEMOVE:{name:"BlueMove",id:"BLUEMOVE",logo:$t.BLUEMOVE,type:"dex",sort:80},BLUEFIN:{name:"Bluefin",id:"BLUEFIN",logo:$t.BLUEFIN,sort:79,type:"dex"},MOMENTUM:{name:"Momentum",id:"MOMENTUM",logo:$t.MOMENTUM,sort:68,type:"dex"},SCALLOP:{name:"Scallop",id:"SCALLOP",logo:$t.SCALLOP,type:"other",sort:70},SPRINGSUI:{name:"SpringSui",id:"SPRINGSUI",logo:$t.SPRINGSUI,type:"other",sort:60},ALPHAFI:{name:"stSUI",id:"ALPHAFI",logo:$t.ALPHAFI,type:"other",sort:50},STEAMM:{name:"STEAMM CPMM",id:"STEAMM",logo:$t.STEAMM,sort:76,type:"dex"},STEAMM_OMM:{name:"STEAMM OMM",id:"STEAMM_OMM",logo:$t.STEAMM_OMM,sort:75,type:"dex"},STEAMM_OMM_V2:{name:"STEAMM OMM",id:"STEAMM_OMM_V2",logo:$t.STEAMM_OMM_V2,sort:74,type:"dex"},METASTABLE:{name:"Metastable",id:"METASTABLE",logo:$t.METASTABLE,sort:77,type:"dex"},OBRIC:{name:"Obric",id:"OBRIC",logo:$t.OBRIC,sort:76,type:"dex"},MAGMA:{name:"Magma",id:"MAGMA",logo:$t.MAGMA,sort:67,type:"dex"},SEVENK:{name:"7K Spot",id:"SEVENK",logo:$t.SEVENK,sort:66,type:"dex"},FULLSAIL:{name:"Full Sail",id:"FULLSAIL",logo:$t.FULLSAIL,sort:65,type:"dex"}},qv=e=>{let t;const r=new Set,n=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),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},tA=e=>e?qv(e):qv,rA=e=>e;function nA(e,t=rA){const r=le.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return le.useDebugValue(r),r}const Hv=e=>{const t=tA(e),r=n=>nA(t,n);return Object.assign(r,t),r},ki=e=>e?Hv(e):Hv;function iA(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,t==null?void 0:t.reviver),a=(s=r.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>r.setItem(i,JSON.stringify(s,t==null?void 0:t.replacer)),removeItem:i=>r.removeItem(i)}}const qf=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return qf(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return qf(n)(r)}}}},Vr=ki(((e,t)=>(r,n,i)=>{let s={storage:iA(()=>localStorage),partialize:v=>v,version:0,merge:(v,_)=>({..._,...v}),...t},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...v)},n,i);const u=()=>{const v=s.partialize({...n()});return l.setItem(s.name,{state:v,version:s.version})},f=i.setState;i.setState=(v,_)=>{f(v,_),u()};const p=e((...v)=>{r(...v),u()},n,i);i.getInitialState=()=>p;let y;const x=()=>{var v,_;if(!l)return;o=!1,a.forEach(O=>{var R;return O((R=n())!=null?R:p)});const T=((_=s.onRehydrateStorage)==null?void 0:_.call(s,(v=n())!=null?v:p))||void 0;return qf(l.getItem.bind(l))(s.name).then(O=>{if(O)if(typeof O.version=="number"&&O.version!==s.version){if(s.migrate){const R=s.migrate(O.state,O.version);return R instanceof Promise?R.then(F=>[!0,F]):[!0,R]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,O.state];return[!1,void 0]}).then(O=>{var R;const[F,B]=O;if(y=s.merge(B,(R=n())!=null?R:p),r(y,!0),F)return u()}).then(()=>{T==null||T(y,void 0),y=n(),o=!0,c.forEach(O=>O(y))}).catch(O=>{T==null||T(void 0,O)})};return i.persist={setOptions:v=>{s={...s,...v},v.storage&&(l=v.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>x(),hasHydrated:()=>o,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},s.skipHydration||x(),y||p})((e,t)=>({ignoreWarnTokenMap:{},currentExplorer:xl[0].link,setCurrentExplorer:r=>{e(()=>({currentExplorer:r}))},rpcList:Aa,setRpcList:r=>{e(()=>({rpcList:[...r]}))},currentRpc:Aa[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(Ta),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}))},transactionMode:"Default",setTransctionMode:r=>{e(()=>({transactionMode:r}))},maxCapForGas:"0.5",setMaxCapForGas:r=>{e(()=>({maxCapForGas:r}))},customGasPrice:"1500",setCustomGasPrice:r=>{e(()=>({customGasPrice:r}))},setIgnoreWarnToken:r=>{const n=t().ignoreWarnTokenMap;n[Ri(r)]=!0,e(()=>({ignoreWarnTokenMap:{...n}}))}}),{name:"useGlobalStore",partialize:e=>{const{currentExplorer:t,currentRpc:r,slippage:n,customRpc:i,providers:s,mevProtect:o,ignoreWarnTokenMap:a,transactionMode:c,maxCapForGas:l,customGasPrice:u}=e;return{currentExplorer:t,currentRpc:r,slippage:n,customRpc:i,providers:s,mevProtect:o,ignoreWarnTokenMap:a,transactionMode:c,maxCapForGas:l,customGasPrice:u}}}));function To(){const{currentExplorer:e}=Vr();return{getExplorerUrl:(r,n="account",i=e)=>{let s;return i.includes("suivision")?s=`${i}/${oA(n)}/${r}`:s=`${i}/${sA(n)}/${r}`,s}}}const sA=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"}},oA=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 Wv(e){const{text:t,keywords:r,onKeywordClick:n,text_highlight_color:i="var(--cs-primary)",text_size:s="12px",text_color:o="var(--cs-text-secondary)"}=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 f=r.includes(l);return w.jsx("span",{style:{lineHeight:"20px",fontSize:s,color:f?i:o,cursor:"pointer",whiteSpace:"inherit"},onClick:()=>n(l),children:l},u)})})}function Hf({size:e="24px",strokeWidth:t="10",color:r="var(--cs-primary)",emptyColor:n="transparent",gapPercentage:i=.5}){const s=50-parseFloat(t),o=2*Math.PI*s,a=o*i,c=o-a;return w.jsxs("svg",{width:e,height:e,viewBox:"0 0 100 100",children:[w.jsx("circle",{cx:"50",cy:"50",r:s,fill:"none",stroke:n,strokeWidth:t}),w.jsx("circle",{cx:"50",cy:"50",r:s,fill:"none",stroke:r,strokeWidth:t,strokeDasharray:`${c} ${a}`,strokeDashoffset:"0",strokeLinecap:"round",style:{animation:"dash 0.5s linear infinite"}}),w.jsx("style",{children:`
|
|
53
53
|
@keyframes dash {
|
|
54
54
|
0% {
|
|
55
55
|
stroke-dashoffset: 0;
|
|
@@ -58,16 +58,16 @@ React keys must be passed directly to JSX without using spread:
|
|
|
58
58
|
stroke-dashoffset: -${o};
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
`})]})}const Zr=ki((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}))}})),Mo=ki((e,t)=>({tokenMapIsInit:!1,requestTokenList:[],addRequestTokenList:r=>{e(()=>({requestTokenList:[...t().requestTokenList,r]}))},setToken:r=>{const{tokenMap:n,requestTokenList:i}=t(),s=dr(r.coin_type).full_address;if(!n.has(s)){const o=new Map(n);o.set(s,r);const a=i.filter(c=>c!==r.coin_type);e(()=>({tokenMap:o,requestTokenList:[...a]})),Ni.setItem(qf,o)}},tokenMap:new Map,setTokenMap:(r,n=!1)=>{r.size>0?e(()=>({tokenMap:r,tokenMapIsInit:!0})):e(()=>({tokenMap:r})),n||Ni.setItem(qf,r)},trustedTokenList:[],setTrustedTokenList:(r,n=!1)=>{e(()=>({trustedTokenList:r})),n||Ni.setItem(Bv,r)}}));Ni.getItem(qf).then(e=>{e!==null&&Mo.getState().setTokenMap(e,!0)}),Ni.getItem(Bv).then(e=>{e!==null&&Mo.getState().setTrustedTokenList(e,!0)});const qs=ki((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||Ni.setItem(Uv,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:s}=t();let o=i;if(n)o=[r,...o];else{const a=Jg(r.coin_type);o=i.filter(c=>Jg(c.coin_type)!==a)}return s(o),Ni.setItem(Fv,o),o},setImportTokenList:r=>{const n=Mo.getState().trustedTokenList,i=r.filter(s=>!n.some(o=>dr(s.coin_type).full_address===dr(o.coin_type).full_address));e(()=>({importTokenList:i}))},setImportTokenIsLoading:r=>{e(()=>({importTokenIsLoading:r}))},searchInput:"",setSearchInput:r=>{e(()=>({searchInput:r}))},showTokenListIsLoading:!1,setShowTokenListIsLoading:r=>{e(()=>({showTokenListIsLoading:r}))}}));Ni.getItem(Uv).then(e=>{e!==null&&qs.getState().setCollectTokenMap(e,!0)}),Ni.getItem(Fv).then(e=>{e&&qs.getState().setImportTokenList(e)});const cA="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==",Ta="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 Pr({token:e,src:t,alt:r,className:n,style:i,showWarn:s,haveBorder:o=!0,showWarnSize:a="14px",...c}){const[l,u]=le.useState(Ta),{defaultFromCoinType:f,defaultToCoinCoinType:p}=Zr(),y=T=>{u(Ta)};le.useEffect(()=>{u(t||Ta)},[t]);const{importTokenList:x}=qs(),v=le.useMemo(()=>{const T=x.some(O=>O.coin_type===(e==null?void 0:e.coin_type));return e&&!(T||e!=null&&e.is_trusted)},[e,x]),_=le.useMemo(()=>!!(f&&p&&(e!=null&&e.coin_type)&&(dr(f).full_address===dr(e==null?void 0:e.coin_type).full_address||dr(p).full_address===dr(e==null?void 0:e.coin_type).full_address)),[f,p,e==null?void 0:e.coin_type]);return w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",border:o?"1px solid var(--cs-border)":"1px solid transparent",borderRadius:o?"50%":"none",borderColor:o&&l!==Ta?"var(--cs-border)":"transparent"},children:[l==Ta?w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{borderRadius:"50%",width:"32px",height:"32px",fill:"var(--cs-primary)",...i},children:w.jsx("use",{xlinkHref:"#icon-token_nor"})}):w.jsx("img",{src:l,alt:r||"",className:[n,"tokenImg"].filter(Boolean).join(" "),loading:"lazy",decoding:"async",style:{borderRadius:"100%",...i},onError:y,...c}),(s||v)&&!_&&w.jsx("img",{style:{position:"absolute",right:-3,bottom:-2,width:a,height:a},src:cA})]})}function lA({toastData:e,onClose:t}){const{status:r,buildShowInfo:n,tx:i,id:s}=e,{getExplorerUrl:o}=To(),a=le.useMemo(()=>{if(n&&r)return n(r)},[r]),c=le.useMemo(()=>{if(r){if(r==="rejected")return"var(--cs-error)";if(r==="success")return"var(--cs-success)"}return"var(--cs-text-secondary)"},[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(Wf,{size:"20px"})}),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",color:"var(--cs-text-primary)"},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",{style:{color:"var(--cs-text-primary)"},children:a==null?void 0:a.toastDescriptionContent}),!(a!=null&&a.toastDescriptionContent)&&i&&w.jsx(Wv,{text:"Confirmation is in progress. Check your transaction on here",keywords:["here"],text_highlight_color:"var(--cs-primary)",onKeywordClick:()=>{window.open(o(i,"tx"),"_blank")}})]}),r==="rejected"&&w.jsxs(w.Fragment,{children:[a!=null&&a.toastDescriptionContent&&typeof a.toastDescriptionContent=="function"?a.toastDescriptionContent():w.jsx("span",{style:{color:"var(--cs-text-primary)"},children:a==null?void 0:a.toastDescriptionContent}),!(a!=null&&a.toastDescriptionContent)&&w.jsx("span",{style:{color:"var(--cs-text-primary)"},children:"Something went wrong"})]}),r==="success"&&w.jsx(w.Fragment,{children:a!=null&&a.toastDescriptionContent&&typeof a.toastDescriptionContent=="function"?a.toastDescriptionContent():w.jsx("span",{style:{color:"var(--cs-text-primary)"},children:a==null?void 0:a.toastDescriptionContent})}),r==="success"&&i&&w.jsxs("div",{className:"view-transaction",children:[w.jsx("span",{children:"View Transaction"}),xl.map(l=>w.jsx("a",{href:o(i,"tx",l.link),target:"_blank",children:w.jsx(Pr,{src:l.img,haveBorder:!1})},l.link))]})]}),w.jsx("svg",{className:"cs-icon close","aria-hidden":"true",onClick:()=>t(s),children:w.jsx("use",{xlinkHref:"#icon-close"})})]})}const uA=ki((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)}))}})),Io=(e="cs-swap-widget")=>{const{toasts:t,setToasts:r,removeToast:n}=uA(),i=(a,c="success")=>{const u={id:Date.now(),status:c,buildShowInfo:()=>({toastTitleText:a})};r(u)},s=a=>{const c=Date.now();return a.id=c,r(a),c},o=le.useCallback(()=>{let a=document.getElementById(e);a||(a=document.createElement("div"),a.id=e,document.body.appendChild(a));const c=a==null?void 0:a.getBoundingClientRect();let l,u;return l=`${window.scrollX+c.left+c.width-308}px`,u=`${window.scrollY+c.top+20}px`,zn.createPortal(w.jsx("div",{className:"cs-toast-wrapper",style:{left:l,top:u},children:t&&t.map(f=>w.jsx(lA,{toastData:f,onClose:()=>{n(f.id)}},f.id))}),document.body)},[t]);return{addCommonToast:i,addTxToast:s,ToastContainer:o,removeToast:n}};function dA({onClick:e}){const[t,r]=le.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"})})})}const HU="",WU="",fs=ki((e,t)=>({suiClient:new js({url:Ao.fullRpcUrl}),setSuiClient:r=>{e(()=>({suiClient:r}))},aggregatorSDK:new dv({signer:Ao.simulationAccount,client:new js({url:Ao.fullRpcUrl}),env:Df.Mainnet}),setAggregatorSDK:r=>{e(()=>({aggregatorSDK:r}))}})),fA=[{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 Sl(){return{fetchByApi:async(t,r,n,i)=>{try{return r==="GET"?await WC(`${i||Ao.api}${t}`,n):await GC(`${i||Ao.api}${t}`,n)}catch(s){throw s}}}}function hA(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 _l(e){var t;return{is_trusted:!!(e!=null&&e.isVerified)||(e==null?void 0:e.is_trusted),coin_type:dr((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 hs(){const{suiClient:e}=fs(),{fetchByApi:t}=Sl();qs();const{setTokenMap:r,tokenMap:n,setToken:i,requestTokenList:s,addRequestTokenList:o,setTrustedTokenList:a}=Mo(),c=async()=>{var _;let y=[];try{const T=await t("/v3/sui/clmm/verified_coins_info","GET");if(!(T!=null&&T.list)||((_=T==null?void 0:T.list)==null?void 0:_.length)===0)throw Error("api no trust tokens data");y=T==null?void 0:T.list}catch{y=fA}const x=[],v=y==null?void 0:y.reduce((T,O)=>(T.set(O.coinType||O.coin_type,_l(O)),(O.isVerified||O!=null&&O.is_trusted)&&x.push(_l(O)),T),new Map);v&&(v.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")&&!v.get("0x2::sui::SUI")?v.set("0x2::sui::SUI",{...v.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"),coin_type:"0x2::sui::SUI"}):!v.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")&&v.get("0x2::sui::SUI")&&v.set("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",{...v.get("0x2::sui::SUI"),coin_type:"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"}),r(new Map([...n,...v])),a(x))},l=async y=>{var T;if((y==null?void 0:y.length)===0)return;const x=await t("/v3/sui/clmm/coins_info","POST",{coinTypes:y}),v=(T=x==null?void 0:x.data)==null?void 0:T.list,_=v==null?void 0:v.reduce((O,R)=>(O.set(R.coinType,_l(R)),O),new Map);return r(new Map([...n,..._])),_},u=async y=>{var x,v,_,T;try{if(!y)return;let O=y;y==="0x2::sui::SUI"&&(O="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI");const R=await t("/v3/sui/clmm/coins_info","POST",{coinTypes:[O]});if((v=(x=R==null?void 0:R.data)==null?void 0:x.list)!=null&&v[0]){const F=_l((T=(_=R==null?void 0:R.data)==null?void 0:_.list)==null?void 0:T[0]);return i(F),F}throw Error("api no this coin types")}catch(O){console.error("🚀 ~ getTokenInfo ~ 57:",O)}},f=async y=>{try{const x=p(y);if(x)return x;if(s.includes(y))return;o(y);try{const v=await u(y);if(v)return v;throw Error("api return is null")}catch{const _=await e.getCoinMetadata({coinType:y});if(_){mv(y)&&(_.iconUrl="https://archive.cetus.zone/assets/image/sui/sui.png");const T=hA(_,y);return i(T),T}}}catch{}},p=le.useCallback(y=>{if(y)return n.get(dr(y).full_address)||n.get(y)},[n]);return{getTrustTokens:c,fetchTokenInfo:f,getTokenInfo:p,getTokens:l}}const zr=ki((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}})}})),El=(e,t)=>{if(!(e!=null&&e.totalBalance)||t===void 0||t===null)return;const r=UC(e.totalBalance,t==null?void 0:t.decimals),n=Ur(r,4);return{...t,displayBalance:n,totalBalanceFormat:r}};function Ma(e){const{suiClient:t}=fs(),{currentAccount:r,setTokenBalanceObj:n,tokenBalanceObj:i}=zr();hs();const[s,o]=le.useState([]),a=async(u=(r==null?void 0:r.address)||"",f)=>{try{if(!u){c();return}let p=[];f?p=[await t.getBalance({owner:u,coinType:f})]:p=[...await t.getAllBalances({owner:u})],o(p);const y={};p.forEach(x=>{y[dr(x.coinType).full_address]=x}),n(y)}catch{o([])}},c=()=>{n({})},l=le.useMemo(()=>{const u=e==null?void 0:e.coin_type;if(u&&r){const f=i[u]||i[dr(u).full_address];return f?El(f,e):void 0}},[e==null?void 0:e.coin_type,i,r]);return{getOwnerCoinBalances:a,balanceInfo:l}}var Gv={exports:{}};/*!
|
|
61
|
+
`})]})}const Zr=ki((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}))}})),Mo=ki((e,t)=>({tokenMapIsInit:!1,requestTokenList:[],addRequestTokenList:r=>{e(()=>({requestTokenList:[...t().requestTokenList,r]}))},setToken:r=>{const{tokenMap:n,requestTokenList:i}=t(),s=dr(r.coin_type).full_address;if(!n.has(s)){const o=new Map(n);o.set(s,r);const a=i.filter(c=>c!==r.coin_type);e(()=>({tokenMap:o,requestTokenList:[...a]})),Ni.setItem(zf,o)}},tokenMap:new Map,setTokenMap:(r,n=!1)=>{r.size>0?e(()=>({tokenMap:r,tokenMapIsInit:!0})):e(()=>({tokenMap:r})),n||Ni.setItem(zf,r)},trustedTokenList:[],setTrustedTokenList:(r,n=!1)=>{e(()=>({trustedTokenList:r})),n||Ni.setItem(Bv,r)}}));Ni.getItem(zf).then(e=>{e!==null&&Mo.getState().setTokenMap(e,!0)}),Ni.getItem(Bv).then(e=>{e!==null&&Mo.getState().setTrustedTokenList(e,!0)});const qs=ki((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||Ni.setItem(Uv,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:s}=t();let o=i;if(n)o=[r,...o];else{const a=Kg(r.coin_type);o=i.filter(c=>Kg(c.coin_type)!==a)}return s(o),Ni.setItem(Fv,o),o},setImportTokenList:r=>{const n=Mo.getState().trustedTokenList,i=r.filter(s=>!n.some(o=>dr(s.coin_type).full_address===dr(o.coin_type).full_address));e(()=>({importTokenList:i}))},setImportTokenIsLoading:r=>{e(()=>({importTokenIsLoading:r}))},searchInput:"",setSearchInput:r=>{e(()=>({searchInput:r}))},showTokenListIsLoading:!1,setShowTokenListIsLoading:r=>{e(()=>({showTokenListIsLoading:r}))}}));Ni.getItem(Uv).then(e=>{e!==null&&qs.getState().setCollectTokenMap(e,!0)}),Ni.getItem(Fv).then(e=>{e&&qs.getState().setImportTokenList(e)});const aA="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==",Ma="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 Pr({token:e,src:t,alt:r,className:n,style:i,showWarn:s,haveBorder:o=!0,showWarnSize:a="14px",...c}){const[l,u]=le.useState(Ma),{defaultFromCoinType:f,defaultToCoinCoinType:p}=Zr(),y=T=>{u(Ma)};le.useEffect(()=>{u(t||Ma)},[t]);const{importTokenList:x}=qs(),v=le.useMemo(()=>{const T=x.some(O=>O.coin_type===(e==null?void 0:e.coin_type));return e&&!(T||e!=null&&e.is_trusted)},[e,x]),_=le.useMemo(()=>!!(f&&p&&(e!=null&&e.coin_type)&&(dr(f).full_address===dr(e==null?void 0:e.coin_type).full_address||dr(p).full_address===dr(e==null?void 0:e.coin_type).full_address)),[f,p,e==null?void 0:e.coin_type]);return w.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",border:o?"1px solid var(--cs-border)":"1px solid transparent",borderRadius:o?"50%":"none",borderColor:o&&l!==Ma?"var(--cs-border)":"transparent"},children:[l==Ma?w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{borderRadius:"50%",width:"32px",height:"32px",fill:"var(--cs-primary)",...i},children:w.jsx("use",{xlinkHref:"#icon-token_nor"})}):w.jsx("img",{src:l,alt:r||"",className:[n,"tokenImg"].filter(Boolean).join(" "),loading:"lazy",decoding:"async",style:{borderRadius:"100%",...i},onError:y,...c}),(s||v)&&!_&&w.jsx("img",{style:{position:"absolute",right:-3,bottom:-2,width:a,height:a},src:aA})]})}function cA({toastData:e,onClose:t}){const{status:r,buildShowInfo:n,tx:i,id:s}=e,{getExplorerUrl:o}=To(),a=le.useMemo(()=>{if(n&&r)return n(r)},[r]),c=le.useMemo(()=>{if(r){if(r==="rejected")return"var(--cs-error)";if(r==="success")return"var(--cs-success)"}return"var(--cs-text-secondary)"},[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(Hf,{size:"20px"})}),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",color:"var(--cs-text-primary)"},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",{style:{color:"var(--cs-text-primary)"},children:a==null?void 0:a.toastDescriptionContent}),!(a!=null&&a.toastDescriptionContent)&&i&&w.jsx(Wv,{text:"Confirmation is in progress. Check your transaction on here",keywords:["here"],text_highlight_color:"var(--cs-primary)",onKeywordClick:()=>{window.open(o(i,"tx"),"_blank")}})]}),r==="rejected"&&w.jsxs(w.Fragment,{children:[a!=null&&a.toastDescriptionContent&&typeof a.toastDescriptionContent=="function"?a.toastDescriptionContent():w.jsx("span",{style:{color:"var(--cs-text-primary)"},children:a==null?void 0:a.toastDescriptionContent}),!(a!=null&&a.toastDescriptionContent)&&w.jsx("span",{style:{color:"var(--cs-text-primary)"},children:"Something went wrong"})]}),r==="success"&&w.jsx(w.Fragment,{children:a!=null&&a.toastDescriptionContent&&typeof a.toastDescriptionContent=="function"?a.toastDescriptionContent():w.jsx("span",{style:{color:"var(--cs-text-primary)"},children:a==null?void 0:a.toastDescriptionContent})}),r==="success"&&i&&w.jsxs("div",{className:"view-transaction",children:[w.jsx("span",{children:"View Transaction"}),xl.map(l=>w.jsx("a",{href:o(i,"tx",l.link),target:"_blank",children:w.jsx(Pr,{src:l.img,haveBorder:!1})},l.link))]})]}),w.jsx("svg",{className:"cs-icon close","aria-hidden":"true",onClick:()=>t(s),children:w.jsx("use",{xlinkHref:"#icon-close"})})]})}const lA=ki((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)}))}})),Io=(e="cs-swap-widget")=>{const{toasts:t,setToasts:r,removeToast:n}=lA(),i=(a,c="success")=>{const u={id:Date.now(),status:c,buildShowInfo:()=>({toastTitleText:a})};r(u)},s=a=>{const c=Date.now();return a.id=c,r(a),c},o=le.useCallback(()=>{let a=document.getElementById(e);a||(a=document.createElement("div"),a.id=e,document.body.appendChild(a));const c=a==null?void 0:a.getBoundingClientRect();let l,u;return l=`${window.scrollX+c.left+c.width-308}px`,u=`${window.scrollY+c.top+20}px`,zn.createPortal(w.jsx("div",{className:"cs-toast-wrapper",style:{left:l,top:u},children:t&&t.map(f=>w.jsx(cA,{toastData:f,onClose:()=>{n(f.id)}},f.id))}),document.body)},[t]);return{addCommonToast:i,addTxToast:s,ToastContainer:o,removeToast:n}};function uA({onClick:e}){const[t,r]=le.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"})})})}const qU="",HU="",hs=ki((e,t)=>({suiClient:new Ns({url:Ao.fullRpcUrl}),setSuiClient:r=>{e(()=>({suiClient:r}))},aggregatorSDK:new lv({signer:Ao.simulationAccount,client:new Ns({url:Ao.fullRpcUrl}),env:kf.Mainnet}),setAggregatorSDK:r=>{e(()=>({aggregatorSDK:r}))}})),dA=[{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 Sl(){return{fetchByApi:async(t,r,n,i)=>{try{return r==="GET"?await HC(`${i||Ao.api}${t}`,n):await WC(`${i||Ao.api}${t}`,n)}catch(s){throw s}}}}function fA(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 _l(e){var t;return{is_trusted:!!(e!=null&&e.isVerified)||(e==null?void 0:e.is_trusted),coin_type:dr((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 ps(){const{suiClient:e}=hs(),{fetchByApi:t}=Sl();qs();const{setTokenMap:r,tokenMap:n,setToken:i,requestTokenList:s,addRequestTokenList:o,setTrustedTokenList:a}=Mo(),c=async()=>{var _;let y=[];try{const T=await t("/v3/sui/clmm/verified_coins_info","GET");if(!(T!=null&&T.list)||((_=T==null?void 0:T.list)==null?void 0:_.length)===0)throw Error("api no trust tokens data");y=T==null?void 0:T.list}catch{y=dA}const x=[],v=y==null?void 0:y.reduce((T,O)=>(T.set(O.coinType||O.coin_type,_l(O)),(O.isVerified||O!=null&&O.is_trusted)&&x.push(_l(O)),T),new Map);v&&(v.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")&&!v.get("0x2::sui::SUI")?v.set("0x2::sui::SUI",{...v.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"),coin_type:"0x2::sui::SUI"}):!v.get("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")&&v.get("0x2::sui::SUI")&&v.set("0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",{...v.get("0x2::sui::SUI"),coin_type:"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI"}),r(new Map([...n,...v])),a(x))},l=async y=>{var T;if((y==null?void 0:y.length)===0)return;const x=await t("/v3/sui/clmm/coins_info","POST",{coinTypes:y}),v=(T=x==null?void 0:x.data)==null?void 0:T.list,_=v==null?void 0:v.reduce((O,R)=>(O.set(R.coinType,_l(R)),O),new Map);return r(new Map([...n,..._])),_},u=async y=>{var x,v,_,T;try{if(!y)return;let O=y;y==="0x2::sui::SUI"&&(O="0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI");const R=await t("/v3/sui/clmm/coins_info","POST",{coinTypes:[O]});if((v=(x=R==null?void 0:R.data)==null?void 0:x.list)!=null&&v[0]){const F=_l((T=(_=R==null?void 0:R.data)==null?void 0:_.list)==null?void 0:T[0]);return i(F),F}throw Error("api no this coin types")}catch(O){console.error("🚀 ~ getTokenInfo ~ 57:",O)}},f=async y=>{try{const x=p(y);if(x)return x;if(s.includes(y))return;o(y);try{const v=await u(y);if(v)return v;throw Error("api return is null")}catch{const _=await e.getCoinMetadata({coinType:y});if(_){hv(y)&&(_.iconUrl="https://archive.cetus.zone/assets/image/sui/sui.png");const T=fA(_,y);return i(T),T}}}catch{}},p=le.useCallback(y=>{if(y)return n.get(dr(y).full_address)||n.get(y)},[n]);return{getTrustTokens:c,fetchTokenInfo:f,getTokenInfo:p,getTokens:l}}const zr=ki((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}})}})),El=(e,t)=>{if(!(e!=null&&e.totalBalance)||t===void 0||t===null)return;const r=FC(e.totalBalance,t==null?void 0:t.decimals),n=Fr(r,4);return{...t,displayBalance:n,totalBalanceFormat:r}};function Ia(e){const{suiClient:t}=hs(),{currentAccount:r,setTokenBalanceObj:n,tokenBalanceObj:i}=zr();ps();const[s,o]=le.useState([]),a=async(u=(r==null?void 0:r.address)||"",f)=>{try{if(!u){c();return}let p=[];f?p=[await t.getBalance({owner:u,coinType:f})]:p=[...await t.getAllBalances({owner:u})],o(p);const y={};p.forEach(x=>{y[dr(x.coinType).full_address]=x}),n(y)}catch{o([])}},c=()=>{n({})},l=le.useMemo(()=>{const u=e==null?void 0:e.coin_type;if(u&&r){const f=i[u]||i[dr(u).full_address];return f?El(f,e):void 0}},[e==null?void 0:e.coin_type,i,r]);return{getOwnerCoinBalances:a,balanceInfo:l}}var Gv={exports:{}};/*!
|
|
62
62
|
Copyright (c) 2018 Jed Watson.
|
|
63
63
|
Licensed under the MIT License (MIT), see
|
|
64
64
|
http://jedwatson.github.io/classnames
|
|
65
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,n(a)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return r.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Gv);var pA=Gv.exports;const or=io(pA);function lt(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 Kv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gf(...e){return t=>{let r=!1;const n=e.map(i=>{const s=Kv(i,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){const s=n[i];typeof s=="function"?s():Kv(e[i],null)}}}}function Xt(...e){return P.useCallback(Gf(...e),e)}function Di(e,t=[]){let r=[];function n(s,o){const a=P.createContext(o),c=r.length;r=[...r,o];const l=f=>{var T;const{scope:p,children:y,...x}=f,v=((T=p==null?void 0:p[e])==null?void 0:T[c])||a,_=P.useMemo(()=>x,Object.values(x));return w.jsx(v.Provider,{value:_,children:y})};l.displayName=s+"Provider";function u(f,p){var v;const y=((v=p==null?void 0:p[e])==null?void 0:v[c])||a,x=P.useContext(y);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[l,u]}const i=()=>{const s=r.map(o=>P.createContext(o));return function(a){const c=(a==null?void 0:a[e])||s;return P.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return i.scopeName=e,[n,mA(i,...t)]}function mA(...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(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function Ia(e){const t=gA(e),r=P.forwardRef((n,i)=>{const{children:s,...o}=n,a=P.Children.toArray(s),c=a.find(vA);if(c){const l=c.props.children,u=a.map(f=>f===c?P.Children.count(l)>1?P.Children.only(null):P.isValidElement(l)?l.props.children:null:f);return w.jsx(t,{...o,ref:i,children:P.isValidElement(l)?P.cloneElement(l,void 0,u):null})}return w.jsx(t,{...o,ref:i,children:s})});return r.displayName=`${e}.Slot`,r}var Kf=Ia("Slot");function gA(e){const t=P.forwardRef((r,n)=>{const{children:i,...s}=r,o=P.isValidElement(i)?yA(i):void 0,a=Xt(o,n);if(P.isValidElement(i)){const c=bA(s,i.props);return i.type!==P.Fragment&&(c.ref=a),P.cloneElement(i,c)}return P.Children.count(i)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Yv=Symbol("radix.slottable");function Jv(e){const t=({children:r})=>w.jsx(w.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Yv,t}var Cl=Jv("Slottable");function vA(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Yv}function bA(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{const c=s(...a);return i(...a),c}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}function yA(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 wA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zt=wA.reduce((e,t)=>{const r=Ia(`Primitive.${t}`),n=P.forwardRef((i,s)=>{const{asChild:o,...a}=i,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Xv(e,t){e&&Th.flushSync(()=>e.dispatchEvent(t))}function Rr(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function xA(e,t=globalThis==null?void 0:globalThis.document){const r=Rr(e);P.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 SA="DismissableLayer",Yf="dismissableLayer.update",_A="dismissableLayer.pointerDownOutside",EA="dismissableLayer.focusOutside",Zv,Qv=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jf=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=e,l=P.useContext(Qv),[u,f]=P.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=P.useState({}),x=Xt(t,$=>f($)),v=Array.from(l.layers),[_]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),T=v.indexOf(_),O=u?v.indexOf(u):-1,R=l.layersWithOutsidePointerEventsDisabled.size>0,F=O>=T,B=TA($=>{const Z=$.target,ce=[...l.branches].some(ne=>ne.contains(Z));!F||ce||(i==null||i($),o==null||o($),$.defaultPrevented||a==null||a())},p),H=MA($=>{const Z=$.target;[...l.branches].some(ne=>ne.contains(Z))||(s==null||s($),o==null||o($),$.defaultPrevented||a==null||a())},p);return xA($=>{O===l.layers.size-1&&(n==null||n($),!$.defaultPrevented&&a&&($.preventDefault(),a()))},p),P.useEffect(()=>{if(u)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Zv=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),eb(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Zv)}},[u,p,r,l]),P.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),eb())},[u,l]),P.useEffect(()=>{const $=()=>y({});return document.addEventListener(Yf,$),()=>document.removeEventListener(Yf,$)},[]),w.jsx(Zt.div,{...c,ref:x,style:{pointerEvents:R?F?"auto":"none":void 0,...e.style},onFocusCapture:lt(e.onFocusCapture,H.onFocusCapture),onBlurCapture:lt(e.onBlurCapture,H.onBlurCapture),onPointerDownCapture:lt(e.onPointerDownCapture,B.onPointerDownCapture)})});Jf.displayName=SA;var CA="DismissableLayerBranch",AA=P.forwardRef((e,t)=>{const r=P.useContext(Qv),n=P.useRef(null),i=Xt(t,n);return P.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),w.jsx(Zt.div,{...e,ref:i})});AA.displayName=CA;function TA(e,t=globalThis==null?void 0:globalThis.document){const r=Rr(e),n=P.useRef(!1),i=P.useRef(()=>{});return P.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){tb(_A,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},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function MA(e,t=globalThis==null?void 0:globalThis.document){const r=Rr(e),n=P.useRef(!1);return P.useEffect(()=>{const i=s=>{s.target&&!n.current&&tb(EA,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function eb(){const e=new CustomEvent(Yf);document.dispatchEvent(e)}function tb(e,t,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?Xv(i,s):i.dispatchEvent(s)}var Li=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},IA=P[" useId ".trim().toString()]||(()=>{}),OA=0;function Oa(e){const[t,r]=P.useState(IA());return Li(()=>{e||r(n=>n??String(OA++))},[e]),e||(t?`radix-${t}`:"")}const PA=["top","right","bottom","left"],ps=Math.min,ln=Math.max,Al=Math.round,Tl=Math.floor,ai=e=>({x:e,y:e}),RA={left:"right",right:"left",bottom:"top",top:"bottom"},jA={start:"end",end:"start"};function Xf(e,t,r){return ln(e,ps(t,r))}function Bi(e,t){return typeof e=="function"?e(t):e}function Ui(e){return e.split("-")[0]}function Oo(e){return e.split("-")[1]}function Zf(e){return e==="x"?"y":"x"}function Qf(e){return e==="y"?"height":"width"}function Fi(e){return["top","bottom"].includes(Ui(e))?"y":"x"}function e0(e){return Zf(Fi(e))}function NA(e,t,r){r===void 0&&(r=!1);const n=Oo(e),i=e0(e),s=Qf(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Ml(o)),[o,Ml(o)]}function kA(e){const t=Ml(e);return[t0(e),t,t0(t)]}function t0(e){return e.replace(/start|end/g,t=>jA[t])}function DA(e,t,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:n:t?n:i;case"left":case"right":return t?s:o;default:return[]}}function LA(e,t,r,n){const i=Oo(e);let s=DA(Ui(e),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(t0)))),s}function Ml(e){return e.replace(/left|right|bottom|top/g,t=>RA[t])}function BA(e){return{top:0,right:0,bottom:0,left:0,...e}}function rb(e){return typeof e!="number"?BA(e):{top:e,right:e,bottom:e,left:e}}function Il(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 nb(e,t,r){let{reference:n,floating:i}=e;const s=Fi(t),o=e0(t),a=Qf(o),c=Ui(t),l=s==="y",u=n.x+n.width/2-i.width/2,f=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:f};break;case"left":y={x:n.x-i.width,y:f};break;default:y={x:n.x,y:n.y}}switch(Oo(t)){case"start":y[o]-=p*(r&&l?-1:1);break;case"end":y[o]+=p*(r&&l?-1:1);break}return y}const UA=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:f}=nb(l,n,c),p=n,y={},x=0;for(let v=0;v<a.length;v++){const{name:_,fn:T}=a[v],{x:O,y:R,data:F,reset:B}=await T({x:u,y:f,initialPlacement:n,placement:p,strategy:i,middlewareData:y,rects:l,platform:o,elements:{reference:e,floating:t}});u=O??u,f=R??f,y={...y,[_]:{...y[_],...F}},B&&x<=50&&(x++,typeof B=="object"&&(B.placement&&(p=B.placement),B.rects&&(l=B.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):B.rects),{x:u,y:f}=nb(l,p,c)),v=-1)}return{x:u,y:f,placement:p,strategy:i,middlewareData:y}};async function Pa(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:s,rects:o,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:y=0}=Bi(t,e),x=rb(y),_=a[p?f==="floating"?"reference":"floating":f],T=Il(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(_)))==null||r?_:_.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),O=f==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),F=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},B=Il(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:O,offsetParent:R,strategy:c}):O);return{top:(T.top-B.top+x.top)/F.y,bottom:(B.bottom-T.bottom+x.bottom)/F.y,left:(T.left-B.left+x.left)/F.x,right:(B.right-T.right+x.right)/F.x}}const FA=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Bi(e,t)||{};if(l==null)return{};const f=rb(u),p={x:r,y:n},y=e0(i),x=Qf(y),v=await o.getDimensions(l),_=y==="y",T=_?"top":"left",O=_?"bottom":"right",R=_?"clientHeight":"clientWidth",F=s.reference[x]+s.reference[y]-p[y]-s.floating[x],B=p[y]-s.reference[y],H=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let $=H?H[R]:0;(!$||!await(o.isElement==null?void 0:o.isElement(H)))&&($=a.floating[R]||s.floating[x]);const Z=F/2-B/2,ce=$/2-v[x]/2-1,ne=ps(f[T],ce),de=ps(f[O],ce),q=ne,N=$-v[x]-de,h=$/2-v[x]/2+Z,d=Xf(q,h,N),m=!c.arrow&&Oo(i)!=null&&h!==d&&s.reference[x]/2-(h<q?ne:de)-v[x]/2<0,S=m?h<q?h-q:h-N:0;return{[y]:p[y]+S,data:{[y]:d,centerOffset:h-d-S,...m&&{alignmentOffset:S}},reset:m}}}),$A=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,..._}=Bi(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const T=Ui(i),O=Fi(a),R=Ui(a)===a,F=await(c.isRTL==null?void 0:c.isRTL(l.floating)),B=p||(R||!v?[Ml(a)]:kA(a)),H=x!=="none";!p&&H&&B.push(...LA(a,v,x,F));const $=[a,...B],Z=await Pa(t,_),ce=[];let ne=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&ce.push(Z[T]),f){const d=NA(i,o,F);ce.push(Z[d[0]],Z[d[1]])}if(ne=[...ne,{placement:i,overflows:ce}],!ce.every(d=>d<=0)){var de,q;const d=(((de=s.flip)==null?void 0:de.index)||0)+1,m=$[d];if(m){var N;const E=f==="alignment"?O!==Fi(m):!1,M=((N=ne[0])==null?void 0:N.overflows[0])>0;if(!E||M)return{data:{index:d,overflows:ne},reset:{placement:m}}}let S=(q=ne.filter(E=>E.overflows[0]<=0).sort((E,M)=>E.overflows[1]-M.overflows[1])[0])==null?void 0:q.placement;if(!S)switch(y){case"bestFit":{var h;const E=(h=ne.filter(M=>{if(H){const j=Fi(M.placement);return j===O||j==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(j=>j>0).reduce((j,I)=>j+I,0)]).sort((M,j)=>M[1]-j[1])[0])==null?void 0:h[0];E&&(S=E);break}case"initialPlacement":S=a;break}if(i!==S)return{reset:{placement:S}}}return{}}}};function ib(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sb(e){return PA.some(t=>e[t]>=0)}const VA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=Bi(e,t);switch(n){case"referenceHidden":{const s=await Pa(t,{...i,elementContext:"reference"}),o=ib(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:sb(o)}}}case"escaped":{const s=await Pa(t,{...i,altBoundary:!0}),o=ib(s,r.floating);return{data:{escapedOffsets:o,escaped:sb(o)}}}default:return{}}}}};async function zA(e,t){const{placement:r,platform:n,elements:i}=e,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Ui(r),a=Oo(r),c=Fi(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=Bi(t,e);let{mainAxis:p,crossAxis:y,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.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 qA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:s,placement:o,middlewareData:a}=t,c=await zA(t,e);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},HA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:_=>{let{x:T,y:O}=_;return{x:T,y:O}}},...c}=Bi(e,t),l={x:r,y:n},u=await Pa(t,c),f=Fi(Ui(i)),p=Zf(f);let y=l[p],x=l[f];if(s){const _=p==="y"?"top":"left",T=p==="y"?"bottom":"right",O=y+u[_],R=y-u[T];y=Xf(O,y,R)}if(o){const _=f==="y"?"top":"left",T=f==="y"?"bottom":"right",O=x+u[_],R=x-u[T];x=Xf(O,x,R)}const v=a.fn({...t,[p]:y,[f]:x});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[p]:s,[f]:o}}}}}},WA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Bi(e,t),u={x:r,y:n},f=Fi(i),p=Zf(f);let y=u[p],x=u[f];const v=Bi(a,t),_=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const R=p==="y"?"height":"width",F=s.reference[p]-s.floating[R]+_.mainAxis,B=s.reference[p]+s.reference[R]-_.mainAxis;y<F?y=F:y>B&&(y=B)}if(l){var T,O;const R=p==="y"?"width":"height",F=["top","left"].includes(Ui(i)),B=s.reference[f]-s.floating[R]+(F&&((T=o.offset)==null?void 0:T[f])||0)+(F?0:_.crossAxis),H=s.reference[f]+s.reference[R]+(F?0:((O=o.offset)==null?void 0:O[f])||0)-(F?_.crossAxis:0);x<B?x=B:x>H&&(x=H)}return{[p]:y,[f]:x}}}},GA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:c=()=>{},...l}=Bi(e,t),u=await Pa(t,l),f=Ui(i),p=Oo(i),y=Fi(i)==="y",{width:x,height:v}=s.floating;let _,T;f==="top"||f==="bottom"?(_=f,T=p===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(T=f,_=p==="end"?"top":"bottom");const O=v-u.top-u.bottom,R=x-u.left-u.right,F=ps(v-u[_],O),B=ps(x-u[T],R),H=!t.middlewareData.shift;let $=F,Z=B;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(Z=R),(n=t.middlewareData.shift)!=null&&n.enabled.y&&($=O),H&&!p){const ne=ln(u.left,0),de=ln(u.right,0),q=ln(u.top,0),N=ln(u.bottom,0);y?Z=x-2*(ne!==0||de!==0?ne+de:ln(u.left,u.right)):$=v-2*(q!==0||N!==0?q+N:ln(u.top,u.bottom))}await c({...t,availableWidth:Z,availableHeight:$});const ce=await o.getDimensions(a.floating);return x!==ce.width||v!==ce.height?{reset:{rects:!0}}:{}}}};function Ol(){return typeof window<"u"}function Po(e){return ob(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ci(e){var t;return(t=(ob(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ob(e){return Ol()?e instanceof Node||e instanceof un(e).Node:!1}function Ln(e){return Ol()?e instanceof Element||e instanceof un(e).Element:!1}function li(e){return Ol()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function ab(e){return!Ol()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}function Ra(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Bn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function KA(e){return["table","td","th"].includes(Po(e))}function Pl(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function r0(e){const t=n0(),r=Ln(e)?Bn(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 YA(e){let t=ms(e);for(;li(t)&&!Ro(t);){if(r0(t))return t;if(Pl(t))return null;t=ms(t)}return null}function n0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ro(e){return["html","body","#document"].includes(Po(e))}function Bn(e){return un(e).getComputedStyle(e)}function Rl(e){return Ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ms(e){if(Po(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ab(e)&&e.host||ci(e);return ab(t)?t.host:t}function cb(e){const t=ms(e);return Ro(t)?e.ownerDocument?e.ownerDocument.body:e.body:li(t)&&Ra(t)?t:cb(t)}function ja(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=cb(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=un(i);if(s){const a=i0(o);return t.concat(o,o.visualViewport||[],Ra(i)?i:[],a&&r?ja(a):[])}return t.concat(i,ja(i,[],r))}function i0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lb(e){const t=Bn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=li(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,a=Al(r)!==s||Al(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function s0(e){return Ln(e)?e:e.contextElement}function jo(e){const t=s0(e);if(!li(t))return ai(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:s}=lb(t);let o=(s?Al(r.width):r.width)/n,a=(s?Al(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const JA=ai(0);function ub(e){const t=un(e);return!n0()||!t.visualViewport?JA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function XA(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==un(e)?!1:t}function Hs(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),s=s0(e);let o=ai(1);t&&(n?Ln(n)&&(o=jo(n)):o=jo(e));const a=XA(s,r,n)?ub(s):ai(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const p=un(s),y=n&&Ln(n)?un(n):n;let x=p,v=i0(x);for(;v&&n&&y!==x;){const _=jo(v),T=v.getBoundingClientRect(),O=Bn(v),R=T.left+(v.clientLeft+parseFloat(O.paddingLeft))*_.x,F=T.top+(v.clientTop+parseFloat(O.paddingTop))*_.y;c*=_.x,l*=_.y,u*=_.x,f*=_.y,c+=R,l+=F,x=un(v),v=i0(x)}}return Il({width:u,height:f,x:c,y:l})}function o0(e,t){const r=Rl(e).scrollLeft;return t?t.left+r:Hs(ci(e)).left+r}function db(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-(r?0:o0(e,n)),s=n.top+t.scrollTop;return{x:i,y:s}}function ZA(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const s=i==="fixed",o=ci(n),a=t?Pl(t.floating):!1;if(n===o||a&&s)return r;let c={scrollLeft:0,scrollTop:0},l=ai(1);const u=ai(0),f=li(n);if((f||!f&&!s)&&((Po(n)!=="body"||Ra(o))&&(c=Rl(n)),li(n))){const y=Hs(n);l=jo(n),u.x=y.x+n.clientLeft,u.y=y.y+n.clientTop}const p=o&&!f&&!s?db(o,c,!0):ai(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 QA(e){return Array.from(e.getClientRects())}function eT(e){const t=ci(e),r=Rl(e),n=e.ownerDocument.body,i=ln(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ln(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+o0(e);const a=-r.scrollTop;return Bn(n).direction==="rtl"&&(o+=ln(t.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function tT(e,t){const r=un(e),n=ci(e),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=n0();(!l||l&&t==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function rT(e,t){const r=Hs(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,s=li(e)?jo(e):ai(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function fb(e,t,r){let n;if(t==="viewport")n=tT(e,r);else if(t==="document")n=eT(ci(e));else if(Ln(t))n=rT(t,r);else{const i=ub(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Il(n)}function hb(e,t){const r=ms(e);return r===t||!Ln(r)||Ro(r)?!1:Bn(r).position==="fixed"||hb(r,t)}function nT(e,t){const r=t.get(e);if(r)return r;let n=ja(e,[],!1).filter(a=>Ln(a)&&Po(a)!=="body"),i=null;const s=Bn(e).position==="fixed";let o=s?ms(e):e;for(;Ln(o)&&!Ro(o);){const a=Bn(o),c=r0(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ra(o)&&!c&&hb(e,o))?n=n.filter(u=>u!==o):i=a,o=ms(o)}return t.set(e,n),n}function iT(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?Pl(t)?[]:nT(t,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=fb(t,u,i);return l.top=ln(f.top,l.top),l.right=ps(f.right,l.right),l.bottom=ps(f.bottom,l.bottom),l.left=ln(f.left,l.left),l},fb(t,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function sT(e){const{width:t,height:r}=lb(e);return{width:t,height:r}}function oT(e,t,r){const n=li(t),i=ci(t),s=r==="fixed",o=Hs(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=ai(0);function l(){c.x=o0(i)}if(n||!n&&!s)if((Po(t)!=="body"||Ra(i))&&(a=Rl(t)),n){const y=Hs(t,!0,s,t);c.x=y.x+t.clientLeft,c.y=y.y+t.clientTop}else i&&l();s&&!n&&i&&l();const u=i&&!n&&!s?db(i,a):ai(0),f=o.left+a.scrollLeft-c.x-u.x,p=o.top+a.scrollTop-c.y-u.y;return{x:f,y:p,width:o.width,height:o.height}}function a0(e){return Bn(e).position==="static"}function pb(e,t){if(!li(e)||Bn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ci(e)===r&&(r=r.ownerDocument.body),r}function mb(e,t){const r=un(e);if(Pl(e))return r;if(!li(e)){let i=ms(e);for(;i&&!Ro(i);){if(Ln(i)&&!a0(i))return i;i=ms(i)}return r}let n=pb(e,t);for(;n&&KA(n)&&a0(n);)n=pb(n,t);return n&&Ro(n)&&a0(n)&&!r0(n)?r:n||YA(e)||r}const aT=async function(e){const t=this.getOffsetParent||mb,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 cT(e){return Bn(e).direction==="rtl"}const lT={convertOffsetParentRelativeRectToViewportRelativeRect:ZA,getDocumentElement:ci,getClippingRect:iT,getOffsetParent:mb,getElementRects:aT,getClientRects:QA,getDimensions:sT,getScale:jo,isElement:Ln,isRTL:cT};function gb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uT(e,t){let r=null,n;const i=ci(e);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:y}=l;if(a||t(),!p||!y)return;const x=Tl(f),v=Tl(i.clientWidth-(u+p)),_=Tl(i.clientHeight-(f+y)),T=Tl(u),R={rootMargin:-x+"px "+-v+"px "+-_+"px "+-T+"px",threshold:ln(0,ps(1,c))||1};let F=!0;function B(H){const $=H[0].intersectionRatio;if($!==c){if(!F)return o();$?o(!1,$):n=setTimeout(()=>{o(!1,1e-7)},1e3)}$===1&&!gb(l,e.getBoundingClientRect())&&o(),F=!1}try{r=new IntersectionObserver(B,{...R,root:i.ownerDocument})}catch{r=new IntersectionObserver(B,R)}r.observe(e)}return o(!0),s}function dT(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=s0(e),u=i||s?[...l?ja(l):[],...ja(t)]:[];u.forEach(T=>{i&&T.addEventListener("scroll",r,{passive:!0}),s&&T.addEventListener("resize",r)});const f=l&&a?uT(l,r):null;let p=-1,y=null;o&&(y=new ResizeObserver(T=>{let[O]=T;O&&O.target===l&&y&&(y.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var R;(R=y)==null||R.observe(t)})),r()}),l&&!c&&y.observe(l),y.observe(t));let x,v=c?Hs(e):null;c&&_();function _(){const T=Hs(e);v&&!gb(v,T)&&r(),v=T,x=requestAnimationFrame(_)}return r(),()=>{var T;u.forEach(O=>{i&&O.removeEventListener("scroll",r),s&&O.removeEventListener("resize",r)}),f==null||f(),(T=y)==null||T.disconnect(),y=null,c&&cancelAnimationFrame(x)}}const fT=qA,hT=HA,pT=$A,mT=GA,gT=VA,vb=FA,vT=WA,bT=(e,t,r)=>{const n=new Map,i={platform:lT,...r},s={...i.platform,_c:n};return UA(e,t,{...i,platform:s})};var jl=typeof document<"u"?le.useLayoutEffect:le.useEffect;function Nl(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(!Nl(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 s=i[n];if(!(s==="_owner"&&e.$$typeof)&&!Nl(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function bb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yb(e,t){const r=bb(e);return Math.round(t*r)/r}function c0(e){const t=P.useRef(e);return jl(()=>{t.current=e}),t}function yT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=P.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,y]=P.useState(n);Nl(p,n)||y(n);const[x,v]=P.useState(null),[_,T]=P.useState(null),O=P.useCallback(E=>{E!==H.current&&(H.current=E,v(E))},[]),R=P.useCallback(E=>{E!==$.current&&($.current=E,T(E))},[]),F=s||x,B=o||_,H=P.useRef(null),$=P.useRef(null),Z=P.useRef(u),ce=c!=null,ne=c0(c),de=c0(i),q=c0(l),N=P.useCallback(()=>{if(!H.current||!$.current)return;const E={placement:t,strategy:r,middleware:p};de.current&&(E.platform=de.current),bT(H.current,$.current,E).then(M=>{const j={...M,isPositioned:q.current!==!1};h.current&&!Nl(Z.current,j)&&(Z.current=j,Th.flushSync(()=>{f(j)}))})},[p,t,r,de,q]);jl(()=>{l===!1&&Z.current.isPositioned&&(Z.current.isPositioned=!1,f(E=>({...E,isPositioned:!1})))},[l]);const h=P.useRef(!1);jl(()=>(h.current=!0,()=>{h.current=!1}),[]),jl(()=>{if(F&&(H.current=F),B&&($.current=B),F&&B){if(ne.current)return ne.current(F,B,N);N()}},[F,B,N,ne,ce]);const d=P.useMemo(()=>({reference:H,floating:$,setReference:O,setFloating:R}),[O,R]),m=P.useMemo(()=>({reference:F,floating:B}),[F,B]),S=P.useMemo(()=>{const E={position:r,left:0,top:0};if(!m.floating)return E;const M=yb(m.floating,u.x),j=yb(m.floating,u.y);return a?{...E,transform:"translate("+M+"px, "+j+"px)",...bb(m.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:M,top:j}},[r,a,m.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:N,refs:d,elements:m,floatingStyles:S}),[u,N,d,m,S])}const wT=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?vb({element:n.current,padding:i}).fn(r):{}:n?vb({element:n,padding:i}).fn(r):{}}}},xT=(e,t)=>({...fT(e),options:[e,t]}),ST=(e,t)=>({...hT(e),options:[e,t]}),_T=(e,t)=>({...vT(e),options:[e,t]}),ET=(e,t)=>({...pT(e),options:[e,t]}),CT=(e,t)=>({...mT(e),options:[e,t]}),AT=(e,t)=>({...gT(e),options:[e,t]}),TT=(e,t)=>({...wT(e),options:[e,t]});var MT="Arrow",wb=P.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...s}=e;return w.jsx(Zt.svg,{...s,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"})})});wb.displayName=MT;var IT=wb;function l0(e){const[t,r]=P.useState(void 0);return Li(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var u0="Popper",[xb,kl]=Di(u0),[OT,Sb]=xb(u0),_b=e=>{const{__scopePopper:t,children:r}=e,[n,i]=P.useState(null);return w.jsx(OT,{scope:t,anchor:n,onAnchorChange:i,children:r})};_b.displayName=u0;var Eb="PopperAnchor",Cb=P.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,s=Sb(Eb,r),o=P.useRef(null),a=Xt(t,o);return P.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:w.jsx(Zt.div,{...i,ref:a})});Cb.displayName=Eb;var d0="PopperContent",[PT,RT]=xb(d0),Ab=P.forwardRef((e,t)=>{var we,Oe,je,L,z,G;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:y="optimized",onPlaced:x,...v}=e,_=Sb(d0,r),[T,O]=P.useState(null),R=Xt(t,re=>O(re)),[F,B]=P.useState(null),H=l0(F),$=(H==null?void 0:H.width)??0,Z=(H==null?void 0:H.height)??0,ce=n+(s!=="center"?"-"+s:""),ne=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},de=Array.isArray(l)?l:[l],q=de.length>0,N={padding:ne,boundary:de.filter(NT),altBoundary:q},{refs:h,floatingStyles:d,placement:m,isPositioned:S,middlewareData:E}=yT({strategy:"fixed",placement:ce,whileElementsMounted:(...re)=>dT(...re,{animationFrame:y==="always"}),elements:{reference:_.anchor},middleware:[xT({mainAxis:i+Z,alignmentAxis:o}),c&&ST({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?_T():void 0,...N}),c&&ET({...N}),CT({...N,apply:({elements:re,rects:ee,availableWidth:Q,availableHeight:fe})=>{const{width:W,height:K}=ee.reference,te=re.floating.style;te.setProperty("--radix-popper-available-width",`${Q}px`),te.setProperty("--radix-popper-available-height",`${fe}px`),te.setProperty("--radix-popper-anchor-width",`${W}px`),te.setProperty("--radix-popper-anchor-height",`${K}px`)}}),F&&TT({element:F,padding:a}),kT({arrowWidth:$,arrowHeight:Z}),p&&AT({strategy:"referenceHidden",...N})]}),[M,j]=Ib(m),I=Rr(x);Li(()=>{S&&(I==null||I())},[S,I]);const g=(we=E.arrow)==null?void 0:we.x,b=(Oe=E.arrow)==null?void 0:Oe.y,k=((je=E.arrow)==null?void 0:je.centerOffset)!==0,[ve,he]=P.useState();return Li(()=>{T&&he(window.getComputedStyle(T).zIndex)},[T]),w.jsx("div",{ref:h.setFloating,"data-radix-popper-content-wrapper":"",style:{...d,transform:S?d.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(L=E.transformOrigin)==null?void 0:L.x,(z=E.transformOrigin)==null?void 0:z.y].join(" "),...((G=E.hide)==null?void 0:G.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(PT,{scope:r,placedSide:M,onArrowChange:B,arrowX:g,arrowY:b,shouldHideArrow:k,children:w.jsx(Zt.div,{"data-side":M,"data-align":j,...v,ref:R,style:{...v.style,animation:S?void 0:"none"}})})})});Ab.displayName=d0;var Tb="PopperArrow",jT={top:"bottom",right:"left",bottom:"top",left:"right"},Mb=P.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,s=RT(Tb,n),o=jT[s.placedSide];return w.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:w.jsx(IT,{...i,ref:r,style:{...i.style,display:"block"}})})});Mb.displayName=Tb;function NT(e){return e!==null}var kT=e=>({name:"transformOrigin",options:e,fn(t){var _,T,O;const{placement:r,rects:n,middlewareData:i}=t,o=((_=i.arrow)==null?void 0:_.centerOffset)!==0,a=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[l,u]=Ib(r),f={start:"0%",center:"50%",end:"100%"}[u],p=(((T=i.arrow)==null?void 0:T.x)??0)+a/2,y=(((O=i.arrow)==null?void 0:O.y)??0)+c/2;let x="",v="";return l==="bottom"?(x=o?f:`${p}px`,v=`${-c}px`):l==="top"?(x=o?f:`${p}px`,v=`${n.floating.height+c}px`):l==="right"?(x=`${-c}px`,v=o?f:`${y}px`):l==="left"&&(x=`${n.floating.width+c}px`,v=o?f:`${y}px`),{data:{x,y:v}}}});function Ib(e){const[t,r="center"]=e.split("-");return[t,r]}var Ob=_b,Pb=Cb,Rb=Ab,jb=Mb,DT="Portal",Nb=P.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[i,s]=P.useState(!1);Li(()=>s(!0),[]);const o=r||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?zn.createPortal(w.jsx(Zt.div,{...n,ref:t}),o):null});Nb.displayName=DT;function LT(e,t){return P.useReducer((r,n)=>t[r][n]??r,e)}var Un=e=>{const{present:t,children:r}=e,n=BT(t),i=typeof r=="function"?r({present:n.isPresent}):P.Children.only(r),s=Xt(n.ref,UT(i));return typeof r=="function"||n.isPresent?P.cloneElement(i,{ref:s}):null};Un.displayName="Presence";function BT(e){const[t,r]=P.useState(),n=P.useRef(null),i=P.useRef(e),s=P.useRef("none"),o=e?"mounted":"unmounted",[a,c]=LT(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const l=Dl(n.current);s.current=a==="mounted"?l:"none"},[a]),Li(()=>{const l=n.current,u=i.current;if(u!==e){const p=s.current,y=Dl(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]),Li(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,f=y=>{const v=Dl(n.current).includes(y.animationName);if(y.target===t&&v&&(c("ANIMATION_END"),!i.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},p=y=>{y.target===t&&(s.current=Dl(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:P.useCallback(l=>{n.current=l?getComputedStyle(l):null,r(l)},[])}}function Dl(e){return(e==null?void 0:e.animationName)||"none"}function UT(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 FT=P[" useInsertionEffect ".trim().toString()]||Li;function Na({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,s,o]=$T({defaultProp:t,onChange:r}),a=e!==void 0,c=a?e:i;{const u=P.useRef(e!==void 0);P.useEffect(()=>{const f=u.current;f!==a&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,n])}const l=P.useCallback(u=>{var f;if(a){const p=VT(u)?u(e):u;p!==e&&((f=o.current)==null||f.call(o,p))}else s(u)},[a,e,s,o]);return[c,l]}function $T({defaultProp:e,onChange:t}){const[r,n]=P.useState(e),i=P.useRef(r),s=P.useRef(t);return FT(()=>{s.current=t},[t]),P.useEffect(()=>{var o;i.current!==r&&((o=s.current)==null||o.call(s,r),i.current=r)},[r,i]),[r,n,s]}function VT(e){return typeof e=="function"}var zT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),qT="VisuallyHidden",kb=P.forwardRef((e,t)=>w.jsx(Zt.span,{...e,ref:t,style:{...zT,...e.style}}));kb.displayName=qT;var HT=kb,[Ll,GU]=Di("Tooltip",[kl]),f0=kl(),Db="TooltipProvider",WT=700,Lb="tooltip.open",[GT,Bb]=Ll(Db),Ub=e=>{const{__scopeTooltip:t,delayDuration:r=WT,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:s}=e,o=P.useRef(!0),a=P.useRef(!1),c=P.useRef(0);return P.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),w.jsx(GT,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:P.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:P.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:P.useCallback(l=>{a.current=l},[]),disableHoverableContent:i,children:s})};Ub.displayName=Db;var Fb="Tooltip",[KU,Bl]=Ll(Fb),h0="TooltipTrigger",KT=P.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=Bl(h0,r),s=Bb(h0,r),o=f0(r),a=P.useRef(null),c=Xt(t,a,i.onTriggerChange),l=P.useRef(!1),u=P.useRef(!1),f=P.useCallback(()=>l.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),w.jsx(Pb,{asChild:!0,...o,children:w.jsx(Zt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:lt(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:lt(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:lt(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:lt(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:lt(e.onBlur,i.onClose),onClick:lt(e.onClick,i.onClose)})})});KT.displayName=h0;var YT="TooltipPortal",[YU,JT]=Ll(YT,{forceMount:void 0}),No="TooltipContent",XT=P.forwardRef((e,t)=>{const r=JT(No,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=e,o=Bl(No,e.__scopeTooltip);return w.jsx(Un,{present:n||o.open,children:o.disableHoverableContent?w.jsx($b,{side:i,...s,ref:t}):w.jsx(ZT,{side:i,...s,ref:t})})}),ZT=P.forwardRef((e,t)=>{const r=Bl(No,e.__scopeTooltip),n=Bb(No,e.__scopeTooltip),i=P.useRef(null),s=Xt(t,i),[o,a]=P.useState(null),{trigger:c,onClose:l}=r,u=i.current,{onPointerInTransitChange:f}=n,p=P.useCallback(()=>{a(null),f(!1)},[f]),y=P.useCallback((x,v)=>{const _=x.currentTarget,T={x:x.clientX,y:x.clientY},O=nM(T,_.getBoundingClientRect()),R=iM(T,O),F=sM(v.getBoundingClientRect()),B=aM([...R,...F]);a(B),f(!0)},[f]);return P.useEffect(()=>()=>p(),[p]),P.useEffect(()=>{if(c&&u){const x=_=>y(_,u),v=_=>y(_,c);return c.addEventListener("pointerleave",x),u.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",v)}}},[c,u,y,p]),P.useEffect(()=>{if(o){const x=v=>{const _=v.target,T={x:v.clientX,y:v.clientY},O=(c==null?void 0:c.contains(_))||(u==null?void 0:u.contains(_)),R=!oM(T,o);O?p():R&&(p(),l())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,u,o,l,p]),w.jsx($b,{...e,ref:s})}),[QT,eM]=Ll(Fb,{isInside:!1}),tM=Jv("TooltipContent"),$b=P.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=e,c=Bl(No,r),l=f0(r),{onClose:u}=c;return P.useEffect(()=>(document.addEventListener(Lb,u),()=>document.removeEventListener(Lb,u)),[u]),P.useEffect(()=>{if(c.trigger){const f=p=>{const y=p.target;y!=null&&y.contains(c.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,u]),w.jsx(Jf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:w.jsxs(Rb,{"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(tM,{children:n}),w.jsx(QT,{scope:r,isInside:!0,children:w.jsx(HT,{id:c.contentId,role:"tooltip",children:i||n})})]})})});XT.displayName=No;var Vb="TooltipArrow",rM=P.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=f0(r);return eM(Vb,r).isInside?null:w.jsx(jb,{...i,...n,ref:t})});rM.displayName=Vb;function nM(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function iM(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 sM(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 oM(e,t){const{x:r,y:n}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],c=t[o],l=a.x,u=a.y,f=c.x,p=c.y;u>n!=p>n&&r<(f-l)*(n-u)/(p-u)+l&&(i=!i)}return i}function aM(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),cM(t)}function cM(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 s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.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 s=r[r.length-1],o=r[r.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.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 lM=Ub,zb=P.createContext(void 0),uM=e=>{const{dir:t,children:r}=e;return w.jsx(zb.Provider,{value:t,children:r})};function p0(e){const t=P.useContext(zb);return e||t||"ltr"}const dM=["tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","brown","orange"],fM=["sky","mint","lime","yellow","amber"],hM=["gold","bronze"],pM=[...dM,...fM,...hM],mM=["gray",...["mauve","slate","sage","olive","sand"]];function gM(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 vM=["inherit","light","dark"],bM=[...pM,"gray"],yM=[...mM,"auto"],qr={hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:vM,default:"inherit"},accentColor:{type:"enum",values:bM,default:"indigo"},grayColor:{type:"enum",values:yM,default:"auto"},panelBackground:{type:"enum",values:["solid","translucent"],default:"translucent"},radius:{type:"enum",values:["none","small","medium","large","full"],default:"medium"},scaling:{type:"enum",values:["90%","95%","100%","105%","110%"],default:"100%"}};function qb(e){return e==="gray"?"gray":gM(e)}const ko=()=>{},Ul=P.createContext(void 0);function wM(){const e=P.useContext(Ul);if(e===void 0)throw new Error("`useThemeContext` must be used within a `Theme`");return e}const Fl=P.forwardRef((e,t)=>P.useContext(Ul)===void 0?P.createElement(lM,null,P.createElement(uM,{dir:"ltr"},P.createElement(Hb,{...e,ref:t}))):P.createElement(m0,{...e,ref:t}));Fl.displayName="Theme";const Hb=P.forwardRef((e,t)=>{const{appearance:r=qr.appearance.default,accentColor:n=qr.accentColor.default,grayColor:i=qr.grayColor.default,panelBackground:s=qr.panelBackground.default,radius:o=qr.radius.default,scaling:a=qr.scaling.default,hasBackground:c=qr.hasBackground.default,...l}=e,[u,f]=P.useState(r);P.useEffect(()=>f(r),[r]);const[p,y]=P.useState(n);P.useEffect(()=>y(n),[n]);const[x,v]=P.useState(i);P.useEffect(()=>v(i),[i]);const[_,T]=P.useState(s);P.useEffect(()=>T(s),[s]);const[O,R]=P.useState(o);P.useEffect(()=>R(o),[o]);const[F,B]=P.useState(a);P.useEffect(()=>B(a),[a]);const H=P.memo(({appearance:Z})=>P.createElement("script",{dangerouslySetInnerHTML:{__html:`!(function(){try{var d=document.documentElement,c=d.classList;c.remove('light','dark');d.style.colorScheme='${Z}';c.add('${Z}');}catch(e){}})();`}}),()=>!0);H.displayName="ExplicitRootAppearanceScript",P.useEffect(()=>xM(r),[r]);const $=x==="auto"?qb(p):x;return P.createElement(P.Fragment,null,u!=="inherit"&&P.createElement(H,{appearance:u}),c&&P.createElement("style",{dangerouslySetInnerHTML:{__html:`
|
|
65
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,n(a)))}return s}function n(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return r.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Gv);var hA=Gv.exports;const or=io(hA);function lt(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 Kv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wf(...e){return t=>{let r=!1;const n=e.map(i=>{const s=Kv(i,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let i=0;i<n.length;i++){const s=n[i];typeof s=="function"?s():Kv(e[i],null)}}}}function Xt(...e){return P.useCallback(Wf(...e),e)}function Di(e,t=[]){let r=[];function n(s,o){const a=P.createContext(o),c=r.length;r=[...r,o];const l=f=>{var T;const{scope:p,children:y,...x}=f,v=((T=p==null?void 0:p[e])==null?void 0:T[c])||a,_=P.useMemo(()=>x,Object.values(x));return w.jsx(v.Provider,{value:_,children:y})};l.displayName=s+"Provider";function u(f,p){var v;const y=((v=p==null?void 0:p[e])==null?void 0:v[c])||a,x=P.useContext(y);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return[l,u]}const i=()=>{const s=r.map(o=>P.createContext(o));return function(a){const c=(a==null?void 0:a[e])||s;return P.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return i.scopeName=e,[n,pA(i,...t)]}function pA(...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(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return P.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function Oa(e){const t=mA(e),r=P.forwardRef((n,i)=>{const{children:s,...o}=n,a=P.Children.toArray(s),c=a.find(gA);if(c){const l=c.props.children,u=a.map(f=>f===c?P.Children.count(l)>1?P.Children.only(null):P.isValidElement(l)?l.props.children:null:f);return w.jsx(t,{...o,ref:i,children:P.isValidElement(l)?P.cloneElement(l,void 0,u):null})}return w.jsx(t,{...o,ref:i,children:s})});return r.displayName=`${e}.Slot`,r}var Gf=Oa("Slot");function mA(e){const t=P.forwardRef((r,n)=>{const{children:i,...s}=r,o=P.isValidElement(i)?bA(i):void 0,a=Xt(o,n);if(P.isValidElement(i)){const c=vA(s,i.props);return i.type!==P.Fragment&&(c.ref=a),P.cloneElement(i,c)}return P.Children.count(i)>1?P.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Yv=Symbol("radix.slottable");function Jv(e){const t=({children:r})=>w.jsx(w.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Yv,t}var Cl=Jv("Slottable");function gA(e){return P.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Yv}function vA(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{const c=s(...a);return i(...a),c}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}function bA(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 yA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zt=yA.reduce((e,t)=>{const r=Oa(`Primitive.${t}`),n=P.forwardRef((i,s)=>{const{asChild:o,...a}=i,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Xv(e,t){e&&Ah.flushSync(()=>e.dispatchEvent(t))}function Rr(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function wA(e,t=globalThis==null?void 0:globalThis.document){const r=Rr(e);P.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 xA="DismissableLayer",Kf="dismissableLayer.update",SA="dismissableLayer.pointerDownOutside",_A="dismissableLayer.focusOutside",Zv,Qv=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yf=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...c}=e,l=P.useContext(Qv),[u,f]=P.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=P.useState({}),x=Xt(t,$=>f($)),v=Array.from(l.layers),[_]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),T=v.indexOf(_),O=u?v.indexOf(u):-1,R=l.layersWithOutsidePointerEventsDisabled.size>0,F=O>=T,B=AA($=>{const Z=$.target,ce=[...l.branches].some(ne=>ne.contains(Z));!F||ce||(i==null||i($),o==null||o($),$.defaultPrevented||a==null||a())},p),H=TA($=>{const Z=$.target;[...l.branches].some(ne=>ne.contains(Z))||(s==null||s($),o==null||o($),$.defaultPrevented||a==null||a())},p);return wA($=>{O===l.layers.size-1&&(n==null||n($),!$.defaultPrevented&&a&&($.preventDefault(),a()))},p),P.useEffect(()=>{if(u)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Zv=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),eb(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Zv)}},[u,p,r,l]),P.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),eb())},[u,l]),P.useEffect(()=>{const $=()=>y({});return document.addEventListener(Kf,$),()=>document.removeEventListener(Kf,$)},[]),w.jsx(Zt.div,{...c,ref:x,style:{pointerEvents:R?F?"auto":"none":void 0,...e.style},onFocusCapture:lt(e.onFocusCapture,H.onFocusCapture),onBlurCapture:lt(e.onBlurCapture,H.onBlurCapture),onPointerDownCapture:lt(e.onPointerDownCapture,B.onPointerDownCapture)})});Yf.displayName=xA;var EA="DismissableLayerBranch",CA=P.forwardRef((e,t)=>{const r=P.useContext(Qv),n=P.useRef(null),i=Xt(t,n);return P.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),w.jsx(Zt.div,{...e,ref:i})});CA.displayName=EA;function AA(e,t=globalThis==null?void 0:globalThis.document){const r=Rr(e),n=P.useRef(!1),i=P.useRef(()=>{});return P.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){tb(SA,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},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function TA(e,t=globalThis==null?void 0:globalThis.document){const r=Rr(e),n=P.useRef(!1);return P.useEffect(()=>{const i=s=>{s.target&&!n.current&&tb(_A,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function eb(){const e=new CustomEvent(Kf);document.dispatchEvent(e)}function tb(e,t,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?Xv(i,s):i.dispatchEvent(s)}var Li=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},MA=P[" useId ".trim().toString()]||(()=>{}),IA=0;function Pa(e){const[t,r]=P.useState(MA());return Li(()=>{e||r(n=>n??String(IA++))},[e]),e||(t?`radix-${t}`:"")}const OA=["top","right","bottom","left"],ms=Math.min,ln=Math.max,Al=Math.round,Tl=Math.floor,ai=e=>({x:e,y:e}),PA={left:"right",right:"left",bottom:"top",top:"bottom"},RA={start:"end",end:"start"};function Jf(e,t,r){return ln(e,ms(t,r))}function Bi(e,t){return typeof e=="function"?e(t):e}function Ui(e){return e.split("-")[0]}function Oo(e){return e.split("-")[1]}function Xf(e){return e==="x"?"y":"x"}function Zf(e){return e==="y"?"height":"width"}function Fi(e){return["top","bottom"].includes(Ui(e))?"y":"x"}function Qf(e){return Xf(Fi(e))}function jA(e,t,r){r===void 0&&(r=!1);const n=Oo(e),i=Qf(e),s=Zf(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Ml(o)),[o,Ml(o)]}function NA(e){const t=Ml(e);return[e0(e),t,e0(t)]}function e0(e){return e.replace(/start|end/g,t=>RA[t])}function kA(e,t,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:n:t?n:i;case"left":case"right":return t?s:o;default:return[]}}function DA(e,t,r,n){const i=Oo(e);let s=kA(Ui(e),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(e0)))),s}function Ml(e){return e.replace(/left|right|bottom|top/g,t=>PA[t])}function LA(e){return{top:0,right:0,bottom:0,left:0,...e}}function rb(e){return typeof e!="number"?LA(e):{top:e,right:e,bottom:e,left:e}}function Il(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 nb(e,t,r){let{reference:n,floating:i}=e;const s=Fi(t),o=Qf(t),a=Zf(o),c=Ui(t),l=s==="y",u=n.x+n.width/2-i.width/2,f=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:f};break;case"left":y={x:n.x-i.width,y:f};break;default:y={x:n.x,y:n.y}}switch(Oo(t)){case"start":y[o]-=p*(r&&l?-1:1);break;case"end":y[o]+=p*(r&&l?-1:1);break}return y}const BA=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:f}=nb(l,n,c),p=n,y={},x=0;for(let v=0;v<a.length;v++){const{name:_,fn:T}=a[v],{x:O,y:R,data:F,reset:B}=await T({x:u,y:f,initialPlacement:n,placement:p,strategy:i,middlewareData:y,rects:l,platform:o,elements:{reference:e,floating:t}});u=O??u,f=R??f,y={...y,[_]:{...y[_],...F}},B&&x<=50&&(x++,typeof B=="object"&&(B.placement&&(p=B.placement),B.rects&&(l=B.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):B.rects),{x:u,y:f}=nb(l,p,c)),v=-1)}return{x:u,y:f,placement:p,strategy:i,middlewareData:y}};async function Ra(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:s,rects:o,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:y=0}=Bi(t,e),x=rb(y),_=a[p?f==="floating"?"reference":"floating":f],T=Il(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(_)))==null||r?_:_.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),O=f==="floating"?{x:n,y:i,width:o.floating.width,height:o.floating.height}:o.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),F=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},B=Il(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:O,offsetParent:R,strategy:c}):O);return{top:(T.top-B.top+x.top)/F.y,bottom:(B.bottom-T.bottom+x.bottom)/F.y,left:(T.left-B.left+x.left)/F.x,right:(B.right-T.right+x.right)/F.x}}const UA=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=t,{element:l,padding:u=0}=Bi(e,t)||{};if(l==null)return{};const f=rb(u),p={x:r,y:n},y=Qf(i),x=Zf(y),v=await o.getDimensions(l),_=y==="y",T=_?"top":"left",O=_?"bottom":"right",R=_?"clientHeight":"clientWidth",F=s.reference[x]+s.reference[y]-p[y]-s.floating[x],B=p[y]-s.reference[y],H=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let $=H?H[R]:0;(!$||!await(o.isElement==null?void 0:o.isElement(H)))&&($=a.floating[R]||s.floating[x]);const Z=F/2-B/2,ce=$/2-v[x]/2-1,ne=ms(f[T],ce),de=ms(f[O],ce),q=ne,N=$-v[x]-de,h=$/2-v[x]/2+Z,d=Jf(q,h,N),m=!c.arrow&&Oo(i)!=null&&h!==d&&s.reference[x]/2-(h<q?ne:de)-v[x]/2<0,S=m?h<q?h-q:h-N:0;return{[y]:p[y]+S,data:{[y]:d,centerOffset:h-d-S,...m&&{alignmentOffset:S}},reset:m}}}),FA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,..._}=Bi(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const T=Ui(i),O=Fi(a),R=Ui(a)===a,F=await(c.isRTL==null?void 0:c.isRTL(l.floating)),B=p||(R||!v?[Ml(a)]:NA(a)),H=x!=="none";!p&&H&&B.push(...DA(a,v,x,F));const $=[a,...B],Z=await Ra(t,_),ce=[];let ne=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&ce.push(Z[T]),f){const d=jA(i,o,F);ce.push(Z[d[0]],Z[d[1]])}if(ne=[...ne,{placement:i,overflows:ce}],!ce.every(d=>d<=0)){var de,q;const d=(((de=s.flip)==null?void 0:de.index)||0)+1,m=$[d];if(m){var N;const E=f==="alignment"?O!==Fi(m):!1,M=((N=ne[0])==null?void 0:N.overflows[0])>0;if(!E||M)return{data:{index:d,overflows:ne},reset:{placement:m}}}let S=(q=ne.filter(E=>E.overflows[0]<=0).sort((E,M)=>E.overflows[1]-M.overflows[1])[0])==null?void 0:q.placement;if(!S)switch(y){case"bestFit":{var h;const E=(h=ne.filter(M=>{if(H){const j=Fi(M.placement);return j===O||j==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(j=>j>0).reduce((j,I)=>j+I,0)]).sort((M,j)=>M[1]-j[1])[0])==null?void 0:h[0];E&&(S=E);break}case"initialPlacement":S=a;break}if(i!==S)return{reset:{placement:S}}}return{}}}};function ib(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sb(e){return OA.some(t=>e[t]>=0)}const $A=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=Bi(e,t);switch(n){case"referenceHidden":{const s=await Ra(t,{...i,elementContext:"reference"}),o=ib(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:sb(o)}}}case"escaped":{const s=await Ra(t,{...i,altBoundary:!0}),o=ib(s,r.floating);return{data:{escapedOffsets:o,escaped:sb(o)}}}default:return{}}}}};async function VA(e,t){const{placement:r,platform:n,elements:i}=e,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=Ui(r),a=Oo(r),c=Fi(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=Bi(t,e);let{mainAxis:p,crossAxis:y,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.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 zA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:s,placement:o,middlewareData:a}=t,c=await VA(t,e);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},qA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:_=>{let{x:T,y:O}=_;return{x:T,y:O}}},...c}=Bi(e,t),l={x:r,y:n},u=await Ra(t,c),f=Fi(Ui(i)),p=Xf(f);let y=l[p],x=l[f];if(s){const _=p==="y"?"top":"left",T=p==="y"?"bottom":"right",O=y+u[_],R=y-u[T];y=Jf(O,y,R)}if(o){const _=f==="y"?"top":"left",T=f==="y"?"bottom":"right",O=x+u[_],R=x-u[T];x=Jf(O,x,R)}const v=a.fn({...t,[p]:y,[f]:x});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[p]:s,[f]:o}}}}}},HA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=Bi(e,t),u={x:r,y:n},f=Fi(i),p=Xf(f);let y=u[p],x=u[f];const v=Bi(a,t),_=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const R=p==="y"?"height":"width",F=s.reference[p]-s.floating[R]+_.mainAxis,B=s.reference[p]+s.reference[R]-_.mainAxis;y<F?y=F:y>B&&(y=B)}if(l){var T,O;const R=p==="y"?"width":"height",F=["top","left"].includes(Ui(i)),B=s.reference[f]-s.floating[R]+(F&&((T=o.offset)==null?void 0:T[f])||0)+(F?0:_.crossAxis),H=s.reference[f]+s.reference[R]+(F?0:((O=o.offset)==null?void 0:O[f])||0)-(F?_.crossAxis:0);x<B?x=B:x>H&&(x=H)}return{[p]:y,[f]:x}}}},WA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:c=()=>{},...l}=Bi(e,t),u=await Ra(t,l),f=Ui(i),p=Oo(i),y=Fi(i)==="y",{width:x,height:v}=s.floating;let _,T;f==="top"||f==="bottom"?(_=f,T=p===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(T=f,_=p==="end"?"top":"bottom");const O=v-u.top-u.bottom,R=x-u.left-u.right,F=ms(v-u[_],O),B=ms(x-u[T],R),H=!t.middlewareData.shift;let $=F,Z=B;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(Z=R),(n=t.middlewareData.shift)!=null&&n.enabled.y&&($=O),H&&!p){const ne=ln(u.left,0),de=ln(u.right,0),q=ln(u.top,0),N=ln(u.bottom,0);y?Z=x-2*(ne!==0||de!==0?ne+de:ln(u.left,u.right)):$=v-2*(q!==0||N!==0?q+N:ln(u.top,u.bottom))}await c({...t,availableWidth:Z,availableHeight:$});const ce=await o.getDimensions(a.floating);return x!==ce.width||v!==ce.height?{reset:{rects:!0}}:{}}}};function Ol(){return typeof window<"u"}function Po(e){return ob(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ci(e){var t;return(t=(ob(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ob(e){return Ol()?e instanceof Node||e instanceof un(e).Node:!1}function Ln(e){return Ol()?e instanceof Element||e instanceof un(e).Element:!1}function li(e){return Ol()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function ab(e){return!Ol()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}function ja(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Bn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function GA(e){return["table","td","th"].includes(Po(e))}function Pl(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function t0(e){const t=r0(),r=Ln(e)?Bn(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 KA(e){let t=gs(e);for(;li(t)&&!Ro(t);){if(t0(t))return t;if(Pl(t))return null;t=gs(t)}return null}function r0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ro(e){return["html","body","#document"].includes(Po(e))}function Bn(e){return un(e).getComputedStyle(e)}function Rl(e){return Ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gs(e){if(Po(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ab(e)&&e.host||ci(e);return ab(t)?t.host:t}function cb(e){const t=gs(e);return Ro(t)?e.ownerDocument?e.ownerDocument.body:e.body:li(t)&&ja(t)?t:cb(t)}function Na(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=cb(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=un(i);if(s){const a=n0(o);return t.concat(o,o.visualViewport||[],ja(i)?i:[],a&&r?Na(a):[])}return t.concat(i,Na(i,[],r))}function n0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lb(e){const t=Bn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=li(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,a=Al(r)!==s||Al(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function i0(e){return Ln(e)?e:e.contextElement}function jo(e){const t=i0(e);if(!li(t))return ai(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:s}=lb(t);let o=(s?Al(r.width):r.width)/n,a=(s?Al(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const YA=ai(0);function ub(e){const t=un(e);return!r0()||!t.visualViewport?YA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function JA(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==un(e)?!1:t}function Hs(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),s=i0(e);let o=ai(1);t&&(n?Ln(n)&&(o=jo(n)):o=jo(e));const a=JA(s,r,n)?ub(s):ai(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const p=un(s),y=n&&Ln(n)?un(n):n;let x=p,v=n0(x);for(;v&&n&&y!==x;){const _=jo(v),T=v.getBoundingClientRect(),O=Bn(v),R=T.left+(v.clientLeft+parseFloat(O.paddingLeft))*_.x,F=T.top+(v.clientTop+parseFloat(O.paddingTop))*_.y;c*=_.x,l*=_.y,u*=_.x,f*=_.y,c+=R,l+=F,x=un(v),v=n0(x)}}return Il({width:u,height:f,x:c,y:l})}function s0(e,t){const r=Rl(e).scrollLeft;return t?t.left+r:Hs(ci(e)).left+r}function db(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-(r?0:s0(e,n)),s=n.top+t.scrollTop;return{x:i,y:s}}function XA(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const s=i==="fixed",o=ci(n),a=t?Pl(t.floating):!1;if(n===o||a&&s)return r;let c={scrollLeft:0,scrollTop:0},l=ai(1);const u=ai(0),f=li(n);if((f||!f&&!s)&&((Po(n)!=="body"||ja(o))&&(c=Rl(n)),li(n))){const y=Hs(n);l=jo(n),u.x=y.x+n.clientLeft,u.y=y.y+n.clientTop}const p=o&&!f&&!s?db(o,c,!0):ai(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 ZA(e){return Array.from(e.getClientRects())}function QA(e){const t=ci(e),r=Rl(e),n=e.ownerDocument.body,i=ln(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ln(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+s0(e);const a=-r.scrollTop;return Bn(n).direction==="rtl"&&(o+=ln(t.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function eT(e,t){const r=un(e),n=ci(e),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=r0();(!l||l&&t==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function tT(e,t){const r=Hs(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,s=li(e)?jo(e):ai(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function fb(e,t,r){let n;if(t==="viewport")n=eT(e,r);else if(t==="document")n=QA(ci(e));else if(Ln(t))n=tT(t,r);else{const i=ub(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Il(n)}function hb(e,t){const r=gs(e);return r===t||!Ln(r)||Ro(r)?!1:Bn(r).position==="fixed"||hb(r,t)}function rT(e,t){const r=t.get(e);if(r)return r;let n=Na(e,[],!1).filter(a=>Ln(a)&&Po(a)!=="body"),i=null;const s=Bn(e).position==="fixed";let o=s?gs(e):e;for(;Ln(o)&&!Ro(o);){const a=Bn(o),c=t0(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ja(o)&&!c&&hb(e,o))?n=n.filter(u=>u!==o):i=a,o=gs(o)}return t.set(e,n),n}function nT(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?Pl(t)?[]:rT(t,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=fb(t,u,i);return l.top=ln(f.top,l.top),l.right=ms(f.right,l.right),l.bottom=ms(f.bottom,l.bottom),l.left=ln(f.left,l.left),l},fb(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}=lb(e);return{width:t,height:r}}function sT(e,t,r){const n=li(t),i=ci(t),s=r==="fixed",o=Hs(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=ai(0);function l(){c.x=s0(i)}if(n||!n&&!s)if((Po(t)!=="body"||ja(i))&&(a=Rl(t)),n){const y=Hs(t,!0,s,t);c.x=y.x+t.clientLeft,c.y=y.y+t.clientTop}else i&&l();s&&!n&&i&&l();const u=i&&!n&&!s?db(i,a):ai(0),f=o.left+a.scrollLeft-c.x-u.x,p=o.top+a.scrollTop-c.y-u.y;return{x:f,y:p,width:o.width,height:o.height}}function o0(e){return Bn(e).position==="static"}function pb(e,t){if(!li(e)||Bn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ci(e)===r&&(r=r.ownerDocument.body),r}function mb(e,t){const r=un(e);if(Pl(e))return r;if(!li(e)){let i=gs(e);for(;i&&!Ro(i);){if(Ln(i)&&!o0(i))return i;i=gs(i)}return r}let n=pb(e,t);for(;n&&GA(n)&&o0(n);)n=pb(n,t);return n&&Ro(n)&&o0(n)&&!t0(n)?r:n||KA(e)||r}const oT=async function(e){const t=this.getOffsetParent||mb,r=this.getDimensions,n=await r(e.floating);return{reference:sT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function aT(e){return Bn(e).direction==="rtl"}const cT={convertOffsetParentRelativeRectToViewportRelativeRect:XA,getDocumentElement:ci,getClippingRect:nT,getOffsetParent:mb,getElementRects:oT,getClientRects:ZA,getDimensions:iT,getScale:jo,isElement:Ln,isRTL:aT};function gb(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=ci(e);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:f,width:p,height:y}=l;if(a||t(),!p||!y)return;const x=Tl(f),v=Tl(i.clientWidth-(u+p)),_=Tl(i.clientHeight-(f+y)),T=Tl(u),R={rootMargin:-x+"px "+-v+"px "+-_+"px "+-T+"px",threshold:ln(0,ms(1,c))||1};let F=!0;function B(H){const $=H[0].intersectionRatio;if($!==c){if(!F)return o();$?o(!1,$):n=setTimeout(()=>{o(!1,1e-7)},1e3)}$===1&&!gb(l,e.getBoundingClientRect())&&o(),F=!1}try{r=new IntersectionObserver(B,{...R,root:i.ownerDocument})}catch{r=new IntersectionObserver(B,R)}r.observe(e)}return o(!0),s}function uT(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=i0(e),u=i||s?[...l?Na(l):[],...Na(t)]:[];u.forEach(T=>{i&&T.addEventListener("scroll",r,{passive:!0}),s&&T.addEventListener("resize",r)});const f=l&&a?lT(l,r):null;let p=-1,y=null;o&&(y=new ResizeObserver(T=>{let[O]=T;O&&O.target===l&&y&&(y.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var R;(R=y)==null||R.observe(t)})),r()}),l&&!c&&y.observe(l),y.observe(t));let x,v=c?Hs(e):null;c&&_();function _(){const T=Hs(e);v&&!gb(v,T)&&r(),v=T,x=requestAnimationFrame(_)}return r(),()=>{var T;u.forEach(O=>{i&&O.removeEventListener("scroll",r),s&&O.removeEventListener("resize",r)}),f==null||f(),(T=y)==null||T.disconnect(),y=null,c&&cancelAnimationFrame(x)}}const dT=zA,fT=qA,hT=FA,pT=WA,mT=$A,vb=UA,gT=HA,vT=(e,t,r)=>{const n=new Map,i={platform:cT,...r},s={...i.platform,_c:n};return BA(e,t,{...i,platform:s})};var jl=typeof document<"u"?le.useLayoutEffect:le.useEffect;function Nl(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(!Nl(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 s=i[n];if(!(s==="_owner"&&e.$$typeof)&&!Nl(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function bb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yb(e,t){const r=bb(e);return Math.round(t*r)/r}function a0(e){const t=P.useRef(e);return jl(()=>{t.current=e}),t}function bT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,f]=P.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,y]=P.useState(n);Nl(p,n)||y(n);const[x,v]=P.useState(null),[_,T]=P.useState(null),O=P.useCallback(E=>{E!==H.current&&(H.current=E,v(E))},[]),R=P.useCallback(E=>{E!==$.current&&($.current=E,T(E))},[]),F=s||x,B=o||_,H=P.useRef(null),$=P.useRef(null),Z=P.useRef(u),ce=c!=null,ne=a0(c),de=a0(i),q=a0(l),N=P.useCallback(()=>{if(!H.current||!$.current)return;const E={placement:t,strategy:r,middleware:p};de.current&&(E.platform=de.current),vT(H.current,$.current,E).then(M=>{const j={...M,isPositioned:q.current!==!1};h.current&&!Nl(Z.current,j)&&(Z.current=j,Ah.flushSync(()=>{f(j)}))})},[p,t,r,de,q]);jl(()=>{l===!1&&Z.current.isPositioned&&(Z.current.isPositioned=!1,f(E=>({...E,isPositioned:!1})))},[l]);const h=P.useRef(!1);jl(()=>(h.current=!0,()=>{h.current=!1}),[]),jl(()=>{if(F&&(H.current=F),B&&($.current=B),F&&B){if(ne.current)return ne.current(F,B,N);N()}},[F,B,N,ne,ce]);const d=P.useMemo(()=>({reference:H,floating:$,setReference:O,setFloating:R}),[O,R]),m=P.useMemo(()=>({reference:F,floating:B}),[F,B]),S=P.useMemo(()=>{const E={position:r,left:0,top:0};if(!m.floating)return E;const M=yb(m.floating,u.x),j=yb(m.floating,u.y);return a?{...E,transform:"translate("+M+"px, "+j+"px)",...bb(m.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:M,top:j}},[r,a,m.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:N,refs:d,elements:m,floatingStyles:S}),[u,N,d,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?vb({element:n.current,padding:i}).fn(r):{}:n?vb({element:n,padding:i}).fn(r):{}}}},wT=(e,t)=>({...dT(e),options:[e,t]}),xT=(e,t)=>({...fT(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]}),AT=(e,t)=>({...yT(e),options:[e,t]});var TT="Arrow",wb=P.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...s}=e;return w.jsx(Zt.svg,{...s,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"})})});wb.displayName=TT;var MT=wb;function c0(e){const[t,r]=P.useState(void 0);return Li(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var l0="Popper",[xb,kl]=Di(l0),[IT,Sb]=xb(l0),_b=e=>{const{__scopePopper:t,children:r}=e,[n,i]=P.useState(null);return w.jsx(IT,{scope:t,anchor:n,onAnchorChange:i,children:r})};_b.displayName=l0;var Eb="PopperAnchor",Cb=P.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,s=Sb(Eb,r),o=P.useRef(null),a=Xt(t,o);return P.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:w.jsx(Zt.div,{...i,ref:a})});Cb.displayName=Eb;var u0="PopperContent",[OT,PT]=xb(u0),Ab=P.forwardRef((e,t)=>{var we,Oe,je,L,z,G;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:y="optimized",onPlaced:x,...v}=e,_=Sb(u0,r),[T,O]=P.useState(null),R=Xt(t,re=>O(re)),[F,B]=P.useState(null),H=c0(F),$=(H==null?void 0:H.width)??0,Z=(H==null?void 0:H.height)??0,ce=n+(s!=="center"?"-"+s:""),ne=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},de=Array.isArray(l)?l:[l],q=de.length>0,N={padding:ne,boundary:de.filter(jT),altBoundary:q},{refs:h,floatingStyles:d,placement:m,isPositioned:S,middlewareData:E}=bT({strategy:"fixed",placement:ce,whileElementsMounted:(...re)=>uT(...re,{animationFrame:y==="always"}),elements:{reference:_.anchor},middleware:[wT({mainAxis:i+Z,alignmentAxis:o}),c&&xT({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?ST():void 0,...N}),c&&_T({...N}),ET({...N,apply:({elements:re,rects:ee,availableWidth:Q,availableHeight:fe})=>{const{width:W,height:K}=ee.reference,te=re.floating.style;te.setProperty("--radix-popper-available-width",`${Q}px`),te.setProperty("--radix-popper-available-height",`${fe}px`),te.setProperty("--radix-popper-anchor-width",`${W}px`),te.setProperty("--radix-popper-anchor-height",`${K}px`)}}),F&&AT({element:F,padding:a}),NT({arrowWidth:$,arrowHeight:Z}),p&&CT({strategy:"referenceHidden",...N})]}),[M,j]=Ib(m),I=Rr(x);Li(()=>{S&&(I==null||I())},[S,I]);const g=(we=E.arrow)==null?void 0:we.x,b=(Oe=E.arrow)==null?void 0:Oe.y,k=((je=E.arrow)==null?void 0:je.centerOffset)!==0,[ve,he]=P.useState();return Li(()=>{T&&he(window.getComputedStyle(T).zIndex)},[T]),w.jsx("div",{ref:h.setFloating,"data-radix-popper-content-wrapper":"",style:{...d,transform:S?d.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(L=E.transformOrigin)==null?void 0:L.x,(z=E.transformOrigin)==null?void 0:z.y].join(" "),...((G=E.hide)==null?void 0:G.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(OT,{scope:r,placedSide:M,onArrowChange:B,arrowX:g,arrowY:b,shouldHideArrow:k,children:w.jsx(Zt.div,{"data-side":M,"data-align":j,...v,ref:R,style:{...v.style,animation:S?void 0:"none"}})})})});Ab.displayName=u0;var Tb="PopperArrow",RT={top:"bottom",right:"left",bottom:"top",left:"right"},Mb=P.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,s=PT(Tb,n),o=RT[s.placedSide];return w.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:w.jsx(MT,{...i,ref:r,style:{...i.style,display:"block"}})})});Mb.displayName=Tb;function jT(e){return e!==null}var NT=e=>({name:"transformOrigin",options:e,fn(t){var _,T,O;const{placement:r,rects:n,middlewareData:i}=t,o=((_=i.arrow)==null?void 0:_.centerOffset)!==0,a=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[l,u]=Ib(r),f={start:"0%",center:"50%",end:"100%"}[u],p=(((T=i.arrow)==null?void 0:T.x)??0)+a/2,y=(((O=i.arrow)==null?void 0:O.y)??0)+c/2;let x="",v="";return l==="bottom"?(x=o?f:`${p}px`,v=`${-c}px`):l==="top"?(x=o?f:`${p}px`,v=`${n.floating.height+c}px`):l==="right"?(x=`${-c}px`,v=o?f:`${y}px`):l==="left"&&(x=`${n.floating.width+c}px`,v=o?f:`${y}px`),{data:{x,y:v}}}});function Ib(e){const[t,r="center"]=e.split("-");return[t,r]}var Ob=_b,Pb=Cb,Rb=Ab,jb=Mb,kT="Portal",Nb=P.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[i,s]=P.useState(!1);Li(()=>s(!0),[]);const o=r||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?zn.createPortal(w.jsx(Zt.div,{...n,ref:t}),o):null});Nb.displayName=kT;function DT(e,t){return P.useReducer((r,n)=>t[r][n]??r,e)}var Un=e=>{const{present:t,children:r}=e,n=LT(t),i=typeof r=="function"?r({present:n.isPresent}):P.Children.only(r),s=Xt(n.ref,BT(i));return typeof r=="function"||n.isPresent?P.cloneElement(i,{ref:s}):null};Un.displayName="Presence";function LT(e){const[t,r]=P.useState(),n=P.useRef(null),i=P.useRef(e),s=P.useRef("none"),o=e?"mounted":"unmounted",[a,c]=DT(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const l=Dl(n.current);s.current=a==="mounted"?l:"none"},[a]),Li(()=>{const l=n.current,u=i.current;if(u!==e){const p=s.current,y=Dl(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]),Li(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,f=y=>{const v=Dl(n.current).includes(y.animationName);if(y.target===t&&v&&(c("ANIMATION_END"),!i.current)){const _=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=_)})}},p=y=>{y.target===t&&(s.current=Dl(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:P.useCallback(l=>{n.current=l?getComputedStyle(l):null,r(l)},[])}}function Dl(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)}var UT=P[" useInsertionEffect ".trim().toString()]||Li;function ka({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,s,o]=FT({defaultProp:t,onChange:r}),a=e!==void 0,c=a?e:i;{const u=P.useRef(e!==void 0);P.useEffect(()=>{const f=u.current;f!==a&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,n])}const l=P.useCallback(u=>{var f;if(a){const p=$T(u)?u(e):u;p!==e&&((f=o.current)==null||f.call(o,p))}else s(u)},[a,e,s,o]);return[c,l]}function FT({defaultProp:e,onChange:t}){const[r,n]=P.useState(e),i=P.useRef(r),s=P.useRef(t);return UT(()=>{s.current=t},[t]),P.useEffect(()=>{var o;i.current!==r&&((o=s.current)==null||o.call(s,r),i.current=r)},[r,i]),[r,n,s]}function $T(e){return typeof e=="function"}var VT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),zT="VisuallyHidden",kb=P.forwardRef((e,t)=>w.jsx(Zt.span,{...e,ref:t,style:{...VT,...e.style}}));kb.displayName=zT;var qT=kb,[Ll,WU]=Di("Tooltip",[kl]),d0=kl(),Db="TooltipProvider",HT=700,Lb="tooltip.open",[WT,Bb]=Ll(Db),Ub=e=>{const{__scopeTooltip:t,delayDuration:r=HT,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:s}=e,o=P.useRef(!0),a=P.useRef(!1),c=P.useRef(0);return P.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),w.jsx(WT,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:P.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:P.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:P.useCallback(l=>{a.current=l},[]),disableHoverableContent:i,children:s})};Ub.displayName=Db;var Fb="Tooltip",[GU,Bl]=Ll(Fb),f0="TooltipTrigger",GT=P.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=Bl(f0,r),s=Bb(f0,r),o=d0(r),a=P.useRef(null),c=Xt(t,a,i.onTriggerChange),l=P.useRef(!1),u=P.useRef(!1),f=P.useCallback(()=>l.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),w.jsx(Pb,{asChild:!0,...o,children:w.jsx(Zt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:c,onPointerMove:lt(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:lt(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:lt(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:lt(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:lt(e.onBlur,i.onClose),onClick:lt(e.onClick,i.onClose)})})});GT.displayName=f0;var KT="TooltipPortal",[KU,YT]=Ll(KT,{forceMount:void 0}),No="TooltipContent",JT=P.forwardRef((e,t)=>{const r=YT(No,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=e,o=Bl(No,e.__scopeTooltip);return w.jsx(Un,{present:n||o.open,children:o.disableHoverableContent?w.jsx($b,{side:i,...s,ref:t}):w.jsx(XT,{side:i,...s,ref:t})})}),XT=P.forwardRef((e,t)=>{const r=Bl(No,e.__scopeTooltip),n=Bb(No,e.__scopeTooltip),i=P.useRef(null),s=Xt(t,i),[o,a]=P.useState(null),{trigger:c,onClose:l}=r,u=i.current,{onPointerInTransitChange:f}=n,p=P.useCallback(()=>{a(null),f(!1)},[f]),y=P.useCallback((x,v)=>{const _=x.currentTarget,T={x:x.clientX,y:x.clientY},O=rM(T,_.getBoundingClientRect()),R=nM(T,O),F=iM(v.getBoundingClientRect()),B=oM([...R,...F]);a(B),f(!0)},[f]);return P.useEffect(()=>()=>p(),[p]),P.useEffect(()=>{if(c&&u){const x=_=>y(_,u),v=_=>y(_,c);return c.addEventListener("pointerleave",x),u.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",v)}}},[c,u,y,p]),P.useEffect(()=>{if(o){const x=v=>{const _=v.target,T={x:v.clientX,y:v.clientY},O=(c==null?void 0:c.contains(_))||(u==null?void 0:u.contains(_)),R=!sM(T,o);O?p():R&&(p(),l())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[c,u,o,l,p]),w.jsx($b,{...e,ref:s})}),[ZT,QT]=Ll(Fb,{isInside:!1}),eM=Jv("TooltipContent"),$b=P.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=e,c=Bl(No,r),l=d0(r),{onClose:u}=c;return P.useEffect(()=>(document.addEventListener(Lb,u),()=>document.removeEventListener(Lb,u)),[u]),P.useEffect(()=>{if(c.trigger){const f=p=>{const y=p.target;y!=null&&y.contains(c.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,u]),w.jsx(Yf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:w.jsxs(Rb,{"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(eM,{children:n}),w.jsx(ZT,{scope:r,isInside:!0,children:w.jsx(qT,{id:c.contentId,role:"tooltip",children:i||n})})]})})});JT.displayName=No;var Vb="TooltipArrow",tM=P.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=d0(r);return QT(Vb,r).isInside?null:w.jsx(jb,{...i,...n,ref:t})});tM.displayName=Vb;function rM(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function nM(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 iM(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 sM(e,t){const{x:r,y:n}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],c=t[o],l=a.x,u=a.y,f=c.x,p=c.y;u>n!=p>n&&r<(f-l)*(n-u)/(p-u)+l&&(i=!i)}return i}function oM(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),aM(t)}function aM(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 s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.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 s=r[r.length-1],o=r[r.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.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 cM=Ub,zb=P.createContext(void 0),lM=e=>{const{dir:t,children:r}=e;return w.jsx(zb.Provider,{value:t,children:r})};function h0(e){const t=P.useContext(zb);return e||t||"ltr"}const uM=["tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","brown","orange"],dM=["sky","mint","lime","yellow","amber"],fM=["gold","bronze"],hM=[...uM,...dM,...fM],pM=["gray",...["mauve","slate","sage","olive","sand"]];function mM(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 gM=["inherit","light","dark"],vM=[...hM,"gray"],bM=[...pM,"auto"],qr={hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:gM,default:"inherit"},accentColor:{type:"enum",values:vM,default:"indigo"},grayColor:{type:"enum",values:bM,default:"auto"},panelBackground:{type:"enum",values:["solid","translucent"],default:"translucent"},radius:{type:"enum",values:["none","small","medium","large","full"],default:"medium"},scaling:{type:"enum",values:["90%","95%","100%","105%","110%"],default:"100%"}};function qb(e){return e==="gray"?"gray":mM(e)}const ko=()=>{},Ul=P.createContext(void 0);function yM(){const e=P.useContext(Ul);if(e===void 0)throw new Error("`useThemeContext` must be used within a `Theme`");return e}const Fl=P.forwardRef((e,t)=>P.useContext(Ul)===void 0?P.createElement(cM,null,P.createElement(lM,{dir:"ltr"},P.createElement(Hb,{...e,ref:t}))):P.createElement(p0,{...e,ref:t}));Fl.displayName="Theme";const Hb=P.forwardRef((e,t)=>{const{appearance:r=qr.appearance.default,accentColor:n=qr.accentColor.default,grayColor:i=qr.grayColor.default,panelBackground:s=qr.panelBackground.default,radius:o=qr.radius.default,scaling:a=qr.scaling.default,hasBackground:c=qr.hasBackground.default,...l}=e,[u,f]=P.useState(r);P.useEffect(()=>f(r),[r]);const[p,y]=P.useState(n);P.useEffect(()=>y(n),[n]);const[x,v]=P.useState(i);P.useEffect(()=>v(i),[i]);const[_,T]=P.useState(s);P.useEffect(()=>T(s),[s]);const[O,R]=P.useState(o);P.useEffect(()=>R(o),[o]);const[F,B]=P.useState(a);P.useEffect(()=>B(a),[a]);const H=P.memo(({appearance:Z})=>P.createElement("script",{dangerouslySetInnerHTML:{__html:`!(function(){try{var d=document.documentElement,c=d.classList;c.remove('light','dark');d.style.colorScheme='${Z}';c.add('${Z}');}catch(e){}})();`}}),()=>!0);H.displayName="ExplicitRootAppearanceScript",P.useEffect(()=>wM(r),[r]);const $=x==="auto"?qb(p):x;return P.createElement(P.Fragment,null,u!=="inherit"&&P.createElement(H,{appearance:u}),c&&P.createElement("style",{dangerouslySetInnerHTML:{__html:`
|
|
66
66
|
:root, .light, .light-theme { --color-page-background: white; }
|
|
67
67
|
.dark, .dark-theme { --color-page-background: var(--${$}-1); }
|
|
68
68
|
body { background-color: var(--color-page-background); }
|
|
69
|
-
`}}),P.createElement(m0,{...l,ref:t,isRoot:!0,hasBackground:c,appearance:u,accentColor:p,grayColor:x,panelBackground:_,radius:O,scaling:F,onAppearanceChange:f,onAccentColorChange:y,onGrayColorChange:v,onPanelBackgroundChange:T,onRadiusChange:R,onScalingChange:B}))});Hb.displayName="ThemeRoot";const m0=P.forwardRef((e,t)=>{var r,n,i,s,o,a;const c=P.useContext(Ul),{asChild:l,isRoot:u,hasBackground:f,appearance:p=(r=c==null?void 0:c.appearance)!==null&&r!==void 0?r:qr.appearance.default,accentColor:y=(n=c==null?void 0:c.accentColor)!==null&&n!==void 0?n:qr.accentColor.default,grayColor:x=(i=c==null?void 0:c.resolvedGrayColor)!==null&&i!==void 0?i:qr.grayColor.default,panelBackground:v=(s=c==null?void 0:c.panelBackground)!==null&&s!==void 0?s:qr.panelBackground.default,radius:_=(o=c==null?void 0:c.radius)!==null&&o!==void 0?o:qr.radius.default,scaling:T=(a=c==null?void 0:c.scaling)!==null&&a!==void 0?a:qr.scaling.default,onAppearanceChange:O=ko,onAccentColorChange:R=ko,onGrayColorChange:F=ko,onPanelBackgroundChange:B=ko,onRadiusChange:H=ko,onScalingChange:$=ko,...Z}=e,ce=l?Kf:"div",ne=x==="auto"?qb(y):x,de=e.appearance!==void 0&&e.appearance!=="inherit",q=e.grayColor!==void 0,N=!u&&(f===!0||f!==!1&&(de||q));return P.createElement(Ul.Provider,{value:P.useMemo(()=>({appearance:p,accentColor:y,grayColor:x,resolvedGrayColor:ne,panelBackground:v,radius:_,scaling:T,onAppearanceChange:O,onAccentColorChange:R,onGrayColorChange:F,onPanelBackgroundChange:B,onRadiusChange:H,onScalingChange:$}),[p,y,x,ne,v,_,T,O,R,F,B,H,$])},P.createElement(ce,{"data-is-root-theme":u?"true":"false","data-accent-color":y,"data-gray-color":ne,"data-has-background":N?"true":"false","data-panel-background":v,"data-radius":_,"data-scaling":T,ref:t,...Z,className:or("radix-themes",{light:!u&&p==="light",dark:!u&&p==="dark"},Z.className)}))});m0.displayName="ThemeImpl";function xM(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 ka={type:"enum",values:qr.accentColor.values,default:void 0},$l={type:"boolean",default:void 0};function Qr(e,t="",r){var n,i,s,o;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("-"),f=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,v=c==="initial"?`${p}${f}${x}`:`${c}:${p}${f}${x}`;a.push(v)}}if(typeof e=="string"){const c=e.startsWith("-"),l=t===""?"":"-",u=c?`-${t}`:t,f=c?e.substring(1):e,p=(s=r==null?void 0:r[f])!==null&&s!==void 0?s:f;a.push(`${u}${l}${p}`)}if(typeof e=="boolean"){const c=t===""?"":"-",l=e.toString(),u=(o=r==null?void 0:r[l])!==null&&o!==void 0?o:l;a.push(`${t}${c}${u}`)}return a.join(" ")}const Ws=["auto","0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],Gs={m:{type:"enum",values:Ws,default:void 0,responsive:!0},mx:{type:"enum",values:Ws,default:void 0,responsive:!0},my:{type:"enum",values:Ws,default:void 0,responsive:!0},mt:{type:"enum",values:Ws,default:void 0,responsive:!0},mr:{type:"enum",values:Ws,default:void 0,responsive:!0},mb:{type:"enum",values:Ws,default:void 0,responsive:!0},ml:{type:"enum",values:Ws,default:void 0,responsive:!0}};function Da(e){const{m:t=Gs.m.default,mx:r=Gs.mx.default,my:n=Gs.my.default,mt:i=Gs.mt.default,mr:s=Gs.mr.default,mb:o=Gs.mb.default,ml:a=Gs.ml.default,...c}=e;return{m:t,mx:r,my:n,mt:i,mr:s,mb:o,ml:a,rest:c}}function La(e){return[Qr(e.m,"rt-r-m"),Qr(e.mx,"rt-r-mx"),Qr(e.my,"rt-r-my"),Qr(e.mt,"rt-r-mt"),Qr(e.mr,"rt-r-mr"),Qr(e.mb,"rt-r-mb"),Qr(e.ml,"rt-r-ml")].filter(Boolean).join(" ")}const g0={type:"enum",values:qr.radius.values,default:void 0};function Wb(e){const t=P.useRef({value:e,previous:e});return P.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Vl="Checkbox",[SM,tF]=Di(Vl),[_M,v0]=SM(Vl);function EM(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:i,disabled:s,form:o,name:a,onCheckedChange:c,required:l,value:u="on",internal_do_not_use_render:f}=e,[p,y]=Na({prop:r,defaultProp:i??!1,onChange:c,caller:Vl}),[x,v]=P.useState(null),[_,T]=P.useState(null),O=P.useRef(!1),R=x?!!o||!!x.closest("form"):!0,F={checked:p,disabled:s,setChecked:y,control:x,setControl:v,name:a,form:o,value:u,hasConsumerStoppedPropagationRef:O,required:l,defaultChecked:gs(i)?!1:i,isFormControl:R,bubbleInput:_,setBubbleInput:T};return w.jsx(_M,{scope:t,...F,children:CM(f)?f(F):n})}var Gb="CheckboxTrigger",Kb=P.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},i)=>{const{control:s,value:o,disabled:a,checked:c,required:l,setControl:u,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:y,bubbleInput:x}=v0(Gb,e),v=Xt(i,u),_=P.useRef(c);return P.useEffect(()=>{const T=s==null?void 0:s.form;if(T){const O=()=>f(_.current);return T.addEventListener("reset",O),()=>T.removeEventListener("reset",O)}},[s,f]),w.jsx(Zt.button,{type:"button",role:"checkbox","aria-checked":gs(c)?"mixed":c,"aria-required":l,"data-state":e2(c),"data-disabled":a?"":void 0,disabled:a,value:o,...n,ref:v,onKeyDown:lt(t,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:lt(r,T=>{f(O=>gs(O)?!0:!O),x&&y&&(p.current=T.isPropagationStopped(),p.current||T.stopPropagation())})})});Kb.displayName=Gb;var Yb=P.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c,onCheckedChange:l,form:u,...f}=e;return w.jsx(EM,{__scopeCheckbox:r,checked:i,defaultChecked:s,disabled:a,required:o,onCheckedChange:l,name:n,form:u,value:c,internal_do_not_use_render:({isFormControl:p})=>w.jsxs(w.Fragment,{children:[w.jsx(Kb,{...f,ref:t,__scopeCheckbox:r}),p&&w.jsx(Qb,{__scopeCheckbox:r})]})})});Yb.displayName=Vl;var Jb="CheckboxIndicator",Xb=P.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...i}=e,s=v0(Jb,r);return w.jsx(Un,{present:n||gs(s.checked)||s.checked===!0,children:w.jsx(Zt.span,{"data-state":e2(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});Xb.displayName=Jb;var Zb="CheckboxBubbleInput",Qb=P.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:o,required:a,disabled:c,name:l,value:u,form:f,bubbleInput:p,setBubbleInput:y}=v0(Zb,e),x=Xt(r,y),v=Wb(s),_=l0(n);P.useEffect(()=>{const O=p;if(!O)return;const R=window.HTMLInputElement.prototype,B=Object.getOwnPropertyDescriptor(R,"checked").set,H=!i.current;if(v!==s&&B){const $=new Event("click",{bubbles:H});O.indeterminate=gs(s),B.call(O,gs(s)?!1:s),O.dispatchEvent($)}},[p,v,s,i]);const T=P.useRef(gs(s)?!1:s);return w.jsx(Zt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??T.current,required:a,disabled:c,name:l,value:u,form:f,...t,tabIndex:-1,ref:x,style:{...t.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Qb.displayName=Zb;function CM(e){return typeof e=="function"}function gs(e){return e==="indeterminate"}function e2(e){return gs(e)?"indeterminate":e?"checked":"unchecked"}const zl={size:{type:"enum",values:["1","2","3"],default:"2",responsive:!0},variant:{type:"enum",values:["classic","surface","soft"],default:"surface"},color:ka,highContrast:$l},ql=P.forwardRef(({color:e="currentColor",...t},r)=>P.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},P.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"})));ql.displayName="ThickCheckIcon";const AM=P.forwardRef(({color:e="currentColor",...t},r)=>P.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},P.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"})));AM.displayName="ChevronDownIcon";const t2=P.forwardRef(({color:e="currentColor",...t},r)=>P.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},P.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"})));t2.displayName="ThickChevronRightIcon";const TM=P.forwardRef(({color:e="currentColor",...t},r)=>P.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,ref:r},P.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"})));TM.displayName="InfoCircledIcon";const Hl=P.forwardRef((e,t)=>{const{rest:r,...n}=Da(e),{className:i,style:s,size:o=zl.size.default,variant:a=zl.variant.default,color:c=zl.color.default,highContrast:l=zl.highContrast.default,...u}=r;return P.createElement("span",{className:or("rt-CheckboxRoot",i,Qr(o,"rt-r-size"),La(n)),style:s},P.createElement(Yb,{"data-accent-color":c,...u,ref:t,className:or("rt-reset","rt-CheckboxButton",`rt-variant-${a}`,{"rt-high-contrast":l})},P.createElement(Xb,{className:"rt-CheckboxIndicator"},P.createElement(ql,{className:"rt-CheckboxIndicatorIcon"}))))});Hl.displayName="Checkbox";function r2(e){const t=e+"CollectionProvider",[r,n]=Di(t),[i,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=v=>{const{scope:_,children:T}=v,O=le.useRef(null),R=le.useRef(new Map).current;return w.jsx(i,{scope:_,itemMap:R,collectionRef:O,children:T})};o.displayName=t;const a=e+"CollectionSlot",c=Ia(a),l=le.forwardRef((v,_)=>{const{scope:T,children:O}=v,R=s(a,T),F=Xt(_,R.collectionRef);return w.jsx(c,{ref:F,children:O})});l.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",p=Ia(u),y=le.forwardRef((v,_)=>{const{scope:T,children:O,...R}=v,F=le.useRef(null),B=Xt(_,F),H=s(u,T);return le.useEffect(()=>(H.itemMap.set(F,{ref:F,...R}),()=>void H.itemMap.delete(F))),w.jsx(p,{[f]:"",ref:B,children:O})});y.displayName=u;function x(v){const _=s(e+"CollectionConsumer",v);return le.useCallback(()=>{const O=_.collectionRef.current;if(!O)return[];const R=Array.from(O.querySelectorAll(`[${f}]`));return Array.from(_.itemMap.values()).sort((H,$)=>R.indexOf(H.ref.current)-R.indexOf($.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:o,Slot:l,ItemSlot:y},x,n]}var b0="rovingFocusGroup.onEntryFocus",MM={bubbles:!1,cancelable:!0},Ba="RovingFocusGroup",[y0,n2,IM]=r2(Ba),[OM,i2]=Di(Ba,[IM]),[PM,RM]=OM(Ba),s2=P.forwardRef((e,t)=>w.jsx(y0.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(y0.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(jM,{...e,ref:t})})}));s2.displayName=Ba;var jM=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...f}=e,p=P.useRef(null),y=Xt(t,p),x=p0(s),[v,_]=Na({prop:o,defaultProp:a??null,onChange:c,caller:Ba}),[T,O]=P.useState(!1),R=Rr(l),F=n2(r),B=P.useRef(!1),[H,$]=P.useState(0);return P.useEffect(()=>{const Z=p.current;if(Z)return Z.addEventListener(b0,R),()=>Z.removeEventListener(b0,R)},[R]),w.jsx(PM,{scope:r,orientation:n,dir:x,loop:i,currentTabStopId:v,onItemFocus:P.useCallback(Z=>_(Z),[_]),onItemShiftTab:P.useCallback(()=>O(!0),[]),onFocusableItemAdd:P.useCallback(()=>$(Z=>Z+1),[]),onFocusableItemRemove:P.useCallback(()=>$(Z=>Z-1),[]),children:w.jsx(Zt.div,{tabIndex:T||H===0?-1:0,"data-orientation":n,...f,ref:y,style:{outline:"none",...e.style},onMouseDown:lt(e.onMouseDown,()=>{B.current=!0}),onFocus:lt(e.onFocus,Z=>{const ce=!B.current;if(Z.target===Z.currentTarget&&ce&&!T){const ne=new CustomEvent(b0,MM);if(Z.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const de=F().filter(m=>m.focusable),q=de.find(m=>m.active),N=de.find(m=>m.id===v),d=[q,N,...de].filter(Boolean).map(m=>m.ref.current);c2(d,u)}}B.current=!1}),onBlur:lt(e.onBlur,()=>O(!1))})})}),o2="RovingFocusGroupItem",a2=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,children:o,...a}=e,c=Oa(),l=s||c,u=RM(o2,r),f=u.currentTabStopId===l,p=n2(r),{onFocusableItemAdd:y,onFocusableItemRemove:x,currentTabStopId:v}=u;return P.useEffect(()=>{if(n)return y(),()=>x()},[n,y,x]),w.jsx(y0.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:w.jsx(Zt.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:lt(e.onMouseDown,_=>{n?u.onItemFocus(l):_.preventDefault()}),onFocus:lt(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:lt(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){u.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const T=DM(_,u.orientation,u.dir);if(T!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let R=p().filter(F=>F.focusable).map(F=>F.ref.current);if(T==="last")R.reverse();else if(T==="prev"||T==="next"){T==="prev"&&R.reverse();const F=R.indexOf(_.currentTarget);R=u.loop?LM(R,F+1):R.slice(F+1)}setTimeout(()=>c2(R))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:v!=null}):o})})});a2.displayName=o2;var NM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function DM(e,t,r){const n=kM(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return NM[n]}function c2(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function LM(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var BM=s2,UM=a2;function FM(e,[t,r]){return Math.min(r,Math.max(t,e))}var w0=0;function $M(){P.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??l2()),document.body.insertAdjacentElement("beforeend",e[1]??l2()),w0++,()=>{w0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),w0--}},[])}function l2(){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 x0="focusScope.autoFocusOnMount",S0="focusScope.autoFocusOnUnmount",u2={bubbles:!1,cancelable:!0},VM="FocusScope",d2=P.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,c]=P.useState(null),l=Rr(i),u=Rr(s),f=P.useRef(null),p=Xt(t,v=>c(v)),y=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(n){let v=function(R){if(y.paused||!a)return;const F=R.target;a.contains(F)?f.current=F:vs(f.current,{select:!0})},_=function(R){if(y.paused||!a)return;const F=R.relatedTarget;F!==null&&(a.contains(F)||vs(f.current,{select:!0}))},T=function(R){if(document.activeElement===document.body)for(const B of R)B.removedNodes.length>0&&vs(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",_);const O=new MutationObserver(T);return a&&O.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",_),O.disconnect()}}},[n,a,y.paused]),P.useEffect(()=>{if(a){p2.add(y);const v=document.activeElement;if(!a.contains(v)){const T=new CustomEvent(x0,u2);a.addEventListener(x0,l),a.dispatchEvent(T),T.defaultPrevented||(zM(KM(f2(a)),{select:!0}),document.activeElement===v&&vs(a))}return()=>{a.removeEventListener(x0,l),setTimeout(()=>{const T=new CustomEvent(S0,u2);a.addEventListener(S0,u),a.dispatchEvent(T),T.defaultPrevented||vs(v??document.body,{select:!0}),a.removeEventListener(S0,u),p2.remove(y)},0)}}},[a,l,u,y]);const x=P.useCallback(v=>{if(!r&&!n||y.paused)return;const _=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,T=document.activeElement;if(_&&T){const O=v.currentTarget,[R,F]=qM(O);R&&F?!v.shiftKey&&T===F?(v.preventDefault(),r&&vs(R,{select:!0})):v.shiftKey&&T===R&&(v.preventDefault(),r&&vs(F,{select:!0})):T===O&&v.preventDefault()}},[r,n,y.paused]);return w.jsx(Zt.div,{tabIndex:-1,...o,ref:p,onKeyDown:x})});d2.displayName=VM;function zM(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(vs(n,{select:t}),document.activeElement!==r)return}function qM(e){const t=f2(e),r=h2(t,e),n=h2(t.reverse(),e);return[r,n]}function f2(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 h2(e,t){for(const r of e)if(!HM(r,{upTo:t}))return r}function HM(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 WM(e){return e instanceof HTMLInputElement&&"select"in e}function vs(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&WM(e)&&t&&e.select()}}var p2=GM();function GM(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=m2(e,t),e.unshift(t)},remove(t){var r;e=m2(e,t),(r=e[0])==null||r.resume()}}}function m2(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function KM(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},Do=new WeakMap,Wl=new WeakMap,Gl={},_0=0,g2=function(e){return e&&(e.host||g2(e.parentNode))},JM=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=g2(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=JM(t,Array.isArray(e)?e:[e]);Gl[r]||(Gl[r]=new WeakMap);var s=Gl[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))u(p);else try{var y=p.getAttribute(n),x=y!==null&&y!=="false",v=(Do.get(p)||0)+1,_=(s.get(p)||0)+1;Do.set(p,v),s.set(p,_),o.push(p),v===1&&x&&Wl.set(p,!0),_===1&&p.setAttribute(r,"true"),x||p.setAttribute(n,"true")}catch(T){console.error("aria-hidden: cannot operate on ",p,T)}})};return u(t),a.clear(),_0++,function(){o.forEach(function(f){var p=Do.get(f)-1,y=s.get(f)-1;Do.set(f,p),s.set(f,y),p||(Wl.has(f)||f.removeAttribute(n),Wl.delete(f)),y||f.removeAttribute(r)}),_0--,_0||(Do=new WeakMap,Do=new WeakMap,Wl=new WeakMap,Gl={})}},ZM=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}},ui=function(){return ui=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},ui.apply(this,arguments)};function v2(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 QM(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Kl="right-scroll-bar-position",Yl="width-before-scroll-bar",eI="with-scroll-bars-hidden",tI="--removed-body-scroll-bar-size";function E0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function rI(e,t){var r=le.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 nI=typeof window<"u"?P.useLayoutEffect:P.useEffect,b2=new WeakMap;function iI(e,t){var r=rI(t||null,function(n){return e.forEach(function(i){return E0(i,n)})});return nI(function(){var n=b2.get(r);if(n){var i=new Set(n),s=new Set(e),o=r.current;i.forEach(function(a){s.has(a)||E0(a,null)}),s.forEach(function(a){i.has(a)||E0(a,o)})}b2.set(r,e)},[e]),r}function sI(e){return e}function oI(e,t){t===void 0&&(t=sI);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(s){var o=t(s,n);return r.push(o),function(){r=r.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(n=!0;r.length;){var o=r;r=[],o.forEach(s)}r={push:function(a){return s(a)},filter:function(){return r}}},assignMedium:function(s){n=!0;var o=[];if(r.length){var a=r;r=[],a.forEach(s),o=r}var c=function(){var u=o;o=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),r}}}};return i}function aI(e){e===void 0&&(e={});var t=oI(null);return t.options=ui({async:!0,ssr:!1},e),t}var y2=function(e){var t=e.sideCar,r=v2(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 P.createElement(n,ui({},r))};y2.isSideCarExport=!0;function cI(e,t){return e.useMedium(t),y2}var w2=aI(),C0=function(){},Jl=P.forwardRef(function(e,t){var r=P.useRef(null),n=P.useState({onScrollCapture:C0,onWheelCapture:C0,onTouchMoveCapture:C0}),i=n[0],s=n[1],o=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,y=e.noIsolation,x=e.inert,v=e.allowPinchZoom,_=e.as,T=_===void 0?"div":_,O=e.gapMode,R=v2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),F=p,B=iI([r,t]),H=ui(ui({},R),i);return P.createElement(P.Fragment,null,u&&P.createElement(F,{sideCar:w2,removeScrollBar:l,shards:f,noIsolation:y,inert:x,setCallbacks:s,allowPinchZoom:!!v,lockRef:r,gapMode:O}),o?P.cloneElement(P.Children.only(a),ui(ui({},H),{ref:B})):P.createElement(T,ui({},H,{className:c,ref:B}),a))});Jl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jl.classNames={fullWidth:Yl,zeroRight:Kl};var x2,lI=function(){if(x2)return x2;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function uI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=lI();return t&&e.setAttribute("nonce",t),e}function dI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hI=function(){var e=0,t=null;return{add:function(r){e==0&&(t=uI())&&(dI(t,r),fI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pI=function(){var e=hI();return function(t,r){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},S2=function(){var e=pI(),t=function(r){var n=r.styles,i=r.dynamic;return e(n,i),null};return t},mI={left:0,top:0,right:0,gap:0},A0=function(e){return parseInt(e||"",10)||0},gI=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[A0(r),A0(n),A0(i)]},vI=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return mI;var t=gI(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])}},bI=S2(),Lo="data-scroll-locked",yI=function(e,t,r,n){var i=e.left,s=e.top,o=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
70
|
-
.`.concat(
|
|
69
|
+
`}}),P.createElement(p0,{...l,ref:t,isRoot:!0,hasBackground:c,appearance:u,accentColor:p,grayColor:x,panelBackground:_,radius:O,scaling:F,onAppearanceChange:f,onAccentColorChange:y,onGrayColorChange:v,onPanelBackgroundChange:T,onRadiusChange:R,onScalingChange:B}))});Hb.displayName="ThemeRoot";const p0=P.forwardRef((e,t)=>{var r,n,i,s,o,a;const c=P.useContext(Ul),{asChild:l,isRoot:u,hasBackground:f,appearance:p=(r=c==null?void 0:c.appearance)!==null&&r!==void 0?r:qr.appearance.default,accentColor:y=(n=c==null?void 0:c.accentColor)!==null&&n!==void 0?n:qr.accentColor.default,grayColor:x=(i=c==null?void 0:c.resolvedGrayColor)!==null&&i!==void 0?i:qr.grayColor.default,panelBackground:v=(s=c==null?void 0:c.panelBackground)!==null&&s!==void 0?s:qr.panelBackground.default,radius:_=(o=c==null?void 0:c.radius)!==null&&o!==void 0?o:qr.radius.default,scaling:T=(a=c==null?void 0:c.scaling)!==null&&a!==void 0?a:qr.scaling.default,onAppearanceChange:O=ko,onAccentColorChange:R=ko,onGrayColorChange:F=ko,onPanelBackgroundChange:B=ko,onRadiusChange:H=ko,onScalingChange:$=ko,...Z}=e,ce=l?Gf:"div",ne=x==="auto"?qb(y):x,de=e.appearance!==void 0&&e.appearance!=="inherit",q=e.grayColor!==void 0,N=!u&&(f===!0||f!==!1&&(de||q));return P.createElement(Ul.Provider,{value:P.useMemo(()=>({appearance:p,accentColor:y,grayColor:x,resolvedGrayColor:ne,panelBackground:v,radius:_,scaling:T,onAppearanceChange:O,onAccentColorChange:R,onGrayColorChange:F,onPanelBackgroundChange:B,onRadiusChange:H,onScalingChange:$}),[p,y,x,ne,v,_,T,O,R,F,B,H,$])},P.createElement(ce,{"data-is-root-theme":u?"true":"false","data-accent-color":y,"data-gray-color":ne,"data-has-background":N?"true":"false","data-panel-background":v,"data-radius":_,"data-scaling":T,ref:t,...Z,className:or("radix-themes",{light:!u&&p==="light",dark:!u&&p==="dark"},Z.className)}))});p0.displayName="ThemeImpl";function wM(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 Da={type:"enum",values:qr.accentColor.values,default:void 0},$l={type:"boolean",default:void 0};function Qr(e,t="",r){var n,i,s,o;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("-"),f=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,v=c==="initial"?`${p}${f}${x}`:`${c}:${p}${f}${x}`;a.push(v)}}if(typeof e=="string"){const c=e.startsWith("-"),l=t===""?"":"-",u=c?`-${t}`:t,f=c?e.substring(1):e,p=(s=r==null?void 0:r[f])!==null&&s!==void 0?s:f;a.push(`${u}${l}${p}`)}if(typeof e=="boolean"){const c=t===""?"":"-",l=e.toString(),u=(o=r==null?void 0:r[l])!==null&&o!==void 0?o:l;a.push(`${t}${c}${u}`)}return a.join(" ")}const Ws=["auto","0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],Gs={m:{type:"enum",values:Ws,default:void 0,responsive:!0},mx:{type:"enum",values:Ws,default:void 0,responsive:!0},my:{type:"enum",values:Ws,default:void 0,responsive:!0},mt:{type:"enum",values:Ws,default:void 0,responsive:!0},mr:{type:"enum",values:Ws,default:void 0,responsive:!0},mb:{type:"enum",values:Ws,default:void 0,responsive:!0},ml:{type:"enum",values:Ws,default:void 0,responsive:!0}};function La(e){const{m:t=Gs.m.default,mx:r=Gs.mx.default,my:n=Gs.my.default,mt:i=Gs.mt.default,mr:s=Gs.mr.default,mb:o=Gs.mb.default,ml:a=Gs.ml.default,...c}=e;return{m:t,mx:r,my:n,mt:i,mr:s,mb:o,ml:a,rest:c}}function Ba(e){return[Qr(e.m,"rt-r-m"),Qr(e.mx,"rt-r-mx"),Qr(e.my,"rt-r-my"),Qr(e.mt,"rt-r-mt"),Qr(e.mr,"rt-r-mr"),Qr(e.mb,"rt-r-mb"),Qr(e.ml,"rt-r-ml")].filter(Boolean).join(" ")}const m0={type:"enum",values:qr.radius.values,default:void 0};function Wb(e){const t=P.useRef({value:e,previous:e});return P.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Vl="Checkbox",[xM,eF]=Di(Vl),[SM,g0]=xM(Vl);function _M(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:i,disabled:s,form:o,name:a,onCheckedChange:c,required:l,value:u="on",internal_do_not_use_render:f}=e,[p,y]=ka({prop:r,defaultProp:i??!1,onChange:c,caller:Vl}),[x,v]=P.useState(null),[_,T]=P.useState(null),O=P.useRef(!1),R=x?!!o||!!x.closest("form"):!0,F={checked:p,disabled:s,setChecked:y,control:x,setControl:v,name:a,form:o,value:u,hasConsumerStoppedPropagationRef:O,required:l,defaultChecked:vs(i)?!1:i,isFormControl:R,bubbleInput:_,setBubbleInput:T};return w.jsx(SM,{scope:t,...F,children:EM(f)?f(F):n})}var Gb="CheckboxTrigger",Kb=P.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},i)=>{const{control:s,value:o,disabled:a,checked:c,required:l,setControl:u,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:y,bubbleInput:x}=g0(Gb,e),v=Xt(i,u),_=P.useRef(c);return P.useEffect(()=>{const T=s==null?void 0:s.form;if(T){const O=()=>f(_.current);return T.addEventListener("reset",O),()=>T.removeEventListener("reset",O)}},[s,f]),w.jsx(Zt.button,{type:"button",role:"checkbox","aria-checked":vs(c)?"mixed":c,"aria-required":l,"data-state":e2(c),"data-disabled":a?"":void 0,disabled:a,value:o,...n,ref:v,onKeyDown:lt(t,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:lt(r,T=>{f(O=>vs(O)?!0:!O),x&&y&&(p.current=T.isPropagationStopped(),p.current||T.stopPropagation())})})});Kb.displayName=Gb;var Yb=P.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c,onCheckedChange:l,form:u,...f}=e;return w.jsx(_M,{__scopeCheckbox:r,checked:i,defaultChecked:s,disabled:a,required:o,onCheckedChange:l,name:n,form:u,value:c,internal_do_not_use_render:({isFormControl:p})=>w.jsxs(w.Fragment,{children:[w.jsx(Kb,{...f,ref:t,__scopeCheckbox:r}),p&&w.jsx(Qb,{__scopeCheckbox:r})]})})});Yb.displayName=Vl;var Jb="CheckboxIndicator",Xb=P.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...i}=e,s=g0(Jb,r);return w.jsx(Un,{present:n||vs(s.checked)||s.checked===!0,children:w.jsx(Zt.span,{"data-state":e2(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});Xb.displayName=Jb;var Zb="CheckboxBubbleInput",Qb=P.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:o,required:a,disabled:c,name:l,value:u,form:f,bubbleInput:p,setBubbleInput:y}=g0(Zb,e),x=Xt(r,y),v=Wb(s),_=c0(n);P.useEffect(()=>{const O=p;if(!O)return;const R=window.HTMLInputElement.prototype,B=Object.getOwnPropertyDescriptor(R,"checked").set,H=!i.current;if(v!==s&&B){const $=new Event("click",{bubbles:H});O.indeterminate=vs(s),B.call(O,vs(s)?!1:s),O.dispatchEvent($)}},[p,v,s,i]);const T=P.useRef(vs(s)?!1:s);return w.jsx(Zt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??T.current,required:a,disabled:c,name:l,value:u,form:f,...t,tabIndex:-1,ref:x,style:{...t.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Qb.displayName=Zb;function EM(e){return typeof e=="function"}function vs(e){return e==="indeterminate"}function e2(e){return vs(e)?"indeterminate":e?"checked":"unchecked"}const zl={size:{type:"enum",values:["1","2","3"],default:"2",responsive:!0},variant:{type:"enum",values:["classic","surface","soft"],default:"surface"},color:Da,highContrast:$l},ql=P.forwardRef(({color:e="currentColor",...t},r)=>P.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},P.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"})));ql.displayName="ThickCheckIcon";const CM=P.forwardRef(({color:e="currentColor",...t},r)=>P.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},P.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"})));CM.displayName="ChevronDownIcon";const t2=P.forwardRef(({color:e="currentColor",...t},r)=>P.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:e,xmlns:"http://www.w3.org/2000/svg",...t,ref:r},P.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"})));t2.displayName="ThickChevronRightIcon";const AM=P.forwardRef(({color:e="currentColor",...t},r)=>P.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,ref:r},P.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"})));AM.displayName="InfoCircledIcon";const Hl=P.forwardRef((e,t)=>{const{rest:r,...n}=La(e),{className:i,style:s,size:o=zl.size.default,variant:a=zl.variant.default,color:c=zl.color.default,highContrast:l=zl.highContrast.default,...u}=r;return P.createElement("span",{className:or("rt-CheckboxRoot",i,Qr(o,"rt-r-size"),Ba(n)),style:s},P.createElement(Yb,{"data-accent-color":c,...u,ref:t,className:or("rt-reset","rt-CheckboxButton",`rt-variant-${a}`,{"rt-high-contrast":l})},P.createElement(Xb,{className:"rt-CheckboxIndicator"},P.createElement(ql,{className:"rt-CheckboxIndicatorIcon"}))))});Hl.displayName="Checkbox";function r2(e){const t=e+"CollectionProvider",[r,n]=Di(t),[i,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=v=>{const{scope:_,children:T}=v,O=le.useRef(null),R=le.useRef(new Map).current;return w.jsx(i,{scope:_,itemMap:R,collectionRef:O,children:T})};o.displayName=t;const a=e+"CollectionSlot",c=Oa(a),l=le.forwardRef((v,_)=>{const{scope:T,children:O}=v,R=s(a,T),F=Xt(_,R.collectionRef);return w.jsx(c,{ref:F,children:O})});l.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",p=Oa(u),y=le.forwardRef((v,_)=>{const{scope:T,children:O,...R}=v,F=le.useRef(null),B=Xt(_,F),H=s(u,T);return le.useEffect(()=>(H.itemMap.set(F,{ref:F,...R}),()=>void H.itemMap.delete(F))),w.jsx(p,{[f]:"",ref:B,children:O})});y.displayName=u;function x(v){const _=s(e+"CollectionConsumer",v);return le.useCallback(()=>{const O=_.collectionRef.current;if(!O)return[];const R=Array.from(O.querySelectorAll(`[${f}]`));return Array.from(_.itemMap.values()).sort((H,$)=>R.indexOf(H.ref.current)-R.indexOf($.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:o,Slot:l,ItemSlot:y},x,n]}var v0="rovingFocusGroup.onEntryFocus",TM={bubbles:!1,cancelable:!0},Ua="RovingFocusGroup",[b0,n2,MM]=r2(Ua),[IM,i2]=Di(Ua,[MM]),[OM,PM]=IM(Ua),s2=P.forwardRef((e,t)=>w.jsx(b0.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(b0.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(RM,{...e,ref:t})})}));s2.displayName=Ua;var RM=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...f}=e,p=P.useRef(null),y=Xt(t,p),x=h0(s),[v,_]=ka({prop:o,defaultProp:a??null,onChange:c,caller:Ua}),[T,O]=P.useState(!1),R=Rr(l),F=n2(r),B=P.useRef(!1),[H,$]=P.useState(0);return P.useEffect(()=>{const Z=p.current;if(Z)return Z.addEventListener(v0,R),()=>Z.removeEventListener(v0,R)},[R]),w.jsx(OM,{scope:r,orientation:n,dir:x,loop:i,currentTabStopId:v,onItemFocus:P.useCallback(Z=>_(Z),[_]),onItemShiftTab:P.useCallback(()=>O(!0),[]),onFocusableItemAdd:P.useCallback(()=>$(Z=>Z+1),[]),onFocusableItemRemove:P.useCallback(()=>$(Z=>Z-1),[]),children:w.jsx(Zt.div,{tabIndex:T||H===0?-1:0,"data-orientation":n,...f,ref:y,style:{outline:"none",...e.style},onMouseDown:lt(e.onMouseDown,()=>{B.current=!0}),onFocus:lt(e.onFocus,Z=>{const ce=!B.current;if(Z.target===Z.currentTarget&&ce&&!T){const ne=new CustomEvent(v0,TM);if(Z.currentTarget.dispatchEvent(ne),!ne.defaultPrevented){const de=F().filter(m=>m.focusable),q=de.find(m=>m.active),N=de.find(m=>m.id===v),d=[q,N,...de].filter(Boolean).map(m=>m.ref.current);c2(d,u)}}B.current=!1}),onBlur:lt(e.onBlur,()=>O(!1))})})}),o2="RovingFocusGroupItem",a2=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,children:o,...a}=e,c=Pa(),l=s||c,u=PM(o2,r),f=u.currentTabStopId===l,p=n2(r),{onFocusableItemAdd:y,onFocusableItemRemove:x,currentTabStopId:v}=u;return P.useEffect(()=>{if(n)return y(),()=>x()},[n,y,x]),w.jsx(b0.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:w.jsx(Zt.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:lt(e.onMouseDown,_=>{n?u.onItemFocus(l):_.preventDefault()}),onFocus:lt(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:lt(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){u.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const T=kM(_,u.orientation,u.dir);if(T!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let R=p().filter(F=>F.focusable).map(F=>F.ref.current);if(T==="last")R.reverse();else if(T==="prev"||T==="next"){T==="prev"&&R.reverse();const F=R.indexOf(_.currentTarget);R=u.loop?DM(R,F+1):R.slice(F+1)}setTimeout(()=>c2(R))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:v!=null}):o})})});a2.displayName=o2;var jM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function NM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function kM(e,t,r){const n=NM(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return jM[n]}function c2(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function DM(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var LM=s2,BM=a2;function UM(e,[t,r]){return Math.min(r,Math.max(t,e))}var y0=0;function FM(){P.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??l2()),document.body.insertAdjacentElement("beforeend",e[1]??l2()),y0++,()=>{y0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),y0--}},[])}function l2(){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 w0="focusScope.autoFocusOnMount",x0="focusScope.autoFocusOnUnmount",u2={bubbles:!1,cancelable:!0},$M="FocusScope",d2=P.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,c]=P.useState(null),l=Rr(i),u=Rr(s),f=P.useRef(null),p=Xt(t,v=>c(v)),y=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(n){let v=function(R){if(y.paused||!a)return;const F=R.target;a.contains(F)?f.current=F:bs(f.current,{select:!0})},_=function(R){if(y.paused||!a)return;const F=R.relatedTarget;F!==null&&(a.contains(F)||bs(f.current,{select:!0}))},T=function(R){if(document.activeElement===document.body)for(const B of R)B.removedNodes.length>0&&bs(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",_);const O=new MutationObserver(T);return a&&O.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",_),O.disconnect()}}},[n,a,y.paused]),P.useEffect(()=>{if(a){p2.add(y);const v=document.activeElement;if(!a.contains(v)){const T=new CustomEvent(w0,u2);a.addEventListener(w0,l),a.dispatchEvent(T),T.defaultPrevented||(VM(GM(f2(a)),{select:!0}),document.activeElement===v&&bs(a))}return()=>{a.removeEventListener(w0,l),setTimeout(()=>{const T=new CustomEvent(x0,u2);a.addEventListener(x0,u),a.dispatchEvent(T),T.defaultPrevented||bs(v??document.body,{select:!0}),a.removeEventListener(x0,u),p2.remove(y)},0)}}},[a,l,u,y]);const x=P.useCallback(v=>{if(!r&&!n||y.paused)return;const _=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,T=document.activeElement;if(_&&T){const O=v.currentTarget,[R,F]=zM(O);R&&F?!v.shiftKey&&T===F?(v.preventDefault(),r&&bs(R,{select:!0})):v.shiftKey&&T===R&&(v.preventDefault(),r&&bs(F,{select:!0})):T===O&&v.preventDefault()}},[r,n,y.paused]);return w.jsx(Zt.div,{tabIndex:-1,...o,ref:p,onKeyDown:x})});d2.displayName=$M;function VM(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(bs(n,{select:t}),document.activeElement!==r)return}function zM(e){const t=f2(e),r=h2(t,e),n=h2(t.reverse(),e);return[r,n]}function f2(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 h2(e,t){for(const r of e)if(!qM(r,{upTo:t}))return r}function qM(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 HM(e){return e instanceof HTMLInputElement&&"select"in e}function bs(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&HM(e)&&t&&e.select()}}var p2=WM();function WM(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=m2(e,t),e.unshift(t)},remove(t){var r;e=m2(e,t),(r=e[0])==null||r.resume()}}}function m2(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function GM(e){return e.filter(t=>t.tagName!=="A")}var KM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Do=new WeakMap,Wl=new WeakMap,Gl={},S0=0,g2=function(e){return e&&(e.host||g2(e.parentNode))},YM=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=g2(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})},JM=function(e,t,r,n){var i=YM(t,Array.isArray(e)?e:[e]);Gl[r]||(Gl[r]=new WeakMap);var s=Gl[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))u(p);else try{var y=p.getAttribute(n),x=y!==null&&y!=="false",v=(Do.get(p)||0)+1,_=(s.get(p)||0)+1;Do.set(p,v),s.set(p,_),o.push(p),v===1&&x&&Wl.set(p,!0),_===1&&p.setAttribute(r,"true"),x||p.setAttribute(n,"true")}catch(T){console.error("aria-hidden: cannot operate on ",p,T)}})};return u(t),a.clear(),S0++,function(){o.forEach(function(f){var p=Do.get(f)-1,y=s.get(f)-1;Do.set(f,p),s.set(f,y),p||(Wl.has(f)||f.removeAttribute(n),Wl.delete(f)),y||f.removeAttribute(r)}),S0--,S0||(Do=new WeakMap,Do=new WeakMap,Wl=new WeakMap,Gl={})}},XM=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=t||KM(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),JM(n,i,r,"aria-hidden")):function(){return null}},ui=function(){return ui=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},ui.apply(this,arguments)};function v2(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 ZM(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Kl="right-scroll-bar-position",Yl="width-before-scroll-bar",QM="with-scroll-bars-hidden",eI="--removed-body-scroll-bar-size";function _0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tI(e,t){var r=le.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 rI=typeof window<"u"?P.useLayoutEffect:P.useEffect,b2=new WeakMap;function nI(e,t){var r=tI(t||null,function(n){return e.forEach(function(i){return _0(i,n)})});return rI(function(){var n=b2.get(r);if(n){var i=new Set(n),s=new Set(e),o=r.current;i.forEach(function(a){s.has(a)||_0(a,null)}),s.forEach(function(a){i.has(a)||_0(a,o)})}b2.set(r,e)},[e]),r}function iI(e){return e}function sI(e,t){t===void 0&&(t=iI);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(s){var o=t(s,n);return r.push(o),function(){r=r.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(n=!0;r.length;){var o=r;r=[],o.forEach(s)}r={push:function(a){return s(a)},filter:function(){return r}}},assignMedium:function(s){n=!0;var o=[];if(r.length){var a=r;r=[],a.forEach(s),o=r}var c=function(){var u=o;o=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),r}}}};return i}function oI(e){e===void 0&&(e={});var t=sI(null);return t.options=ui({async:!0,ssr:!1},e),t}var y2=function(e){var t=e.sideCar,r=v2(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 P.createElement(n,ui({},r))};y2.isSideCarExport=!0;function aI(e,t){return e.useMedium(t),y2}var w2=oI(),E0=function(){},Jl=P.forwardRef(function(e,t){var r=P.useRef(null),n=P.useState({onScrollCapture:E0,onWheelCapture:E0,onTouchMoveCapture:E0}),i=n[0],s=n[1],o=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,y=e.noIsolation,x=e.inert,v=e.allowPinchZoom,_=e.as,T=_===void 0?"div":_,O=e.gapMode,R=v2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),F=p,B=nI([r,t]),H=ui(ui({},R),i);return P.createElement(P.Fragment,null,u&&P.createElement(F,{sideCar:w2,removeScrollBar:l,shards:f,noIsolation:y,inert:x,setCallbacks:s,allowPinchZoom:!!v,lockRef:r,gapMode:O}),o?P.cloneElement(P.Children.only(a),ui(ui({},H),{ref:B})):P.createElement(T,ui({},H,{className:c,ref:B}),a))});Jl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Jl.classNames={fullWidth:Yl,zeroRight:Kl};var x2,cI=function(){if(x2)return x2;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function lI(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=cI();return t&&e.setAttribute("nonce",t),e}function uI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dI(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var fI=function(){var e=0,t=null;return{add:function(r){e==0&&(t=lI())&&(uI(t,r),dI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hI=function(){var e=fI();return function(t,r){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},S2=function(){var e=hI(),t=function(r){var n=r.styles,i=r.dynamic;return e(n,i),null};return t},pI={left:0,top:0,right:0,gap:0},C0=function(e){return parseInt(e||"",10)||0},mI=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[C0(r),C0(n),C0(i)]},gI=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return pI;var t=mI(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])}},vI=S2(),Lo="data-scroll-locked",bI=function(e,t,r,n){var i=e.left,s=e.top,o=e.right,a=e.gap;return r===void 0&&(r="margin"),`
|
|
70
|
+
.`.concat(QM,` {
|
|
71
71
|
overflow: hidden `).concat(n,`;
|
|
72
72
|
padding-right: `).concat(a,"px ").concat(n,`;
|
|
73
73
|
}
|
|
@@ -101,12 +101,12 @@ body { background-color: var(--color-page-background); }
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
body[`).concat(Lo,`] {
|
|
104
|
-
`).concat(
|
|
104
|
+
`).concat(eI,": ").concat(a,`px;
|
|
105
105
|
}
|
|
106
|
-
`)},_2=function(){var e=parseInt(document.body.getAttribute(Lo)||"0",10);return isFinite(e)?e:0},
|
|
106
|
+
`)},_2=function(){var e=parseInt(document.body.getAttribute(Lo)||"0",10);return isFinite(e)?e:0},yI=function(){P.useEffect(function(){return document.body.setAttribute(Lo,(_2()+1).toString()),function(){var e=_2()-1;e<=0?document.body.removeAttribute(Lo):document.body.setAttribute(Lo,e.toString())}},[])},wI=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;yI();var s=P.useMemo(function(){return gI(i)},[i]);return P.createElement(vI,{styles:bI(s,!t,i,r?"":"!important")})},A0=!1;if(typeof window<"u")try{var Xl=Object.defineProperty({},"passive",{get:function(){return A0=!0,!0}});window.addEventListener("test",Xl,Xl),window.removeEventListener("test",Xl,Xl)}catch{A0=!1}var Bo=A0?{passive:!1}:!1,xI=function(e){return e.tagName==="TEXTAREA"},E2=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!xI(e)&&r[t]==="visible")},SI=function(e){return E2(e,"overflowY")},_I=function(e){return E2(e,"overflowX")},C2=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=A2(e,n);if(i){var s=T2(e,n),o=s[1],a=s[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},EI=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},CI=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},A2=function(e,t){return e==="v"?SI(t):_I(t)},T2=function(e,t){return e==="v"?EI(t):CI(t)},AI=function(e,t){return e==="h"&&t==="rtl"?-1:1},TI=function(e,t,r,n,i){var s=AI(e,window.getComputedStyle(t).direction),o=s*n,a=r.target,c=t.contains(a),l=!1,u=o>0,f=0,p=0;do{var y=T2(e,a),x=y[0],v=y[1],_=y[2],T=v-_-s*x;(x||T)&&A2(e,a)&&(f+=T,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(f)<1||!i&&o>f)||!u&&(i&&Math.abs(p)<1||!i&&-o>p))&&(l=!0),l},Zl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},M2=function(e){return[e.deltaX,e.deltaY]},I2=function(e){return e&&"current"in e?e.current:e},MI=function(e,t){return e[0]===t[0]&&e[1]===t[1]},II=function(e){return`
|
|
107
107
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
108
108
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
109
|
-
`)},PI=0,Uo=[];function RI(e){var t=P.useRef([]),r=P.useRef([0,0]),n=P.useRef(),i=P.useState(PI++)[0],s=P.useState(S2)[0],o=P.useRef(e);P.useEffect(function(){o.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=QM([e.lockRef.current],(e.shards||[]).map(I2),!0).filter(Boolean);return v.forEach(function(_){return _.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=P.useCallback(function(v,_){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var T=Zl(v),O=r.current,R="deltaX"in v?v.deltaX:O[0]-T[0],F="deltaY"in v?v.deltaY:O[1]-T[1],B,H=v.target,$=Math.abs(R)>Math.abs(F)?"h":"v";if("touches"in v&&$==="h"&&H.type==="range")return!1;var Z=C2($,H);if(!Z)return!0;if(Z?B=$:(B=$==="v"?"h":"v",Z=C2($,H)),!Z)return!1;if(!n.current&&"changedTouches"in v&&(R||F)&&(n.current=B),!B)return!0;var ce=n.current||B;return MI(ce,_,v,ce==="h"?R:F,!0)},[]),c=P.useCallback(function(v){var _=v;if(!(!Uo.length||Uo[Uo.length-1]!==s)){var T="deltaY"in _?M2(_):Zl(_),O=t.current.filter(function(B){return B.name===_.type&&(B.target===_.target||_.target===B.shadowParent)&&II(B.delta,T)})[0];if(O&&O.should){_.cancelable&&_.preventDefault();return}if(!O){var R=(o.current.shards||[]).map(I2).filter(Boolean).filter(function(B){return B.contains(_.target)}),F=R.length>0?a(_,R[0]):!o.current.noIsolation;F&&_.cancelable&&_.preventDefault()}}},[]),l=P.useCallback(function(v,_,T,O){var R={name:v,delta:_,target:T,should:O,shadowParent:jI(T)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(F){return F!==R})},1)},[]),u=P.useCallback(function(v){r.current=Zl(v),n.current=void 0},[]),f=P.useCallback(function(v){l(v.type,M2(v),v.target,a(v,e.lockRef.current))},[]),p=P.useCallback(function(v){l(v.type,Zl(v),v.target,a(v,e.lockRef.current))},[]);P.useEffect(function(){return Uo.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Bo),document.addEventListener("touchmove",c,Bo),document.addEventListener("touchstart",u,Bo),function(){Uo=Uo.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,Bo),document.removeEventListener("touchmove",c,Bo),document.removeEventListener("touchstart",u,Bo)}},[]);var y=e.removeScrollBar,x=e.inert;return P.createElement(P.Fragment,null,x?P.createElement(s,{styles:OI(i)}):null,y?P.createElement(xI,{gapMode:e.gapMode}):null)}function jI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const NI=cI(w2,RI);var O2=P.forwardRef(function(e,t){return P.createElement(Jl,ui({},e,{ref:t,sideCar:NI}))});O2.classNames=Jl.classNames;const kI=O2;function DI(e,t){return P.useReducer((r,n)=>t[r][n]??r,e)}var M0="ScrollArea",[P2,iF]=Di(M0),[LI,wn]=P2(M0),R2=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:i,scrollHideDelay:s=600,...o}=e,[a,c]=P.useState(null),[l,u]=P.useState(null),[f,p]=P.useState(null),[y,x]=P.useState(null),[v,_]=P.useState(null),[T,O]=P.useState(0),[R,F]=P.useState(0),[B,H]=P.useState(!1),[$,Z]=P.useState(!1),ce=Xt(t,de=>c(de)),ne=p0(i);return w.jsx(LI,{scope:r,type:n,dir:ne,scrollHideDelay:s,scrollArea:a,viewport:l,onViewportChange:u,content:f,onContentChange:p,scrollbarX:y,onScrollbarXChange:x,scrollbarXEnabled:B,onScrollbarXEnabledChange:H,scrollbarY:v,onScrollbarYChange:_,scrollbarYEnabled:$,onScrollbarYEnabledChange:Z,onCornerWidthChange:O,onCornerHeightChange:F,children:w.jsx(Zt.div,{dir:ne,...o,ref:ce,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":R+"px",...e.style}})})});R2.displayName=M0;var j2="ScrollAreaViewport",N2=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:i,...s}=e,o=wn(j2,r),a=P.useRef(null),c=Xt(t,a,o.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(Zt.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:w.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});N2.displayName=j2;var di="ScrollAreaScrollbar",k2=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=wn(di,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:o}=i,a=e.orientation==="horizontal";return P.useEffect(()=>(a?s(!0):o(!0),()=>{a?s(!1):o(!1)}),[a,s,o]),i.type==="hover"?w.jsx(BI,{...n,ref:t,forceMount:r}):i.type==="scroll"?w.jsx(UI,{...n,ref:t,forceMount:r}):i.type==="auto"?w.jsx(D2,{...n,ref:t,forceMount:r}):i.type==="always"?w.jsx(I0,{...n,ref:t}):null});k2.displayName=di;var BI=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=wn(di,e.__scopeScrollArea),[s,o]=P.useState(!1);return P.useEffect(()=>{const a=i.scrollArea;let c=0;if(a){const l=()=>{window.clearTimeout(c),o(!0)},u=()=>{c=window.setTimeout(()=>o(!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(Un,{present:r||s,children:w.jsx(D2,{"data-state":s?"visible":"hidden",...n,ref:t})})}),UI=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=wn(di,e.__scopeScrollArea),s=e.orientation==="horizontal",o=ru(()=>c("SCROLL_END"),100),[a,c]=DI("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 P.useEffect(()=>{if(a==="idle"){const l=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[a,i.scrollHideDelay,c]),P.useEffect(()=>{const l=i.viewport,u=s?"scrollLeft":"scrollTop";if(l){let f=l[u];const p=()=>{const y=l[u];f!==y&&(c("SCROLL"),o()),f=y};return l.addEventListener("scroll",p),()=>l.removeEventListener("scroll",p)}},[i.viewport,s,c,o]),w.jsx(Un,{present:r||a!=="hidden",children:w.jsx(I0,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:lt(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:lt(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),D2=P.forwardRef((e,t)=>{const r=wn(di,e.__scopeScrollArea),{forceMount:n,...i}=e,[s,o]=P.useState(!1),a=e.orientation==="horizontal",c=ru(()=>{if(r.viewport){const l=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;o(a?l:u)}},10);return Fo(r.viewport,c),Fo(r.content,c),w.jsx(Un,{present:n||s,children:w.jsx(I0,{"data-state":s?"visible":"hidden",...i,ref:t})})}),I0=P.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,i=wn(di,e.__scopeScrollArea),s=P.useRef(null),o=P.useRef(0),[a,c]=P.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=$2(a.viewport,a.content),u={...n,sizes:a,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:p=>o.current=p};function f(p,y){return HI(p,o.current,a,y)}return r==="horizontal"?w.jsx(FI,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollLeft,y=V2(p,a,i.dir);s.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=f(p,i.dir))}}):r==="vertical"?w.jsx($I,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollTop,y=V2(p,a);s.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=f(p))}}):null}),FI=P.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,s=wn(di,e.__scopeScrollArea),[o,a]=P.useState(),c=P.useRef(null),l=Xt(t,c,s.onScrollbarXChange);return P.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.jsx(B2,{"data-orientation":"horizontal",...i,ref:l,sizes:r,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":tu(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(s.viewport){const p=s.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),q2(p,f)&&u.preventDefault()}},onResize:()=>{c.current&&s.viewport&&o&&n({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:eu(o.paddingLeft),paddingEnd:eu(o.paddingRight)}})}})}),$I=P.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,s=wn(di,e.__scopeScrollArea),[o,a]=P.useState(),c=P.useRef(null),l=Xt(t,c,s.onScrollbarYChange);return P.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.jsx(B2,{"data-orientation":"vertical",...i,ref:l,sizes:r,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":tu(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(s.viewport){const p=s.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),q2(p,f)&&u.preventDefault()}},onResize:()=>{c.current&&s.viewport&&o&&n({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:eu(o.paddingTop),paddingEnd:eu(o.paddingBottom)}})}})}),[VI,L2]=P2(di),B2=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:i,onThumbChange:s,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:f,...p}=e,y=wn(di,r),[x,v]=P.useState(null),_=Xt(t,ce=>v(ce)),T=P.useRef(null),O=P.useRef(""),R=y.viewport,F=n.content-n.viewport,B=Rr(u),H=Rr(c),$=ru(f,10);function Z(ce){if(T.current){const ne=ce.clientX-T.current.left,de=ce.clientY-T.current.top;l({x:ne,y:de})}}return P.useEffect(()=>{const ce=ne=>{const de=ne.target;(x==null?void 0:x.contains(de))&&B(ne,F)};return document.addEventListener("wheel",ce,{passive:!1}),()=>document.removeEventListener("wheel",ce,{passive:!1})},[R,x,F,B]),P.useEffect(H,[n,H]),Fo(x,$),Fo(y.content,$),w.jsx(VI,{scope:r,scrollbar:x,hasThumb:i,onThumbChange:Rr(s),onThumbPointerUp:Rr(o),onThumbPositionChange:H,onThumbPointerDown:Rr(a),children:w.jsx(Zt.div,{...p,ref:_,style:{position:"absolute",...p.style},onPointerDown:lt(e.onPointerDown,ce=>{ce.button===0&&(ce.target.setPointerCapture(ce.pointerId),T.current=x.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),Z(ce))}),onPointerMove:lt(e.onPointerMove,Z),onPointerUp:lt(e.onPointerUp,ce=>{const ne=ce.target;ne.hasPointerCapture(ce.pointerId)&&ne.releasePointerCapture(ce.pointerId),document.body.style.webkitUserSelect=O.current,y.viewport&&(y.viewport.style.scrollBehavior=""),T.current=null})})})}),Ql="ScrollAreaThumb",U2=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=L2(Ql,e.__scopeScrollArea);return w.jsx(Un,{present:r||i.hasThumb,children:w.jsx(zI,{ref:t,...n})})}),zI=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...i}=e,s=wn(Ql,r),o=L2(Ql,r),{onThumbPositionChange:a}=o,c=Xt(t,f=>o.onThumbChange(f)),l=P.useRef(void 0),u=ru(()=>{l.current&&(l.current(),l.current=void 0)},100);return P.useEffect(()=>{const f=s.viewport;if(f){const p=()=>{if(u(),!l.current){const y=WI(f,a);l.current=y,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[s.viewport,u,a]),w.jsx(Zt.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:lt(e.onPointerDownCapture,f=>{const y=f.target.getBoundingClientRect(),x=f.clientX-y.left,v=f.clientY-y.top;o.onThumbPointerDown({x,y:v})}),onPointerUp:lt(e.onPointerUp,o.onThumbPointerUp)})});U2.displayName=Ql;var O0="ScrollAreaCorner",F2=P.forwardRef((e,t)=>{const r=wn(O0,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?w.jsx(qI,{...e,ref:t}):null});F2.displayName=O0;var qI=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,i=wn(O0,r),[s,o]=P.useState(0),[a,c]=P.useState(0),l=!!(s&&a);return Fo(i.scrollbarX,()=>{var f;const u=((f=i.scrollbarX)==null?void 0:f.offsetHeight)||0;i.onCornerHeightChange(u),c(u)}),Fo(i.scrollbarY,()=>{var f;const u=((f=i.scrollbarY)==null?void 0:f.offsetWidth)||0;i.onCornerWidthChange(u),o(u)}),l?w.jsx(Zt.div,{...n,ref:t,style:{width:s,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function eu(e){return e?parseInt(e,10):0}function $2(e,t){const r=e/t;return isNaN(r)?0:r}function tu(e){const t=$2(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function HI(e,t,r,n="ltr"){const i=tu(r),s=i/2,o=t||s,a=i-o,c=r.scrollbar.paddingStart+o,l=r.scrollbar.size-r.scrollbar.paddingEnd-a,u=r.content-r.viewport,f=n==="ltr"?[0,u]:[u*-1,0];return z2([c,l],f)(e)}function V2(e,t,r="ltr"){const n=tu(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,o=t.content-t.viewport,a=s-n,c=r==="ltr"?[0,o]:[o*-1,0],l=FM(e,c);return z2([0,o],[0,a])(l)}function z2(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 q2(e,t){return e>0&&e<t}var WI=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},o=r.left!==s.left,a=r.top!==s.top;(o||a)&&t(),r=s,n=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(n)};function ru(e,t){const r=Rr(e),n=P.useRef(0);return P.useEffect(()=>()=>window.clearTimeout(n.current),[]),P.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Fo(e,t){const r=Rr(t);Li(()=>{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 GI=R2,KI=N2,H2=k2,W2=U2,YI=F2,nu="Switch",[JI,sF]=Di(nu),[XI,ZI]=JI(nu),G2=P.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,form:u,...f}=e,[p,y]=P.useState(null),x=Xt(t,R=>y(R)),v=P.useRef(!1),_=p?u||!!p.closest("form"):!0,[T,O]=Na({prop:i,defaultProp:s??!1,onChange:l,caller:nu});return w.jsxs(XI,{scope:r,checked:T,disabled:a,children:[w.jsx(Zt.button,{type:"button",role:"switch","aria-checked":T,"aria-required":o,"data-state":X2(T),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:x,onClick:lt(e.onClick,R=>{O(F=>!F),_&&(v.current=R.isPropagationStopped(),v.current||R.stopPropagation())})}),_&&w.jsx(J2,{control:p,bubbles:!v.current,name:n,value:c,checked:T,required:o,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});G2.displayName=nu;var K2="SwitchThumb",Y2=P.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,i=ZI(K2,r);return w.jsx(Zt.span,{"data-state":X2(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:t})});Y2.displayName=K2;var QI="SwitchBubbleInput",J2=P.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...i},s)=>{const o=P.useRef(null),a=Xt(o,s),c=Wb(r),l=l0(t);return P.useEffect(()=>{const u=o.current;if(!u)return;const f=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&y){const x=new Event("click",{bubbles:n});y.call(u,r),u.dispatchEvent(x)}},[c,r,n]),w.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:a,style:{...i.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});J2.displayName=QI;function X2(e){return e?"checked":"unchecked"}var eO=G2,tO=Y2;const Ua={size:{type:"enum",values:["1","2","3"],default:"2",responsive:!0},variant:{type:"enum",values:["classic","surface","soft"],default:"surface"},color:ka,highContrast:$l,radius:g0},Z2=P.forwardRef((e,t)=>{const{rest:r,...n}=Da(e),{className:i,style:s,size:o=Ua.size.default,variant:a=Ua.variant.default,color:c=Ua.color.default,highContrast:l=Ua.highContrast.default,radius:u=Ua.radius.default,...f}=r;return P.createElement("span",{"data-radius":u,className:or("rt-SwitchRoot",i,Qr(o,"rt-r-size"),`rt-variant-${a}`,{"rt-high-contrast":l},La(n)),style:s},P.createElement(eO,{"data-accent-color":c,...f,ref:t,className:or("rt-reset","rt-SwitchButton",{"rt-high-contrast":l})},P.createElement(tO,{className:or("rt-SwitchThumb",{"rt-high-contrast":l})})))});Z2.displayName="Switch";var P0=["Enter"," "],rO=["ArrowDown","PageUp","Home"],Q2=["ArrowUp","PageDown","End"],nO=[...rO,...Q2],iO={ltr:[...P0,"ArrowRight"],rtl:[...P0,"ArrowLeft"]},sO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Fa="Menu",[$a,oO,aO]=r2(Fa),[Ks,ey]=Di(Fa,[aO,kl,i2]),Va=kl(),ty=i2(),[ry,bs]=Ks(Fa),[cO,za]=Ks(Fa),ny=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:s,modal:o=!0}=e,a=Va(t),[c,l]=P.useState(null),u=P.useRef(!1),f=Rr(s),p=p0(i);return P.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(Ob,{...a,children:w.jsx(ry,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:l,children:w.jsx(cO,{scope:t,onClose:P.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:o,children:n})})})};ny.displayName=Fa;var lO="MenuAnchor",R0=P.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=Va(r);return w.jsx(Pb,{...i,...n,ref:t})});R0.displayName=lO;var j0="MenuPortal",[uO,iy]=Ks(j0,{forceMount:void 0}),sy=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,s=bs(j0,t);return w.jsx(uO,{scope:t,forceMount:r,children:w.jsx(Un,{present:r||s.open,children:w.jsx(Nb,{asChild:!0,container:i,children:n})})})};sy.displayName=j0;var xn="MenuContent",[dO,N0]=Ks(xn),oy=P.forwardRef((e,t)=>{const r=iy(xn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,s=bs(xn,e.__scopeMenu),o=za(xn,e.__scopeMenu);return w.jsx($a.Provider,{scope:e.__scopeMenu,children:w.jsx(Un,{present:n||s.open,children:w.jsx($a.Slot,{scope:e.__scopeMenu,children:o.modal?w.jsx(fO,{...i,ref:t}):w.jsx(hO,{...i,ref:t})})})})}),fO=P.forwardRef((e,t)=>{const r=bs(xn,e.__scopeMenu),n=P.useRef(null),i=Xt(t,n);return P.useEffect(()=>{const s=n.current;if(s)return ZM(s)},[]),w.jsx(k0,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:lt(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),hO=P.forwardRef((e,t)=>{const r=bs(xn,e.__scopeMenu);return w.jsx(k0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),pO=Ia("MenuContent.ScrollLock"),k0=P.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:y,disableOutsideScroll:x,...v}=e,_=bs(xn,r),T=za(xn,r),O=Va(r),R=ty(r),F=oO(r),[B,H]=P.useState(null),$=P.useRef(null),Z=Xt(t,$,_.onContentChange),ce=P.useRef(0),ne=P.useRef(""),de=P.useRef(0),q=P.useRef(null),N=P.useRef("right"),h=P.useRef(0),d=x?kI:P.Fragment,m=x?{as:pO,allowPinchZoom:!0}:void 0,S=M=>{var we,Oe;const j=ne.current+M,I=F().filter(je=>!je.disabled),g=document.activeElement,b=(we=I.find(je=>je.ref.current===g))==null?void 0:we.textValue,k=I.map(je=>je.textValue),ve=AO(k,j,b),he=(Oe=I.find(je=>je.textValue===ve))==null?void 0:Oe.ref.current;(function je(L){ne.current=L,window.clearTimeout(ce.current),L!==""&&(ce.current=window.setTimeout(()=>je(""),1e3))})(j),he&&setTimeout(()=>he.focus())};P.useEffect(()=>()=>window.clearTimeout(ce.current),[]),$M();const E=P.useCallback(M=>{var I,g;return N.current===((I=q.current)==null?void 0:I.side)&&MO(M,(g=q.current)==null?void 0:g.area)},[]);return w.jsx(dO,{scope:r,searchRef:ne,onItemEnter:P.useCallback(M=>{E(M)&&M.preventDefault()},[E]),onItemLeave:P.useCallback(M=>{var j;E(M)||((j=$.current)==null||j.focus(),H(null))},[E]),onTriggerLeave:P.useCallback(M=>{E(M)&&M.preventDefault()},[E]),pointerGraceTimerRef:de,onPointerGraceIntentChange:P.useCallback(M=>{q.current=M},[]),children:w.jsx(d,{...m,children:w.jsx(d2,{asChild:!0,trapped:i,onMountAutoFocus:lt(s,M=>{var j;M.preventDefault(),(j=$.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:w.jsx(Jf,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:y,children:w.jsx(BM,{asChild:!0,...R,dir:T.dir,orientation:"vertical",loop:n,currentTabStopId:B,onCurrentTabStopIdChange:H,onEntryFocus:lt(c,M=>{T.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(Rb,{role:"menu","aria-orientation":"vertical","data-state":Ey(_.open),"data-radix-menu-content":"",dir:T.dir,...O,...v,ref:Z,style:{outline:"none",...v.style},onKeyDown:lt(v.onKeyDown,M=>{const I=M.target.closest("[data-radix-menu-content]")===M.currentTarget,g=M.ctrlKey||M.altKey||M.metaKey,b=M.key.length===1;I&&(M.key==="Tab"&&M.preventDefault(),!g&&b&&S(M.key));const k=$.current;if(M.target!==k||!nO.includes(M.key))return;M.preventDefault();const he=F().filter(we=>!we.disabled).map(we=>we.ref.current);Q2.includes(M.key)&&he.reverse(),EO(he)}),onBlur:lt(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(ce.current),ne.current="")}),onPointerMove:lt(e.onPointerMove,Ha(M=>{const j=M.target,I=h.current!==M.clientX;if(M.currentTarget.contains(j)&&I){const g=M.clientX>h.current?"right":"left";N.current=g,h.current=M.clientX}}))})})})})})})});oy.displayName=xn;var mO="MenuGroup",D0=P.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Zt.div,{role:"group",...n,ref:t})});D0.displayName=mO;var gO="MenuLabel",ay=P.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Zt.div,{...n,ref:t})});ay.displayName=gO;var iu="MenuItem",cy="menu.itemSelect",su=P.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,s=P.useRef(null),o=za(iu,e.__scopeMenu),a=N0(iu,e.__scopeMenu),c=Xt(t,s),l=P.useRef(!1),u=()=>{const f=s.current;if(!r&&f){const p=new CustomEvent(cy,{bubbles:!0,cancelable:!0});f.addEventListener(cy,y=>n==null?void 0:n(y),{once:!0}),Xv(f,p),p.defaultPrevented?l.current=!1:o.onClose()}};return w.jsx(ly,{...i,ref:c,disabled:r,onClick:lt(e.onClick,u),onPointerDown:f=>{var p;(p=e.onPointerDown)==null||p.call(e,f),l.current=!0},onPointerUp:lt(e.onPointerUp,f=>{var p;l.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:lt(e.onKeyDown,f=>{const p=a.searchRef.current!=="";r||p&&f.key===" "||P0.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});su.displayName=iu;var ly=P.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=e,o=N0(iu,r),a=ty(r),c=P.useRef(null),l=Xt(t,c),[u,f]=P.useState(!1),[p,y]=P.useState("");return P.useEffect(()=>{const x=c.current;x&&y((x.textContent??"").trim())},[s.children]),w.jsx($a.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:w.jsx(UM,{asChild:!0,...a,focusable:!n,children:w.jsx(Zt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:l,onPointerMove:lt(e.onPointerMove,Ha(x=>{n?o.onItemLeave(x):(o.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:lt(e.onPointerLeave,Ha(x=>o.onItemLeave(x))),onFocus:lt(e.onFocus,()=>f(!0)),onBlur:lt(e.onBlur,()=>f(!1))})})})}),vO="MenuCheckboxItem",uy=P.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...i}=e;return w.jsx(my,{scope:e.__scopeMenu,checked:r,children:w.jsx(su,{role:"menuitemcheckbox","aria-checked":ou(r)?"mixed":r,...i,ref:t,"data-state":U0(r),onSelect:lt(i.onSelect,()=>n==null?void 0:n(ou(r)?!0:!r),{checkForDefaultPrevented:!1})})})});uy.displayName=vO;var dy="MenuRadioGroup",[bO,yO]=Ks(dy,{value:void 0,onValueChange:()=>{}}),fy=P.forwardRef((e,t)=>{const{value:r,onValueChange:n,...i}=e,s=Rr(n);return w.jsx(bO,{scope:e.__scopeMenu,value:r,onValueChange:s,children:w.jsx(D0,{...i,ref:t})})});fy.displayName=dy;var hy="MenuRadioItem",py=P.forwardRef((e,t)=>{const{value:r,...n}=e,i=yO(hy,e.__scopeMenu),s=r===i.value;return w.jsx(my,{scope:e.__scopeMenu,checked:s,children:w.jsx(su,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":U0(s),onSelect:lt(n.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})})});py.displayName=hy;var L0="MenuItemIndicator",[my,wO]=Ks(L0,{checked:!1}),gy=P.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...i}=e,s=wO(L0,r);return w.jsx(Un,{present:n||ou(s.checked)||s.checked===!0,children:w.jsx(Zt.span,{...i,ref:t,"data-state":U0(s.checked)})})});gy.displayName=L0;var xO="MenuSeparator",vy=P.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Zt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});vy.displayName=xO;var SO="MenuArrow",by=P.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=Va(r);return w.jsx(jb,{...i,...n,ref:t})});by.displayName=SO;var B0="MenuSub",[_O,yy]=Ks(B0),wy=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:i}=e,s=bs(B0,t),o=Va(t),[a,c]=P.useState(null),[l,u]=P.useState(null),f=Rr(i);return P.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),w.jsx(Ob,{...o,children:w.jsx(ry,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:w.jsx(_O,{scope:t,contentId:Oa(),triggerId:Oa(),trigger:a,onTriggerChange:c,children:r})})})};wy.displayName=B0;var qa="MenuSubTrigger",xy=P.forwardRef((e,t)=>{const r=bs(qa,e.__scopeMenu),n=za(qa,e.__scopeMenu),i=yy(qa,e.__scopeMenu),s=N0(qa,e.__scopeMenu),o=P.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:e.__scopeMenu},u=P.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return P.useEffect(()=>u,[u]),P.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),c(null)}},[a,c]),w.jsx(R0,{asChild:!0,...l,children:w.jsx(ly,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":Ey(r.open),...e,ref:Gf(t,i.onTriggerChange),onClick:f=>{var p;(p=e.onClick)==null||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:lt(e.onPointerMove,Ha(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:lt(e.onPointerLeave,Ha(f=>{var y,x;u();const p=(y=r.content)==null?void 0:y.getBoundingClientRect();if(p){const v=(x=r.content)==null?void 0:x.dataset.side,_=v==="right",T=_?-5:5,O=p[_?"left":"right"],R=p[_?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+T,y:f.clientY},{x:O,y:p.top},{x:R,y:p.top},{x:R,y:p.bottom},{x:O,y:p.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:lt(e.onKeyDown,f=>{var y;const p=s.searchRef.current!=="";e.disabled||p&&f.key===" "||iO[n.dir].includes(f.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),f.preventDefault())})})})});xy.displayName=qa;var Sy="MenuSubContent",_y=P.forwardRef((e,t)=>{const r=iy(xn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,s=bs(xn,e.__scopeMenu),o=za(xn,e.__scopeMenu),a=yy(Sy,e.__scopeMenu),c=P.useRef(null),l=Xt(t,c);return w.jsx($a.Provider,{scope:e.__scopeMenu,children:w.jsx(Un,{present:n||s.open,children:w.jsx($a.Slot,{scope:e.__scopeMenu,children:w.jsx(k0,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:lt(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:lt(e.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:lt(e.onKeyDown,u=>{var y;const f=u.currentTarget.contains(u.target),p=sO[o.dir].includes(u.key);f&&p&&(s.onOpenChange(!1),(y=a.trigger)==null||y.focus(),u.preventDefault())})})})})})});_y.displayName=Sy;function Ey(e){return e?"open":"closed"}function ou(e){return e==="indeterminate"}function U0(e){return ou(e)?"indeterminate":e?"checked":"unchecked"}function EO(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function CO(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function AO(e,t,r){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let o=CO(e,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function TO(e,t){const{x:r,y:n}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],c=t[o],l=a.x,u=a.y,f=c.x,p=c.y;u>n!=p>n&&r<(f-l)*(n-u)/(p-u)+l&&(i=!i)}return i}function MO(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return TO(r,t)}function Ha(e){return t=>t.pointerType==="mouse"?e(t):void 0}var IO=ny,OO=R0,PO=sy,RO=oy,jO=D0,NO=ay,kO=su,DO=uy,LO=fy,BO=py,UO=gy,FO=vy,$O=by,VO=wy,zO=xy,qO=_y,au="DropdownMenu",[HO,cF]=Di(au,[ey]),Fr=ey(),[WO,Cy]=HO(au),Ay=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,c=Fr(t),l=P.useRef(null),[u,f]=Na({prop:i,defaultProp:s??!1,onChange:o,caller:au});return w.jsx(WO,{scope:t,triggerId:Oa(),triggerRef:l,contentId:Oa(),open:u,onOpenChange:f,onOpenToggle:P.useCallback(()=>f(p=>!p),[f]),modal:a,children:w.jsx(IO,{...c,open:u,onOpenChange:f,dir:n,modal:a,children:r})})};Ay.displayName=au;var Ty="DropdownMenuTrigger",My=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,s=Cy(Ty,r),o=Fr(r);return w.jsx(OO,{asChild:!0,...o,children:w.jsx(Zt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:Gf(t,s.triggerRef),onPointerDown:lt(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:lt(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});My.displayName=Ty;var GO="DropdownMenuPortal",Iy=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Fr(t);return w.jsx(PO,{...n,...r})};Iy.displayName=GO;var Oy="DropdownMenuContent",Py=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Cy(Oy,r),s=Fr(r),o=P.useRef(!1);return w.jsx(RO,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...n,ref:t,onCloseAutoFocus:lt(e.onCloseAutoFocus,a=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:lt(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!i.modal||u)&&(o.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)"}})});Py.displayName=Oy;var KO="DropdownMenuGroup",Ry=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return w.jsx(jO,{...i,...n,ref:t})});Ry.displayName=KO;var YO="DropdownMenuLabel",jy=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return w.jsx(NO,{...i,...n,ref:t})});jy.displayName=YO;var JO="DropdownMenuItem",Ny=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return w.jsx(kO,{...i,...n,ref:t})});Ny.displayName=JO;var XO="DropdownMenuCheckboxItem",ky=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return w.jsx(DO,{...i,...n,ref:t})});ky.displayName=XO;var ZO="DropdownMenuRadioGroup",Dy=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return w.jsx(LO,{...i,...n,ref:t})});Dy.displayName=ZO;var QO="DropdownMenuRadioItem",Ly=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return w.jsx(BO,{...i,...n,ref:t})});Ly.displayName=QO;var eP="DropdownMenuItemIndicator",By=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return w.jsx(UO,{...i,...n,ref:t})});By.displayName=eP;var tP="DropdownMenuSeparator",Uy=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return w.jsx(FO,{...i,...n,ref:t})});Uy.displayName=tP;var rP="DropdownMenuArrow",nP=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return w.jsx($O,{...i,...n,ref:t})});nP.displayName=rP;var iP=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:i,defaultOpen:s}=e,o=Fr(t),[a,c]=Na({prop:n,defaultProp:s??!1,onChange:i,caller:"DropdownMenuSub"});return w.jsx(VO,{...o,open:a,onOpenChange:c,children:r})},sP="DropdownMenuSubTrigger",Fy=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return w.jsx(zO,{...i,...n,ref:t})});Fy.displayName=sP;var oP="DropdownMenuSubContent",$y=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return w.jsx(qO,{...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)"}})});$y.displayName=oP;var aP=Ay,cP=My,Vy=Iy,lP=Py,uP=Ry,dP=jy,fP=Ny,hP=ky,pP=Dy,mP=Ly,zy=By,gP=Uy,vP=iP,bP=Fy,yP=$y;const F0={size:{type:"enum",values:["1","2","3"],default:"1",responsive:!0},radius:g0,scrollbars:{type:"enum",values:["vertical","horizontal","both"],default:"both"}},$0=P.forwardRef((e,t)=>{const{rest:r,...n}=Da(e),{className:i,style:s,type:o,scrollHideDelay:a=o!=="scroll"?0:void 0,dir:c,size:l=F0.size.default,radius:u=F0.radius.default,scrollbars:f=F0.scrollbars.default,...p}=r;return P.createElement(GI,{type:o,scrollHideDelay:a,className:or("rt-ScrollAreaRoot",i,La(n)),style:s},P.createElement(KI,{...p,ref:t,className:"rt-ScrollAreaViewport"}),P.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),f!=="vertical"?P.createElement(H2,{"data-radius":u,orientation:"horizontal",className:or("rt-ScrollAreaScrollbar",Qr(l,"rt-r-size"))},P.createElement(W2,{className:"rt-ScrollAreaThumb"})):null,f!=="horizontal"?P.createElement(H2,{"data-radius":u,orientation:"vertical",className:or("rt-ScrollAreaScrollbar",Qr(l,"rt-r-size"))},P.createElement(W2,{className:"rt-ScrollAreaThumb"})):null,f==="both"?P.createElement(YI,{className:"rt-ScrollAreaCorner"}):null)});$0.displayName="ScrollArea";const V0={size:{type:"enum",values:["1","2"],default:"2",responsive:!0},variant:{type:"enum",values:["solid","soft"],default:"solid"},color:ka,highContrast:$l},qy={color:ka,shortcut:{type:"string",default:void 0}},Hy=e=>P.createElement(aP,{...e});Hy.displayName="DropdownMenuRoot";const Wy=P.forwardRef((e,t)=>P.createElement(cP,{...e,ref:t,asChild:!0}));Wy.displayName="DropdownMenuTrigger";const Gy=P.createContext({}),Ky=P.forwardRef((e,t)=>{const r=wM(),{className:n,children:i,size:s=V0.size.default,variant:o=V0.variant.default,highContrast:a=V0.highContrast.default,color:c=qy.color.default,container:l,forceMount:u,...f}=e,p=c??r.accentColor;return P.createElement(Vy,{container:l,forceMount:u},P.createElement(Fl,{asChild:!0},P.createElement(lP,{"data-accent-color":p,align:"start",sideOffset:4,collisionPadding:10,...f,ref:t,className:or("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",n,Qr(s,"rt-r-size"),`rt-variant-${o}`,{"rt-high-contrast":a})},P.createElement($0,{type:"auto"},P.createElement("div",{className:or("rt-BaseMenuViewport","rt-DropdownMenuViewport")},P.createElement(Gy.Provider,{value:P.useMemo(()=>({size:s,variant:o,color:p,highContrast:a}),[s,o,p,a])},i))))))});Ky.displayName="DropdownMenuContent";const Yy=P.forwardRef((e,t)=>P.createElement(dP,{...e,ref:t,className:or("rt-BaseMenuLabel","rt-DropdownMenuLabel",e.className)}));Yy.displayName="DropdownMenuLabel";const Jy=P.forwardRef((e,t)=>{const{className:r,children:n,color:i=qy.color.default,shortcut:s,...o}=e;return P.createElement(fP,{"data-accent-color":i,...o,ref:t,className:or("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",r)},P.createElement(Cl,null,n),s&&P.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},s))});Jy.displayName="DropdownMenuItem";const Xy=P.forwardRef((e,t)=>P.createElement(uP,{...e,ref:t,className:or("rt-BaseMenuGroup","rt-DropdownMenuGroup",e.className)}));Xy.displayName="DropdownMenuGroup";const Zy=P.forwardRef((e,t)=>P.createElement(pP,{...e,ref:t,className:or("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",e.className)}));Zy.displayName="DropdownMenuRadioGroup";const Qy=P.forwardRef((e,t)=>{const{children:r,className:n,...i}=e;return P.createElement(mP,{...i,ref:t,className:or("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",n)},P.createElement(Cl,null,r),P.createElement(zy,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},P.createElement(ql,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})))});Qy.displayName="DropdownMenuRadioItem";const ew=P.forwardRef((e,t)=>{const{children:r,className:n,shortcut:i,...s}=e;return P.createElement(hP,{...s,ref:t,className:or("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",n)},P.createElement(Cl,null,r),P.createElement(zy,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},P.createElement(ql,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),i&&P.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},i))});ew.displayName="DropdownMenuCheckboxItem";const tw=e=>P.createElement(vP,{...e});tw.displayName="DropdownMenuSub";const rw=P.forwardRef((e,t)=>{const{className:r,children:n,...i}=e;return P.createElement(bP,{...i,ref:t,className:or("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",r)},P.createElement(Cl,null,n),P.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},P.createElement(t2,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"})))});rw.displayName="DropdownMenuSubTrigger";const nw=P.forwardRef((e,t)=>{const{className:r,children:n,container:i,forceMount:s,...o}=e,{size:a,variant:c,color:l,highContrast:u}=P.useContext(Gy);return P.createElement(Vy,{container:i,forceMount:s},P.createElement(Fl,{asChild:!0},P.createElement(yP,{"data-accent-color":l,alignOffset:-Number(a)*4,sideOffset:1,collisionPadding:10,...o,ref:t,className:or("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",r,Qr(a,"rt-r-size"),`rt-variant-${c}`,{"rt-high-contrast":u})},P.createElement($0,{type:"auto"},P.createElement("div",{className:or("rt-BaseMenuViewport","rt-DropdownMenuViewport")},n)))))});nw.displayName="DropdownMenuSubContent";const iw=P.forwardRef((e,t)=>P.createElement(gP,{...e,ref:t,className:or("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",e.className)}));iw.displayName="DropdownMenuSeparator";const $i=Object.assign({},{Root:Hy,Trigger:Wy,Content:Ky,Label:Yy,Item:Jy,Group:Xy,RadioGroup:Zy,RadioItem:Qy,CheckboxItem:ew,Sub:tw,SubTrigger:rw,SubContent:nw,Separator:iw}),Wa={size:{type:"enum",values:["1","2","3","4"],default:"2",responsive:!0},variant:{type:"enum",values:["classic","solid","soft","surface","outline","ghost"],default:"solid"},color:ka,highContrast:$l,radius:g0},sw=P.forwardRef((e,t)=>{const{rest:r,...n}=Da(e),{className:i,asChild:s=!1,size:o=Wa.size.default,variant:a=Wa.variant.default,color:c=Wa.color.default,highContrast:l=Wa.highContrast.default,radius:u=Wa.radius.default,...f}=r,p=s?Kf:"button";return P.createElement(p,{"data-disabled":f.disabled||void 0,"data-accent-color":c,"data-radius":u,...f,ref:t,className:or("rt-reset","rt-BaseButton",i,Qr(o,"rt-r-size"),`rt-variant-${a}`,{"rt-high-contrast":l},La(n))})});sw.displayName="BaseButton";const ow=P.forwardRef((e,t)=>P.createElement(sw,{...e,ref:t,className:or("rt-Button",e.className)}));ow.displayName="Button";const wP={loading:{type:"boolean",default:!0}},Ys=P.forwardRef((e,t)=>{const{rest:r,...n}=Da(e),{className:i,children:s,loading:o=wP.loading.default,...a}=r;if(!o)return P.createElement(P.Fragment,null,s);const c=P.isValidElement(s)?Kf:"span";return P.createElement(c,{ref:t,"aria-hidden":!0,className:or("rt-Skeleton",i,La(n)),"data-inline-skeleton":P.isValidElement(s)?void 0:!0,tabIndex:-1,inert:"",...a},s)});Ys.displayName="Skeleton";const mF="";function z0(e){const{text:t,onClick:r,className:n,btnIsDisabled:i=!1}=e,s=()=>{r&&r()};return w.jsx(ow,{disabled:i,className:n?`cs-button ${n}`:"cs-button",onClick:s,children:t})}function Js({content:e,children:t,position:r="top",marginTop:n="0px",borderRadius:i="8px",delay:s=0,backgroundColor:o="var(--cs-bg-primary)"}){const[a,c]=le.useState(!1),[l,u]=le.useState(!1),f=le.useRef(null),p=()=>{f.current&&(clearTimeout(f.current),f.current=null),c(!0)};le.useEffect(()=>()=>{a||f.current&&(clearTimeout(f.current),f.current=null)},[a]);const y=()=>{f.current=setTimeout(()=>{l||(c(!1),f.current&&(clearTimeout(f.current),f.current=null))},0)},x=()=>{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{}}},v=le.useRef(null),[_,T]=le.useState({left:void 0,top:void 0});return le.useEffect(()=>{var O;if(a&&v.current){const R=(O=v.current)==null?void 0:O.getBoundingClientRect();let F,B;r==="top"?(F=`${window.scrollX+R.left+R.width/2}px`,B=`${window.scrollY+R.top-2*R.height-8}px`):r==="bottom"?(F=`${window.scrollX+R.left+R.width/2}px`,B=`${window.scrollY+R.bottom}px`):r==="left"?(F=`${window.scrollX+R.left-8}px`,B=`${window.scrollY+R.top+R.height/2}px`):r==="right"?(F=`${window.scrollX+R.right+8}px`,B=`${window.scrollY+R.top+R.height/2}px`):(F=`${window.scrollX+R.left+R.width/2}px`,B=`${window.scrollY+R.top+R.height/2}px`),T({left:F,top:B})}},[a]),w.jsxs("div",{ref:v,style:{position:"relative",display:"inline-block"},onMouseEnter:p,onMouseLeave:y,children:[t,a&&zn.createPortal(w.jsx("div",{style:{transition:"opacity 0.3s ease",opacity:a?1:0,position:"absolute",zIndex:9e3,padding:"8px 12px",backgroundColor:o,color:"var(--cs-text-secondary)",borderRadius:i,fontSize:"12px",whiteSpace:"nowrap",border:"1px solid",borderColor:"var(--cs-border)",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.1)",...x(),..._,marginTop:n},onMouseEnter:()=>u(!0),onMouseLeave:()=>{f.current&&(clearTimeout(f.current),f.current=null),u(!1),c(!1)},children:e}),document.body)]})}const gF="",q0=[{label:"Default"},{label:"Fast Mode",beforeIcon:{xlinkHref:"#icon-icon_flash",fontSize:"16px",activeColor:"var(--cs-primary)",activeHoverColor:"var(--cs-primary)"}}],xP=e=>{const{transactionMode:t,setTransactionMode:r,maxCapForGas:n,setMaxCapForGas:i,customGasPrice:s,setCustomGasPrice:o,suiBalance:a,themeType:c}=e,l=c=="Light"?Ct("/images/icon_shio_light@2x.png"):Ct("/images/icon_shio@2x.png"),u=le.useMemo(()=>{var O;return(O=q0.filter(R=>(R==null?void 0:R.label)===t))==null?void 0:O[0]},[t,q0]),f=O=>{const R=new RegExp("[^\\d-]*(\\d*(?:\\.\\d{0,9})?).*$");O.target.value=O.target.value.replace(R,"$1"),i(O.target.value)},p=O=>{const R=new RegExp("[^\\d-]*(\\d*(?:\\.\\d{0,9})?).*$");O.target.value=O.target.value.replace(R,"$1");const F=Ue(O.target.value).gt(0)?Ue(O.target.value).div(Math.pow(10,9)).toString():"0";Ue(F).gt(n)&&i(F),o(O.target.value)},y=le.useMemo(()=>!n||Number(n)==0?"Please enter a value higher than 0":n&&Number(n)>5?"Only allow up to 5 SUI":Ue(n).gt(a)?"Insufficient SUI balance ":Ue(n).lt(Ue(s).div(Math.pow(10,9)))?"Max cap cannot be less than custom gas.":"",[n]),x=le.useMemo(()=>n&&Number(n)>0&&Number(n)<2e-6?"Your current maximum fee is below the market rate. Please raise it to ensure your transactions are processed.":"",[n]),v=le.useMemo(()=>!s||Number(s)==0?"Please enter a value higher than 0":"",[s]),_=le.useMemo(()=>s&&Number(s)>0&&Ue(s).lt(750)?"Your current maximum fee is below the market rate. Please raise it to ensure your transactions are processed.":"",[s]),T=le.useMemo(()=>!s||s==="0"?"0":Ue(s).div(Math.pow(10,9)).toString(),[s]);return w.jsxs("div",{className:"transaction-mode-container",children:[w.jsxs("div",{className:"transaction-mode-header",children:[w.jsxs("div",{className:"transaction-mode-label",children:[w.jsx("svg",{children:w.jsx("use",{xlinkHref:"#icon-icon_mode"})}),w.jsx("span",{className:"caption-text",children:"Transaction Mode"})]}),w.jsx("div",{className:"slippage-tab-list",children:q0.map(O=>w.jsxs("div",{className:O.label===u.label?"active slippage-tab":"slippage-tab",children:[O.label!=="Default"&&w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_flash"})}),w.jsx("span",{onClick:()=>{r(O.label)},children:O.label})]},O.label))})]}),w.jsx("p",{className:"transaction-description",children:t==="Default"?"Standard gas based on real-time network conditions":"Land your transaction earlier and avoid congestion with a higher gas price. MEV protection is on by default in Fast Mode."}),t==="Fast Mode"&&w.jsxs("div",{className:"fast-mode-section",children:[w.jsxs("div",{className:"input-card",children:[w.jsxs("div",{className:"input-label",children:[w.jsx("span",{children:"Custom Gas Price"}),w.jsx(Js,{position:"bottom",content:w.jsx("div",{className:"tooltip-content",children:"The total gas depends on the gas price and actual gas units consumed."}),children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-tips"})})})]}),w.jsxs("div",{className:"input-right",children:[w.jsxs("div",{className:"input-field",children:[w.jsx("input",{value:s,onChange:p,placeholder:"0.0"}),w.jsx("span",{className:"caption-text",children:"MIST"})]}),w.jsxs("div",{className:"unit-text",children:[w.jsx("span",{children:T}),"SUI"]})]})]}),v&&w.jsx(cu,{text:v,type:"error"}),_&&w.jsx(cu,{text:_,type:"warn"}),w.jsxs("div",{className:"input-card",children:[w.jsxs("div",{className:"input-label",children:[w.jsx("span",{children:"Set Max Cap for Gas"}),w.jsx(Js,{position:"bottom",content:w.jsx("div",{className:"tooltip-content",children:"Set a max cap for your gas to prevent overpaying"}),children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-tips"})})})]}),w.jsx("div",{className:"input-right",children:w.jsxs("div",{className:"input-field",children:[w.jsx("input",{value:n,onChange:f,placeholder:"0.0"}),w.jsx("span",{className:"caption-text",children:"SUI"})]})})]}),y&&w.jsx(cu,{text:y,type:"error"}),x&&w.jsx(cu,{text:x,type:"warn"}),w.jsxs("div",{className:"powered-by",children:[w.jsx("span",{children:"Powered by"}),w.jsx("img",{src:l,alt:"shio"})]})]})]})},cu=e=>{const{text:t,type:r}=e;return w.jsx("div",{style:{width:"100%",padding:"4px 16px",borderRadius:"8px",background:r==="warn"?"var(--cs-warning-10)":"var(--cs-error-10)",display:"flex",alignItems:"center",justifyContent:"center"},children:w.jsx("span",{style:{color:r==="warn"?"var(--cs-warning)":"var(--cs-error)",fontSize:"12px",lineHeight:"16px"},children:t})})},SP={id:"0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",coin_type:"0x2::sui::SUI",decimals:9,description:"",name:"Sui",symbol:"SUI",logo_url:"https://archive.cetus.zone/assets/image/sui/sui.png",is_verified:!0,extensions:{rank:"880"}};function _P({themeType:e}){const{setIsOpenSlippageDialog:t,isOpenSlippageDialog:r,slippage:n}=Vr();return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"slippage-button",onClick:()=>t(!0),children:[w.jsxs("span",{children:[n,"%"]}),w.jsx("div",{className:"svg-box",children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-verticalslider"})})})]}),r&&w.jsx(EP,{themeType:e,onClose:()=>t(!1)})]})}function EP({onClose:e,themeType:t}){const{transactionMode:r,maxCapForGas:n,customGasPrice:i,setMaxCapForGas:s,setCustomGasPrice:o,setTransctionMode:a,mevProtect:c,setMevProtect:l}=Vr(),{balanceInfo:u}=Ma(SP),[f,p]=le.useState(r),[y,x]=le.useState(n),[v,_]=le.useState(i),[T,O]=le.useState(c),{slippage:R,setSlippage:F}=Vr(),[B,H]=le.useState(R),$=de=>{H(de.display)},Z=de=>{const q=new RegExp("[^\\d-]*(\\d*(?:\\.\\d{0,2})?).*$");de.target.value=de.target.value.replace(q,"$1"),H(de.target.value)},ce=()=>{B&&F(B),f==="Fast Mode"&&(s(y),o(v)),a(f),l(T),e()};le.useEffect(()=>{f==="Fast Mode"&&O(!0)},[f]);const ne=le.useMemo(()=>f==="Fast Mode"&&(!y||Number(y)===0||Number(y)>5||!v||Number(v)===0||Ue(y).gt((u==null?void 0:u.totalBalanceFormat)||"0")||Ue(y).lt(Ue(v).div(Math.pow(10,9))))||!+B?!0:Number(B)>50||Number(B)<.01,[B,f,y,v,u]);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:"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:YC.map(de=>w.jsxs("span",{className:de.display===B?"active":"",onClick:()=>$(de),children:[de.display," %"]},de.display))}),w.jsxs("div",{className:"input-box",children:[w.jsx("span",{children:"Custom"}),w.jsx("input",{className:"cs-input",placeholder:"0.0",value:B,onChange:Z}),w.jsx("div",{style:{fontSize:"14px",color:"var(--cs-text-primary)"},children:"%"})]})]}),Number(B)<=.05&&w.jsx("div",{className:"tips warning",children:"Slippage is low. Your transaction may fail."}),Number(B)<=50&&Number(B)>1&&w.jsx("div",{className:"tips warning",children:"Your transaction may frontrun"}),Number(B)>50&&w.jsx("div",{className:"tips error",children:" Enter a valid slippage percentage"}),w.jsx(xP,{transactionMode:f,setTransactionMode:p,maxCapForGas:y,setMaxCapForGas:x,customGasPrice:v,setCustomGasPrice:_,suiBalance:(u==null?void 0:u.totalBalanceFormat)||"0",themeType:t}),w.jsx(CP,{mevProtect:T,setMevProtect:O,disabled:f==="Fast Mode"}),w.jsx(z0,{text:"Save",btnIsDisabled:ne,className:"slippage-save-btn",onClick:ce})]})})]})}const CP=e=>{const{mevProtect:t,disabled:r,setMevProtect:n}=e;return w.jsxs("div",{className:"mev-settings-box",children:[w.jsx("div",{className:"mev-setting-title",children:w.jsxs("div",{className:"name",children:[w.jsx("svg",{"aria-hidden":"true",cursor:"pointer",fill:"var(--cs-icon-fill)",children:w.jsx("use",{xlinkHref:"#icon-icon_mev"})}),w.jsx("span",{children:"MEV Protect"})]})}),w.jsxs("div",{className:"mev-setting-Switch",children:[w.jsxs("div",{className:"label",children:[w.jsx("span",{children:"Enable MEV Protection"}),w.jsx(Js,{position:"bottom",marginTop:"-118px",content:w.jsx("div",{className:"mev-tips",style:{width:"310px",whiteSpace:"wrap",color:"var(--cs-text-primary)"},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."}),children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{cursor:"pointer"},children:w.jsx("use",{xlinkHref:"#icon-tips"})})})]}),w.jsx(Z2,{checked:t,disabled:r,className:"cs-switch",onClick:()=>{n(!t)}})]})]})};function AP({handleRefresh:e,themeType:t}){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(_P,{themeType:t}),w.jsx(dA,{onClick:e})]})]})})}const vF="",bF="";function TP(){const[e,t]=le.useState(!1);return w.jsxs($i.Root,{open:e,onOpenChange:t,children:[w.jsx($i.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($i.Content,{variant:"soft",className:"cs-dropdown-content",style:{backgroundColor:"var(--cs-primary-10)"},side:"bottom",align:"end",children:w.jsxs("div",{className:"cs-settings-box",children:[w.jsx("h3",{children:"Settings"}),w.jsx(MP,{}),w.jsx(OP,{onClose:()=>{t(!1)}})]})})]})}function MP(){const{currentExplorer:e,setCurrentExplorer:t,currentRpc:r,setCurrentRpc:n}=Vr(),i=s=>{t(s)};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:xl.map(s=>w.jsxs("div",{className:"group-item",style:{justifyContent:"center"},onClick:()=>i(s.link),children:[w.jsx(Hl,{color:"indigo",checked:s.link===e,variant:"soft",className:"cs-checkbox cs-allow-change-checkbox"}),w.jsx("img",{src:s.img}),w.jsx("span",{children:s.name})]},s.link))})]})}const IP=e=>!/^(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/.test(e);function OP({onClose:e}){const{addTxToast:t}=Io(),{currentRpc:r,setCurrentRpc:n,customRpc:i,setCustomRpc:s,rpcList:o}=Vr(),[a,c]=le.useState(i),[l,u]=le.useState(r),f=v=>{t({id:0,status:"success",buildShowInfo:()=>({toastTitleText:"RPC update",toastDescriptionContent:`RPC is currently set to ${v}`})})},p=v=>{u(v),v.isCustom||(n(v),f(v.link),e())},y=v=>{c(v.target.value)},x=()=>{if(a){const v={name:"Custom RPC URL",link:a,isCustom:!0};s(a),n(v),f(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 rpc-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-rpc"})}),w.jsx("span",{children:"RPC Node"})]}),w.jsxs("div",{className:"rpc-checkbox-group",children:[o.map(v=>w.jsxs("div",{className:"rpc-item",onClick:()=>p(v),children:[w.jsx(Hl,{color:"indigo",checked:l.name===v.name,variant:"soft",className:"cs-checkbox cs-allow-change-checkbox"}),w.jsx("span",{children:v.name})]},v.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(z0,{btnIsDisabled:IP(a),text:"Save",onClick:x})]})]})]})}const yF="";function aw(){const{suiClient:e}=fs(),{setAccountServiceNameObj:t,accountServiceNameObj:r}=zr(),n=async s=>{if(!((s==null?void 0:s.length)<1))try{const o=s.map(async l=>{var f;const u=await e.resolveNameServiceNames({address:l});return{address:l,name:((f=u==null?void 0:u.data)==null?void 0:f[0])||""}}),a=await Promise.all(o),c=Object.fromEntries(a==null?void 0:a.map(l=>[l.address,l.name]));t(c)}catch{}};return{fetchServiceNames:n,getServiceNames:async s=>{const o=[];s==null||s.forEach(a=>{const c=a==null?void 0:a.address;r!=null&&r[c]||o.push(c)}),(o==null?void 0:o.length)>0&&n(o)}}}var PP=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()}},RP=PP,cw={"text/plain":"Text","text/html":"Url",default:"Text"},jP="Copy to clipboard: #{key}, Enter";function NP(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function kP(e,t){var r,n,i,s,o,a,c=!1;t||(t={}),r=t.debug||!1;try{i=RP(),s=document.createRange(),o=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 f=cw[t.format]||cw.default;window.clipboardData.setData(f,e)}else u.clipboardData.clearData(),u.clipboardData.setData(t.format,e);t.onCopy&&(u.preventDefault(),t.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);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(f){r&&console.error("unable to copy using clipboardData: ",f),r&&console.error("falling back to prompt"),n=NP("message"in t?t.message:jP),window.prompt(n,e)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),i()}return c}var DP=kP;const lw=io(DP);function LP({currentAccount:e}){const{mutate:t}=Wr.useSwitchAccount(),r=Wr.useAccounts(),{isOpenAccountList:n,setIsOpenAccountList:i,accountServiceNameObj:s}=zr(),{getServiceNames:o}=aw(),a=le.useCallback(()=>{n||o(r),i(!n)},[n,r]);le.useEffect(()=>()=>{i(!1)},[]);const c=le.useMemo(()=>r.filter(u=>u.address!==e),[r,e]);le.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&&(s==null?void 0:s[e])||zs(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=>{var f,p,y,x;return w.jsxs("div",{className:"account-item",children:[w.jsxs("div",{className:"left",children:[w.jsxs("div",{className:"label",children:[((f=u==null?void 0:u.label)==null?void 0:f.length)>16?((p=u==null?void 0:u.label)==null?void 0:p.substring(0,6))+"..."+((x=u==null?void 0:u.label)==null?void 0:x.substring(((y=u==null?void 0:u.label)==null?void 0:y.length)-10)):u==null?void 0:u.label," "]}),w.jsx("div",{className:"address",children:(s==null?void 0:s[u==null?void 0:u.address])||zs(u==null?void 0:u.address)})]}),w.jsx("button",{className:"cs-outline-btn",onClick:()=>l(u),children:"Switch"})]},u==null?void 0:u.address)})})]})}const BP=le.forwardRef(({connect:e,isSimulate:t=!1})=>{const r=Wr.useCurrentAccount();return w.jsx("div",{children:r?w.jsx(UP,{isSimulate:t}):w.jsx(z0,{text:"Connect",className:"cs-connect-button",onClick:()=>e(!0)})})});function UP({isSimulate:e}){const{mutate:t}=Wr.useDisconnectWallet(),r=Wr.useCurrentAccount(),{currentWallet:n}=Wr.useCurrentWallet(),{addCommonToast:i}=Io(),{getExplorerUrl:s}=To(),{accountServiceNameObj:o}=zr(),a=()=>{r&&(lw(r.address||"",{debug:!1,message:"message"}),i("Copied"))},c=()=>{r&&window.open(s(r.address,"account"),"_blank")};return le.useEffect(()=>{},[n]),w.jsxs($i.Root,{children:[w.jsx($i.Trigger,{children:w.jsxs("div",{className:"cs-connected-button",children:[w.jsx("img",{src:n==null?void 0:n.icon,style:{width:"20px",height:"20px"}}),w.jsx("span",{style:{color:e?"#fff":"var(--cs-text-primary)"},children:(r==null?void 0:r.address)&&(o==null?void 0:o[r==null?void 0:r.address])||zs(r==null?void 0:r.address)})]})}),w.jsx($i.Content,{variant:"soft",className:"cs-dropdown-content",style:{backgroundColor:"var(--cs-primary-10)"},side:"bottom",align:"end",children:w.jsxs("div",{className:"account-op-box",children:[w.jsx("span",{style:{fontSize:"14px",color:"var(--cs-text-secondary)",marginBottom:"6px"},children:r==null?void 0:r.label}),w.jsx(LP,{currentAccount:r==null?void 0:r.address}),w.jsxs("div",{className:"account-op-item",onClick:a,style:{marginTop:"12px"},children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_copy"})}),w.jsx("span",{children:"Copy address"})]}),w.jsxs("div",{className:"account-op-item",onClick:c,children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_link"})}),w.jsx("span",{children:"Open explorer"})]}),w.jsxs("div",{className:"account-op-item",onClick:()=>t(),children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_disconnect"})}),w.jsx("span",{children:"Disconnect"})]})]})})]})}function FP({isSimulate:e=!1}){const{fetchServiceNames:t}=aw(),r=Wr.useCurrentAccount();Wr.useCurrentWallet();const{isOpenWalletModal:n,onWalletModal:i,saveCurrentAccount:s}=zr();return Wr.useWallets(),le.useEffect(()=>{r!=null&&r.address&&t([r==null?void 0:r.address])},[r==null?void 0:r.address]),w.jsx(w.Fragment,{children:w.jsx(Wr.ConnectModal,{trigger:w.jsx(BP,{connect:i,isSimulate:e}),open:n,onOpenChange:o=>i(o)})})}function $P({independentWallet:e,customWallet:t,logo:r}){return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"widget-header",children:[w.jsx("img",{src:r,className:"cetus-logo"}),w.jsxs("div",{className:"right",children:[e&&w.jsx(FP,{}),w.jsx(TP,{})]})]}),w.jsx("div",{style:{marginTop:"12px"}})]})}const wF="",uw=()=>{const e=le.useRef(null);le.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:"var(--cs-primary)",boxShadow:"0px 0px 20px 2px var(--cs-primary)",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 VP({onClose:e,transactionData:t}){const{status:r,buildShowInfo:n,tx:i}=t,s=le.useMemo(()=>{if(n&&r)return n(r)},[r]);return w.jsxs("div",{className:"ts-status-dialog",children:[(r==="confirmation"||r==="submitted")&&w.jsx(zP,{info:s,status:r}),(r==="success"||r==="rejected")&&w.jsx(qP,{info:s,status:r,tx:i,onClose:e})]})}function zP({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(uw,{})}),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 qP({info:e,status:t,tx:r,onClose:n}){const{getExplorerUrl:i}=To();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"}),xl.map(s=>w.jsx("a",{href:i(r,"tx",s.link),target:"_blank",children:w.jsx("img",{src:s.img})},s.link))]})]}),w.jsx("button",{className:"cs-solid-btn swap-more-btn",onClick:n,children:t==="success"?"Swap More":"Retry"})]})}function HP(){const{fetchByApi:e}=Sl(),{setProviders:t}=Vr();return{fetchRouterConfig:async()=>{try{const n=await e("/router_v2/status","GET"),{providers:i}=n;i&&t(i)}catch{}}}}function WP({interval:e,callback:t}){const r=le.useRef(),n=le.useRef(null);le.useEffect(()=>{r.current=t},[t]);const i=le.useCallback(()=>{n.current&&clearInterval(n.current),e>0&&(n.current=setInterval(()=>{r.current&&r.current(Date.now())},e))},[e]),s=le.useCallback(()=>{n.current&&(clearInterval(n.current),n.current=null)},[]);return le.useEffect(()=>(i(),()=>s()),[]),{startTimer:i,stopTimer:s}}const dw=ki((e,t)=>({coinPriceObj:{},setPriceObj:r=>{const n=t().coinPriceObj;e({coinPriceObj:{...n,...r}})},clearPriceObj:r=>{const n=t().coinPriceObj;r.forEach(i=>{delete n[dr(i).full_address]}),e({coinPriceObj:{...n}})}}));function GP(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function Ga(){const{fetchByApi:e}=Sl(),{coinPriceObj:t,setPriceObj:r,clearPriceObj:n}=dw(),i=async a=>{const l=GP(a,10);try{const f=(await Promise.all(l.map(p=>e("/v3/sui/market_price","GET",{base_symbol_address:p.map(y=>Ri(y,!1))})))).map(p=>p.prices).flat();if(f){const p={};f.forEach(y=>{p[dr(y.base_symbol).full_address]=y}),r(p)}return f}catch{return n(a),null}},s=le.useCallback(a=>{if(!a)return;const c=t[dr(a).full_address];if(c)return c},[t]),o=le.useCallback((a,c,l)=>{const u=Number(c)==0||!l?"0":l;if(c&&a&&+c){const f=s(a);if(f)return Ue(c).mul(f.price).toString()}return u},[t]);return{fetchTokenPrices:i,getTokenPrice:s,getTokenAmountValue:o}}function KP(){const{tokenBalanceObj:e}=zr(),{fetchTokenPrices:t}=Ga(),{isOpenTokensDialog:r}=Zr(),n=le.useCallback(()=>{if(HC(e)){const i=Object.keys(e);t(i)}},[e]);return le.useEffect(()=>{r&&n()},[r]),{getMyAssetsPrice:n}}const YP={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"}},fw={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"}},hw=YP;function JP(e,t){const{fetchTokenInfo:r}=hs(),{setFromCoin:n,setToCoin:i,setDefaultCoin:s,fromCoin:o,toCoin:a}=Zr(),{setSlippage:c,setRpcList:l,setCurrentRpc:u}=Vr(),{tokenMapIsInit:f}=Mo(),p=le.useRef({}),y=async(v,_)=>{if(!_&&!v&&(o||a))return;const T=v?await r(v):fw,O=_?await r(_):hw;n(T),i(O),s(T==null?void 0:T.coin_type,O==null?void 0:O.coin_type)},x=(v=[],_)=>{let T=[],O=Ca[0],R=Ca[0];v.forEach(F=>{const B={name:F,link:F,isCustom:!1};T.push(B),F===_&&(R=B)}),_&&v.includes(_)?T=[R,O,...T.filter(F=>F.link!==_)]:T.unshift(Ca[0]),l([...T,{name:"Custom RPC URL",link:"",isCustom:!0}]),u(R)};return le.useEffect(()=>{if(f&&!zf(e,p.current)){const{defaultFromToken:v,defaultToToken:_,defaultSlippage:T,customRpcList:O,defaultRpc:R}=e;y(v,_),T&&c(T),x(O||[],R),p.current=e}},[e,f]),{handleSetDefaultPair:y}}function XP(e){const{currentRpc:t}=Vr(),{setSuiClient:r,setAggregatorSDK:n}=fs(),{currentAccount:i}=zr();le.useEffect(()=>{if(t){const o=new js({url:t.link});r(o)}},[t]);const s=()=>{const o={endpoint:Ao.aggregatorUrl,signer:(i==null?void 0:i.address)||"",client:new js({url:t.link}),env:Df.Mainnet,overlayFeeRate:(e==null?void 0:e.overlayFeeRate)||void 0,overlayFeeReceiver:(e==null?void 0:e.overlayFeeReceiver)||void 0},a=new dv(o);n(a)};le.useEffect(()=>{t&&s()},[t.link,i==null?void 0:i.address]),le.useEffect(()=>{e!=null&&e.overlayFeeRate&&(e!=null&&e.overlayFeeReceiver)&&s()},[e==null?void 0:e.overlayFeeRate,e==null?void 0:e.overlayFeeReceiver])}const H0=ki((e,t)=>({transactionData:void 0,setTransactionData:r=>{e(()=>({transactionData:r}))}})),jr=[];for(let e=0;e<256;++e)jr.push((e+256).toString(16).slice(1));function ZP(e,t=0){return(jr[e[t+0]]+jr[e[t+1]]+jr[e[t+2]]+jr[e[t+3]]+"-"+jr[e[t+4]]+jr[e[t+5]]+"-"+jr[e[t+6]]+jr[e[t+7]]+"-"+jr[e[t+8]]+jr[e[t+9]]+"-"+jr[e[t+10]]+jr[e[t+11]]+jr[e[t+12]]+jr[e[t+13]]+jr[e[t+14]]+jr[e[t+15]]).toLowerCase()}let W0;const QP=new Uint8Array(16);function eR(){if(!W0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");W0=crypto.getRandomValues.bind(crypto)}return W0(QP)}const pw={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function mw(e,t,r){var i;if(pw.randomUUID&&!t&&!e)return pw.randomUUID();e=e||{};const n=e.random??((i=e.rng)==null?void 0:i.call(e))??eR();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 s=0;s<16;++s)t[r+s]=n[s];return t}return ZP(n)}var Xs=(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))(Xs||{});const tR=new js({url:zh("mainnet")}),rR=["0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC","0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD","0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD","0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb::usdy::USDY","0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF"],nR=["deny_list","DenyList","DenyCap","create_regulated_currency"],iR={showType:!0,showContent:!0,showOwner:!1,showPreviousTransaction:!1,showStorageRebate:!1,showDisplay:!1},sR=async e=>{let t=!1;if(rR.includes(e))return t;const r=e.split("::"),n=r[0]&&Dt(r[0]),i=r[1],s=await tR.getObject({id:n,options:iR}),o="disassembled"in s.data.content?s.data.content.disassembled[i]:null;return o&&typeof o=="string"&&new RegExp(nR.join("|"),"i").test(o)&&(t=!0),t},oR=e=>{var n;if(!e)return"";const t=e==null?void 0:e.split(",");return(n=t==null?void 0:t.map(i=>Ri(i,!1)))==null?void 0:n.join(",")};function aR(){const{fetchByApi:e}=Sl(),t=async s=>{try{const o={...s},a=oR(s==null?void 0:s.coin_type);a&&(o.coin_type=a);const c=await e("/v2/sui/stats_pools","GET",o);if(c!=null&&c.lp_list)return{list:(c==null?void 0:c.lp_list)||[],total:c==null?void 0:c.total}}catch(o){return console.error("getPoolList ~ Error:",o),await r(s)}return{list:[],total:0}},r=async s=>{var o,a,c,l;try{const u=Ct("/data/pools.json"),f=await fetch(u).then(p=>p.json());if((o=f==null?void 0:f.data)!=null&&o.lp_list){const p=(a=f==null?void 0:f.data)==null?void 0:a.lp_list;let y=p;if(s!=null&&s.coin_type){const v=(l=(c=s==null?void 0:s.coin_type)==null?void 0:c.split(","))==null?void 0:l.map(_=>cn(_).source_address);y=p==null?void 0:p.filter(_=>{var R,F;const T=cn((R=_==null?void 0:_.coin_a)==null?void 0:R.address).source_address,O=cn((F=_==null?void 0:_.coin_b)==null?void 0:F.address).source_address;return(v==null?void 0:v.length)>1&&v.includes(T)&&v.includes(O)?!0:!!((v==null?void 0:v.length)===1&&(v.includes(T)||v.includes(O)))})}s!=null&&s.is_vaults&&(y=p==null?void 0:p.filter(v=>v==null?void 0:v.is_vaults)),s!=null&&s.has_farming&&!(s!=null&&s.is_vaults)&&!(s!=null&&s.has_mining)&&!(s!=null&&s.no_incentives)&&(y=p==null?void 0:p.filter(v=>v==null?void 0:v.has_farming));const x=y;return{list:x,total:(x==null?void 0:x.length)||0}}}catch(u){console.error("getLocalJsonPoolList Error:",u)}return{list:[],total:0}},n=s=>Lv(s)==="0x2::sui::SUI"?"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI":Lv(s);return{getPoolList:t,getLocalJsonPoolList:r,getLocalJsonPoolAddress:async(s,o)=>{try{const a=n(s),c=n(o),l=await fetch("/data/all-pools.json").then(u=>u.json());if(l)return l[`${a.toLocaleLowerCase()}-${c.toLocaleLowerCase()}`]||l[`${c.toLocaleLowerCase()}-${a.toLocaleLowerCase()}`]}catch(a){console.error("getLocalJsonPoolAddress Error:",a)}return[]}}}function cR(e=!0){const{poolApiMap:t,setPoolApiMap:r}=Vr(),{getPoolList:n,getLocalJsonPoolList:i,getLocalJsonPoolAddress:s}=aR();return{getPoolListByCoinType:async(c,l)=>{if(c&&l){const u=[c,l].sort(),f=`${u[0]}_${u[1]}`,p=t[f];if(p)return p;const y={coin_type:`${c},${l}`,display_all_pools:!0,offset:0,limit:100,order_by:"-tvl",no_incentives:!0,has_farming:!0,has_mining:!0};let x=e?await i(y):void 0;(x===void 0||x.list.length===0)&&(x=await n(y));const v=x.list;if(v.length>0)return t[f]=v,r(f,v),v}return[]},getPoolAddressByCoinType:async(c,l)=>{if(c&&l){const u=[c,l].sort(),f=`${u[0]}_${u[1]}`;if(e){const x=await s(c,l);if(!x||x.length===0){const v=t[f];if(v)return v.map(_=>_.poolAddress)}else return x}const p={coin_type:`${c},${l}`,display_all_pools:!0,offset:0,limit:100,order_by:"-tvl",no_incentives:!0,has_farming:!0,has_mining:!0},y=await n(p);if(y){const x=y.list;if(x.length>0)return t[f]=x,r(f,x),x.map(v=>v.poolAddress)}}return[]}}}function lR(e){const{routerData:t}=Zr();return{priceAcceptRouterData:le.useMemo(()=>{if(t&&e){if(e.byAmountIn){if(!Ue(e.toAmountUi).eq(t.toAmountUi||"0"))return t}else if(!Ue(e.fromAmountUi).eq(t.fromAmountUi||"0"))return t;return}},[t,e])}}function gw(e,t){return{amountLimit:le.useMemo(()=>{if(t&&t.routerData){const{byAmountIn:n,fromAmountUi:i,toAmountUi:s}=t;return n?Ue(s).mul(Ue(1).sub(Ue(e).div(100))).toString():Ue(i).mul(Ue(1).add(Ue(e).div(100))).toString()}},[e,t])}}function uR(e){const{getTokenInfo:t,fetchTokenInfo:r}=hs();return{formatSwapRouter:le.useMemo(()=>{if(e&&e.routerData){const i=[],s=e.byAmountIn?e.routerData.amountIn.toString():e.routerData.amountOut.toString(),o=[],a=[];let c=Ue(0);if(e.routerData.routes.forEach((u,f)=>{const p={},y=e.byAmountIn?u.amountIn.toString():u.amountOut.toString();f===e.routerData.routes.length-1?p.percentage=Ue(1).sub(c).toFixed(2):p.percentage=Ue(y).div(s).toFixed(2),c=Ue(c).add(p.percentage);const x=[];u.path.forEach(v=>{i.includes(v.provider)||i.push(v.provider);const _=dr(v.from).full_address,T=dr(v.target).full_address,O=t(_),R=t(T);O||a.includes(_)&&a.push(_),R||a.includes(T)&&a.push(T);const F=v.provider===Aa.SCALLOP||v.provider===Aa.FLOWX||v.provider===Aa.FLOWXV3;x.push({from_type:_,to_type:T,pool_address:F?"":v.id,fee_rate:v.feeRate,provider:v.provider})}),p.paths=x,o.push(p)}),a.length>0)for(const u in a)r(u);return{router_summery:`${e.routerData.routes.length} Streams`,providers:i,routers:o}}},[e])}}function dR(){const{fromCoin:e,toCoin:t}=Zr(),{getPoolAddressByCoinType:r}=cR(!0);return{getSwapPoolAddress:async()=>e&&t?await r(e.coin_type,t.coin_type):[]}}function vw(e,t,r){return le.useMemo(()=>t&&r&&+t&&+r?e?Ue(r).div(t).toString():Ue(t).div(r).toString():"0",[t,r,e])}function bw(e){const[t,r]=le.useState(),n=async i=>{if(i.is_trusted)return!1;try{return await sR(i.coin_type)}catch{}return!1};return le.useEffect(()=>{r(void 0),e&&n(e).then(i=>{r(i)})},[e==null?void 0:e.coin_type]),{isScamsCoin:t}}function fR(e,t){const{defaultFromCoinType:r,defaultToCoinCoinType:n}=Zr(),{getTokenInfo:i}=hs(),{ignoreWarnTokenMap:s}=Vr(),o=i(e),a=i(t),c=le.useMemo(()=>!yl(r,fw.coin_type)||!yl(n,hw.coin_type),[r,n]),l=le.useCallback(f=>f&&!s[Ri(f.coin_type)]&&(yl(r,f.coin_type)||yl(n,f.coin_type))?!f.is_trusted:!1,[r,n,s]),u=le.useMemo(()=>{const f=[];return c&&(o&&l(o)&&f.push({...o}),a&&l(a)&&f.push({...a})),f},[o==null?void 0:o.coin_type,a==null?void 0:a.coin_type,c,s]);return{isCustomMode:c,customWarnTokenList:u}}function hR(){const{aggregatorSDK:e}=fs(),{getSwapPoolAddress:t}=dR(),r=s=>s&&s.error?s.error.code===Xs.InsufficientLiquidity||Xs.HoneyPot||Xs.NumberTooLarge:!1,n=async s=>{const{fromToken:o,toToken:a,amount:c,providersKeys:l,by_amount_in:u,uuid:f}=s;try{const p={from:o.coin_type,target:a.coin_type,amount:new Tm(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,f,o,a,y);if(!y||y.routes.length===0)throw Error("not find router");return i(!1,u,f,o,a,y)}catch{const y=await t(),x={from:o.coin_type,target:a.coin_type,amount:new Tm(c),byAmountIn:u,pools:y};try{const v=await e.swapInPools(x);return!v||!v.routeData?i(!0,u,f,o,a):i(!0,u,f,o,a,v.routeData)}catch{return{uuid:f,byAmountIn:u,isDegrade:!0}}}},i=(s,o,a,c,l,u)=>{var f;if(u){const p=u.error!==void 0,y=Vf(u.amountIn.toString(),c.decimals).toString(),x=Vf(u.amountOut.toString(),l.decimals).toString();return{routerData:p?void 0:u,fromAmountUi:p?o?y:"":y,toAmountUi:p&&o?"":x,uuid:a,byAmountIn:o,isDegrade:s,errorCode:(f=u.error)==null?void 0:f.code}}else return{uuid:a,byAmountIn:o,isDegrade:s}};return{findBestRouters:n}}function $o(e){const t=le.useRef(e);return le.useEffect(()=>{t.current=e},[e]),t}function pR(e){try{return e&&e.toString().includes("Rejected from user")}catch{return!1}}function mR(e){const t=String(e);return t.indexOf("withdraw_with_proof")>-1||t.indexOf("check_coin_threshold")>-1||t.indexOf('Identifier("balance")')>-1}function gR(e){return!!String(e).includes("Could not find the referenced transaction")}function vR(e){return!!String(e).includes("Max cap reached.")}function bR(e){return!!String(e).includes("Fast Mode service error")}function yR(e){return pR(e)?"User rejected the request":mR(e)?"Exceeded price slippage":gR(e)?"Oops. Failed to sync data from your txid. Please check your txn status from explorer or from your wallet.":vR(e)?"Max cap reached. This is to prevent your txn from overpaying. You can choose to edit your gas max cap in settings if needed.":bR(e)?"Fast Mode service error, please switch to the Default Transaction Mode or try again later.":"Transaction failed"}var G0={},wR=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(G0,"__esModule",{value:!0});var xR=G0.executeAuction=yw;const SR=wR(d1),_R="https://rpc.getshio.com",ER=500,CR=300;function yw(e,t,r=ER){const n={jsonrpc:"2.0",method:"shio_executeAuction",params:[e,t],id:1};return new Promise((i,s)=>{setTimeout(i,r),SR.default.post(_R,n,{headers:{"Content-Type":"application/json"},timeout:r}).then(o=>{setTimeout(i,CR)}).catch(s)})}G0.default={executeAuction:yw};const AR="0x2::sui::SUI",TR="https://rpc.getshio.com/fast",MR="0x1889977f0fb56ae730e7bda8e8e32859ce78874458c74910d36121a81a615123",ww=[{objectId:"0xc32ce42eac951759666cbc993646b72387ec2708a2917c2c6fb7d21f00108c18",version:72869622},{objectId:"0x0289acae0edcdf1fe3aedc2e886bc23064d41c359e0179a18152a64d1c1c2b3e",version:327637282},{objectId:"0x03132160e8c2c45208abf3ccf165e82edcc42fee2e614afe54582f9740a808b8",version:327637282},{objectId:"0x072ae7307459e535379f422995a0d10132f12a3450298f8cf0cc07bd164f9999",version:327637282},{objectId:"0x1c1a96a2f4a34ea09ab15b8ff98f4b6b4338ce89f4158eb7d3eb2cd4dcbd6d86",version:327637282},{objectId:"0x20d76f37ad9f2421a9e6afaf3bb204250b1c2241c50e8a955e86a1a48767d06f",version:327637282},{objectId:"0x213ed368233cc7480fcb6336e70c5ae7ee106b2317ba02ccb5d0478e45bcc046",version:327637282},{objectId:"0x22ce1e80937354eba5549fed2937dc6e2b24026d03505bb51a3e4a64aa4142f6",version:327637282},{objectId:"0x26188cb7ce5ae633279f440f66081cb65cc585e428de18e194f8843e866f799f",version:327637282},{objectId:"0x38642f01422480128388d3e2948d3dc1b2680f9914077edb6bd3451ae1c5bcf0",version:327637282},{objectId:"0x3dd85b6424aea1cae9eff6e55456ca783e056226325f1362106eca8b3ed04ca0",version:327637282},{objectId:"0x42f8adc490542369d9c3b95e9f6eb70b2583102900feb7e103072ed49ba7fc3d",version:327637282},{objectId:"0x46b8158c82fa6bda7230d31a127d934c7295a0042083b4900f3096e9191f6f3f",version:327637282},{objectId:"0x6ebac88a8c3f7a4a9fb05ea49d188a1fe8520ae59ee736e0473004d3033512a4",version:327637282},{objectId:"0x6f55ad6cb40cfc124c11b11c19be0a80237b104acd955e7b52ccb7bf9046fe33",version:327637282},{objectId:"0x71aafb8bac986e82e5f78846bf3b36c2a82505585625207324140227a27ff279",version:327637282},{objectId:"0x7fe9b08680d4179de5672f213b863525b21f10604ca161538075e9338d1d2324",version:327637282},{objectId:"0x81538ef2909a3e0dd3d7f38bcbee191509bae4e8666272938ced295672e2ee8d",version:327637282},{objectId:"0x828eb6b3354ad68a23dd792313a16a0d888b7ea4fdb884bb22bd569f8e61319e",version:327637282},{objectId:"0x9705a332b8c1650dd7fe687ef9f9a9638afb51c30c0b34db150d60b920bc07eb",version:327637282},{objectId:"0x9918f73797a9390e9888b55454f2b31bc01de1a4634acab08f80641c4248e8a5",version:327637282},{objectId:"0x9cd4c08bdf2e132ec2cc77b0f03be60a94951e046d8e82ed5494f44e609edd2f",version:327637282},{objectId:"0xac8ce2033571140509788337c8a1f3aa8941a320ecd7047acda310d39cad9e03",version:327637282},{objectId:"0xbcd4527035265461a9a7b4f1e57c63ea7a6bdf0dc223c66033c218d880f928b1",version:327637282},{objectId:"0xbfdb691b8cc0b3c3a3b7a654f6682f3e53b164d9ee00b9582cdb4d0a353440a9",version:327637282},{objectId:"0xc2559d5c52ae04837ddf943a8c2cd53a5a0b512cee615d30d3abe25aa339465e",version:327637282},{objectId:"0xc56db634d02511e66d7ca1254312b71c60d64dc44bf67ea46b922c52d8aebba6",version:327637282},{objectId:"0xc84545cbff1b36b874ab2b69d11a3d108f23562e87550588c0bda335b27101e0",version:327637282},{objectId:"0xcc141659b5885043f9bfcfe470064819ab9ac667953bcedd1000e0652e90ee76",version:327637282},{objectId:"0xef6bf4952968d25d3e79f7e4db1dc38f2e9d99d61ad38f3829acb4100fe6383a",version:327637282},{objectId:"0xf2ed8d00ef829de5c4a3c5adf2d6b0f41f7fec005fb9c88e5616b98173b2fd66",version:327637282},{objectId:"0xfce73f3c32c3f56ddb924a04cabd44dd870b72954bbe7c3d7767c3b8c25c4326",version:327637282}];async function IR(e){const t=e.client,r=await e.transaction.build({client:t,onlyTransactionKind:!0});let n=e.sender??e.transaction.getData().sender;if(!n)throw new Error("Sender need to be either set in options or in transaction data");return await t.call("shio_estimateFastModeFee",[n,e.transaction.getData().gasData.price,Oc.from(r).toString("base64")])}function OR(){return ww[Math.floor(Math.random()*ww.length)]}async function PR(e,t,r){return await e.executeTransactionBlock({transactionBlock:t.bytes,signature:t.signature,options:r})}async function RR(e,t,r){let n=e.moveCall({package:"0x2",module:"coin",function:"into_balance",typeArguments:[AR],arguments:[t]});return jR(e,n,r)}async function jR(e,t,r){let n=OR();e.moveCall({package:MR,module:"auctioneer",function:"submit_bid",arguments:[e.sharedObjectRef({objectId:n.objectId,mutable:!0,initialSharedVersion:n.version}),e.pure.u64(r),t]})}const K0="CoinWithBalance",NR=Fe({type:At(),balance:gc()});async function kR(e,t,r){var l,u;const n=new Set,i=new Map;if(!e.sender)throw new Error("Sender must be set to resolve CoinWithBalance");for(const f of e.commands)if(f.$kind==="$Intent"&&f.$Intent.name===K0){const{type:p,balance:y}=cr(NR,f.$Intent.data);p!=="gas"&&y>0n&&n.add(p),i.set(p,(i.get(p)??0n)+y)}const s=new Set;for(const f of e.inputs)(l=f.Object)!=null&&l.ImmOrOwnedObject&&s.add(f.Object.ImmOrOwnedObject.objectId),(u=f.UnresolvedObject)!=null&&u.objectId&&s.add(f.UnresolvedObject.objectId);const o=new Map,a=t.client;await Promise.all([...n].map(async f=>{o.set(f,await DR({coinType:f,balance:i.get(f),client:a,owner:e.sender,usedIds:s}))}));const c=new Map;c.set("gas",{$kind:"GasCoin",GasCoin:!0});for(const[f,p]of e.commands.entries()){if(p.$kind!=="$Intent"||p.$Intent.name!==K0)continue;const{type:y,balance:x}=p.$Intent.data;if(x===0n&&y!=="gas"){e.replaceCommand(f,Kn.MoveCall({target:"0x2::coin::zero",typeArguments:[y]}));continue}const v=[];if(!c.has(y)){const[_,...T]=o.get(y).map(O=>e.addInput("object",In.ObjectRef({objectId:O.coinObjectId,digest:O.digest,version:O.version})));T.length>0&&v.push(Kn.MergeCoins(_,T)),c.set(y,_)}v.push(Kn.SplitCoins(c.get(y),[e.addInput("pure",In.Pure(_g.bcs.u64().serialize(x)))])),e.replaceCommand(f,v),e.mapArguments(_=>_.$kind==="Result"&&_.Result===f?{$kind:"NestedResult",NestedResult:[f+v.length-1,0]}:_)}return r()}async function DR({coinType:e,balance:t,client:r,owner:n,usedIds:i}){let s=t;const o=[];return a();async function a(c=null){const{data:l,hasNextPage:u,nextCursor:f}=await r.getCoins({owner:n,coinType:e,cursor:c}),p=l.sort((y,x)=>Number(BigInt(x.balance)-BigInt(y.balance)));for(const y of p){if(i.has(y.coinObjectId))continue;const x=BigInt(y.balance);if(o.push(y),s-=x,s<=0)return o}if(u)return a(f);throw new Error(`Not enough coins of type ${e} to satisfy requested balance`)}}function xw(){const{suiClient:e}=fs(),{currentAccount:t}=zr(),{mutateAsync:r}=Wr.useSignTransaction(),{mutate:n}=Wr.useSignAndExecuteTransaction({execute:async({bytes:c,signature:l})=>await s(c,l)}),i=le.useMemo(()=>"sui:mainnet",[t]),s=async(c,l,u=!1)=>{var p,y;if(u){const x=await e.devInspectTransactionBlock({transactionBlock:es.from(yr(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 f,p;let u;if(typeof c=="string"?u=es.from(c):u=c,l){const y=await e.devInspectTransactionBlock({transactionBlock:c,sender:t.address});if(!y||((f=y.effects)==null?void 0:f.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:v=>{y(v)},onError:v=>{console.error("signAndExecuteTransactionBlock transaction failed",v),x(v)}})})},signTransactionBlock:async c=>(c instanceof Uint8Array&&(c=es.from(c)),typeof c=="string"&&(c=es.from(yr(c))),new Promise((l,u)=>{r({transaction:c,chain:i},{onSuccess:f=>{l(f)},onError:f=>{console.error("signTransactionBlock failed",f),u(f)},onSettled:(f,p,y,x)=>{console.error("signTransactionBlock onSettled",{data:f,error:p,variables:y})}})})),executeTransactionBlock:s}}function LR(){const{signTransactionBlock:e,executeTransactionBlock:t,signAndExecuteTransactionBlock:r}=xw(),{currentAccount:n}=zr();return{getFastModeTx:async(s,o,a)=>{let c,l,u;try{const f=new js({url:TR});s.setSender(n==null?void 0:n.address),s.setGasPrice(Number(a));const p=es.from(s);p.addIntentResolver(K0,kR);const y=await IR({transaction:p,client:f}),x=Ue(o).mul(Math.pow(10,9)).toString();if(Ue(y.gasBudget).gt(x))throw Error("Max cap reached. This is to prevent your txn from overpaying. You can choose to edit your gas max cap in settings if needed.");s.setGasBudget(y.gasBudget);const v=s.splitCoins(s.gas,[y.tipAmount]);RR(s,v[0],y.tipAmount);const _=await s.build({client:f}),T=await e(_),{bytes:O,signature:R}=T;u=O,l=new Date().getTime(),c=await PR(f,T,{showEffects:!0,showEvents:!0})}catch(f){throw String(f).includes("Failed to fetch")?Error("Fast Mode service error"):f}return{result:c,startExecuteTime:l,transactionBlockBytes:u}}}}function BR(){const{signTransactionBlock:e,executeTransactionBlock:t,signAndExecuteTransactionBlock:r}=xw(),{currentAccount:n}=zr(),{suiClient:i}=fs(),{setTransactionData:s}=H0(),{addTxToast:o,removeToast:a}=Io(),{getFastModeTx:c}=LR(),l=5,u=2e3;async function f(x,v=1){try{let _;try{_=await i.getTransactionBlock({digest:x,options:{showEvents:!0,showEffects:!0,showBalanceChanges:!0,showInput:!0,showRawInput:!0,showObjectChanges:!0}})}catch{_=await i.getTransactionBlock({digest:x,options:{showEvents:!0,showEffects:!0}})}if(_)return _;throw new Error("Empty response")}catch(_){if(console.error(`Attempt ${v} failed:`,_),v>=l)throw new Error("Failed to fetch transaction status after maximum retries.");return await kv(u),f(x,v+1)}}const p=async(x,v,_={useDevInspect:!1,useMev:!1,txAction:"signTransactionBlock",useFastMode:!1,maxCapForGas:"",customGasPrice:""})=>{var ce,ne,de;const{useDevInspect:T=!1,useMev:O,txAction:R="signTransactionBlock",useFastMode:F=!1,maxCapForGas:B="",customGasPrice:H=""}=_;let $;v.status="confirmation",s(v);let Z="";try{let q,N,h;typeof x=="function"?h=await x():h=x,h.setSender(n.address);let d;if(F&&B&&H){const S=await c(h,B,H);q=S.result,d=S.startExecuteTime,N=S.transactionBlockBytes}else if(R==="signTransactionBlock"){const S=await e(h),{bytes:E,signature:M}=S;if(O)try{const j=await xR(E,M,500)}catch{}q=await t(E,M,T)}else q=await r(h,T);v.status="submitted",s({...v}),v.tx=q.digest,$=o(v),await kv(u),Z=q==null?void 0:q.digest;let m;if(((ce=q==null?void 0:q.effects)==null?void 0:ce.status.status)==="success"?m=q:m=await f(Z,0),!m||((ne=m.effects)==null?void 0:ne.status.status)==="failure")y(v,(de=m.effects)==null?void 0:de.status.error);else{const S=qC(m,n==null?void 0:n.address,!1);if(v.buildShowInfo){const E=v.buildShowInfo("success",S);v.buildShowInfo=M=>E}a($),v.status="success",s({...v})}return m}catch(q){y(v,q)}},y=(x,v)=>{const _=yR(v);if(x.buildShowInfo){const T=x.buildShowInfo("confirmation");x.buildShowInfo=O=>(T.toastDescriptionContent=_,T.modalDescriptionText=_,T),x.status="rejected",s({...x})}else x.buildShowInfo=T=>{const O={};return O.toastDescriptionContent=_,O.modalDescriptionText=_,O},x.status="rejected",s({...x})};return{signAndExecuteTransaction:p}}function Y0(e,t=1e3){const r=le.useRef(),n=le.useCallback((...i)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(...i)},t)},[e,t]);return le.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),n}function UR(){const{aggregatorSDK:e}=fs(),{findBestRouters:t}=hR(),{getTokenAmountValue:r,fetchTokenPrices:n}=Ga(),{providers:i,slippage:s,mevProtect:o,maxCapForGas:a,transactionMode:c,customGasPrice:l}=Vr(),{signAndExecuteTransaction:u}=BR(),{setTransactionData:f}=H0(),{addTxToast:p}=Io(),{fromCoin:y,toCoin:x,setFromCoin:v,setToCoin:_,setToAmount:T,fromAmount:O,toAmount:R,setFromAmount:F,setFindRouterLoading:B,setRouterData:H,setByAmountIn:$,byAmountIn:Z}=Zr(),[ce,ne]=le.useState(""),de=$o(ce),q=$o(Z),N=$o(O),h=$o(R),d=$o(y),m=$o(x),{balanceInfo:S,getOwnerCoinBalances:E}=Ma(y),{balanceInfo:M}=Ma(x),j=r(y==null?void 0:y.coin_type,O),I=r(x==null?void 0:x.coin_type,R),b=Y0(async(re,ee,Q)=>{if(d.current&&m.current&&+re){(+N.current||+h.current)&&B(!0);const fe=$C(re,ee?d.current.decimals:m.current.decimals),W=await t({fromToken:d.current,toToken:m.current,amount:fe.toString(),providersKeys:i,by_amount_in:ee,uuid:Q});B(!1),de.current===Q&&(ee?+N.current?(T(W.toAmountUi||""),H(W)):T(""):+h.current?(F(W.fromAmountUi||"ß"),H(W)):F(""))}else he(!ee)},500),k=(re,ee,Q=!1)=>{if($(ee),ee?(F(re),Q&&T("")):(T(re),Q&&F("")),+re){const fe=mw();ne(fe),b(re,ee,fe)}else B(!1),H(void 0),he(!ee)},ve=(re,ee=!0)=>{he(),ee?((re==null?void 0:re.coin_type)===(x==null?void 0:x.coin_type)&&_(y),v(re)):((re==null?void 0:re.coin_type)===(y==null?void 0:y.coin_type)&&v(x),_(re))},he=re=>{re===void 0?(F(""),T("")):re?F(""):T(""),B(!1),H(void 0)},we=()=>{const re=q.current?N.current:h.current;if(+re){const ee=mw();ne(ee),b(re,q.current,ee)}},Oe=async(re,ee)=>{const{routerData:Q,byAmountIn:fe,fromAmountUi:W,toAmountUi:K}=re,te=new es,oe={routers:Q,slippage:Number(s)/100,txb:te,partner:ee||JC};try{const pe={status:"confirmation",buildShowInfo:(Ne,He)=>{const Ge=`Swap ${Ur(W,y==null?void 0:y.decimals)} ${y==null?void 0:y.symbol} for ${Ur(K,x==null?void 0:x.decimals)} ${x==null?void 0:x.symbol}`,Re={modalDescriptionText:Ge,toastTitleText:Ge};if(Ne==="success"){let Ke=W,nt=K;He&&(Ke=Dv(He,y)||W,nt=Dv(He,x)||K);const Qe=`Swapped ${Ur(Ke,y==null?void 0:y.decimals)} ${y==null?void 0:y.symbol} for ${Ur(nt,x==null?void 0:x.decimals)} ${x==null?void 0:x.symbol}`;Re.toastTitleText=Qe,Re.modalDescriptionText=Qe}return Re},id:0};f(pe),await u(async()=>(await e.fastRouterSwap(oe),te),pe,{useMev:o,useFastMode:c==="Fast Mode",maxCapForGas:a,customGasPrice:l})?(he(),E()):we()}catch(pe){String(pe).includes("TypeError: Failed to fetch")&&p({id:0,status:"rejected",buildShowInfo(Se,_e){return{toastTitleText:"RPC loading failed",toastDescriptionContent:"Try resubmission. Or to check your network and switch an RPC in settings to try again."}}})}};le.useEffect(()=>{je(),he()},[y==null?void 0:y.coin_type,x==null?void 0:x.coin_type]);const je=()=>{const re=[];y&&re.push(y.coin_type),x&&re.push(x.coin_type),re.length>0&&n(re)},{isScamsCoin:L}=bw(y),{isScamsCoin:z}=bw(x),G=le.useMemo(()=>{if(!(!L&&!z)){if(L&&z)return`${y==null?void 0:y.symbol} and ${x==null?void 0:x.symbol} are`;if(L)return`${y==null?void 0:y.symbol} token is `;if(z)return`${x==null?void 0:x.symbol} token is `}},[L,z]);return{handleAmountChange:k,handleSelectToken:ve,fromBalanceInfo:S,toBalanceInfo:M,fromAmountValue:j,toAmountValue:I,doSwapAction:Oe,reCalculateRouteData:we,refreshMarketPrice:je,scamsText:G}}function FR(e){const{fromCoin:t,toCoin:r,fromAmount:n,toAmount:i,routerData:s}=Zr(),{currentAccount:o}=zr(),a=le.useMemo(()=>{const c={text:"Swap",disabled:!1};if(!(o!=null&&o.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(s&&s.errorCode){if(s.errorCode===Xs.InsufficientLiquidity)return c.text="Insufficient liquidity for this trade",c.disabled=!0,c;if(s.errorCode===Xs.NoRouter||s.errorCode===Xs.HoneyPot)return c.text="No Available Route",c.disabled=!0,c}return+n&&Ue(n).gt(e||0)?(c.disabled=!0,c.text=`Insufficient ${yn(t==null?void 0:t.symbol)} Balance`,c):((!+n||!+i)&&(c.disabled=!0),c)},[o==null?void 0:o.address,n,i,e,s==null?void 0:s.errorCode,t,r]);return{btnText:a.text,btnDisabled:a.disabled}}function $R({themeType:e}){const t=e=="Light"?Ct("/images/logo_light@2x.png"):Ct("/images/logo@2x.png");return w.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",marginTop:"16px"},children:[w.jsx("span",{style:{fontSize:"12px",color:"var(--cs-text-primary)",fontWeight:"500",marginRight:"8px"},children:"Powered by"}),w.jsx("img",{style:{height:"20px"},src:t})]})}function J0({baseToken:e,quoteToken:t,baseAmount:r,quoteAmount:n,loading:i,fontSize:s="14px"}){const[o,a]=le.useState(!0),c=vw(o,r,n);return w.jsxs("div",{className:"current-price-block",style:{cursor:"pointer"},onClick:()=>{a(!o)},children:[w.jsx(Pr,{src:o?e==null?void 0:e.logo_url:t==null?void 0:t.logo_url,token:o?e:t,showWarnSize:"10px"}),w.jsxs("span",{style:{display:"flex",alignItems:"center",color:"var(--cs-text-primary)",fontSize:s,maxWidth:"80%"},children:["1"," ",yn(o?e==null?void 0:e.symbol:t==null?void 0:t.symbol)," ","="," ",i?w.jsx(Ys,{className:"custom-skeleton",style:{height:"16px",width:"40px",marginLeft:"2px",marginRight:"2px"}}):Ur(c,t==null?void 0:t.decimals)," ",yn(o?t==null?void 0:t.symbol:e==null?void 0:e.symbol)]}),w.jsx(Pr,{src:o?t==null?void 0:t.logo_url:e==null?void 0:e.logo_url,token:o?t:e,showWarnSize:"8px"}),w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-swap"})})]})}function Ka(){const[e,t]=le.useState(window.innerWidth),r=Y0(()=>{t(window.innerWidth)},300);le.useEffect(()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}),[]);const n=le.useMemo(()=>e<810,[e]);return{windowWidth:e,isApp:n}}function X0({content:e,children:t,position:r,autoSwitchTooltip:n=!1,borderRadius:i="8px"}){const{isApp:s}=Ka();return s&&n?w.jsxs($i.Root,{children:[w.jsx($i.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($i.Content,{variant:"soft",style:{transition:"opacity 0.3s ease",display:"block",zIndex:9e3,padding:"8px 12px",backgroundColor:"var(--cs-bg-primary)",color:"var(--cs-text-secondary)",borderRadius:i,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(Js,{content:e,position:r,borderRadius:i,children:t})}function VR({pr:e="8px",pl:t="8px",value:r,isLoading:n}){const{isApp:i}=Ka();return w.jsxs("div",{className:"swap-info-between",style:{paddingLeft:t,paddingRight:e},children:[w.jsxs("div",{className:"left",children:[w.jsx("span",{children:"Overlay Fee"}),w.jsx(X0,{autoSwitchTooltip:!0,position:"top",content:w.jsx("div",{style:{color:"var(--cs-text-secondary)",fontSize:"12px",lineHeight:"18px",width:i?"200px":"280px",textAlign:"start",whiteSpace:"normal"},children:"Fees charged by the integrator, which has been deducted from the output."}),children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{cursor:"pointer",width:"20px",height:"20px"},children:w.jsx("use",{xlinkHref:"#icon-tips"})})})]}),n?w.jsx(Ys,{className:"custom-skeleton",style:{height:"18px",width:"80px"}}):w.jsx("div",{className:"right",children:r?`${Ue(r).mul(100).toString()}%`:""})]})}function Sw(e,t,r,n){const{getTokenPrice:i}=Ga(),s=i(e==null?void 0:e.coin_type),o=i(t==null?void 0:t.coin_type),a=vw(!0,r,n),c=le.useMemo(()=>{if(o&&s)return Ue(s.price).div(o.price).toString()},[s==null?void 0:s.price,o==null?void 0:o.price]),l=le.useMemo(()=>{if(c&&+a)return Ue(a).sub(c).div(a).mul(100).toFixed(10)},[c,a]),u=le.useMemo(()=>{const v=[];return s&&v.push(s.market),o&&!v.includes(o.market)&&v.push(o.market),v},[s==null?void 0:s.market,o==null?void 0:o.market]),f=le.useMemo(()=>!s||!o||s.market==="cetus"||o.market==="cetus",[s,o]),p=le.useMemo(()=>f?!1:l&&Ue(l).lt(0)?Ue(l).abs().gt(5):!1,[l,f]),y=le.useMemo(()=>f?!1:l&&Ue(l).lt(0)?Ue(l).abs().gt(10):!1,[l,f]),x=le.useMemo(()=>{let v,_="yellow";if(f)return{priceImpactText:void 0,textColor:"yellow"};if(l)if(Ue(l).gt(0))_="green",Ue(l).lt(.1)?v="< 0.1% cheaper than":v=`${Ur(l,2,!0,$r.ROUND_UP)}% cheaper than`;else if(Ue(l).eq(0))v="0%",_="green";else{const T=Ue(l).abs();T.lte(5)?(_="green",v=`Within ${Ur(T.toString(),2,!0,$r.ROUND_UP)}%`):T.lte(10)?(_="yellow",v=`${Ur(T.toString(),2,!0,$r.ROUND_UP)}% more than`):T.lte(100)?(_="red",v=`${Ur(T.toString(),2,!0,$r.ROUND_UP)}% more than`):(_="red",v="> 100% more than")}return{priceImpactText:v,textColor:_}},[l,f]);return{swapPrice:a,marketPrice:c,priceImpact:l,sources:u,showPriceImpactTips:p,showPriceImpactWarn:y,priceImpactTextInfo:x,showIncalculable:f}}function _w({isLoading:e,routerData:t,noTips:r}){const{fromCoin:n,toCoin:i,fromAmount:s,toAmount:o}=Zr();Ka();const{priceImpact:a,sources:c,marketPrice:l,priceImpactTextInfo:u,showIncalculable:f}=Sw(n,i,t==null?void 0:t.fromAmountUi,t==null?void 0:t.toAmountUi);return w.jsxs(w.Fragment,{children:[!r&&Ue(a).lte(-30)&&!f&&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-secondary)"},children:"Price Difference"}),w.jsx(X0,{autoSwitchTooltip:!0,position:"top",content:w.jsx(zR,{fromToken:n,toToken:i,sources:c,baseAmount:"1",quoteAmount:l,showIncalculable:f}),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(Ys,{className:"custom-skeleton",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&&!f?u==null?void 0:u.priceImpactText:"Incalculable"}),u.priceImpactText&&!f&&w.jsx("div",{className:"platforms",children:c.map(p=>w.jsx(Js,{content:w.jsx("span",{style:{fontSize:"12px",color:"var(--cs-text-primary)"},children:Vv[p]}),position:"top",delay:300,children:w.jsx(Pr,{src:tA[p],haveBorder:!1,style:{width:"16px",height:"16px"}})},p))})]})]})]})]})}function zR({fromToken:e,toToken:t,baseAmount:r,quoteAmount:n,sources:i,showIncalculable:s}){const{isApp:o}=Ka();return w.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[w.jsx("p",{style:{color:"var(--cs-text-secondary)",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."}),!s&&w.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[w.jsx("p",{style:{fontSize:"12px",color:"var(--cs-text-primary)"},children:"Market price sources:"}),r&&n?w.jsx(J0,{baseToken:e,quoteToken:t,baseAmount:"1",quoteAmount:n,loading:!1,fontSize:"12px"}):w.jsx("p",{style:{color:"var(--cs-text-primary)",fontSize:"12px"},children:"Price is unknown"})]}),!s&&w.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[w.jsx("p",{style:{color:"var(--cs-text-secondary)",fontSize:"12px",whiteSpace:"pre"},children:"Market price sources:"}),w.jsx("p",{style:{color:"var(--cs-text-secondary)",fontSize:"12px",whiteSpace:"pre"},children:i.map(a=>Vv[a]+" ").join("")})]})]})}function Ew({pr:e="8px",pl:t="8px",amountLimit:r,isLoading:n}){const{fromCoin:i,toCoin:s,byAmountIn:o}=Zr();return w.jsxs("div",{className:"swap-info-between",style:{paddingLeft:t,paddingRight:e},children:[w.jsx("div",{className:"left",children:o?"Minimum Received":"Maximum Sold"}),n?w.jsx(Ys,{className:"custom-skeleton",style:{height:"18px",width:"80px"}}):w.jsxs("div",{className:"right",children:[Ur(r,o?s==null?void 0:s.decimals:i==null?void 0:i.decimals,!1,$r.ROUND_DOWN)," ",yn(o?(s==null?void 0:s.symbol)||"":(i==null?void 0:i.symbol)||"")]})]})}function qR({scamsText:e}){return w.jsxs("div",{style:{marginTop:"16px",borderRadius:"8px",border:"1px solid var(--cs-border)",paddingTop:"12px",width:"100%",backgroundColor:"var(--cs-bg-secondary-common)"},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:"var(--cs-warning)"},"aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-alert"})}),w.jsx("span",{style:{color:"var(--cs-warning)",marginLeft:"4px"},children:"Alert"})]}),w.jsx("div",{style:{borderRadius:"8px",padding:"11px",margin:"-1px",marginTop:"14px",border:"1px solid var(--cs-border)",lineHeight:"1"},children:w.jsx(Wv,{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 HR({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(HR,{onClick:t}),w.jsx("span",{className:"title",children:e})]})}const lu=globalThis||void 0||self;var WR=typeof lu=="object"&&lu&&lu.Object===Object&&lu;const Cw=WR;var GR=typeof self=="object"&&self&&self.Object===Object&&self,KR=Cw||GR||Function("return this")();const fi=KR;var YR=fi.Symbol;const hi=YR;var Aw=Object.prototype,JR=Aw.hasOwnProperty,XR=Aw.toString,Ya=hi?hi.toStringTag:void 0;function ZR(e){var t=JR.call(e,Ya),r=e[Ya];try{e[Ya]=void 0;var n=!0}catch{}var i=XR.call(e);return n&&(t?e[Ya]=r:delete e[Ya]),i}var QR=Object.prototype,ej=QR.toString;function tj(e){return ej.call(e)}var rj="[object Null]",nj="[object Undefined]",Tw=hi?hi.toStringTag:void 0;function Vo(e){return e==null?e===void 0?nj:rj:Tw&&Tw in Object(e)?ZR(e):tj(e)}function ys(e){return e!=null&&typeof e=="object"}var ij="[object Symbol]";function Ja(e){return typeof e=="symbol"||ys(e)&&Vo(e)==ij}function uu(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 sj=Array.isArray;const en=sj;var oj=1/0,Mw=hi?hi.prototype:void 0,Iw=Mw?Mw.toString:void 0;function Ow(e){if(typeof e=="string")return e;if(en(e))return uu(e,Ow)+"";if(Ja(e))return Iw?Iw.call(e):"";var t=e+"";return t=="0"&&1/e==-oj?"-0":t}function zo(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Pw(e){return e}var aj="[object AsyncFunction]",cj="[object Function]",lj="[object GeneratorFunction]",uj="[object Proxy]";function Rw(e){if(!zo(e))return!1;var t=Vo(e);return t==cj||t==lj||t==aj||t==uj}var dj=fi["__core-js_shared__"];const Q0=dj;var jw=function(){var e=/[^.]+$/.exec(Q0&&Q0.keys&&Q0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function fj(e){return!!jw&&jw in e}var hj=Function.prototype,pj=hj.toString;function Zs(e){if(e!=null){try{return pj.call(e)}catch{}try{return e+""}catch{}}return""}var mj=/[\\^$.*+?()[\]{}|]/g,gj=/^\[object .+?Constructor\]$/,vj=Function.prototype,bj=Object.prototype,yj=vj.toString,wj=bj.hasOwnProperty,xj=RegExp("^"+yj.call(wj).replace(mj,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sj(e){if(!zo(e)||fj(e))return!1;var t=Rw(e)?xj:gj;return t.test(Zs(e))}function _j(e,t){return e==null?void 0:e[t]}function Qs(e,t){var r=_j(e,t);return Sj(r)?r:void 0}var Ej=Qs(fi,"WeakMap");const eh=Ej;var Nw=Object.create,Cj=function(){function e(){}return function(t){if(!zo(t))return{};if(Nw)return Nw(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();const Aj=Cj;function Tj(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Mj=function(){try{var e=Qs(Object,"defineProperty");return e({},"",{}),e}catch{}}();const kw=Mj;function Ij(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var Oj=9007199254740991,Pj=/^(?:0|[1-9]\d*)$/;function Dw(e,t){var r=typeof e;return t=t??Oj,!!t&&(r=="number"||r!="symbol"&&Pj.test(e))&&e>-1&&e%1==0&&e<t}function Lw(e,t,r){t=="__proto__"&&kw?kw(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function th(e,t){return e===t||e!==e&&t!==t}var Rj=Object.prototype,jj=Rj.hasOwnProperty;function Bw(e,t,r){var n=e[t];(!(jj.call(e,t)&&th(n,r))||r===void 0&&!(t in e))&&Lw(e,t,r)}function du(e,t,r,n){var i=!r;r||(r={});for(var s=-1,o=t.length;++s<o;){var a=t[s],c=n?n(r[a],e[a],a,r,e):void 0;c===void 0&&(c=e[a]),i?Lw(r,a,c):Bw(r,a,c)}return r}var Nj=9007199254740991;function rh(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Nj}function fu(e){return e!=null&&rh(e.length)&&!Rw(e)}var kj=Object.prototype;function nh(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||kj;return e===r}function Dj(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Lj="[object Arguments]";function Uw(e){return ys(e)&&Vo(e)==Lj}var Fw=Object.prototype,Bj=Fw.hasOwnProperty,Uj=Fw.propertyIsEnumerable,Fj=Uw(function(){return arguments}())?Uw:function(e){return ys(e)&&Bj.call(e,"callee")&&!Uj.call(e,"callee")};const $w=Fj;function $j(){return!1}var Vw=typeof Wt=="object"&&Wt&&!Wt.nodeType&&Wt,zw=Vw&&typeof module=="object"&&module&&!module.nodeType&&module,Vj=zw&&zw.exports===Vw,qw=Vj?fi.Buffer:void 0,zj=qw?qw.isBuffer:void 0,qj=zj||$j;const hu=qj;var Hj="[object Arguments]",Wj="[object Array]",Gj="[object Boolean]",Kj="[object Date]",Yj="[object Error]",Jj="[object Function]",Xj="[object Map]",Zj="[object Number]",Qj="[object Object]",eN="[object RegExp]",tN="[object Set]",rN="[object String]",nN="[object WeakMap]",iN="[object ArrayBuffer]",sN="[object DataView]",oN="[object Float32Array]",aN="[object Float64Array]",cN="[object Int8Array]",lN="[object Int16Array]",uN="[object Int32Array]",dN="[object Uint8Array]",fN="[object Uint8ClampedArray]",hN="[object Uint16Array]",pN="[object Uint32Array]",tr={};tr[oN]=tr[aN]=tr[cN]=tr[lN]=tr[uN]=tr[dN]=tr[fN]=tr[hN]=tr[pN]=!0,tr[Hj]=tr[Wj]=tr[iN]=tr[Gj]=tr[sN]=tr[Kj]=tr[Yj]=tr[Jj]=tr[Xj]=tr[Zj]=tr[Qj]=tr[eN]=tr[tN]=tr[rN]=tr[nN]=!1;function mN(e){return ys(e)&&rh(e.length)&&!!tr[Vo(e)]}function pu(e){return function(t){return e(t)}}var Hw=typeof Wt=="object"&&Wt&&!Wt.nodeType&&Wt,Xa=Hw&&typeof module=="object"&&module&&!module.nodeType&&module,gN=Xa&&Xa.exports===Hw,ih=gN&&Cw.process,vN=function(){try{var e=Xa&&Xa.require&&Xa.require("util").types;return e||ih&&ih.binding&&ih.binding("util")}catch{}}();const qo=vN;var Ww=qo&&qo.isTypedArray,bN=Ww?pu(Ww):mN;const Gw=bN;var yN=Object.prototype,wN=yN.hasOwnProperty;function Kw(e,t){var r=en(e),n=!r&&$w(e),i=!r&&!n&&hu(e),s=!r&&!n&&!i&&Gw(e),o=r||n||i||s,a=o?Dj(e.length,String):[],c=a.length;for(var l in e)(t||wN.call(e,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Dw(l,c)))&&a.push(l);return a}function Yw(e,t){return function(r){return e(t(r))}}var xN=Yw(Object.keys,Object);const SN=xN;var _N=Object.prototype,EN=_N.hasOwnProperty;function CN(e){if(!nh(e))return SN(e);var t=[];for(var r in Object(e))EN.call(e,r)&&r!="constructor"&&t.push(r);return t}function Za(e){return fu(e)?Kw(e):CN(e)}function AN(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var TN=Object.prototype,MN=TN.hasOwnProperty;function IN(e){if(!zo(e))return AN(e);var t=nh(e),r=[];for(var n in e)n=="constructor"&&(t||!MN.call(e,n))||r.push(n);return r}function sh(e){return fu(e)?Kw(e,!0):IN(e)}var ON=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,PN=/^\w*$/;function oh(e,t){if(en(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Ja(e)?!0:PN.test(e)||!ON.test(e)||t!=null&&e in Object(t)}var RN=Qs(Object,"create");const Qa=RN;function jN(){this.__data__=Qa?Qa(null):{},this.size=0}function NN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var kN="__lodash_hash_undefined__",DN=Object.prototype,LN=DN.hasOwnProperty;function BN(e){var t=this.__data__;if(Qa){var r=t[e];return r===kN?void 0:r}return LN.call(t,e)?t[e]:void 0}var UN=Object.prototype,FN=UN.hasOwnProperty;function $N(e){var t=this.__data__;return Qa?t[e]!==void 0:FN.call(t,e)}var VN="__lodash_hash_undefined__";function zN(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Qa&&t===void 0?VN:t,this}function eo(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])}}eo.prototype.clear=jN,eo.prototype.delete=NN,eo.prototype.get=BN,eo.prototype.has=$N,eo.prototype.set=zN;function qN(){this.__data__=[],this.size=0}function mu(e,t){for(var r=e.length;r--;)if(th(e[r][0],t))return r;return-1}var HN=Array.prototype,WN=HN.splice;function GN(e){var t=this.__data__,r=mu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():WN.call(t,r,1),--this.size,!0}function KN(e){var t=this.__data__,r=mu(t,e);return r<0?void 0:t[r][1]}function YN(e){return mu(this.__data__,e)>-1}function JN(e,t){var r=this.__data__,n=mu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Vi(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])}}Vi.prototype.clear=qN,Vi.prototype.delete=GN,Vi.prototype.get=KN,Vi.prototype.has=YN,Vi.prototype.set=JN;var XN=Qs(fi,"Map");const ec=XN;function ZN(){this.size=0,this.__data__={hash:new eo,map:new(ec||Vi),string:new eo}}function QN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function gu(e,t){var r=e.__data__;return QN(t)?r[typeof t=="string"?"string":"hash"]:r.map}function ek(e){var t=gu(this,e).delete(e);return this.size-=t?1:0,t}function tk(e){return gu(this,e).get(e)}function rk(e){return gu(this,e).has(e)}function nk(e,t){var r=gu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function zi(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])}}zi.prototype.clear=ZN,zi.prototype.delete=ek,zi.prototype.get=tk,zi.prototype.has=rk,zi.prototype.set=nk;var ik="Expected a function";function ah(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(ik);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(ah.Cache||zi),r}ah.Cache=zi;var sk=500;function ok(e){var t=ah(e,function(n){return r.size===sk&&r.clear(),n}),r=t.cache;return t}var ak=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ck=/\\(\\)?/g,lk=ok(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(ak,function(r,n,i,s){t.push(i?s.replace(ck,"$1"):n||r)}),t});const uk=lk;function dk(e){return e==null?"":Ow(e)}function Jw(e,t){return en(e)?e:oh(e,t)?[e]:uk(dk(e))}var fk=1/0;function vu(e){if(typeof e=="string"||Ja(e))return e;var t=e+"";return t=="0"&&1/e==-fk?"-0":t}function ch(e,t){t=Jw(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[vu(t[r++])];return r&&r==n?e:void 0}function hk(e,t,r){var n=e==null?void 0:ch(e,t);return n===void 0?r:n}function Xw(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var pk=Yw(Object.getPrototypeOf,Object);const Zw=pk;function mk(){this.__data__=new Vi,this.size=0}function gk(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function vk(e){return this.__data__.get(e)}function bk(e){return this.__data__.has(e)}var yk=200;function wk(e,t){var r=this.__data__;if(r instanceof Vi){var n=r.__data__;if(!ec||n.length<yk-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new zi(n)}return r.set(e,t),this.size=r.size,this}function pi(e){var t=this.__data__=new Vi(e);this.size=t.size}pi.prototype.clear=mk,pi.prototype.delete=gk,pi.prototype.get=vk,pi.prototype.has=bk,pi.prototype.set=wk;function xk(e,t){return e&&du(t,Za(t),e)}function Sk(e,t){return e&&du(t,sh(t),e)}var Qw=typeof Wt=="object"&&Wt&&!Wt.nodeType&&Wt,e6=Qw&&typeof module=="object"&&module&&!module.nodeType&&module,_k=e6&&e6.exports===Qw,t6=_k?fi.Buffer:void 0,r6=t6?t6.allocUnsafe:void 0;function Ek(e,t){if(t)return e.slice();var r=e.length,n=r6?r6(r):new e.constructor(r);return e.copy(n),n}function n6(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}function i6(){return[]}var Ck=Object.prototype,Ak=Ck.propertyIsEnumerable,s6=Object.getOwnPropertySymbols,Tk=s6?function(e){return e==null?[]:(e=Object(e),n6(s6(e),function(t){return Ak.call(e,t)}))}:i6;const lh=Tk;function Mk(e,t){return du(e,lh(e),t)}var Ik=Object.getOwnPropertySymbols,Ok=Ik?function(e){for(var t=[];e;)Xw(t,lh(e)),e=Zw(e);return t}:i6;const o6=Ok;function Pk(e,t){return du(e,o6(e),t)}function a6(e,t,r){var n=t(e);return en(e)?n:Xw(n,r(e))}function uh(e){return a6(e,Za,lh)}function Rk(e){return a6(e,sh,o6)}var jk=Qs(fi,"DataView");const dh=jk;var Nk=Qs(fi,"Promise");const fh=Nk;var kk=Qs(fi,"Set");const hh=kk;var c6="[object Map]",Dk="[object Object]",l6="[object Promise]",u6="[object Set]",d6="[object WeakMap]",f6="[object DataView]",Lk=Zs(dh),Bk=Zs(ec),Uk=Zs(fh),Fk=Zs(hh),$k=Zs(eh),to=Vo;(dh&&to(new dh(new ArrayBuffer(1)))!=f6||ec&&to(new ec)!=c6||fh&&to(fh.resolve())!=l6||hh&&to(new hh)!=u6||eh&&to(new eh)!=d6)&&(to=function(e){var t=Vo(e),r=t==Dk?e.constructor:void 0,n=r?Zs(r):"";if(n)switch(n){case Lk:return f6;case Bk:return c6;case Uk:return l6;case Fk:return u6;case $k:return d6}return t});const tc=to;var Vk=Object.prototype,zk=Vk.hasOwnProperty;function qk(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&zk.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Hk=fi.Uint8Array;const bu=Hk;function ph(e){var t=new e.constructor(e.byteLength);return new bu(t).set(new bu(e)),t}function Wk(e,t){var r=t?ph(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Gk=/\w*$/;function Kk(e){var t=new e.constructor(e.source,Gk.exec(e));return t.lastIndex=e.lastIndex,t}var h6=hi?hi.prototype:void 0,p6=h6?h6.valueOf:void 0;function Yk(e){return p6?Object(p6.call(e)):{}}function Jk(e,t){var r=t?ph(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Xk="[object Boolean]",Zk="[object Date]",Qk="[object Map]",eD="[object Number]",tD="[object RegExp]",rD="[object Set]",nD="[object String]",iD="[object Symbol]",sD="[object ArrayBuffer]",oD="[object DataView]",aD="[object Float32Array]",cD="[object Float64Array]",lD="[object Int8Array]",uD="[object Int16Array]",dD="[object Int32Array]",fD="[object Uint8Array]",hD="[object Uint8ClampedArray]",pD="[object Uint16Array]",mD="[object Uint32Array]";function gD(e,t,r){var n=e.constructor;switch(t){case sD:return ph(e);case Xk:case Zk:return new n(+e);case oD:return Wk(e,r);case aD:case cD:case lD:case uD:case dD:case fD:case hD:case pD:case mD:return Jk(e,r);case Qk:return new n;case eD:case nD:return new n(e);case tD:return Kk(e);case rD:return new n;case iD:return Yk(e)}}function vD(e){return typeof e.constructor=="function"&&!nh(e)?Aj(Zw(e)):{}}var bD="[object Map]";function yD(e){return ys(e)&&tc(e)==bD}var m6=qo&&qo.isMap,wD=m6?pu(m6):yD;const xD=wD;var SD="[object Set]";function _D(e){return ys(e)&&tc(e)==SD}var g6=qo&&qo.isSet,ED=g6?pu(g6):_D;const CD=ED;var AD=1,TD=2,MD=4,v6="[object Arguments]",ID="[object Array]",OD="[object Boolean]",PD="[object Date]",RD="[object Error]",b6="[object Function]",jD="[object GeneratorFunction]",ND="[object Map]",kD="[object Number]",y6="[object Object]",DD="[object RegExp]",LD="[object Set]",BD="[object String]",UD="[object Symbol]",FD="[object WeakMap]",$D="[object ArrayBuffer]",VD="[object DataView]",zD="[object Float32Array]",qD="[object Float64Array]",HD="[object Int8Array]",WD="[object Int16Array]",GD="[object Int32Array]",KD="[object Uint8Array]",YD="[object Uint8ClampedArray]",JD="[object Uint16Array]",XD="[object Uint32Array]",Qt={};Qt[v6]=Qt[ID]=Qt[$D]=Qt[VD]=Qt[OD]=Qt[PD]=Qt[zD]=Qt[qD]=Qt[HD]=Qt[WD]=Qt[GD]=Qt[ND]=Qt[kD]=Qt[y6]=Qt[DD]=Qt[LD]=Qt[BD]=Qt[UD]=Qt[KD]=Qt[YD]=Qt[JD]=Qt[XD]=!0,Qt[RD]=Qt[b6]=Qt[FD]=!1;function yu(e,t,r,n,i,s){var o,a=t&AD,c=t&TD,l=t&MD;if(r&&(o=i?r(e,n,i,s):r(e)),o!==void 0)return o;if(!zo(e))return e;var u=en(e);if(u){if(o=qk(e),!a)return Tj(e,o)}else{var f=tc(e),p=f==b6||f==jD;if(hu(e))return Ek(e,a);if(f==y6||f==v6||p&&!i){if(o=c||p?{}:vD(e),!a)return c?Pk(e,Sk(o,e)):Mk(e,xk(o,e))}else{if(!Qt[f])return i?e:{};o=gD(e,f,a)}}s||(s=new pi);var y=s.get(e);if(y)return y;s.set(e,o),CD(e)?e.forEach(function(_){o.add(yu(_,t,r,_,e,s))}):xD(e)&&e.forEach(function(_,T){o.set(T,yu(_,t,r,T,e,s))});var x=l?c?Rk:uh:c?sh:Za,v=u?void 0:x(e);return Ij(v||e,function(_,T){v&&(T=_,_=e[T]),Bw(o,T,yu(_,t,r,T,e,s))}),o}var ZD=1,QD=4;function eL(e){return yu(e,ZD|QD)}var tL="__lodash_hash_undefined__";function rL(e){return this.__data__.set(e,tL),this}function nL(e){return this.__data__.has(e)}function wu(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new zi;++t<r;)this.add(e[t])}wu.prototype.add=wu.prototype.push=rL,wu.prototype.has=nL;function iL(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 sL(e,t){return e.has(t)}var oL=1,aL=2;function w6(e,t,r,n,i,s){var o=r&oL,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var f=-1,p=!0,y=r&aL?new wu:void 0;for(s.set(e,t),s.set(t,e);++f<a;){var x=e[f],v=t[f];if(n)var _=o?n(v,x,f,t,e,s):n(x,v,f,e,t,s);if(_!==void 0){if(_)continue;p=!1;break}if(y){if(!iL(t,function(T,O){if(!sL(y,O)&&(x===T||i(x,T,r,n,s)))return y.push(O)})){p=!1;break}}else if(!(x===v||i(x,v,r,n,s))){p=!1;break}}return s.delete(e),s.delete(t),p}function cL(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function lL(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var uL=1,dL=2,fL="[object Boolean]",hL="[object Date]",pL="[object Error]",mL="[object Map]",gL="[object Number]",vL="[object RegExp]",bL="[object Set]",yL="[object String]",wL="[object Symbol]",xL="[object ArrayBuffer]",SL="[object DataView]",x6=hi?hi.prototype:void 0,mh=x6?x6.valueOf:void 0;function _L(e,t,r,n,i,s,o){switch(r){case SL:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case xL:return!(e.byteLength!=t.byteLength||!s(new bu(e),new bu(t)));case fL:case hL:case gL:return th(+e,+t);case pL:return e.name==t.name&&e.message==t.message;case vL:case yL:return e==t+"";case mL:var a=cL;case bL:var c=n&uL;if(a||(a=lL),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;n|=dL,o.set(e,t);var u=w6(a(e),a(t),n,i,s,o);return o.delete(e),u;case wL:if(mh)return mh.call(e)==mh.call(t)}return!1}var EL=1,CL=Object.prototype,AL=CL.hasOwnProperty;function TL(e,t,r,n,i,s){var o=r&EL,a=uh(e),c=a.length,l=uh(t),u=l.length;if(c!=u&&!o)return!1;for(var f=c;f--;){var p=a[f];if(!(o?p in t:AL.call(t,p)))return!1}var y=s.get(e),x=s.get(t);if(y&&x)return y==t&&x==e;var v=!0;s.set(e,t),s.set(t,e);for(var _=o;++f<c;){p=a[f];var T=e[p],O=t[p];if(n)var R=o?n(O,T,p,t,e,s):n(T,O,p,e,t,s);if(!(R===void 0?T===O||i(T,O,r,n,s):R)){v=!1;break}_||(_=p=="constructor")}if(v&&!_){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)&&(v=!1)}return s.delete(e),s.delete(t),v}var ML=1,S6="[object Arguments]",_6="[object Array]",xu="[object Object]",IL=Object.prototype,E6=IL.hasOwnProperty;function OL(e,t,r,n,i,s){var o=en(e),a=en(t),c=o?_6:tc(e),l=a?_6:tc(t);c=c==S6?xu:c,l=l==S6?xu:l;var u=c==xu,f=l==xu,p=c==l;if(p&&hu(e)){if(!hu(t))return!1;o=!0,u=!1}if(p&&!u)return s||(s=new pi),o||Gw(e)?w6(e,t,r,n,i,s):_L(e,t,c,r,n,i,s);if(!(r&ML)){var y=u&&E6.call(e,"__wrapped__"),x=f&&E6.call(t,"__wrapped__");if(y||x){var v=y?e.value():e,_=x?t.value():t;return s||(s=new pi),i(v,_,r,n,s)}}return p?(s||(s=new pi),TL(e,t,r,n,i,s)):!1}function Su(e,t,r,n,i){return e===t?!0:e==null||t==null||!ys(e)&&!ys(t)?e!==e&&t!==t:OL(e,t,r,n,Su,i)}var PL=1,RL=2;function jL(e,t,r,n){var i=r.length,s=i,o=!n;if(e==null)return!s;for(e=Object(e);i--;){var a=r[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=r[i];var c=a[0],l=e[c],u=a[1];if(o&&a[2]){if(l===void 0&&!(c in e))return!1}else{var f=new pi;if(n)var p=n(l,u,c,e,t,f);if(!(p===void 0?Su(u,l,PL|RL,n,f):p))return!1}}return!0}function C6(e){return e===e&&!zo(e)}function NL(e){for(var t=Za(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,C6(i)]}return t}function A6(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function kL(e){var t=NL(e);return t.length==1&&t[0][2]?A6(t[0][0],t[0][1]):function(r){return r===e||jL(r,e,t)}}function DL(e,t){return e!=null&&t in Object(e)}function LL(e,t,r){t=Jw(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=vu(t[n]);if(!(s=e!=null&&r(e,o)))break;e=e[o]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&rh(i)&&Dw(o,i)&&(en(e)||$w(e)))}function BL(e,t){return e!=null&&LL(e,t,DL)}var UL=1,FL=2;function $L(e,t){return oh(e)&&C6(t)?A6(vu(e),t):function(r){var n=hk(r,e);return n===void 0&&n===t?BL(r,e):Su(t,n,UL|FL)}}function VL(e){return function(t){return t==null?void 0:t[e]}}function zL(e){return function(t){return ch(t,e)}}function qL(e){return oh(e)?VL(vu(e)):zL(e)}function T6(e){return typeof e=="function"?e:e==null?Pw:typeof e=="object"?en(e)?$L(e[0],e[1]):kL(e):qL(e)}function HL(e){return function(t,r,n){for(var i=-1,s=Object(t),o=n(t),a=o.length;a--;){var c=o[e?a:++i];if(r(s[c],c,s)===!1)break}return t}}var WL=HL();const GL=WL;function KL(e,t){return e&&GL(e,t,Za)}function YL(e,t){return function(r,n){if(r==null)return r;if(!fu(r))return e(r,n);for(var i=r.length,s=t?i:-1,o=Object(r);(t?s--:++s<i)&&n(o[s],s,o)!==!1;);return r}}var JL=YL(KL);const M6=JL;function XL(e,t){var r=[];return M6(e,function(n,i,s){t(n,i,s)&&r.push(n)}),r}function ZL(e,t){var r=en(e)?n6:XL;return r(e,T6(t))}function QL(e,t){var r=-1,n=fu(e)?Array(e.length):[];return M6(e,function(i,s,o){n[++r]=t(i,s,o)}),n}function eB(e,t){return Su(e,t)}function tB(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}function rB(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,s=Ja(e),o=t!==void 0,a=t===null,c=t===t,l=Ja(t);if(!a&&!l&&!s&&e>t||s&&o&&c&&!a&&!l||n&&o&&c||!r&&c||!i)return 1;if(!n&&!s&&!l&&e<t||l&&r&&i&&!n&&!s||a&&r&&i||!o&&i||!c)return-1}return 0}function nB(e,t,r){for(var n=-1,i=e.criteria,s=t.criteria,o=i.length,a=r.length;++n<o;){var c=rB(i[n],s[n]);if(c){if(n>=a)return c;var l=r[n];return c*(l=="desc"?-1:1)}}return e.index-t.index}function iB(e,t,r){t.length?t=uu(t,function(s){return en(s)?function(o){return ch(o,s.length===1?s[0]:s)}:s}):t=[Pw];var n=-1;t=uu(t,pu(T6));var i=QL(e,function(s,o,a){var c=uu(t,function(l){return l(s)});return{criteria:c,index:++n,value:s}});return tB(i,function(s,o){return nB(s,o,r)})}function sB(e,t,r,n){return e==null?[]:(en(t)||(t=t==null?[]:[t]),r=n?void 0:r,en(r)||(r=r==null?[]:[r]),iB(e,t,r))}function oB({toBack:e,onSubmitClick:t,data:r}){const{fromCoin:n,toCoin:i}=Zr(),s=le.useRef(!1),{slippage:o}=Vr(),[a,c]=le.useState(r),{fromAmountUi:l,toAmountUi:u,byAmountIn:f}=a,{amountLimit:p}=gw(o,a),{showPriceImpactTips:y,showPriceImpactWarn:x}=Sw(n,i,l,u),{priceAcceptRouterData:v}=lR(a),[_,T]=le.useState(!1),[O,R]=le.useState(!1);le.useMemo(()=>f?i:n,[f]);const F=le.useMemo(()=>v!==void 0,[v]),B=()=>{if(v){if(s.current)return;s.current=!0;const $=eL(v);c($),setTimeout(()=>{s.current=!1},300)}},H=le.useMemo(()=>_?!1:!!x,[_,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:Co(l||"")}),w.jsx(Pr,{src:n==null?void 0:n.logo_url,token:n,style:{width:"28px",height:"28px"}}),w.jsx("span",{className:"symbol",children:yn((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:Co(u||"")}),w.jsx(Pr,{src:i==null?void 0:i.logo_url,token:i,style:{width:"28px",height:"28px"}}),w.jsx("span",{className:"symbol",children:yn((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:"var(--cs-bg-primary)",marginTop:"-1px"},children:w.jsx(J0,{baseToken:n,quoteToken:i,baseAmount:l||"0",quoteAmount:u||"0",loading:!1})}),y&&w.jsx("div",{style:{paddingLeft:"8px",paddingBottom:"10px",color:"var(--cs-warning)"},children:"High price difference. Be cautious before submitting your order."})]}),w.jsxs("div",{className:"swap-info-between",style:{marginTop:"16px"},children:[w.jsx("div",{className:"left",children:"Slippage Tolerance"}),w.jsxs("div",{className:"right",children:[o,"%"]})]}),w.jsx(Ew,{pl:"0px",pr:"0px",isLoading:!1,amountLimit:p}),w.jsx(_w,{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:"var(--cs-error)"},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 ignorePriceImpact-btn":"swap-btn cs-outline-btn secondary-btn",style:{fontSize:"14px",height:"42px",flex:1,color:_?"var(--cs-primary)":"var(--cs-btn-disabled-text)"},onClick:()=>{T(!0)},children:"Yes, please continue."}),w.jsx("button",{className:"swap-btn cs-outline-btn secondary-btn",style:{fontSize:"14px",height:"42px",color:"var(--cs-btn-disabled-text)",flex:1},onClick:()=>e(),children:"No,cancel it."})]})]})]}),!F&&w.jsx("button",{disabled:H||O,className:"swap-btn cs-solid-btn",style:{marginTop:"16px"},onClick:()=>{O||(R(!0),t(a))},children:O?w.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:w.jsx(Wf,{})}):"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 _u(e){const{text:t,type:r,classType:n=""}=e,[i,s]=le.useState(!1),{addCommonToast:o}=Io(),a=c=>{i||(bl(c),lw(t,{debug:!1,message:"message"}),o("Copied"),s(!i))};return le.useEffect(()=>{i&&setTimeout(()=>{s(!1)},2e3)},[i]),w.jsx(w.Fragment,{children:r==="btn"?w.jsxs("div",{className:n?`${n} copy-btn`:"copy-btn",onClick:a,children:[w.jsx("svg",{className:"cs-icon cs-copy-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:i?"#icon-sel":"#icon-icon_copy"})}),w.jsx("span",{children:"Copy"})]}):w.jsx("svg",{className:"cs-icon cs-copy-icon","aria-hidden":"true",onClick:a,children:w.jsx("use",{xlinkHref:i?"#icon-sel":"#icon-icon_copy"})})})}function aB({toBack:e,data:t,isLoading:r}){const{fromCoin:n,toCoin:i,fromAmount:s,toAmount:o}=Zr(),{fetchTokenInfo:a}=hs(),[c,l]=le.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 le.useEffect(()=>{u().then(f=>{l(f)})},[t]),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(O6,{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(Pr,{src:n==null?void 0:n.logo_url,token:n,style:{width:"26px",height:"26px",borderRadius:"100%"}}),w.jsx("span",{className:"amount",style:{color:"var(--cs-text-primary)"},children:Ur(s,n==null?void 0:n.decimals)}),w.jsx("span",{className:"symbol",style:{color:"var(--cs-text-secondary)"},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 var(--cs-border)",borderRadius:"8px",display:"flex",flexDirection:"column",paddingTop:"20px",paddingBottom:"20px",overflowY:"auto",maxHeight:"280px",position:"relative"},children:c==null?void 0:c.map((f,p)=>w.jsxs("div",{className:"route-item-box-h5",children:[w.jsxs("div",{className:"percent",children:[Ue(f.percentage).mul(100).toString(),"%"]}),w.jsx("div",{className:f.paths.length>1?"route-two-h5":"",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},children:f.paths.map(y=>w.jsx("div",{className:"route-path-item",children:w.jsx(X0,{autoSwitchTooltip:!0,position:"bottom",borderRadius:"12px",content:w.jsxs("div",{className:"router-pool-tip-con",style:{display:"flex",flexDirection:"column",minWidth:"220px"},children:[w.jsx(lB,{poolAddress:y.pool_address}),w.jsx(I6,{token:y.fromToken}),w.jsx(I6,{token:y.toToken})]}),children:w.jsx(cB,{path:y})})},y.to_type))})]},p))})}),w.jsxs("div",{className:"center",style:{gap:"4px"},children:[w.jsx(Pr,{src:i==null?void 0:i.logo_url,token:i,style:{width:"26px",height:"26px",borderRadius:"100%"}}),w.jsx("span",{className:"amount",style:{color:"var(--cs-text-primary)"},children:Ur(o,i==null?void 0:i.decimals)}),w.jsx("span",{className:"symbol",style:{color:"var(--cs-text-secondary)"},children:i==null?void 0:i.symbol})]})]})]})]})}function cB({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(Pr,{src:(t=e.fromToken)==null?void 0:t.logo_url,token:e.fromToken,style:{width:"24px",height:"24px",minWidth:"24px",minHeight:"24px",borderRadius:"100%"}}),w.jsx(Pr,{src:(r=e.toToken)==null?void 0:r.logo_url,token:e.toToken,style:{width:"24px",height:"24px",minWidth:"24px",minHeight:"24px",borderRadius:"100%"}})]}),w.jsxs("span",{className:"provider",style:{color:"var(--cs-text-primary)"},children:[(n=zv[e.provider])==null?void 0:n.name," "]}),!!+e.fee_rate&&w.jsxs("div",{className:"fee-tier",children:[" ",Ue(e.fee_rate).mul(100).toString(),"%"]})]})}function I6({token:e}){const{getExplorerUrl:t}=To();return w.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"12px",margin:"8px 0 4px",gap:"12px"},children:[w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexShrink:0},children:[w.jsx(Pr,{src:e==null?void 0:e.logo_url,token:e,showWarnSize:"12px",style:{width:"20px",height:"20px",borderRadius:"100%"}}),w.jsx("span",{style:{color:"var(--cs-text-primary)",fontSize:"12px"},children:yn((e==null?void 0:e.symbol)||"")})]}),w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[w.jsx("a",{onClick:bl,href:t(e==null?void 0:e.coin_type,"coin"),target:"_blank",style:{textDecoration:"none",color:"var(--cs-text-secondary)",marginRight:"4px"},children:zs(e==null?void 0:e.coin_type)}),w.jsx(_u,{text:(e==null?void 0:e.coin_type)||""})]})]})}function lB({poolAddress:e}){const{getExplorerUrl:t}=To();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:"var(--cs-text-primary)",fontSize:"12px"},children:"Pool"}),w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[w.jsx("a",{style:{color:"var(--cs-text-primary)",textDecoration:"none",marginRight:"4px"},onClick:bl,href:t(e,"poolAddress"),target:"_blank",children:zs(e)}),w.jsx(_u,{text:e})]})]}),e&&w.jsx("div",{style:{width:"100%",height:"1px",marginTop:"8px",backgroundColor:"var(--cs-border)"}})]})}function O6({hasSubMenu:e,isLoading:t,formatSwapRouter:r}){var f;const[n,i]=le.useState(!1),{isApp:s}=Ka(),{fetchTokenInfo:o}=hs(),a=le.useMemo(()=>(r==null?void 0:r.routers.length)===1,[r==null?void 0:r.routers.length]),[c,l]=le.useState(""),u=async()=>{var v,_;const p=[],y=((_=(v=r==null?void 0:r.routers)==null?void 0:v[0])==null?void 0:_.paths)||[];for(let T=0;T<y.length;T++){const O=y[T],R=await o(O==null?void 0:O.to_type);if(T===0){const F=await o(O==null?void 0:O.from_type);p.push(`${F==null?void 0:F.symbol} > ${R==null?void 0:R.symbol}`)}else p.push(R==null?void 0:R.symbol)}const x=p.join(" > ");l(x)};return le.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-secondary)":"var(--cs-text-primary)",paddingRight:"8px"},children:e?"Auto Router":"Route"}),t?w.jsx(Ys,{className:"custom-skeleton",style:{width:"80px",height:"18px"}}):w.jsxs("div",{className:"right",onClick:()=>{i(!0)},children:[w.jsx("span",{style:{textAlign:"right",color:"var(--cs-text-primary)"},children:a?c:r==null?void 0:r.router_summery}),w.jsxs("div",{className:"providers",children:[(f=r==null?void 0:r.providers)==null?void 0:f.map((p,y)=>{var x;return s?w.jsx(Pr,{src:$t[p],style:{width:"16px",height:"16px"},haveBorder:!1}):w.jsx(Js,{content:w.jsx("div",{style:{color:"var(--cs-text-primary)"},children:((x=zv[p])==null?void 0:x.name)||p}),position:"top",delay:300,children:w.jsx(Pr,{src:$t[p],style:{width:"16px",height:"16px"},haveBorder:!1})},p)}),e&&w.jsx("svg",{className:"cs-icon spread-icon","aria-hidden":"true",style:{width:"16px",height:"16px",flexShrink:0},children:w.jsx("use",{xlinkHref:"#icon-spread"})})]})]}),n&&e&&w.jsx(aB,{data:r,isLoading:t,toBack:()=>i(!1)})]})}const EF="";function P6(){const{setCollectTokenMap:e,collectTokenMap:t}=qs(),r=i=>{const s=new Map(t);s.get(i.coin_type)?s.delete(i.coin_type):s.set(i.coin_type,i),e(s)},n=le.useCallback(i=>t.get(i.coin_type)!==void 0,[t]);return{handleCollectToken:r,isCollectToken:n,collectTokenMap:t}}function uB(e){const{trustedTokenList:t}=Mo(),{tokenBalanceObj:r,currentAccount:n}=zr(),{coinPriceObj:i}=dw(),{getTokenAmountValue:s}=Ga(),{fetchTokenInfo:o}=hs(),{currentTypeTab:a,showTokenList:c,setShowTokenList:l,combineTokenList:u,importTokenList:f,setComBineTokenList:p,setImportToken:y,setCurrentImportTokenData:x,setImportTokenIsLoading:v,currentImportTokenData:_,searchInput:T,setSearchInput:O,importTokenIsLoading:R,showTokenListIsLoading:F,setCurrentTypeTab:B,setCurrentPlatformTab:H}=qs(),[$,Z]=le.useState(!1);le.useEffect(()=>{t&&(t==null?void 0:t.length)>0&&Z(!0)},[t]);const[ce,ne]=le.useState(!1);le.useEffect(()=>{jv(i)||ne(!0)},[i]);const de=le.useRef({}),[q,N]=le.useState(!1);le.useEffect(()=>{(!jv(r)||!zf(de.current,r))&&(de.current=r,N(!0))},[r]);const h=le.useMemo(()=>(f==null?void 0:f.length)>1?f==null?void 0:f.map(ve=>{const he=El(r==null?void 0:r[ve==null?void 0:ve.coin_type],ve),we=he==null?void 0:he.totalBalanceFormat,Oe=Ue(we).gt("0")?s(ve==null?void 0:ve.coin_type,we):"0";return{...ve,balance:we,rate:Oe}}):f,[f,r,i]),d=(ve,he)=>{const we=he&&he.toLocaleLowerCase().trim(),Oe=ve.map(L=>{let z=0,G=0;L.symbol.toLowerCase()===we||L.name.toLowerCase()===we||L.coin_type.toLowerCase()===we?(z=1e3,G=2):L.symbol.toLowerCase().indexOf(we)>-1?(z=100,G=0):L.name.toLowerCase().indexOf(we)>-1?(z=10,G=0):L.coin_type.toLowerCase().indexOf(we)>-1?(z=1,G=0):L.coin_type.toLowerCase()=="0x2::sui::sui"&&(G=1);let re=Array.isArray(L==null?void 0:L.coin_priority)?Number(L.coin_priority[0])||0:Number(L==null?void 0:L.coin_priority)||0;return e===L.coin_type&&!he&&(G=12,z=1e3,re=1e4),{...L,mark:z,sort:G,coin_priority_sort:re,rateNumber:Number((L==null?void 0:L.rate)||"0"),balanceNumber:Number((L==null?void 0:L.balance)||"0")}});return sB(Oe,[L=>!he&&e===L.coin_type?1:0,"rateNumber","balanceNumber","sort","mark","coin_priority_sort"],["desc","desc","desc","desc","desc","desc"])},m=(ve,he=!1)=>{const we=he?ve.trim():ve.toLowerCase().trim(),Oe=["symbol","name","coin_type"];return ZL(we.length===0?u:[...u,...h],L=>Oe.some(z=>{const G=L[z];if(typeof G=="string"){const re=he?G:G.toLowerCase();return z==="coin_type"?re.includes(we)||Ri(re,!0).includes(Ri(we,!0)):re.includes(we)}return!1}))},S=ve=>{ve||x(void 0);const he=m(ve);if((he==null?void 0:he.length)===0){E(ve);return}else{const we=d(he,ve);l(we)}},E=async ve=>{v(!0);try{if(Nv(ve)){const he=ve.trim(),we=dr(he).full_address,Oe=await o(we);if(!Oe){l([]);return}const je=El(r==null?void 0:r[we],Oe),L=(je==null?void 0:je.totalBalanceFormat)||"0",z=Ue(L).gt("0")?s(he,L):"0",G={...Oe,balance:L,rate:z};l([G]),x(G)}else{l([]);return}}catch{x(void 0),l([]);return}finally{v(!1)}},M=ve=>{if(ve==="Default")g("All"),H("All");else{const he=d(h,T);l(he)}},j=()=>{if(_){const ve=y(_,!0),he=d(ve,T);l(he),x(void 0),O("")}},I=ve=>{const he=y(ve,!1),we=d(he,T);l(we)},g=ve=>{const he=ve==="All"?[...u]:u.filter(Oe=>ve=="Native"?!Oe.labels||Oe.labels.length==0||Oe.labels=="Native":Oe.labels&&Oe.labels.length>0&&Oe.labels[0].toLowerCase()==ve.toLowerCase()),we=d(he,T);l(we)};le.useEffect(()=>{if(!$||!(t!=null&&t.length)){p([]);return}if(!(n!=null&&n.address))p(t);else if(n!=null&&n.address){const ve=[];for(const he of t){const we=r==null?void 0:r[he==null?void 0:he.coin_type],Oe=El(we,he),je=(Oe==null?void 0:Oe.totalBalanceFormat)||"0",L=(Oe==null?void 0:Oe.displayBalance)||"0",z=Ue(je).gt("0")?s(he==null?void 0:he.coin_type,je):"0";ve.push({...he,balance:L,rate:Ur(z,4,!0)})}p(ve)}},[$,ce,q,n==null?void 0:n.address,i]);const b=le.useRef([]);le.useEffect(()=>{if((u==null?void 0:u.length)>0&&!eB(b.current,u)){b.current=u;const ve=d(u);e?h.find(we=>we.coin_type===e)!==void 0||a!=="Default"?(B("Imported"),M("Imported")):l(_?[_]:ve):l(ve)}},[u,e]);const k=le.useMemo(()=>{if(a==="Default"){if(!F&&(c==null?void 0:c.length)===0)return!0}else if((c==null?void 0:c.length)===0&&!R)return!0;return!1},[T,c,_,R,F]);return{showTokenList:c,handleSearch:S,handleChangePlatform:g,currentImportTokenData:_,handleChangeType:M,handleImportClick:j,handleDeleteImportClick:I,isNoData:k}}function dB({tokenList:e,onHandleTokenAction:t}){return w.jsx("div",{className:"token-collect-list",children:e.map(r=>w.jsx(fB,{token:r,onHandleTokenAction:t},r.coin_type))})}function fB({token:e,onHandleTokenAction:t}){return w.jsxs("div",{className:"token-collect-item",onClick:()=>{t(e,"select_token")},children:[w.jsx(Pr,{src:e==null?void 0:e.logo_url,token:e,style:{width:"20px",height:"20px"}}),w.jsx("span",{style:{marginLeft:"4px"},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"})})})]})}function hB(e){const{img:t="",text:r,width:n="100%",height:i="100%",padding:s="20px",subItem:o}=e;return w.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:n,height:i,padding:s,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:"var(--cs-text-primary)",fontSize:"14px"},children:r}),o&&o]})}function pB({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 R6=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function mB(e,t){return!!(e===t||R6(e)&&R6(t))}function gB(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!mB(e[r],t[r]))return!1;return!0}function vB(e,t){t===void 0&&(t=gB);var r=null;function n(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(r&&r.lastThis===this&&t(i,r.lastArgs))return r.lastResult;var o=e.apply(this,i);return r={lastResult:o,lastArgs:i,lastThis:this},o}return n.clear=function(){r=null},n}function gh(){return gh=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},gh.apply(null,arguments)}function j6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vh(e,t){return vh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},vh(e,t)}function bB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,vh(e,t)}var N6=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function yB(e,t){return!!(e===t||N6(e)&&N6(t))}function wB(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!yB(e[r],t[r]))return!1;return!0}function bh(e,t){t===void 0&&(t=wB);var r,n=[],i,s=!1;function o(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return s&&r===this&&t(a,n)||(i=e.apply(this,a),s=!0,r=this,n=a),i}return o}function k6(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 xB=typeof performance=="object"&&typeof performance.now=="function",D6=xB?function(){return performance.now()}:function(){return Date.now()};function L6(e){cancelAnimationFrame(e.id)}function SB(e,t){var r=D6();function n(){D6()-r>=t?e.call(null):i.id=requestAnimationFrame(n)}var i={id:requestAnimationFrame(n)};return i}var yh=-1;function B6(e){if(e===void 0&&(e=!1),yh===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),yh=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return yh}var Ho=null;function U6(e){if(e===void 0&&(e=!1),Ho===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?Ho="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Ho="negative":Ho="positive-ascending"),document.body.removeChild(t),Ho}return Ho}_n.env.NODE_ENV;var _B=150,EB=function(t,r){return t},Eu=null,Cu=null;_n.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Eu=new WeakSet,Cu=new WeakSet);function CB(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,i=e.getItemSize,s=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,c=e.initInstanceProps,l=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(f){bB(p,f);function p(x){var v;return v=f.call(this,x)||this,v._instanceProps=c(v.props,j6(v)),v._outerRef=void 0,v._resetIsScrollingTimeoutId=null,v.state={instance:j6(v),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof v.props.initialScrollOffset=="number"?v.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},v._callOnItemsRendered=void 0,v._callOnItemsRendered=bh(function(_,T,O,R){return v.props.onItemsRendered({overscanStartIndex:_,overscanStopIndex:T,visibleStartIndex:O,visibleStopIndex:R})}),v._callOnScroll=void 0,v._callOnScroll=bh(function(_,T,O){return v.props.onScroll({scrollDirection:_,scrollOffset:T,scrollUpdateWasRequested:O})}),v._getItemStyle=void 0,v._getItemStyle=function(_){var T=v.props,O=T.direction,R=T.itemSize,F=T.layout,B=v._getItemStyleCache(l&&R,l&&F,l&&O),H;if(B.hasOwnProperty(_))H=B[_];else{var $=r(v.props,_,v._instanceProps),Z=i(v.props,_,v._instanceProps),ce=O==="horizontal"||F==="horizontal",ne=O==="rtl",de=ce?$:0;B[_]=H={position:"absolute",left:ne?void 0:de,right:ne?de:void 0,top:ce?0:$,height:ce?"100%":Z,width:ce?Z:"100%"}}return H},v._getItemStyleCache=void 0,v._getItemStyleCache=bh(function(_,T,O){return{}}),v._onScrollHorizontal=function(_){var T=_.currentTarget,O=T.clientWidth,R=T.scrollLeft,F=T.scrollWidth;v.setState(function(B){if(B.scrollOffset===R)return null;var H=v.props.direction,$=R;if(H==="rtl")switch(U6()){case"negative":$=-R;break;case"positive-descending":$=F-O-R;break}return $=Math.max(0,Math.min($,F-O)),{isScrolling:!0,scrollDirection:B.scrollOffset<$?"forward":"backward",scrollOffset:$,scrollUpdateWasRequested:!1}},v._resetIsScrollingDebounced)},v._onScrollVertical=function(_){var T=_.currentTarget,O=T.clientHeight,R=T.scrollHeight,F=T.scrollTop;v.setState(function(B){if(B.scrollOffset===F)return null;var H=Math.max(0,Math.min(F,R-O));return{isScrolling:!0,scrollDirection:B.scrollOffset<H?"forward":"backward",scrollOffset:H,scrollUpdateWasRequested:!1}},v._resetIsScrollingDebounced)},v._outerRefSetter=function(_){var T=v.props.outerRef;v._outerRef=_,typeof T=="function"?T(_):T!=null&&typeof T=="object"&&T.hasOwnProperty("current")&&(T.current=_)},v._resetIsScrollingDebounced=function(){v._resetIsScrollingTimeoutId!==null&&L6(v._resetIsScrollingTimeoutId),v._resetIsScrollingTimeoutId=SB(v._resetIsScrolling,_B)},v._resetIsScrolling=function(){v._resetIsScrollingTimeoutId=null,v.setState({isScrolling:!1},function(){v._getItemStyleCache(-1,null)})},v}p.getDerivedStateFromProps=function(v,_){return AB(v,_),u(v),null};var y=p.prototype;return y.scrollTo=function(v){v=Math.max(0,v),this.setState(function(_){return _.scrollOffset===v?null:{scrollDirection:_.scrollOffset<v?"forward":"backward",scrollOffset:v,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},y.scrollToItem=function(v,_){_===void 0&&(_="auto");var T=this.props,O=T.itemCount,R=T.layout,F=this.state.scrollOffset;v=Math.max(0,Math.min(v,O-1));var B=0;if(this._outerRef){var H=this._outerRef;R==="vertical"?B=H.scrollWidth>H.clientWidth?B6():0:B=H.scrollHeight>H.clientHeight?B6():0}this.scrollTo(s(this.props,v,_,F,this._instanceProps,B))},y.componentDidMount=function(){var v=this.props,_=v.direction,T=v.initialScrollOffset,O=v.layout;if(typeof T=="number"&&this._outerRef!=null){var R=this._outerRef;_==="horizontal"||O==="horizontal"?R.scrollLeft=T:R.scrollTop=T}this._callPropsCallbacks()},y.componentDidUpdate=function(){var v=this.props,_=v.direction,T=v.layout,O=this.state,R=O.scrollOffset,F=O.scrollUpdateWasRequested;if(F&&this._outerRef!=null){var B=this._outerRef;if(_==="horizontal"||T==="horizontal")if(_==="rtl")switch(U6()){case"negative":B.scrollLeft=-R;break;case"positive-ascending":B.scrollLeft=R;break;default:var H=B.clientWidth,$=B.scrollWidth;B.scrollLeft=$-H-R;break}else B.scrollLeft=R;else B.scrollTop=R}this._callPropsCallbacks()},y.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&L6(this._resetIsScrollingTimeoutId)},y.render=function(){var v=this.props,_=v.children,T=v.className,O=v.direction,R=v.height,F=v.innerRef,B=v.innerElementType,H=v.innerTagName,$=v.itemCount,Z=v.itemData,ce=v.itemKey,ne=ce===void 0?EB:ce,de=v.layout,q=v.outerElementType,N=v.outerTagName,h=v.style,d=v.useIsScrolling,m=v.width,S=this.state.isScrolling,E=O==="horizontal"||de==="horizontal",M=E?this._onScrollHorizontal:this._onScrollVertical,j=this._getRangeToRender(),I=j[0],g=j[1],b=[];if($>0)for(var k=I;k<=g;k++)b.push(le.createElement(_,{data:Z,key:ne(k,Z),index:k,isScrolling:d?S:void 0,style:this._getItemStyle(k)}));var ve=n(this.props,this._instanceProps);return le.createElement(q||N||"div",{className:T,onScroll:M,ref:this._outerRefSetter,style:gh({position:"relative",height:R,width:m,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:O},h)},le.createElement(B||H||"div",{children:b,ref:F,style:{height:E?"100%":ve,pointerEvents:S?"none":void 0,width:E?ve:"100%"}}))},y._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var v=this.props.itemCount;if(v>0){var _=this._getRangeToRender(),T=_[0],O=_[1],R=_[2],F=_[3];this._callOnItemsRendered(T,O,R,F)}}if(typeof this.props.onScroll=="function"){var B=this.state,H=B.scrollDirection,$=B.scrollOffset,Z=B.scrollUpdateWasRequested;this._callOnScroll(H,$,Z)}},y._getRangeToRender=function(){var v=this.props,_=v.itemCount,T=v.overscanCount,O=this.state,R=O.isScrolling,F=O.scrollDirection,B=O.scrollOffset;if(_===0)return[0,0,0,0];var H=o(this.props,B,this._instanceProps),$=a(this.props,H,B,this._instanceProps),Z=!R||F==="backward"?Math.max(1,T):1,ce=!R||F==="forward"?Math.max(1,T):1;return[Math.max(0,H-Z),Math.max(0,Math.min(_-1,$+ce)),H,$]},p}(le.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var AB=function(t,r){var n=t.children,i=t.direction,s=t.height,o=t.layout,a=t.innerTagName,c=t.outerTagName,l=t.width,u=r.instance;if(_n.env.NODE_ENV!=="production"){(a!=null||c!=null)&&Cu&&!Cu.has(u)&&(Cu.add(u),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=i==="horizontal"||o==="horizontal";switch(i){case"horizontal":case"vertical":Eu&&!Eu.has(u)&&(Eu.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(o){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+o+'" 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(f&&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(!f&&typeof s!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(s===null?"null":typeof s)+'" was specified.'))}},TB=CB({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,s,o){var a=t.direction,c=t.height,l=t.itemCount,u=t.itemSize,f=t.layout,p=t.width,y=a==="horizontal"||f==="horizontal",x=y?p:c,v=Math.max(0,l*u-x),_=Math.min(v,r*u),T=Math.max(0,r*u-x+u+o);switch(n==="smart"&&(i>=T-x&&i<=_+x?n="auto":n="center"),n){case"start":return _;case"end":return T;case"center":{var O=Math.round(T+(_-T)/2);return O<Math.ceil(x/2)?0:O>v+Math.floor(x/2)?v:O}case"auto":default:return i>=T&&i<=_?i:i<T?T:_}},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,s=t.height,o=t.itemCount,a=t.itemSize,c=t.layout,l=t.width,u=i==="horizontal"||c==="horizontal",f=r*a,p=u?l:s,y=Math.ceil((p+n-f)/a);return Math.max(0,Math.min(o-1,r+y-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(_n.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 F6(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 MB=["style"],IB=["style"];function OB(e,t){var r=e.style,n=k6(e,MB),i=t.style,s=k6(t,IB);return!F6(r,i)&&!F6(n,s)}const PB=le.memo(({data:e,index:t,style:r})=>{const{items:n,onHandleTokenAction:i,showCollect:s,showDelete:o}=e,a=n[t];return w.jsx("div",{style:r,children:w.jsx(NB,{data:a,onHandleTokenAction:i,showCollect:s,showDelete:o})})},OB),RB=vB((e,t,r,n)=>({items:e,onHandleTokenAction:t,showCollect:r,showDelete:n}));function jB({showTokenList:e,onHandleTokenAction:t,showCollect:r=!0,showDelete:n=!1}){const i=le.useRef(null);le.useEffect(()=>{i.current&&i.current.scrollTo(0)},[e.length]);const s=RB(e,t,r,n);return w.jsx("div",{className:"token-list",children:w.jsx(TB,{ref:i,style:{overflowY:"scroll",scrollbarWidth:"none",msOverflowStyle:"none",padding:"8px"},height:360,itemCount:e.length,itemData:s,itemSize:72,width:"100%",children:PB})})}function NB({data:e,showCollect:t,showDelete:r,onHandleTokenAction:n}){const{isCollectToken:i}=P6(),{getExplorerUrl:s}=To();return Ga(),w.jsxs("div",{className:"token-list-item",onClick:o=>{t&&(o.stopPropagation(),n(e,"select_token"))},children:[w.jsx(Pr,{className:"token-img",src:e==null?void 0:e.logo_url,token:e,showWarnSize:"16px",showWarn:!t}),w.jsxs("div",{className:"token-info",children:[w.jsx("h4",{className:"token-symbol",children:w.jsx("span",{children:yn(e.symbol)})}),w.jsx("p",{className:"token-name",children:yn(e==null?void 0:e.name,20)}),w.jsxs("div",{className:"copy",children:[w.jsx("a",{onClick:bl,href:s(e==null?void 0:e.coin_type,"coin"),target:"_blank",style:{fontSize:"12px"},children:zs(e==null?void 0:e.coin_type)}),w.jsx(_u,{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?Pv(e==null?void 0:e.rate,2):""})]}),r&&w.jsx("div",{className:"collect-button",onClick:o=>{o.stopPropagation(),n(e,"delete_import")},children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_del1"})})}),t&&w.jsx("div",{className:"collect-button",onClick:o=>{o.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 kB({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:s,handleChangePlatform:o,handleChangeType:a,handleImportClick:c,handleDeleteImportClick:l}=uB(r==null?void 0:r.coin_type),{importTokenList:u,currentTypeTab:f,setCurrentTypeTab:p,currentPlatformTab:y,setCurrentPlatformTab:x,platformList:v,isOpenImportDialog:_,setIsOpenImportDialog:T,setSearchInput:O,searchInput:R,importTokenIsLoading:F,currentImportTokenData:B,setCurrentImportTokenData:H}=qs();le.useEffect(()=>()=>{O(""),x("All"),p("Default"),H(void 0)},[]);const{handleCollectToken:$,collectTokenMap:Z}=P6(),ce=m=>{p(m),a(m)},ne=m=>{x(m),o(m)},de=()=>{c(),T(!1)},q=m=>{let S=m.replace(/[^a-zA-Z0-9\s]+$/g,"").trim();O(S),S?N(S):(N(""),ce("Default"))},N=Y0(m=>{Nv(m)?s(Ri(m,!0)):s(m)},300),h=(m,S)=>{if(S==="delete_import"){l(m);return}if(S==="collect_token"||S==="un_collect"){$(m);return}S==="select_token"&&(t(m),e())},d=le.useMemo(()=>Array.from(Z.values()),[Z]);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:R,onChange:m=>q(m.target.value),style:{paddingRight:"40px"}}),R.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"})})]}),d.length>0&&w.jsx(dB,{tokenList:d,onHandleTokenAction:h}),R.length===0&&w.jsx(kB,{currentType:f,changeTab:ce}),R.length===0&&f==="Default"&&w.jsx(pB,{tabList:v,currentTab:y,changeTab:ne})]}),i&&w.jsx(LB,{showTooltip:R.length>0,text:R.length>0||B===void 0?"No tokens found":"No Imported Tokens"}),F&&w.jsx(uw,{}),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(jB,{showTokenList:n,showCollect:!B,showDelete:!B&&f==="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:()=>{de(),h(B,"select_token")},children:"Import"})})]})]})]})}function LB({showTooltip:e,text:t}){return w.jsx("div",{style:{height:"360px"},children:w.jsx(hB,{text:t,subItem:e?w.jsx("div",{children:w.jsx(Js,{position:"bottom",content:w.jsx("div",{style:{color:"var(--cs-text-primary)"},children:"The unique id of coin"}),children:w.jsxs("div",{style:{fontSize:"12px",color:"var(--cs-text-secondary)",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 BB({onClose:e,tokenList:t,onSureClick:r}){const[n,i]=le.useState(!1),{setIgnoreWarnToken:s}=Vr();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(o=>w.jsxs("div",{className:"import-token-info",children:[w.jsx(Pr,{style:{width:"30px",height:"30px",borderRadius:"36px"},token:o,showWarnSize:"16px",src:o.logo_url}),w.jsxs("div",{className:"info",children:[w.jsx("div",{className:"name",children:w.jsxs("span",{children:[" ",o.symbol," "]})}),w.jsxs("div",{className:"address",children:[w.jsx("span",{children:zs(o.coin_type)}),w.jsx(_u,{text:o.coin_type})]})]})]},o.coin_type)),w.jsxs("div",{className:"risk-checkbox ",children:[w.jsx(Hl,{color:"indigo",checked:n,variant:"soft",className:"cs-checkbox cs-allow-change-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(o=>{s(o.coin_type)})},children:"Confirm"})]})]})]})]})}const CF="";function $6(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 rc;(function(e){e.event="event",e.props="prop"})(rc||(rc={}));function ws(){}function UB(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(s,o){return s===t[o]})||(t=n,r=e.apply(void 0,n)),r}}function nc(e){return!!(e||"").match(/\d/)}function Wo(e){return e==null}function FB(e){return typeof e=="number"&&isNaN(e)}function V6(e){return Wo(e)||FB(e)||typeof e=="number"&&!isFinite(e)}function z6(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function $B(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 VB(e,t,r){var n=$B(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 zB(e){var t=le.useRef(e);t.current=e;var r=le.useRef(function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return t.current.apply(t,n)});return r.current}function wh(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var i=e.split("."),s=i[0],o=i[1]||"";return{beforeDecimal:s,afterDecimal:o,hasNegation:r,addNegation:n}}function qB(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 q6(e,t,r){for(var n="",i=r?"0":"",s=0;s<=t-1;s++)n+=e[s]||i;return n}function H6(e,t){return Array(t+1).join(e)}function W6(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),i=n[0],s=n[1];if(s=Number(s),!s)return r+i;i=i.replace(".","");var o=1+s,a=i.length;return o<0?i="0."+H6("0",Math.abs(o))+i:o>=a?i=i+H6("0",o-a):i=(i.substring(0,o)||"0")+"."+i.substring(o),r+i}function G6(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,i=wh(e),s=i.beforeDecimal,o=i.afterDecimal,a=i.hasNegation,c=parseFloat("0."+(o||"0")),l=o.length<=t?"0."+o:c.toFixed(t),u=l.split("."),f=s;s&&Number(u[0])&&(f=s.split("").reverse().reduce(function(v,_,T){return v.length>T?(Number(v[0])+Number(_)).toString()+v.substring(1,v.length):_+v},u[0]));var p=q6(u[1]||"",t,r),y=a?"-":"",x=n?".":"";return""+y+f+x+p}function ro(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 K6=UB(function(e,t){for(var r=0,n=0,i=e.length,s=t.length;e[r]===t[r]&&r<i;)r++;for(;e[i-1-n]===t[s-1-n]&&s-n>r&&i-n>r;)n++;return{from:{start:r,end:i-n},to:{start:r,end:s-n}}}),HB=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function WB(e,t,r){return Math.min(Math.max(e,t),r)}function xh(e){return Math.max(e.selectionStart,e.selectionEnd)}function GB(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function KB(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 JB(e,t,r,n,i,s,o){o===void 0&&(o=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,f={},p=new Array(l),y=0;y<l;y++){p[y]=-1;for(var x=0,v=u;x<v;x++){var _=o({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:y,formattedValueIndex:x});if(_&&f[x]!==!0){p[y]=x,f[x]=!0;break}}}for(var T=n;T<l&&(p[T]===-1||!s(r[T]));)T++;var O=T===l||p[T]===-1?u:p[T];for(T=n-1;T>0&&p[T]===-1;)T--;var R=T===-1||p[T]===-1?0:p[T]+1;return R>O?O:n-R<O-n?R:O}function Y6(e,t,r,n){var i=e.length;if(t=WB(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]=!!(nc(e[r])||nc(e[r-1]));return t}function J6(e,t,r,n,i,s){s===void 0&&(s=ws);var o=zB(function(x,v){var _,T;return V6(x)?(T="",_=""):typeof x=="number"||v?(T=typeof x=="number"?W6(x):x,_=n(T)):(T=i(x,void 0),_=n(T)),{formattedValue:_,numAsString:T}}),a=le.useState(function(){return o(Wo(e)?t:e,r)}),c=a[0],l=a[1],u=function(x,v){x.formattedValue!==c.formattedValue&&l({formattedValue:x.formattedValue,numAsString:x.value}),s(x,v)},f=e,p=r;Wo(e)&&(f=c.numAsString,p=!0);var y=o(f,p);return le.useMemo(function(){l(y)},[y.formattedValue]),[c,u]}function ZB(e){return e.replace(/[^0-9]/g,"")}function QB(e){return e}function eU(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,s=e.getInputRef,o=e.format;o===void 0&&(o=QB);var a=e.removeFormatting;a===void 0&&(a=ZB);var c=e.defaultValue,l=e.valueIsNumericString,u=e.onValueChange,f=e.isAllowed,p=e.onChange;p===void 0&&(p=ws);var y=e.onKeyDown;y===void 0&&(y=ws);var x=e.onMouseUp;x===void 0&&(x=ws);var v=e.onFocus;v===void 0&&(v=ws);var _=e.onBlur;_===void 0&&(_=ws);var T=e.value,O=e.getCaretBoundary;O===void 0&&(O=XB);var R=e.isValidInputCharacter;R===void 0&&(R=nc);var F=e.isCharacterSame,B=$6(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),H=J6(T,c,!!l,o,a,u),$=H[0],Z=$.formattedValue,ce=$.numAsString,ne=H[1],de=le.useRef(),q=le.useRef({formattedValue:Z,numAsString:ce}),N=function(W,K){q.current={formattedValue:W.formattedValue,numAsString:W.value},ne(W,K)},h=le.useState(!1),d=h[0],m=h[1],S=le.useRef(null),E=le.useRef({setCaretTimeout:null,focusTimeout:null});le.useEffect(function(){return m(!0),function(){clearTimeout(E.current.setCaretTimeout),clearTimeout(E.current.focusTimeout)}},[]);var M=o,j=function(W,K){var te=parseFloat(K);return{formattedValue:W,value:K,floatValue:isNaN(te)?void 0:te}},I=function(W,K,te){W.selectionStart===0&&W.selectionEnd===W.value.length||(ro(W,K),E.current.setCaretTimeout=setTimeout(function(){W.value===te&&W.selectionStart!==K&&ro(W,K)},0))},g=function(W,K,te){return Y6(W,K,O(W),te)},b=function(W,K,te){var oe=O(K),pe=JB(K,Z,W,te,oe,R,F);return pe=Y6(K,pe,oe),pe},k=function(W){var K=W.formattedValue;K===void 0&&(K="");var te=W.input,oe=W.source,pe=W.event,Se=W.numAsString,_e;if(te){var Ne=W.inputValue||te.value,He=xh(te);te.value=K,_e=b(Ne,K,He),_e!==void 0&&I(te,_e,K)}K!==Z&&N(j(K,Se),{event:pe,source:oe})};le.useEffect(function(){var W=q.current,K=W.formattedValue,te=W.numAsString;(Z!==K||ce!==te)&&N(j(Z,ce),{event:void 0,source:rc.props})},[Z,ce]);var ve=S.current?xh(S.current):void 0,he=typeof window<"u"?le.useLayoutEffect:le.useEffect;he(function(){var W=S.current;if(Z!==q.current.formattedValue&&W){var K=b(q.current.formattedValue,Z,ve);W.value=Z,I(W,K,Z)}},[Z]);var we=function(W,K,te){var oe=K.target,pe=de.current?HB(de.current,oe.selectionEnd):K6(Z,W),Se=Object.assign(Object.assign({},pe),{lastValue:Z}),_e=a(W,Se),Ne=M(_e);if(_e=a(Ne,void 0),f&&!f(j(Ne,_e))){var He=K.target,Ge=xh(He),Re=b(W,Z,Ge);return He.value=Z,I(He,Re,Z),!1}return k({formattedValue:Ne,numAsString:_e,inputValue:W,event:K,source:te,input:K.target}),!0},Oe=function(W,K){K===void 0&&(K=0);var te=W.selectionStart,oe=W.selectionEnd;de.current={selectionStart:te,selectionEnd:oe+K}},je=function(W){var K=W.target,te=K.value,oe=we(te,W,rc.event);oe&&p(W),de.current=void 0},L=function(W){var K=W.target,te=W.key,oe=K.selectionStart,pe=K.selectionEnd,Se=K.value;Se===void 0&&(Se="");var _e;te==="ArrowLeft"||te==="Backspace"?_e=Math.max(oe-1,0):te==="ArrowRight"?_e=Math.min(oe+1,Se.length):te==="Delete"&&(_e=oe);var Ne=0;te==="Delete"&&oe===pe&&(Ne=1);var He=te==="ArrowLeft"||te==="ArrowRight";if(_e===void 0||oe!==pe&&!He){y(W),Oe(K,Ne);return}var Ge=_e;if(He){var Re=te==="ArrowLeft"?"left":"right";Ge=g(Se,_e,Re),Ge!==_e&&W.preventDefault()}else te==="Delete"&&!R(Se[_e])?Ge=g(Se,_e,"right"):te==="Backspace"&&!R(Se[_e])&&(Ge=g(Se,_e,"left"));Ge!==_e&&I(K,Ge,Se),y(W),Oe(K,Ne)},z=function(W){var K=W.target,te=function(){var oe=K.selectionStart,pe=K.selectionEnd,Se=K.value;if(Se===void 0&&(Se=""),oe===pe){var _e=g(Se,oe);_e!==oe&&I(K,_e,Se)}};te(),requestAnimationFrame(function(){te()}),x(W),Oe(K)},G=function(W){W.persist&&W.persist();var K=W.target,te=W.currentTarget;S.current=K,E.current.focusTimeout=setTimeout(function(){var oe=K.selectionStart,pe=K.selectionEnd,Se=K.value;Se===void 0&&(Se="");var _e=g(Se,oe);_e!==oe&&!(oe===0&&pe===Se.length)&&I(K,_e,Se),v(Object.assign(Object.assign({},W),{currentTarget:te}))},0)},re=function(W){S.current=null,clearTimeout(E.current.focusTimeout),clearTimeout(E.current.setCaretTimeout),_(W)},ee=d&&GB()?"numeric":void 0,Q=Object.assign({inputMode:ee},B,{type:t,value:Z,onChange:je,onKeyDown:L,onMouseUp:z,onFocus:G,onBlur:re});if(r==="text")return i?le.createElement(le.Fragment,null,i(Z,B)||null):le.createElement("span",Object.assign({},B,{ref:s}),Z);if(n){var fe=n;return le.createElement(fe,Object.assign({},Q,{ref:s}))}return le.createElement("input",Object.assign({},Q,{ref:s}))}function X6(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var s=t.suffix;s===void 0&&(s="");var o=t.allowNegative,a=t.thousandsGroupStyle;if(a===void 0&&(a="thousand"),e===""||e==="-")return e;var c=Au(t),l=c.thousandSeparator,u=c.decimalSeparator,f=r!==0&&e.indexOf(".")!==-1||r&&n,p=wh(e,o),y=p.beforeDecimal,x=p.afterDecimal,v=p.addNegation;return r!==void 0&&(x=q6(x,r,!!n)),l&&(y=VB(y,l,a)),i&&(y=i+y),s&&(x=x+s),v&&(y="-"+y),e=y+(f&&u||"")+x,e}function Au(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 tU(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),i=r.test(e),s=n.test(e);return e=e.replace(/-/g,""),i&&!s&&t&&(e="-"+e),e}function rU(e,t){return new RegExp("(^-)|[0-9]|"+z6(e),t?"g":void 0)}function nU(e,t,r){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(r!=null&&r.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function iU(e,t,r){var n;t===void 0&&(t=KB(e));var i=r.allowNegative,s=r.prefix;s===void 0&&(s="");var o=r.suffix;o===void 0&&(o="");var a=r.decimalScale,c=t.from,l=t.to,u=l.start,f=l.end,p=Au(r),y=p.allowedDecimalSeparators,x=p.decimalSeparator,v=e[f]===x;if(nc(e)&&(e===s||e===o)&&t.lastValue==="")return e;if(f-u===1&&y.indexOf(e[u])!==-1){var _=a===0?"":x;e=e.substring(0,u)+_+e.substring(u+1,e.length)}var T=function(S,E,M){var j=!1,I=!1;s.startsWith("-")?j=!1:S.startsWith("--")?(j=!1,I=!0):o.startsWith("-")&&S.length===o.length?j=!1:S[0]==="-"&&(j=!0);var g=j?1:0;return I&&(g=2),g&&(S=S.substring(g),E-=g,M-=g),{value:S,start:E,end:M,hasNegation:j}},O=T(e,u,f),R=O.hasNegation;n=O,e=n.value,u=n.start,f=n.end;var F=T(t.lastValue,c.start,c.end),B=F.start,H=F.end,$=F.value,Z=e.substring(u,f);e.length&&$.length&&(B>$.length-o.length||H<s.length)&&!(Z&&o.startsWith(Z))&&(e=$);var ce=0;e.startsWith(s)?ce+=s.length:u<s.length&&(ce=u),e=e.substring(ce),f-=ce;var ne=e.length,de=e.length-o.length;e.endsWith(o)?ne=de:(f>de||f>e.length-o.length)&&(ne=f),e=e.substring(0,ne),e=tU(R?"-"+e:e,i),e=(e.match(rU(x,!0))||[]).join("");var q=e.indexOf(x);e=e.replace(new RegExp(z6(x),"g"),function(S,E){return E===q?".":""});var N=wh(e,i),h=N.beforeDecimal,d=N.afterDecimal,m=N.addNegation;return l.end-l.start<c.end-c.start&&h===""&&v&&!parseFloat(d)&&(e=m?"-":""),e}function sU(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}),s=e[0]==="-";i.fill(!1,0,r.length+(s?1:0));var o=e.length;return i.fill(!1,o-n.length+1,o+1),i}function oU(e){var t=Au(e),r=t.thousandSeparator,n=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var s=e.allowNegative;if(s===void 0&&(s=!0),r===n)throw new Error(`
|
|
109
|
+
`)},OI=0,Uo=[];function PI(e){var t=P.useRef([]),r=P.useRef([0,0]),n=P.useRef(),i=P.useState(OI++)[0],s=P.useState(S2)[0],o=P.useRef(e);P.useEffect(function(){o.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=ZM([e.lockRef.current],(e.shards||[]).map(I2),!0).filter(Boolean);return v.forEach(function(_){return _.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=P.useCallback(function(v,_){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var T=Zl(v),O=r.current,R="deltaX"in v?v.deltaX:O[0]-T[0],F="deltaY"in v?v.deltaY:O[1]-T[1],B,H=v.target,$=Math.abs(R)>Math.abs(F)?"h":"v";if("touches"in v&&$==="h"&&H.type==="range")return!1;var Z=C2($,H);if(!Z)return!0;if(Z?B=$:(B=$==="v"?"h":"v",Z=C2($,H)),!Z)return!1;if(!n.current&&"changedTouches"in v&&(R||F)&&(n.current=B),!B)return!0;var ce=n.current||B;return TI(ce,_,v,ce==="h"?R:F,!0)},[]),c=P.useCallback(function(v){var _=v;if(!(!Uo.length||Uo[Uo.length-1]!==s)){var T="deltaY"in _?M2(_):Zl(_),O=t.current.filter(function(B){return B.name===_.type&&(B.target===_.target||_.target===B.shadowParent)&&MI(B.delta,T)})[0];if(O&&O.should){_.cancelable&&_.preventDefault();return}if(!O){var R=(o.current.shards||[]).map(I2).filter(Boolean).filter(function(B){return B.contains(_.target)}),F=R.length>0?a(_,R[0]):!o.current.noIsolation;F&&_.cancelable&&_.preventDefault()}}},[]),l=P.useCallback(function(v,_,T,O){var R={name:v,delta:_,target:T,should:O,shadowParent:RI(T)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(F){return F!==R})},1)},[]),u=P.useCallback(function(v){r.current=Zl(v),n.current=void 0},[]),f=P.useCallback(function(v){l(v.type,M2(v),v.target,a(v,e.lockRef.current))},[]),p=P.useCallback(function(v){l(v.type,Zl(v),v.target,a(v,e.lockRef.current))},[]);P.useEffect(function(){return Uo.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Bo),document.addEventListener("touchmove",c,Bo),document.addEventListener("touchstart",u,Bo),function(){Uo=Uo.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,Bo),document.removeEventListener("touchmove",c,Bo),document.removeEventListener("touchstart",u,Bo)}},[]);var y=e.removeScrollBar,x=e.inert;return P.createElement(P.Fragment,null,x?P.createElement(s,{styles:II(i)}):null,y?P.createElement(wI,{gapMode:e.gapMode}):null)}function RI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jI=aI(w2,PI);var O2=P.forwardRef(function(e,t){return P.createElement(Jl,ui({},e,{ref:t,sideCar:jI}))});O2.classNames=Jl.classNames;const NI=O2;function kI(e,t){return P.useReducer((r,n)=>t[r][n]??r,e)}var T0="ScrollArea",[P2,nF]=Di(T0),[DI,wn]=P2(T0),R2=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:i,scrollHideDelay:s=600,...o}=e,[a,c]=P.useState(null),[l,u]=P.useState(null),[f,p]=P.useState(null),[y,x]=P.useState(null),[v,_]=P.useState(null),[T,O]=P.useState(0),[R,F]=P.useState(0),[B,H]=P.useState(!1),[$,Z]=P.useState(!1),ce=Xt(t,de=>c(de)),ne=h0(i);return w.jsx(DI,{scope:r,type:n,dir:ne,scrollHideDelay:s,scrollArea:a,viewport:l,onViewportChange:u,content:f,onContentChange:p,scrollbarX:y,onScrollbarXChange:x,scrollbarXEnabled:B,onScrollbarXEnabledChange:H,scrollbarY:v,onScrollbarYChange:_,scrollbarYEnabled:$,onScrollbarYEnabledChange:Z,onCornerWidthChange:O,onCornerHeightChange:F,children:w.jsx(Zt.div,{dir:ne,...o,ref:ce,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":R+"px",...e.style}})})});R2.displayName=T0;var j2="ScrollAreaViewport",N2=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:i,...s}=e,o=wn(j2,r),a=P.useRef(null),c=Xt(t,a,o.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(Zt.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:w.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});N2.displayName=j2;var di="ScrollAreaScrollbar",k2=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=wn(di,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:o}=i,a=e.orientation==="horizontal";return P.useEffect(()=>(a?s(!0):o(!0),()=>{a?s(!1):o(!1)}),[a,s,o]),i.type==="hover"?w.jsx(LI,{...n,ref:t,forceMount:r}):i.type==="scroll"?w.jsx(BI,{...n,ref:t,forceMount:r}):i.type==="auto"?w.jsx(D2,{...n,ref:t,forceMount:r}):i.type==="always"?w.jsx(M0,{...n,ref:t}):null});k2.displayName=di;var LI=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=wn(di,e.__scopeScrollArea),[s,o]=P.useState(!1);return P.useEffect(()=>{const a=i.scrollArea;let c=0;if(a){const l=()=>{window.clearTimeout(c),o(!0)},u=()=>{c=window.setTimeout(()=>o(!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(Un,{present:r||s,children:w.jsx(D2,{"data-state":s?"visible":"hidden",...n,ref:t})})}),BI=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=wn(di,e.__scopeScrollArea),s=e.orientation==="horizontal",o=ru(()=>c("SCROLL_END"),100),[a,c]=kI("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 P.useEffect(()=>{if(a==="idle"){const l=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[a,i.scrollHideDelay,c]),P.useEffect(()=>{const l=i.viewport,u=s?"scrollLeft":"scrollTop";if(l){let f=l[u];const p=()=>{const y=l[u];f!==y&&(c("SCROLL"),o()),f=y};return l.addEventListener("scroll",p),()=>l.removeEventListener("scroll",p)}},[i.viewport,s,c,o]),w.jsx(Un,{present:r||a!=="hidden",children:w.jsx(M0,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:lt(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:lt(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),D2=P.forwardRef((e,t)=>{const r=wn(di,e.__scopeScrollArea),{forceMount:n,...i}=e,[s,o]=P.useState(!1),a=e.orientation==="horizontal",c=ru(()=>{if(r.viewport){const l=r.viewport.offsetWidth<r.viewport.scrollWidth,u=r.viewport.offsetHeight<r.viewport.scrollHeight;o(a?l:u)}},10);return Fo(r.viewport,c),Fo(r.content,c),w.jsx(Un,{present:n||s,children:w.jsx(M0,{"data-state":s?"visible":"hidden",...i,ref:t})})}),M0=P.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,i=wn(di,e.__scopeScrollArea),s=P.useRef(null),o=P.useRef(0),[a,c]=P.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=$2(a.viewport,a.content),u={...n,sizes:a,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:p=>o.current=p};function f(p,y){return qI(p,o.current,a,y)}return r==="horizontal"?w.jsx(UI,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollLeft,y=V2(p,a,i.dir);s.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=f(p,i.dir))}}):r==="vertical"?w.jsx(FI,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollTop,y=V2(p,a);s.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=f(p))}}):null}),UI=P.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,s=wn(di,e.__scopeScrollArea),[o,a]=P.useState(),c=P.useRef(null),l=Xt(t,c,s.onScrollbarXChange);return P.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.jsx(B2,{"data-orientation":"horizontal",...i,ref:l,sizes:r,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":tu(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(s.viewport){const p=s.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),q2(p,f)&&u.preventDefault()}},onResize:()=>{c.current&&s.viewport&&o&&n({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:eu(o.paddingLeft),paddingEnd:eu(o.paddingRight)}})}})}),FI=P.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,s=wn(di,e.__scopeScrollArea),[o,a]=P.useState(),c=P.useRef(null),l=Xt(t,c,s.onScrollbarYChange);return P.useEffect(()=>{c.current&&a(getComputedStyle(c.current))},[c]),w.jsx(B2,{"data-orientation":"vertical",...i,ref:l,sizes:r,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":tu(r)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(s.viewport){const p=s.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),q2(p,f)&&u.preventDefault()}},onResize:()=>{c.current&&s.viewport&&o&&n({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:eu(o.paddingTop),paddingEnd:eu(o.paddingBottom)}})}})}),[$I,L2]=P2(di),B2=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:i,onThumbChange:s,onThumbPointerUp:o,onThumbPointerDown:a,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:f,...p}=e,y=wn(di,r),[x,v]=P.useState(null),_=Xt(t,ce=>v(ce)),T=P.useRef(null),O=P.useRef(""),R=y.viewport,F=n.content-n.viewport,B=Rr(u),H=Rr(c),$=ru(f,10);function Z(ce){if(T.current){const ne=ce.clientX-T.current.left,de=ce.clientY-T.current.top;l({x:ne,y:de})}}return P.useEffect(()=>{const ce=ne=>{const de=ne.target;(x==null?void 0:x.contains(de))&&B(ne,F)};return document.addEventListener("wheel",ce,{passive:!1}),()=>document.removeEventListener("wheel",ce,{passive:!1})},[R,x,F,B]),P.useEffect(H,[n,H]),Fo(x,$),Fo(y.content,$),w.jsx($I,{scope:r,scrollbar:x,hasThumb:i,onThumbChange:Rr(s),onThumbPointerUp:Rr(o),onThumbPositionChange:H,onThumbPointerDown:Rr(a),children:w.jsx(Zt.div,{...p,ref:_,style:{position:"absolute",...p.style},onPointerDown:lt(e.onPointerDown,ce=>{ce.button===0&&(ce.target.setPointerCapture(ce.pointerId),T.current=x.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),Z(ce))}),onPointerMove:lt(e.onPointerMove,Z),onPointerUp:lt(e.onPointerUp,ce=>{const ne=ce.target;ne.hasPointerCapture(ce.pointerId)&&ne.releasePointerCapture(ce.pointerId),document.body.style.webkitUserSelect=O.current,y.viewport&&(y.viewport.style.scrollBehavior=""),T.current=null})})})}),Ql="ScrollAreaThumb",U2=P.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=L2(Ql,e.__scopeScrollArea);return w.jsx(Un,{present:r||i.hasThumb,children:w.jsx(VI,{ref:t,...n})})}),VI=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...i}=e,s=wn(Ql,r),o=L2(Ql,r),{onThumbPositionChange:a}=o,c=Xt(t,f=>o.onThumbChange(f)),l=P.useRef(void 0),u=ru(()=>{l.current&&(l.current(),l.current=void 0)},100);return P.useEffect(()=>{const f=s.viewport;if(f){const p=()=>{if(u(),!l.current){const y=HI(f,a);l.current=y,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[s.viewport,u,a]),w.jsx(Zt.div,{"data-state":o.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:lt(e.onPointerDownCapture,f=>{const y=f.target.getBoundingClientRect(),x=f.clientX-y.left,v=f.clientY-y.top;o.onThumbPointerDown({x,y:v})}),onPointerUp:lt(e.onPointerUp,o.onThumbPointerUp)})});U2.displayName=Ql;var I0="ScrollAreaCorner",F2=P.forwardRef((e,t)=>{const r=wn(I0,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?w.jsx(zI,{...e,ref:t}):null});F2.displayName=I0;var zI=P.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,i=wn(I0,r),[s,o]=P.useState(0),[a,c]=P.useState(0),l=!!(s&&a);return Fo(i.scrollbarX,()=>{var f;const u=((f=i.scrollbarX)==null?void 0:f.offsetHeight)||0;i.onCornerHeightChange(u),c(u)}),Fo(i.scrollbarY,()=>{var f;const u=((f=i.scrollbarY)==null?void 0:f.offsetWidth)||0;i.onCornerWidthChange(u),o(u)}),l?w.jsx(Zt.div,{...n,ref:t,style:{width:s,height:a,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function eu(e){return e?parseInt(e,10):0}function $2(e,t){const r=e/t;return isNaN(r)?0:r}function tu(e){const t=$2(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function qI(e,t,r,n="ltr"){const i=tu(r),s=i/2,o=t||s,a=i-o,c=r.scrollbar.paddingStart+o,l=r.scrollbar.size-r.scrollbar.paddingEnd-a,u=r.content-r.viewport,f=n==="ltr"?[0,u]:[u*-1,0];return z2([c,l],f)(e)}function V2(e,t,r="ltr"){const n=tu(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,o=t.content-t.viewport,a=s-n,c=r==="ltr"?[0,o]:[o*-1,0],l=UM(e,c);return z2([0,o],[0,a])(l)}function z2(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 q2(e,t){return e>0&&e<t}var HI=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},o=r.left!==s.left,a=r.top!==s.top;(o||a)&&t(),r=s,n=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(n)};function ru(e,t){const r=Rr(e),n=P.useRef(0);return P.useEffect(()=>()=>window.clearTimeout(n.current),[]),P.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Fo(e,t){const r=Rr(t);Li(()=>{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 WI=R2,GI=N2,H2=k2,W2=U2,KI=F2,nu="Switch",[YI,iF]=Di(nu),[JI,XI]=YI(nu),G2=P.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,form:u,...f}=e,[p,y]=P.useState(null),x=Xt(t,R=>y(R)),v=P.useRef(!1),_=p?u||!!p.closest("form"):!0,[T,O]=ka({prop:i,defaultProp:s??!1,onChange:l,caller:nu});return w.jsxs(JI,{scope:r,checked:T,disabled:a,children:[w.jsx(Zt.button,{type:"button",role:"switch","aria-checked":T,"aria-required":o,"data-state":X2(T),"data-disabled":a?"":void 0,disabled:a,value:c,...f,ref:x,onClick:lt(e.onClick,R=>{O(F=>!F),_&&(v.current=R.isPropagationStopped(),v.current||R.stopPropagation())})}),_&&w.jsx(J2,{control:p,bubbles:!v.current,name:n,value:c,checked:T,required:o,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});G2.displayName=nu;var K2="SwitchThumb",Y2=P.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,i=XI(K2,r);return w.jsx(Zt.span,{"data-state":X2(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:t})});Y2.displayName=K2;var ZI="SwitchBubbleInput",J2=P.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...i},s)=>{const o=P.useRef(null),a=Xt(o,s),c=Wb(r),l=c0(t);return P.useEffect(()=>{const u=o.current;if(!u)return;const f=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&y){const x=new Event("click",{bubbles:n});y.call(u,r),u.dispatchEvent(x)}},[c,r,n]),w.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:a,style:{...i.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});J2.displayName=ZI;function X2(e){return e?"checked":"unchecked"}var QI=G2,eO=Y2;const Fa={size:{type:"enum",values:["1","2","3"],default:"2",responsive:!0},variant:{type:"enum",values:["classic","surface","soft"],default:"surface"},color:Da,highContrast:$l,radius:m0},Z2=P.forwardRef((e,t)=>{const{rest:r,...n}=La(e),{className:i,style:s,size:o=Fa.size.default,variant:a=Fa.variant.default,color:c=Fa.color.default,highContrast:l=Fa.highContrast.default,radius:u=Fa.radius.default,...f}=r;return P.createElement("span",{"data-radius":u,className:or("rt-SwitchRoot",i,Qr(o,"rt-r-size"),`rt-variant-${a}`,{"rt-high-contrast":l},Ba(n)),style:s},P.createElement(QI,{"data-accent-color":c,...f,ref:t,className:or("rt-reset","rt-SwitchButton",{"rt-high-contrast":l})},P.createElement(eO,{className:or("rt-SwitchThumb",{"rt-high-contrast":l})})))});Z2.displayName="Switch";var O0=["Enter"," "],tO=["ArrowDown","PageUp","Home"],Q2=["ArrowUp","PageDown","End"],rO=[...tO,...Q2],nO={ltr:[...O0,"ArrowRight"],rtl:[...O0,"ArrowLeft"]},iO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},$a="Menu",[Va,sO,oO]=r2($a),[Ks,ey]=Di($a,[oO,kl,i2]),za=kl(),ty=i2(),[ry,ys]=Ks($a),[aO,qa]=Ks($a),ny=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:s,modal:o=!0}=e,a=za(t),[c,l]=P.useState(null),u=P.useRef(!1),f=Rr(s),p=h0(i);return P.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(Ob,{...a,children:w.jsx(ry,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:l,children:w.jsx(aO,{scope:t,onClose:P.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:o,children:n})})})};ny.displayName=$a;var cO="MenuAnchor",P0=P.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=za(r);return w.jsx(Pb,{...i,...n,ref:t})});P0.displayName=cO;var R0="MenuPortal",[lO,iy]=Ks(R0,{forceMount:void 0}),sy=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,s=ys(R0,t);return w.jsx(lO,{scope:t,forceMount:r,children:w.jsx(Un,{present:r||s.open,children:w.jsx(Nb,{asChild:!0,container:i,children:n})})})};sy.displayName=R0;var xn="MenuContent",[uO,j0]=Ks(xn),oy=P.forwardRef((e,t)=>{const r=iy(xn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,s=ys(xn,e.__scopeMenu),o=qa(xn,e.__scopeMenu);return w.jsx(Va.Provider,{scope:e.__scopeMenu,children:w.jsx(Un,{present:n||s.open,children:w.jsx(Va.Slot,{scope:e.__scopeMenu,children:o.modal?w.jsx(dO,{...i,ref:t}):w.jsx(fO,{...i,ref:t})})})})}),dO=P.forwardRef((e,t)=>{const r=ys(xn,e.__scopeMenu),n=P.useRef(null),i=Xt(t,n);return P.useEffect(()=>{const s=n.current;if(s)return XM(s)},[]),w.jsx(N0,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:lt(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),fO=P.forwardRef((e,t)=>{const r=ys(xn,e.__scopeMenu);return w.jsx(N0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),hO=Oa("MenuContent.ScrollLock"),N0=P.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:y,disableOutsideScroll:x,...v}=e,_=ys(xn,r),T=qa(xn,r),O=za(r),R=ty(r),F=sO(r),[B,H]=P.useState(null),$=P.useRef(null),Z=Xt(t,$,_.onContentChange),ce=P.useRef(0),ne=P.useRef(""),de=P.useRef(0),q=P.useRef(null),N=P.useRef("right"),h=P.useRef(0),d=x?NI:P.Fragment,m=x?{as:hO,allowPinchZoom:!0}:void 0,S=M=>{var we,Oe;const j=ne.current+M,I=F().filter(je=>!je.disabled),g=document.activeElement,b=(we=I.find(je=>je.ref.current===g))==null?void 0:we.textValue,k=I.map(je=>je.textValue),ve=CO(k,j,b),he=(Oe=I.find(je=>je.textValue===ve))==null?void 0:Oe.ref.current;(function je(L){ne.current=L,window.clearTimeout(ce.current),L!==""&&(ce.current=window.setTimeout(()=>je(""),1e3))})(j),he&&setTimeout(()=>he.focus())};P.useEffect(()=>()=>window.clearTimeout(ce.current),[]),FM();const E=P.useCallback(M=>{var I,g;return N.current===((I=q.current)==null?void 0:I.side)&&TO(M,(g=q.current)==null?void 0:g.area)},[]);return w.jsx(uO,{scope:r,searchRef:ne,onItemEnter:P.useCallback(M=>{E(M)&&M.preventDefault()},[E]),onItemLeave:P.useCallback(M=>{var j;E(M)||((j=$.current)==null||j.focus(),H(null))},[E]),onTriggerLeave:P.useCallback(M=>{E(M)&&M.preventDefault()},[E]),pointerGraceTimerRef:de,onPointerGraceIntentChange:P.useCallback(M=>{q.current=M},[]),children:w.jsx(d,{...m,children:w.jsx(d2,{asChild:!0,trapped:i,onMountAutoFocus:lt(s,M=>{var j;M.preventDefault(),(j=$.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:w.jsx(Yf,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:y,children:w.jsx(LM,{asChild:!0,...R,dir:T.dir,orientation:"vertical",loop:n,currentTabStopId:B,onCurrentTabStopIdChange:H,onEntryFocus:lt(c,M=>{T.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:w.jsx(Rb,{role:"menu","aria-orientation":"vertical","data-state":Ey(_.open),"data-radix-menu-content":"",dir:T.dir,...O,...v,ref:Z,style:{outline:"none",...v.style},onKeyDown:lt(v.onKeyDown,M=>{const I=M.target.closest("[data-radix-menu-content]")===M.currentTarget,g=M.ctrlKey||M.altKey||M.metaKey,b=M.key.length===1;I&&(M.key==="Tab"&&M.preventDefault(),!g&&b&&S(M.key));const k=$.current;if(M.target!==k||!rO.includes(M.key))return;M.preventDefault();const he=F().filter(we=>!we.disabled).map(we=>we.ref.current);Q2.includes(M.key)&&he.reverse(),_O(he)}),onBlur:lt(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(ce.current),ne.current="")}),onPointerMove:lt(e.onPointerMove,Wa(M=>{const j=M.target,I=h.current!==M.clientX;if(M.currentTarget.contains(j)&&I){const g=M.clientX>h.current?"right":"left";N.current=g,h.current=M.clientX}}))})})})})})})});oy.displayName=xn;var pO="MenuGroup",k0=P.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Zt.div,{role:"group",...n,ref:t})});k0.displayName=pO;var mO="MenuLabel",ay=P.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Zt.div,{...n,ref:t})});ay.displayName=mO;var iu="MenuItem",cy="menu.itemSelect",su=P.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,s=P.useRef(null),o=qa(iu,e.__scopeMenu),a=j0(iu,e.__scopeMenu),c=Xt(t,s),l=P.useRef(!1),u=()=>{const f=s.current;if(!r&&f){const p=new CustomEvent(cy,{bubbles:!0,cancelable:!0});f.addEventListener(cy,y=>n==null?void 0:n(y),{once:!0}),Xv(f,p),p.defaultPrevented?l.current=!1:o.onClose()}};return w.jsx(ly,{...i,ref:c,disabled:r,onClick:lt(e.onClick,u),onPointerDown:f=>{var p;(p=e.onPointerDown)==null||p.call(e,f),l.current=!0},onPointerUp:lt(e.onPointerUp,f=>{var p;l.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:lt(e.onKeyDown,f=>{const p=a.searchRef.current!=="";r||p&&f.key===" "||O0.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});su.displayName=iu;var ly=P.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=e,o=j0(iu,r),a=ty(r),c=P.useRef(null),l=Xt(t,c),[u,f]=P.useState(!1),[p,y]=P.useState("");return P.useEffect(()=>{const x=c.current;x&&y((x.textContent??"").trim())},[s.children]),w.jsx(Va.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:w.jsx(BM,{asChild:!0,...a,focusable:!n,children:w.jsx(Zt.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:l,onPointerMove:lt(e.onPointerMove,Wa(x=>{n?o.onItemLeave(x):(o.onItemEnter(x),x.defaultPrevented||x.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:lt(e.onPointerLeave,Wa(x=>o.onItemLeave(x))),onFocus:lt(e.onFocus,()=>f(!0)),onBlur:lt(e.onBlur,()=>f(!1))})})})}),gO="MenuCheckboxItem",uy=P.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...i}=e;return w.jsx(my,{scope:e.__scopeMenu,checked:r,children:w.jsx(su,{role:"menuitemcheckbox","aria-checked":ou(r)?"mixed":r,...i,ref:t,"data-state":B0(r),onSelect:lt(i.onSelect,()=>n==null?void 0:n(ou(r)?!0:!r),{checkForDefaultPrevented:!1})})})});uy.displayName=gO;var dy="MenuRadioGroup",[vO,bO]=Ks(dy,{value:void 0,onValueChange:()=>{}}),fy=P.forwardRef((e,t)=>{const{value:r,onValueChange:n,...i}=e,s=Rr(n);return w.jsx(vO,{scope:e.__scopeMenu,value:r,onValueChange:s,children:w.jsx(k0,{...i,ref:t})})});fy.displayName=dy;var hy="MenuRadioItem",py=P.forwardRef((e,t)=>{const{value:r,...n}=e,i=bO(hy,e.__scopeMenu),s=r===i.value;return w.jsx(my,{scope:e.__scopeMenu,checked:s,children:w.jsx(su,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":B0(s),onSelect:lt(n.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})})});py.displayName=hy;var D0="MenuItemIndicator",[my,yO]=Ks(D0,{checked:!1}),gy=P.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...i}=e,s=yO(D0,r);return w.jsx(Un,{present:n||ou(s.checked)||s.checked===!0,children:w.jsx(Zt.span,{...i,ref:t,"data-state":B0(s.checked)})})});gy.displayName=D0;var wO="MenuSeparator",vy=P.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return w.jsx(Zt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});vy.displayName=wO;var xO="MenuArrow",by=P.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=za(r);return w.jsx(jb,{...i,...n,ref:t})});by.displayName=xO;var L0="MenuSub",[SO,yy]=Ks(L0),wy=e=>{const{__scopeMenu:t,children:r,open:n=!1,onOpenChange:i}=e,s=ys(L0,t),o=za(t),[a,c]=P.useState(null),[l,u]=P.useState(null),f=Rr(i);return P.useEffect(()=>(s.open===!1&&f(!1),()=>f(!1)),[s.open,f]),w.jsx(Ob,{...o,children:w.jsx(ry,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:w.jsx(SO,{scope:t,contentId:Pa(),triggerId:Pa(),trigger:a,onTriggerChange:c,children:r})})})};wy.displayName=L0;var Ha="MenuSubTrigger",xy=P.forwardRef((e,t)=>{const r=ys(Ha,e.__scopeMenu),n=qa(Ha,e.__scopeMenu),i=yy(Ha,e.__scopeMenu),s=j0(Ha,e.__scopeMenu),o=P.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:c}=s,l={__scopeMenu:e.__scopeMenu},u=P.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return P.useEffect(()=>u,[u]),P.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),c(null)}},[a,c]),w.jsx(P0,{asChild:!0,...l,children:w.jsx(ly,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":Ey(r.open),...e,ref:Wf(t,i.onTriggerChange),onClick:f=>{var p;(p=e.onClick)==null||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:lt(e.onPointerMove,Wa(f=>{s.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:lt(e.onPointerLeave,Wa(f=>{var y,x;u();const p=(y=r.content)==null?void 0:y.getBoundingClientRect();if(p){const v=(x=r.content)==null?void 0:x.dataset.side,_=v==="right",T=_?-5:5,O=p[_?"left":"right"],R=p[_?"right":"left"];s.onPointerGraceIntentChange({area:[{x:f.clientX+T,y:f.clientY},{x:O,y:p.top},{x:R,y:p.top},{x:R,y:p.bottom},{x:O,y:p.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(f),f.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:lt(e.onKeyDown,f=>{var y;const p=s.searchRef.current!=="";e.disabled||p&&f.key===" "||nO[n.dir].includes(f.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),f.preventDefault())})})})});xy.displayName=Ha;var Sy="MenuSubContent",_y=P.forwardRef((e,t)=>{const r=iy(xn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,s=ys(xn,e.__scopeMenu),o=qa(xn,e.__scopeMenu),a=yy(Sy,e.__scopeMenu),c=P.useRef(null),l=Xt(t,c);return w.jsx(Va.Provider,{scope:e.__scopeMenu,children:w.jsx(Un,{present:n||s.open,children:w.jsx(Va.Slot,{scope:e.__scopeMenu,children:w.jsx(N0,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:lt(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:lt(e.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:lt(e.onKeyDown,u=>{var y;const f=u.currentTarget.contains(u.target),p=iO[o.dir].includes(u.key);f&&p&&(s.onOpenChange(!1),(y=a.trigger)==null||y.focus(),u.preventDefault())})})})})})});_y.displayName=Sy;function Ey(e){return e?"open":"closed"}function ou(e){return e==="indeterminate"}function B0(e){return ou(e)?"indeterminate":e?"checked":"unchecked"}function _O(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function EO(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function CO(e,t,r){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let o=EO(e,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function AO(e,t){const{x:r,y:n}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],c=t[o],l=a.x,u=a.y,f=c.x,p=c.y;u>n!=p>n&&r<(f-l)*(n-u)/(p-u)+l&&(i=!i)}return i}function TO(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return AO(r,t)}function Wa(e){return t=>t.pointerType==="mouse"?e(t):void 0}var MO=ny,IO=P0,OO=sy,PO=oy,RO=k0,jO=ay,NO=su,kO=uy,DO=fy,LO=py,BO=gy,UO=vy,FO=by,$O=wy,VO=xy,zO=_y,au="DropdownMenu",[qO,aF]=Di(au,[ey]),$r=ey(),[HO,Cy]=qO(au),Ay=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,c=$r(t),l=P.useRef(null),[u,f]=ka({prop:i,defaultProp:s??!1,onChange:o,caller:au});return w.jsx(HO,{scope:t,triggerId:Pa(),triggerRef:l,contentId:Pa(),open:u,onOpenChange:f,onOpenToggle:P.useCallback(()=>f(p=>!p),[f]),modal:a,children:w.jsx(MO,{...c,open:u,onOpenChange:f,dir:n,modal:a,children:r})})};Ay.displayName=au;var Ty="DropdownMenuTrigger",My=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,s=Cy(Ty,r),o=$r(r);return w.jsx(IO,{asChild:!0,...o,children:w.jsx(Zt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:Wf(t,s.triggerRef),onPointerDown:lt(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:lt(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});My.displayName=Ty;var WO="DropdownMenuPortal",Iy=e=>{const{__scopeDropdownMenu:t,...r}=e,n=$r(t);return w.jsx(OO,{...n,...r})};Iy.displayName=WO;var Oy="DropdownMenuContent",Py=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Cy(Oy,r),s=$r(r),o=P.useRef(!1);return w.jsx(PO,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...n,ref:t,onCloseAutoFocus:lt(e.onCloseAutoFocus,a=>{var c;o.current||(c=i.triggerRef.current)==null||c.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:lt(e.onInteractOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0,u=c.button===2||l;(!i.modal||u)&&(o.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)"}})});Py.displayName=Oy;var GO="DropdownMenuGroup",Ry=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=$r(r);return w.jsx(RO,{...i,...n,ref:t})});Ry.displayName=GO;var KO="DropdownMenuLabel",jy=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=$r(r);return w.jsx(jO,{...i,...n,ref:t})});jy.displayName=KO;var YO="DropdownMenuItem",Ny=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=$r(r);return w.jsx(NO,{...i,...n,ref:t})});Ny.displayName=YO;var JO="DropdownMenuCheckboxItem",ky=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=$r(r);return w.jsx(kO,{...i,...n,ref:t})});ky.displayName=JO;var XO="DropdownMenuRadioGroup",Dy=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=$r(r);return w.jsx(DO,{...i,...n,ref:t})});Dy.displayName=XO;var ZO="DropdownMenuRadioItem",Ly=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=$r(r);return w.jsx(LO,{...i,...n,ref:t})});Ly.displayName=ZO;var QO="DropdownMenuItemIndicator",By=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=$r(r);return w.jsx(BO,{...i,...n,ref:t})});By.displayName=QO;var eP="DropdownMenuSeparator",Uy=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=$r(r);return w.jsx(UO,{...i,...n,ref:t})});Uy.displayName=eP;var tP="DropdownMenuArrow",rP=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=$r(r);return w.jsx(FO,{...i,...n,ref:t})});rP.displayName=tP;var nP=e=>{const{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:i,defaultOpen:s}=e,o=$r(t),[a,c]=ka({prop:n,defaultProp:s??!1,onChange:i,caller:"DropdownMenuSub"});return w.jsx($O,{...o,open:a,onOpenChange:c,children:r})},iP="DropdownMenuSubTrigger",Fy=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=$r(r);return w.jsx(VO,{...i,...n,ref:t})});Fy.displayName=iP;var sP="DropdownMenuSubContent",$y=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=$r(r);return w.jsx(zO,{...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)"}})});$y.displayName=sP;var oP=Ay,aP=My,Vy=Iy,cP=Py,lP=Ry,uP=jy,dP=Ny,fP=ky,hP=Dy,pP=Ly,zy=By,mP=Uy,gP=nP,vP=Fy,bP=$y;const U0={size:{type:"enum",values:["1","2","3"],default:"1",responsive:!0},radius:m0,scrollbars:{type:"enum",values:["vertical","horizontal","both"],default:"both"}},F0=P.forwardRef((e,t)=>{const{rest:r,...n}=La(e),{className:i,style:s,type:o,scrollHideDelay:a=o!=="scroll"?0:void 0,dir:c,size:l=U0.size.default,radius:u=U0.radius.default,scrollbars:f=U0.scrollbars.default,...p}=r;return P.createElement(WI,{type:o,scrollHideDelay:a,className:or("rt-ScrollAreaRoot",i,Ba(n)),style:s},P.createElement(GI,{...p,ref:t,className:"rt-ScrollAreaViewport"}),P.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),f!=="vertical"?P.createElement(H2,{"data-radius":u,orientation:"horizontal",className:or("rt-ScrollAreaScrollbar",Qr(l,"rt-r-size"))},P.createElement(W2,{className:"rt-ScrollAreaThumb"})):null,f!=="horizontal"?P.createElement(H2,{"data-radius":u,orientation:"vertical",className:or("rt-ScrollAreaScrollbar",Qr(l,"rt-r-size"))},P.createElement(W2,{className:"rt-ScrollAreaThumb"})):null,f==="both"?P.createElement(KI,{className:"rt-ScrollAreaCorner"}):null)});F0.displayName="ScrollArea";const $0={size:{type:"enum",values:["1","2"],default:"2",responsive:!0},variant:{type:"enum",values:["solid","soft"],default:"solid"},color:Da,highContrast:$l},qy={color:Da,shortcut:{type:"string",default:void 0}},Hy=e=>P.createElement(oP,{...e});Hy.displayName="DropdownMenuRoot";const Wy=P.forwardRef((e,t)=>P.createElement(aP,{...e,ref:t,asChild:!0}));Wy.displayName="DropdownMenuTrigger";const Gy=P.createContext({}),Ky=P.forwardRef((e,t)=>{const r=yM(),{className:n,children:i,size:s=$0.size.default,variant:o=$0.variant.default,highContrast:a=$0.highContrast.default,color:c=qy.color.default,container:l,forceMount:u,...f}=e,p=c??r.accentColor;return P.createElement(Vy,{container:l,forceMount:u},P.createElement(Fl,{asChild:!0},P.createElement(cP,{"data-accent-color":p,align:"start",sideOffset:4,collisionPadding:10,...f,ref:t,className:or("rt-PopperContent","rt-BaseMenuContent","rt-DropdownMenuContent",n,Qr(s,"rt-r-size"),`rt-variant-${o}`,{"rt-high-contrast":a})},P.createElement(F0,{type:"auto"},P.createElement("div",{className:or("rt-BaseMenuViewport","rt-DropdownMenuViewport")},P.createElement(Gy.Provider,{value:P.useMemo(()=>({size:s,variant:o,color:p,highContrast:a}),[s,o,p,a])},i))))))});Ky.displayName="DropdownMenuContent";const Yy=P.forwardRef((e,t)=>P.createElement(uP,{...e,ref:t,className:or("rt-BaseMenuLabel","rt-DropdownMenuLabel",e.className)}));Yy.displayName="DropdownMenuLabel";const Jy=P.forwardRef((e,t)=>{const{className:r,children:n,color:i=qy.color.default,shortcut:s,...o}=e;return P.createElement(dP,{"data-accent-color":i,...o,ref:t,className:or("rt-reset","rt-BaseMenuItem","rt-DropdownMenuItem",r)},P.createElement(Cl,null,n),s&&P.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},s))});Jy.displayName="DropdownMenuItem";const Xy=P.forwardRef((e,t)=>P.createElement(lP,{...e,ref:t,className:or("rt-BaseMenuGroup","rt-DropdownMenuGroup",e.className)}));Xy.displayName="DropdownMenuGroup";const Zy=P.forwardRef((e,t)=>P.createElement(hP,{...e,ref:t,className:or("rt-BaseMenuRadioGroup","rt-DropdownMenuRadioGroup",e.className)}));Zy.displayName="DropdownMenuRadioGroup";const Qy=P.forwardRef((e,t)=>{const{children:r,className:n,...i}=e;return P.createElement(pP,{...i,ref:t,className:or("rt-BaseMenuItem","rt-BaseMenuRadioItem","rt-DropdownMenuItem","rt-DropdownMenuRadioItem",n)},P.createElement(Cl,null,r),P.createElement(zy,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},P.createElement(ql,{className:"rt-BaseMenuItemIndicatorIcon rt-DropdownMenuItemIndicatorIcon"})))});Qy.displayName="DropdownMenuRadioItem";const ew=P.forwardRef((e,t)=>{const{children:r,className:n,shortcut:i,...s}=e;return P.createElement(fP,{...s,ref:t,className:or("rt-BaseMenuItem","rt-BaseMenuCheckboxItem","rt-DropdownMenuItem","rt-DropdownMenuCheckboxItem",n)},P.createElement(Cl,null,r),P.createElement(zy,{className:"rt-BaseMenuItemIndicator rt-DropdownMenuItemIndicator"},P.createElement(ql,{className:"rt-BaseMenuItemIndicatorIcon rt-ContextMenuItemIndicatorIcon"})),i&&P.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},i))});ew.displayName="DropdownMenuCheckboxItem";const tw=e=>P.createElement(gP,{...e});tw.displayName="DropdownMenuSub";const rw=P.forwardRef((e,t)=>{const{className:r,children:n,...i}=e;return P.createElement(vP,{...i,ref:t,className:or("rt-BaseMenuItem","rt-BaseMenuSubTrigger","rt-DropdownMenuItem","rt-DropdownMenuSubTrigger",r)},P.createElement(Cl,null,n),P.createElement("div",{className:"rt-BaseMenuShortcut rt-DropdownMenuShortcut"},P.createElement(t2,{className:"rt-BaseMenuSubTriggerIcon rt-DropdownMenuSubtriggerIcon"})))});rw.displayName="DropdownMenuSubTrigger";const nw=P.forwardRef((e,t)=>{const{className:r,children:n,container:i,forceMount:s,...o}=e,{size:a,variant:c,color:l,highContrast:u}=P.useContext(Gy);return P.createElement(Vy,{container:i,forceMount:s},P.createElement(Fl,{asChild:!0},P.createElement(bP,{"data-accent-color":l,alignOffset:-Number(a)*4,sideOffset:1,collisionPadding:10,...o,ref:t,className:or("rt-PopperContent","rt-BaseMenuContent","rt-BaseMenuSubContent","rt-DropdownMenuContent","rt-DropdownMenuSubContent",r,Qr(a,"rt-r-size"),`rt-variant-${c}`,{"rt-high-contrast":u})},P.createElement(F0,{type:"auto"},P.createElement("div",{className:or("rt-BaseMenuViewport","rt-DropdownMenuViewport")},n)))))});nw.displayName="DropdownMenuSubContent";const iw=P.forwardRef((e,t)=>P.createElement(mP,{...e,ref:t,className:or("rt-BaseMenuSeparator","rt-DropdownMenuSeparator",e.className)}));iw.displayName="DropdownMenuSeparator";const $i=Object.assign({},{Root:Hy,Trigger:Wy,Content:Ky,Label:Yy,Item:Jy,Group:Xy,RadioGroup:Zy,RadioItem:Qy,CheckboxItem:ew,Sub:tw,SubTrigger:rw,SubContent:nw,Separator:iw}),Ga={size:{type:"enum",values:["1","2","3","4"],default:"2",responsive:!0},variant:{type:"enum",values:["classic","solid","soft","surface","outline","ghost"],default:"solid"},color:Da,highContrast:$l,radius:m0},sw=P.forwardRef((e,t)=>{const{rest:r,...n}=La(e),{className:i,asChild:s=!1,size:o=Ga.size.default,variant:a=Ga.variant.default,color:c=Ga.color.default,highContrast:l=Ga.highContrast.default,radius:u=Ga.radius.default,...f}=r,p=s?Gf:"button";return P.createElement(p,{"data-disabled":f.disabled||void 0,"data-accent-color":c,"data-radius":u,...f,ref:t,className:or("rt-reset","rt-BaseButton",i,Qr(o,"rt-r-size"),`rt-variant-${a}`,{"rt-high-contrast":l},Ba(n))})});sw.displayName="BaseButton";const ow=P.forwardRef((e,t)=>P.createElement(sw,{...e,ref:t,className:or("rt-Button",e.className)}));ow.displayName="Button";const yP={loading:{type:"boolean",default:!0}},Ys=P.forwardRef((e,t)=>{const{rest:r,...n}=La(e),{className:i,children:s,loading:o=yP.loading.default,...a}=r;if(!o)return P.createElement(P.Fragment,null,s);const c=P.isValidElement(s)?Gf:"span";return P.createElement(c,{ref:t,"aria-hidden":!0,className:or("rt-Skeleton",i,Ba(n)),"data-inline-skeleton":P.isValidElement(s)?void 0:!0,tabIndex:-1,inert:"",...a},s)});Ys.displayName="Skeleton";const pF="";function V0(e){const{text:t,onClick:r,className:n,btnIsDisabled:i=!1}=e,s=()=>{r&&r()};return w.jsx(ow,{disabled:i,className:n?`cs-button ${n}`:"cs-button",onClick:s,children:t})}function Js({content:e,children:t,position:r="top",marginTop:n="0px",borderRadius:i="8px",delay:s=0,backgroundColor:o="var(--cs-bg-primary)"}){const[a,c]=le.useState(!1),[l,u]=le.useState(!1),f=le.useRef(null),p=()=>{f.current&&(clearTimeout(f.current),f.current=null),c(!0)};le.useEffect(()=>()=>{a||f.current&&(clearTimeout(f.current),f.current=null)},[a]);const y=()=>{f.current=setTimeout(()=>{l||(c(!1),f.current&&(clearTimeout(f.current),f.current=null))},0)},x=()=>{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{}}},v=le.useRef(null),[_,T]=le.useState({left:void 0,top:void 0});return le.useEffect(()=>{var O;if(a&&v.current){const R=(O=v.current)==null?void 0:O.getBoundingClientRect();let F,B;r==="top"?(F=`${window.scrollX+R.left+R.width/2}px`,B=`${window.scrollY+R.top-2*R.height-8}px`):r==="bottom"?(F=`${window.scrollX+R.left+R.width/2}px`,B=`${window.scrollY+R.bottom}px`):r==="left"?(F=`${window.scrollX+R.left-8}px`,B=`${window.scrollY+R.top+R.height/2}px`):r==="right"?(F=`${window.scrollX+R.right+8}px`,B=`${window.scrollY+R.top+R.height/2}px`):(F=`${window.scrollX+R.left+R.width/2}px`,B=`${window.scrollY+R.top+R.height/2}px`),T({left:F,top:B})}},[a]),w.jsxs("div",{ref:v,style:{position:"relative",display:"inline-block"},onMouseEnter:p,onMouseLeave:y,children:[t,a&&zn.createPortal(w.jsx("div",{style:{transition:"opacity 0.3s ease",opacity:a?1:0,position:"absolute",zIndex:9e3,padding:"8px 12px",backgroundColor:o,color:"var(--cs-text-secondary)",borderRadius:i,fontSize:"12px",whiteSpace:"nowrap",border:"1px solid",borderColor:"var(--cs-border)",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.1)",...x(),..._,marginTop:n},onMouseEnter:()=>u(!0),onMouseLeave:()=>{f.current&&(clearTimeout(f.current),f.current=null),u(!1),c(!1)},children:e}),document.body)]})}const mF="",z0=[{label:"Default"},{label:"Fast Mode",beforeIcon:{xlinkHref:"#icon-icon_flash",fontSize:"16px",activeColor:"var(--cs-primary)",activeHoverColor:"var(--cs-primary)"}}],wP=e=>{const{transactionMode:t,setTransactionMode:r,maxCapForGas:n,setMaxCapForGas:i,customGasPrice:s,setCustomGasPrice:o,suiBalance:a,themeType:c}=e,l=c=="Light"?Ct("/images/icon_shio_light@2x.png"):Ct("/images/icon_shio@2x.png"),u=le.useMemo(()=>{var O;return(O=z0.filter(R=>(R==null?void 0:R.label)===t))==null?void 0:O[0]},[t,z0]),f=O=>{const R=new RegExp("[^\\d-]*(\\d*(?:\\.\\d{0,9})?).*$");O.target.value=O.target.value.replace(R,"$1"),i(O.target.value)},p=O=>{const R=new RegExp("[^\\d-]*(\\d*(?:\\.\\d{0,9})?).*$");O.target.value=O.target.value.replace(R,"$1");const F=Be(O.target.value).gt(0)?Be(O.target.value).div(Math.pow(10,9)).toString():"0";Be(F).gt(n)&&i(F),o(O.target.value)},y=le.useMemo(()=>!n||Number(n)==0?"Please enter a value higher than 0":n&&Number(n)>5?"Only allow up to 5 SUI":Be(n).gt(a)?"Insufficient SUI balance ":Be(n).lt(Be(s).div(Math.pow(10,9)))?"Max cap cannot be less than custom gas.":"",[n]),x=le.useMemo(()=>n&&Number(n)>0&&Number(n)<2e-6?"Your current maximum fee is below the market rate. Please raise it to ensure your transactions are processed.":"",[n]),v=le.useMemo(()=>!s||Number(s)==0?"Please enter a value higher than 0":"",[s]),_=le.useMemo(()=>s&&Number(s)>0&&Be(s).lt(750)?"Your current maximum fee is below the market rate. Please raise it to ensure your transactions are processed.":"",[s]),T=le.useMemo(()=>!s||s==="0"?"0":Be(s).div(Math.pow(10,9)).toString(),[s]);return w.jsxs("div",{className:"transaction-mode-container",children:[w.jsxs("div",{className:"transaction-mode-header",children:[w.jsxs("div",{className:"transaction-mode-label",children:[w.jsx("svg",{children:w.jsx("use",{xlinkHref:"#icon-icon_mode"})}),w.jsx("span",{className:"caption-text",children:"Transaction Mode"})]}),w.jsx("div",{className:"slippage-tab-list",children:z0.map(O=>w.jsxs("div",{className:O.label===u.label?"active slippage-tab":"slippage-tab",children:[O.label!=="Default"&&w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_flash"})}),w.jsx("span",{onClick:()=>{r(O.label)},children:O.label})]},O.label))})]}),w.jsx("p",{className:"transaction-description",children:t==="Default"?"Standard gas based on real-time network conditions":"Land your transaction earlier and avoid congestion with a higher gas price. MEV protection is on by default in Fast Mode."}),t==="Fast Mode"&&w.jsxs("div",{className:"fast-mode-section",children:[w.jsxs("div",{className:"input-card",children:[w.jsxs("div",{className:"input-label",children:[w.jsx("span",{children:"Custom Gas Price"}),w.jsx(Js,{position:"bottom",content:w.jsx("div",{className:"tooltip-content",children:"The total gas depends on the gas price and actual gas units consumed."}),children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-tips"})})})]}),w.jsxs("div",{className:"input-right",children:[w.jsxs("div",{className:"input-field",children:[w.jsx("input",{value:s,onChange:p,placeholder:"0.0"}),w.jsx("span",{className:"caption-text",children:"MIST"})]}),w.jsxs("div",{className:"unit-text",children:[w.jsx("span",{children:T}),"SUI"]})]})]}),v&&w.jsx(cu,{text:v,type:"error"}),_&&w.jsx(cu,{text:_,type:"warn"}),w.jsxs("div",{className:"input-card",children:[w.jsxs("div",{className:"input-label",children:[w.jsx("span",{children:"Set Max Cap for Gas"}),w.jsx(Js,{position:"bottom",content:w.jsx("div",{className:"tooltip-content",children:"Set a max cap for your gas to prevent overpaying"}),children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-tips"})})})]}),w.jsx("div",{className:"input-right",children:w.jsxs("div",{className:"input-field",children:[w.jsx("input",{value:n,onChange:f,placeholder:"0.0"}),w.jsx("span",{className:"caption-text",children:"SUI"})]})})]}),y&&w.jsx(cu,{text:y,type:"error"}),x&&w.jsx(cu,{text:x,type:"warn"}),w.jsxs("div",{className:"powered-by",children:[w.jsx("span",{children:"Powered by"}),w.jsx("img",{src:l,alt:"shio"})]})]})]})},cu=e=>{const{text:t,type:r}=e;return w.jsx("div",{style:{width:"100%",padding:"4px 16px",borderRadius:"8px",background:r==="warn"?"var(--cs-warning-10)":"var(--cs-error-10)",display:"flex",alignItems:"center",justifyContent:"center"},children:w.jsx("span",{style:{color:r==="warn"?"var(--cs-warning)":"var(--cs-error)",fontSize:"12px",lineHeight:"16px"},children:t})})},xP={id:"0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3",coin_type:"0x2::sui::SUI",decimals:9,description:"",name:"Sui",symbol:"SUI",logo_url:"https://archive.cetus.zone/assets/image/sui/sui.png",is_verified:!0,extensions:{rank:"880"}};function SP({themeType:e}){const{setIsOpenSlippageDialog:t,isOpenSlippageDialog:r,slippage:n}=Vr();return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"slippage-button",onClick:()=>t(!0),children:[w.jsxs("span",{children:[n,"%"]}),w.jsx("div",{className:"svg-box",children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-verticalslider"})})})]}),r&&w.jsx(_P,{themeType:e,onClose:()=>t(!1)})]})}function _P({onClose:e,themeType:t}){const{transactionMode:r,maxCapForGas:n,customGasPrice:i,setMaxCapForGas:s,setCustomGasPrice:o,setTransctionMode:a,mevProtect:c,setMevProtect:l}=Vr(),{balanceInfo:u}=Ia(xP),[f,p]=le.useState(r),[y,x]=le.useState(n),[v,_]=le.useState(i),[T,O]=le.useState(c),{slippage:R,setSlippage:F}=Vr(),[B,H]=le.useState(R),$=de=>{H(de.display)},Z=de=>{const q=new RegExp("[^\\d-]*(\\d*(?:\\.\\d{0,2})?).*$");de.target.value=de.target.value.replace(q,"$1"),H(de.target.value)},ce=()=>{B&&F(B),f==="Fast Mode"&&(s(y),o(v)),a(f),l(T),e()};le.useEffect(()=>{f==="Fast Mode"&&O(!0)},[f]);const ne=le.useMemo(()=>f==="Fast Mode"&&(!y||Number(y)===0||Number(y)>5||!v||Number(v)===0||Be(y).gt((u==null?void 0:u.totalBalanceFormat)||"0")||Be(y).lt(Be(v).div(Math.pow(10,9))))||!+B?!0:Number(B)>50||Number(B)<.01,[B,f,y,v,u]);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:"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:KC.map(de=>w.jsxs("span",{className:de.display===B?"active":"",onClick:()=>$(de),children:[de.display," %"]},de.display))}),w.jsxs("div",{className:"input-box",children:[w.jsx("span",{children:"Custom"}),w.jsx("input",{className:"cs-input",placeholder:"0.0",value:B,onChange:Z}),w.jsx("div",{style:{fontSize:"14px",color:"var(--cs-text-primary)"},children:"%"})]})]}),Number(B)<=.05&&w.jsx("div",{className:"tips warning",children:"Slippage is low. Your transaction may fail."}),Number(B)<=50&&Number(B)>1&&w.jsx("div",{className:"tips warning",children:"Your transaction may frontrun"}),Number(B)>50&&w.jsx("div",{className:"tips error",children:" Enter a valid slippage percentage"}),w.jsx(wP,{transactionMode:f,setTransactionMode:p,maxCapForGas:y,setMaxCapForGas:x,customGasPrice:v,setCustomGasPrice:_,suiBalance:(u==null?void 0:u.totalBalanceFormat)||"0",themeType:t}),w.jsx(EP,{mevProtect:T,setMevProtect:O,disabled:f==="Fast Mode"}),w.jsx(V0,{text:"Save",btnIsDisabled:ne,className:"slippage-save-btn",onClick:ce})]})})]})}const EP=e=>{const{mevProtect:t,disabled:r,setMevProtect:n}=e;return w.jsxs("div",{className:"mev-settings-box",children:[w.jsx("div",{className:"mev-setting-title",children:w.jsxs("div",{className:"name",children:[w.jsx("svg",{"aria-hidden":"true",cursor:"pointer",fill:"var(--cs-icon-fill)",children:w.jsx("use",{xlinkHref:"#icon-icon_mev"})}),w.jsx("span",{children:"MEV Protect"})]})}),w.jsxs("div",{className:"mev-setting-Switch",children:[w.jsxs("div",{className:"label",children:[w.jsx("span",{children:"Enable MEV Protection"}),w.jsx(Js,{position:"bottom",marginTop:"-118px",content:w.jsx("div",{className:"mev-tips",style:{width:"310px",whiteSpace:"wrap",color:"var(--cs-text-primary)"},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."}),children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{cursor:"pointer"},children:w.jsx("use",{xlinkHref:"#icon-tips"})})})]}),w.jsx(Z2,{checked:t,disabled:r,className:"cs-switch",onClick:()=>{n(!t)}})]})]})};function CP({handleRefresh:e,themeType:t}){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(SP,{themeType:t}),w.jsx(uA,{onClick:e})]})]})})}const gF="",vF="";function AP(){const[e,t]=le.useState(!1);return w.jsxs($i.Root,{open:e,onOpenChange:t,children:[w.jsx($i.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($i.Content,{variant:"soft",className:"cs-dropdown-content",style:{backgroundColor:"var(--cs-primary-10)"},side:"bottom",align:"end",children:w.jsxs("div",{className:"cs-settings-box",children:[w.jsx("h3",{children:"Settings"}),w.jsx(TP,{}),w.jsx(IP,{onClose:()=>{t(!1)}})]})})]})}function TP(){const{currentExplorer:e,setCurrentExplorer:t,currentRpc:r,setCurrentRpc:n}=Vr(),i=s=>{t(s)};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:xl.map(s=>w.jsxs("div",{className:"group-item",style:{justifyContent:"center"},onClick:()=>i(s.link),children:[w.jsx(Hl,{color:"indigo",checked:s.link===e,variant:"soft",className:"cs-checkbox cs-allow-change-checkbox"}),w.jsx("img",{src:s.img}),w.jsx("span",{children:s.name})]},s.link))})]})}const MP=e=>!/^(http|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/.test(e);function IP({onClose:e}){const{addTxToast:t}=Io(),{currentRpc:r,setCurrentRpc:n,customRpc:i,setCustomRpc:s,rpcList:o}=Vr(),[a,c]=le.useState(i),[l,u]=le.useState(r),f=v=>{t({id:0,status:"success",buildShowInfo:()=>({toastTitleText:"RPC update",toastDescriptionContent:`RPC is currently set to ${v}`})})},p=v=>{u(v),v.isCustom||(n(v),f(v.link),e())},y=v=>{c(v.target.value)},x=()=>{if(a){const v={name:"Custom RPC URL",link:a,isCustom:!0};s(a),n(v),f(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 rpc-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-rpc"})}),w.jsx("span",{children:"RPC Node"})]}),w.jsxs("div",{className:"rpc-checkbox-group",children:[o.map(v=>w.jsxs("div",{className:"rpc-item",onClick:()=>p(v),children:[w.jsx(Hl,{color:"indigo",checked:l.name===v.name,variant:"soft",className:"cs-checkbox cs-allow-change-checkbox"}),w.jsx("span",{children:v.name})]},v.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(V0,{btnIsDisabled:MP(a),text:"Save",onClick:x})]})]})]})}const bF="";function aw(){const{suiClient:e}=hs(),{setAccountServiceNameObj:t,accountServiceNameObj:r}=zr(),n=async s=>{if(!((s==null?void 0:s.length)<1))try{const o=s.map(async l=>{var f;const u=await e.resolveNameServiceNames({address:l});return{address:l,name:((f=u==null?void 0:u.data)==null?void 0:f[0])||""}}),a=await Promise.all(o),c=Object.fromEntries(a==null?void 0:a.map(l=>[l.address,l.name]));t(c)}catch{}};return{fetchServiceNames:n,getServiceNames:async s=>{const o=[];s==null||s.forEach(a=>{const c=a==null?void 0:a.address;r!=null&&r[c]||o.push(c)}),(o==null?void 0:o.length)>0&&n(o)}}}var OP=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()}},PP=OP,cw={"text/plain":"Text","text/html":"Url",default:"Text"},RP="Copy to clipboard: #{key}, Enter";function jP(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function NP(e,t){var r,n,i,s,o,a,c=!1;t||(t={}),r=t.debug||!1;try{i=PP(),s=document.createRange(),o=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 f=cw[t.format]||cw.default;window.clipboardData.setData(f,e)}else u.clipboardData.clearData(),u.clipboardData.setData(t.format,e);t.onCopy&&(u.preventDefault(),t.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);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(f){r&&console.error("unable to copy using clipboardData: ",f),r&&console.error("falling back to prompt"),n=jP("message"in t?t.message:RP),window.prompt(n,e)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),i()}return c}var kP=NP;const lw=io(kP);function DP({currentAccount:e}){const{mutate:t}=Wr.useSwitchAccount(),r=Wr.useAccounts(),{isOpenAccountList:n,setIsOpenAccountList:i,accountServiceNameObj:s}=zr(),{getServiceNames:o}=aw(),a=le.useCallback(()=>{n||o(r),i(!n)},[n,r]);le.useEffect(()=>()=>{i(!1)},[]);const c=le.useMemo(()=>r.filter(u=>u.address!==e),[r,e]);le.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&&(s==null?void 0:s[e])||zs(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=>{var f,p,y,x;return w.jsxs("div",{className:"account-item",children:[w.jsxs("div",{className:"left",children:[w.jsxs("div",{className:"label",children:[((f=u==null?void 0:u.label)==null?void 0:f.length)>16?((p=u==null?void 0:u.label)==null?void 0:p.substring(0,6))+"..."+((x=u==null?void 0:u.label)==null?void 0:x.substring(((y=u==null?void 0:u.label)==null?void 0:y.length)-10)):u==null?void 0:u.label," "]}),w.jsx("div",{className:"address",children:(s==null?void 0:s[u==null?void 0:u.address])||zs(u==null?void 0:u.address)})]}),w.jsx("button",{className:"cs-outline-btn",onClick:()=>l(u),children:"Switch"})]},u==null?void 0:u.address)})})]})}const LP=le.forwardRef(({connect:e,isSimulate:t=!1})=>{const r=Wr.useCurrentAccount();return w.jsx("div",{children:r?w.jsx(BP,{isSimulate:t}):w.jsx(V0,{text:"Connect",className:"cs-connect-button",onClick:()=>e(!0)})})});function BP({isSimulate:e}){const{mutate:t}=Wr.useDisconnectWallet(),r=Wr.useCurrentAccount(),{currentWallet:n}=Wr.useCurrentWallet(),{addCommonToast:i}=Io(),{getExplorerUrl:s}=To(),{accountServiceNameObj:o}=zr(),a=()=>{r&&(lw(r.address||"",{debug:!1,message:"message"}),i("Copied"))},c=()=>{r&&window.open(s(r.address,"account"),"_blank")};return le.useEffect(()=>{},[n]),w.jsxs($i.Root,{children:[w.jsx($i.Trigger,{children:w.jsxs("div",{className:"cs-connected-button",children:[w.jsx("img",{src:n==null?void 0:n.icon,style:{width:"20px",height:"20px"}}),w.jsx("span",{style:{color:e?"#fff":"var(--cs-text-primary)"},children:(r==null?void 0:r.address)&&(o==null?void 0:o[r==null?void 0:r.address])||zs(r==null?void 0:r.address)})]})}),w.jsx($i.Content,{variant:"soft",className:"cs-dropdown-content",style:{backgroundColor:"var(--cs-primary-10)"},side:"bottom",align:"end",children:w.jsxs("div",{className:"account-op-box",children:[w.jsx("span",{style:{fontSize:"14px",color:"var(--cs-text-secondary)",marginBottom:"6px"},children:r==null?void 0:r.label}),w.jsx(DP,{currentAccount:r==null?void 0:r.address}),w.jsxs("div",{className:"account-op-item",onClick:a,style:{marginTop:"12px"},children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_copy"})}),w.jsx("span",{children:"Copy address"})]}),w.jsxs("div",{className:"account-op-item",onClick:c,children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_link"})}),w.jsx("span",{children:"Open explorer"})]}),w.jsxs("div",{className:"account-op-item",onClick:()=>t(),children:[w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_disconnect"})}),w.jsx("span",{children:"Disconnect"})]})]})})]})}function UP({isSimulate:e=!1}){const{fetchServiceNames:t}=aw(),r=Wr.useCurrentAccount();Wr.useCurrentWallet();const{isOpenWalletModal:n,onWalletModal:i,saveCurrentAccount:s}=zr();return Wr.useWallets(),le.useEffect(()=>{r!=null&&r.address&&t([r==null?void 0:r.address])},[r==null?void 0:r.address]),w.jsx(w.Fragment,{children:w.jsx(Wr.ConnectModal,{trigger:w.jsx(LP,{connect:i,isSimulate:e}),open:n,onOpenChange:o=>i(o)})})}function FP({independentWallet:e,customWallet:t,logo:r}){return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"widget-header",children:[w.jsx("img",{src:r,className:"cetus-logo"}),w.jsxs("div",{className:"right",children:[e&&w.jsx(UP,{}),w.jsx(AP,{})]})]}),w.jsx("div",{style:{marginTop:"12px"}})]})}const yF="",uw=()=>{const e=le.useRef(null);le.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:"var(--cs-primary)",boxShadow:"0px 0px 20px 2px var(--cs-primary)",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 $P({onClose:e,transactionData:t}){const{status:r,buildShowInfo:n,tx:i}=t,s=le.useMemo(()=>{if(n&&r)return n(r)},[r]);return w.jsxs("div",{className:"ts-status-dialog",children:[(r==="confirmation"||r==="submitted")&&w.jsx(VP,{info:s,status:r}),(r==="success"||r==="rejected")&&w.jsx(zP,{info:s,status:r,tx:i,onClose:e})]})}function VP({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(uw,{})}),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 zP({info:e,status:t,tx:r,onClose:n}){const{getExplorerUrl:i}=To();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"}),xl.map(s=>w.jsx("a",{href:i(r,"tx",s.link),target:"_blank",children:w.jsx("img",{src:s.img})},s.link))]})]}),w.jsx("button",{className:"cs-solid-btn swap-more-btn",onClick:n,children:t==="success"?"Swap More":"Retry"})]})}function qP(){const{fetchByApi:e}=Sl(),{setProviders:t}=Vr();return{fetchRouterConfig:async()=>{try{const n=await e("/router_v2/status","GET"),{providers:i}=n;i&&t(i)}catch{}}}}function HP({interval:e,callback:t}){const r=le.useRef(),n=le.useRef(null);le.useEffect(()=>{r.current=t},[t]);const i=le.useCallback(()=>{n.current&&clearInterval(n.current),e>0&&(n.current=setInterval(()=>{r.current&&r.current(Date.now())},e))},[e]),s=le.useCallback(()=>{n.current&&(clearInterval(n.current),n.current=null)},[]);return le.useEffect(()=>(i(),()=>s()),[]),{startTimer:i,stopTimer:s}}const dw=ki((e,t)=>({coinPriceObj:{},setPriceObj:r=>{const n=t().coinPriceObj;e({coinPriceObj:{...n,...r}})},clearPriceObj:r=>{const n=t().coinPriceObj;r.forEach(i=>{delete n[dr(i).full_address]}),e({coinPriceObj:{...n}})}}));function WP(e,t){const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function Ka(){const{fetchByApi:e}=Sl(),{coinPriceObj:t,setPriceObj:r,clearPriceObj:n}=dw(),i=async a=>{const l=WP(a,10);try{const f=(await Promise.all(l.map(p=>e("/v3/sui/market_price","GET",{base_symbol_address:p.map(y=>Ri(y,!1))})))).map(p=>p.prices).flat();if(f){const p={};f.forEach(y=>{p[dr(y.base_symbol).full_address]=y}),r(p)}return f}catch{return n(a),null}},s=le.useCallback(a=>{if(!a)return;const c=t[dr(a).full_address];if(c)return c},[t]),o=le.useCallback((a,c,l)=>{const u=Number(c)==0||!l?"0":l;if(c&&a&&+c){const f=s(a);if(f)return Be(c).mul(f.price).toString()}return u},[t]);return{fetchTokenPrices:i,getTokenPrice:s,getTokenAmountValue:o}}function GP(){const{tokenBalanceObj:e}=zr(),{fetchTokenPrices:t}=Ka(),{isOpenTokensDialog:r}=Zr(),n=le.useCallback(()=>{if(qC(e)){const i=Object.keys(e);t(i)}},[e]);return le.useEffect(()=>{r&&n()},[r]),{getMyAssetsPrice:n}}const KP={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"}},fw={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"}},hw=KP;function YP(e,t){const{fetchTokenInfo:r}=ps(),{setFromCoin:n,setToCoin:i,setDefaultCoin:s,fromCoin:o,toCoin:a}=Zr(),{setSlippage:c,setRpcList:l,setCurrentRpc:u}=Vr(),{tokenMapIsInit:f}=Mo(),p=le.useRef({}),y=async(v,_)=>{if(!_&&!v&&(o||a))return;const T=v?await r(v):fw,O=_?await r(_):hw;n(T),i(O),s(T==null?void 0:T.coin_type,O==null?void 0:O.coin_type)},x=(v=[],_)=>{let T=[],O=Aa[0],R=Aa[0];v.forEach(F=>{const B={name:F,link:F,isCustom:!1};T.push(B),F===_&&(R=B)}),_&&v.includes(_)?T=[R,O,...T.filter(F=>F.link!==_)]:T.unshift(Aa[0]),l([...T,{name:"Custom RPC URL",link:"",isCustom:!0}]),u(R)};return le.useEffect(()=>{if(f&&!Vf(e,p.current)){const{defaultFromToken:v,defaultToToken:_,defaultSlippage:T,customRpcList:O,defaultRpc:R}=e;y(v,_),T&&c(T),x(O||[],R),p.current=e}},[e,f]),{handleSetDefaultPair:y}}function JP(e){const{currentRpc:t}=Vr(),{setSuiClient:r,setAggregatorSDK:n}=hs(),{currentAccount:i}=zr();le.useEffect(()=>{if(t){const o=new Ns({url:t.link});r(o)}},[t]);const s=()=>{const o={endpoint:Ao.aggregatorUrl,signer:(i==null?void 0:i.address)||"",client:new Ns({url:t.link}),env:kf.Mainnet,overlayFeeRate:(e==null?void 0:e.overlayFeeRate)||void 0,overlayFeeReceiver:(e==null?void 0:e.overlayFeeReceiver)||void 0},a=new lv(o);n(a)};le.useEffect(()=>{t&&s()},[t.link,i==null?void 0:i.address]),le.useEffect(()=>{e!=null&&e.overlayFeeRate&&(e!=null&&e.overlayFeeReceiver)&&s()},[e==null?void 0:e.overlayFeeRate,e==null?void 0:e.overlayFeeReceiver])}const q0=ki((e,t)=>({transactionData:void 0,setTransactionData:r=>{e(()=>({transactionData:r}))}})),jr=[];for(let e=0;e<256;++e)jr.push((e+256).toString(16).slice(1));function XP(e,t=0){return(jr[e[t+0]]+jr[e[t+1]]+jr[e[t+2]]+jr[e[t+3]]+"-"+jr[e[t+4]]+jr[e[t+5]]+"-"+jr[e[t+6]]+jr[e[t+7]]+"-"+jr[e[t+8]]+jr[e[t+9]]+"-"+jr[e[t+10]]+jr[e[t+11]]+jr[e[t+12]]+jr[e[t+13]]+jr[e[t+14]]+jr[e[t+15]]).toLowerCase()}let H0;const ZP=new Uint8Array(16);function QP(){if(!H0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");H0=crypto.getRandomValues.bind(crypto)}return H0(ZP)}const pw={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function mw(e,t,r){var i;if(pw.randomUUID&&!t&&!e)return pw.randomUUID();e=e||{};const n=e.random??((i=e.rng)==null?void 0:i.call(e))??QP();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 s=0;s<16;++s)t[r+s]=n[s];return t}return XP(n)}var Xs=(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))(Xs||{});const eR=new Ns({url:Vh("mainnet")}),tR=["0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC","0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD","0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD","0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb::usdy::USDY","0x294de7579d55c110a00a7c4946e09a1b5cbeca2592fbb83fd7bfacba3cfeaf0e::drf::DRF"],rR=["deny_list","DenyList","DenyCap","create_regulated_currency"],nR={showType:!0,showContent:!0,showOwner:!1,showPreviousTransaction:!1,showStorageRebate:!1,showDisplay:!1},iR=async e=>{let t=!1;if(tR.includes(e))return t;const r=e.split("::"),n=r[0]&&Dt(r[0]),i=r[1],s=await eR.getObject({id:n,options:nR}),o="disassembled"in s.data.content?s.data.content.disassembled[i]:null;return o&&typeof o=="string"&&new RegExp(rR.join("|"),"i").test(o)&&(t=!0),t},sR=e=>{var n;if(!e)return"";const t=e==null?void 0:e.split(",");return(n=t==null?void 0:t.map(i=>Ri(i,!1)))==null?void 0:n.join(",")};function oR(){const{fetchByApi:e}=Sl(),t=async s=>{try{const o={...s},a=sR(s==null?void 0:s.coin_type);a&&(o.coin_type=a);const c=await e("/v2/sui/stats_pools","GET",o);if(c!=null&&c.lp_list)return{list:(c==null?void 0:c.lp_list)||[],total:c==null?void 0:c.total}}catch(o){return console.error("getPoolList ~ Error:",o),await r(s)}return{list:[],total:0}},r=async s=>{var o,a,c,l;try{const u=Ct("/data/pools.json"),f=await fetch(u).then(p=>p.json());if((o=f==null?void 0:f.data)!=null&&o.lp_list){const p=(a=f==null?void 0:f.data)==null?void 0:a.lp_list;let y=p;if(s!=null&&s.coin_type){const v=(l=(c=s==null?void 0:s.coin_type)==null?void 0:c.split(","))==null?void 0:l.map(_=>cn(_).source_address);y=p==null?void 0:p.filter(_=>{var R,F;const T=cn((R=_==null?void 0:_.coin_a)==null?void 0:R.address).source_address,O=cn((F=_==null?void 0:_.coin_b)==null?void 0:F.address).source_address;return(v==null?void 0:v.length)>1&&v.includes(T)&&v.includes(O)?!0:!!((v==null?void 0:v.length)===1&&(v.includes(T)||v.includes(O)))})}s!=null&&s.is_vaults&&(y=p==null?void 0:p.filter(v=>v==null?void 0:v.is_vaults)),s!=null&&s.has_farming&&!(s!=null&&s.is_vaults)&&!(s!=null&&s.has_mining)&&!(s!=null&&s.no_incentives)&&(y=p==null?void 0:p.filter(v=>v==null?void 0:v.has_farming));const x=y;return{list:x,total:(x==null?void 0:x.length)||0}}}catch(u){console.error("getLocalJsonPoolList Error:",u)}return{list:[],total:0}},n=s=>Lv(s)==="0x2::sui::SUI"?"0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI":Lv(s);return{getPoolList:t,getLocalJsonPoolList:r,getLocalJsonPoolAddress:async(s,o)=>{try{const a=n(s),c=n(o),l=await fetch("/data/all-pools.json").then(u=>u.json());if(l)return l[`${a.toLocaleLowerCase()}-${c.toLocaleLowerCase()}`]||l[`${c.toLocaleLowerCase()}-${a.toLocaleLowerCase()}`]}catch(a){console.error("getLocalJsonPoolAddress Error:",a)}return[]}}}function aR(e=!0){const{poolApiMap:t,setPoolApiMap:r}=Vr(),{getPoolList:n,getLocalJsonPoolList:i,getLocalJsonPoolAddress:s}=oR();return{getPoolListByCoinType:async(c,l)=>{if(c&&l){const u=[c,l].sort(),f=`${u[0]}_${u[1]}`,p=t[f];if(p)return p;const y={coin_type:`${c},${l}`,display_all_pools:!0,offset:0,limit:100,order_by:"-tvl",no_incentives:!0,has_farming:!0,has_mining:!0};let x=e?await i(y):void 0;(x===void 0||x.list.length===0)&&(x=await n(y));const v=x.list;if(v.length>0)return t[f]=v,r(f,v),v}return[]},getPoolAddressByCoinType:async(c,l)=>{if(c&&l){const u=[c,l].sort(),f=`${u[0]}_${u[1]}`;if(e){const x=await s(c,l);if(!x||x.length===0){const v=t[f];if(v)return v.map(_=>_.poolAddress)}else return x}const p={coin_type:`${c},${l}`,display_all_pools:!0,offset:0,limit:100,order_by:"-tvl",no_incentives:!0,has_farming:!0,has_mining:!0},y=await n(p);if(y){const x=y.list;if(x.length>0)return t[f]=x,r(f,x),x.map(v=>v.poolAddress)}}return[]}}}function cR(e){const{routerData:t}=Zr();return{priceAcceptRouterData:le.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 gw(e,t){return{amountLimit:le.useMemo(()=>{if(t&&t.routerData){const{byAmountIn:n,fromAmountUi:i,toAmountUi:s}=t;return n?Be(s).mul(Be(1).sub(Be(e).div(100))).toString():Be(i).mul(Be(1).add(Be(e).div(100))).toString()}},[e,t])}}function lR(e){const{getTokenInfo:t,fetchTokenInfo:r}=ps();return{formatSwapRouter:le.useMemo(()=>{if(e&&e.routerData){const i=[],s=e.byAmountIn?e.routerData.amountIn.toString():e.routerData.amountOut.toString(),o=[],a=[];let c=Be(0);if(e.routerData.routes.forEach((u,f)=>{const p={},y=e.byAmountIn?u.amountIn.toString():u.amountOut.toString();f===e.routerData.routes.length-1?p.percentage=Be(1).sub(c).toFixed(2):p.percentage=Be(y).div(s).toFixed(2),c=Be(c).add(p.percentage);const x=[];u.path.forEach(v=>{i.includes(v.provider)||i.push(v.provider);const _=dr(v.from).full_address,T=dr(v.target).full_address,O=t(_),R=t(T);O||a.includes(_)&&a.push(_),R||a.includes(T)&&a.push(T);const F=v.provider===Ta.SCALLOP||v.provider===Ta.FLOWX||v.provider===Ta.FLOWXV3;x.push({from_type:_,to_type:T,pool_address:F?"":v.id,fee_rate:v.feeRate,provider:v.provider})}),p.paths=x,o.push(p)}),a.length>0)for(const u in a)r(u);return{router_summery:`${e.routerData.routes.length} Streams`,providers:i,routers:o}}},[e])}}function uR(){const{fromCoin:e,toCoin:t}=Zr(),{getPoolAddressByCoinType:r}=aR(!0);return{getSwapPoolAddress:async()=>e&&t?await r(e.coin_type,t.coin_type):[]}}function vw(e,t,r){return le.useMemo(()=>t&&r&&+t&&+r?e?Be(r).div(t).toString():Be(t).div(r).toString():"0",[t,r,e])}function bw(e){const[t,r]=le.useState(),n=async i=>{if(i.is_trusted)return!1;try{return await iR(i.coin_type)}catch{}return!1};return le.useEffect(()=>{r(void 0),e&&n(e).then(i=>{r(i)})},[e==null?void 0:e.coin_type]),{isScamsCoin:t}}function dR(e,t){const{defaultFromCoinType:r,defaultToCoinCoinType:n}=Zr(),{getTokenInfo:i}=ps(),{ignoreWarnTokenMap:s}=Vr(),o=i(e),a=i(t),c=le.useMemo(()=>!yl(r,fw.coin_type)||!yl(n,hw.coin_type),[r,n]),l=le.useCallback(f=>f&&!s[Ri(f.coin_type)]&&(yl(r,f.coin_type)||yl(n,f.coin_type))?!f.is_trusted:!1,[r,n,s]),u=le.useMemo(()=>{const f=[];return c&&(o&&l(o)&&f.push({...o}),a&&l(a)&&f.push({...a})),f},[o==null?void 0:o.coin_type,a==null?void 0:a.coin_type,c,s]);return{isCustomMode:c,customWarnTokenList:u}}function fR(){const{aggregatorSDK:e}=hs(),{getSwapPoolAddress:t}=uR(),r=s=>s&&s.error?s.error.code===Xs.InsufficientLiquidity||Xs.HoneyPot||Xs.NumberTooLarge:!1,n=async s=>{const{fromToken:o,toToken:a,amount:c,providersKeys:l,by_amount_in:u,uuid:f}=s;try{const p={from:o.coin_type,target:a.coin_type,amount:new Cm(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,f,o,a,y);if(!y||y.routes.length===0)throw Error("not find router");return i(!1,u,f,o,a,y)}catch{const y=await t(),x={from:o.coin_type,target:a.coin_type,amount:new Cm(c),byAmountIn:u,pools:y};try{const v=await e.swapInPools(x);return!v||!v.routeData?i(!0,u,f,o,a):i(!0,u,f,o,a,v.routeData)}catch{return{uuid:f,byAmountIn:u,isDegrade:!0}}}},i=(s,o,a,c,l,u)=>{var f;if(u){const p=u.error!==void 0,y=$f(u.amountIn.toString(),c.decimals).toString(),x=$f(u.amountOut.toString(),l.decimals).toString();return{routerData:p?void 0:u,fromAmountUi:p?o?y:"":y,toAmountUi:p&&o?"":x,uuid:a,byAmountIn:o,isDegrade:s,errorCode:(f=u.error)==null?void 0:f.code}}else return{uuid:a,byAmountIn:o,isDegrade:s}};return{findBestRouters:n}}function $o(e){const t=le.useRef(e);return le.useEffect(()=>{t.current=e},[e]),t}function hR(e){try{return e&&e.toString().includes("Rejected from user")}catch{return!1}}function pR(e){const t=String(e);return t.indexOf("withdraw_with_proof")>-1||t.indexOf("check_coin_threshold")>-1||t.indexOf('Identifier("balance")')>-1}function mR(e){return!!String(e).includes("Could not find the referenced transaction")}function gR(e){return!!String(e).includes("Max cap reached.")}function vR(e){return!!String(e).includes("Fast Mode service error")}function bR(e){return hR(e)?"User rejected the request":pR(e)?"Exceeded price slippage":mR(e)?"Oops. Failed to sync data from your txid. Please check your txn status from explorer or from your wallet.":gR(e)?"Max cap reached. This is to prevent your txn from overpaying. You can choose to edit your gas max cap in settings if needed.":vR(e)?"Fast Mode service error, please switch to the Default Transaction Mode or try again later.":"Transaction failed"}var W0={},yR=Cr&&Cr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(W0,"__esModule",{value:!0});var wR=W0.executeAuction=yw;const xR=yR(l1),SR="https://rpc.getshio.com",_R=500,ER=300;function yw(e,t,r=_R){const n={jsonrpc:"2.0",method:"shio_executeAuction",params:[e,t],id:1};return new Promise((i,s)=>{setTimeout(i,r),xR.default.post(SR,n,{headers:{"Content-Type":"application/json"},timeout:r}).then(o=>{setTimeout(i,ER)}).catch(s)})}W0.default={executeAuction:yw};const CR="0x2::sui::SUI",AR="https://rpc.getshio.com/fast",TR="0x1889977f0fb56ae730e7bda8e8e32859ce78874458c74910d36121a81a615123",ww=[{objectId:"0xc32ce42eac951759666cbc993646b72387ec2708a2917c2c6fb7d21f00108c18",version:72869622},{objectId:"0x0289acae0edcdf1fe3aedc2e886bc23064d41c359e0179a18152a64d1c1c2b3e",version:327637282},{objectId:"0x03132160e8c2c45208abf3ccf165e82edcc42fee2e614afe54582f9740a808b8",version:327637282},{objectId:"0x072ae7307459e535379f422995a0d10132f12a3450298f8cf0cc07bd164f9999",version:327637282},{objectId:"0x1c1a96a2f4a34ea09ab15b8ff98f4b6b4338ce89f4158eb7d3eb2cd4dcbd6d86",version:327637282},{objectId:"0x20d76f37ad9f2421a9e6afaf3bb204250b1c2241c50e8a955e86a1a48767d06f",version:327637282},{objectId:"0x213ed368233cc7480fcb6336e70c5ae7ee106b2317ba02ccb5d0478e45bcc046",version:327637282},{objectId:"0x22ce1e80937354eba5549fed2937dc6e2b24026d03505bb51a3e4a64aa4142f6",version:327637282},{objectId:"0x26188cb7ce5ae633279f440f66081cb65cc585e428de18e194f8843e866f799f",version:327637282},{objectId:"0x38642f01422480128388d3e2948d3dc1b2680f9914077edb6bd3451ae1c5bcf0",version:327637282},{objectId:"0x3dd85b6424aea1cae9eff6e55456ca783e056226325f1362106eca8b3ed04ca0",version:327637282},{objectId:"0x42f8adc490542369d9c3b95e9f6eb70b2583102900feb7e103072ed49ba7fc3d",version:327637282},{objectId:"0x46b8158c82fa6bda7230d31a127d934c7295a0042083b4900f3096e9191f6f3f",version:327637282},{objectId:"0x6ebac88a8c3f7a4a9fb05ea49d188a1fe8520ae59ee736e0473004d3033512a4",version:327637282},{objectId:"0x6f55ad6cb40cfc124c11b11c19be0a80237b104acd955e7b52ccb7bf9046fe33",version:327637282},{objectId:"0x71aafb8bac986e82e5f78846bf3b36c2a82505585625207324140227a27ff279",version:327637282},{objectId:"0x7fe9b08680d4179de5672f213b863525b21f10604ca161538075e9338d1d2324",version:327637282},{objectId:"0x81538ef2909a3e0dd3d7f38bcbee191509bae4e8666272938ced295672e2ee8d",version:327637282},{objectId:"0x828eb6b3354ad68a23dd792313a16a0d888b7ea4fdb884bb22bd569f8e61319e",version:327637282},{objectId:"0x9705a332b8c1650dd7fe687ef9f9a9638afb51c30c0b34db150d60b920bc07eb",version:327637282},{objectId:"0x9918f73797a9390e9888b55454f2b31bc01de1a4634acab08f80641c4248e8a5",version:327637282},{objectId:"0x9cd4c08bdf2e132ec2cc77b0f03be60a94951e046d8e82ed5494f44e609edd2f",version:327637282},{objectId:"0xac8ce2033571140509788337c8a1f3aa8941a320ecd7047acda310d39cad9e03",version:327637282},{objectId:"0xbcd4527035265461a9a7b4f1e57c63ea7a6bdf0dc223c66033c218d880f928b1",version:327637282},{objectId:"0xbfdb691b8cc0b3c3a3b7a654f6682f3e53b164d9ee00b9582cdb4d0a353440a9",version:327637282},{objectId:"0xc2559d5c52ae04837ddf943a8c2cd53a5a0b512cee615d30d3abe25aa339465e",version:327637282},{objectId:"0xc56db634d02511e66d7ca1254312b71c60d64dc44bf67ea46b922c52d8aebba6",version:327637282},{objectId:"0xc84545cbff1b36b874ab2b69d11a3d108f23562e87550588c0bda335b27101e0",version:327637282},{objectId:"0xcc141659b5885043f9bfcfe470064819ab9ac667953bcedd1000e0652e90ee76",version:327637282},{objectId:"0xef6bf4952968d25d3e79f7e4db1dc38f2e9d99d61ad38f3829acb4100fe6383a",version:327637282},{objectId:"0xf2ed8d00ef829de5c4a3c5adf2d6b0f41f7fec005fb9c88e5616b98173b2fd66",version:327637282},{objectId:"0xfce73f3c32c3f56ddb924a04cabd44dd870b72954bbe7c3d7767c3b8c25c4326",version:327637282}];async function MR(e){const t=e.client,r=await e.transaction.build({client:t,onlyTransactionKind:!0});let n=e.sender??e.transaction.getData().sender;if(!n)throw new Error("Sender need to be either set in options or in transaction data");return await t.call("shio_estimateFastModeFee",[n,e.transaction.getData().gasData.price,Oc.from(r).toString("base64")])}function IR(){return ww[Math.floor(Math.random()*ww.length)]}async function OR(e,t,r){return await e.executeTransactionBlock({transactionBlock:t.bytes,signature:t.signature,options:r})}async function PR(e,t,r){let n=e.moveCall({package:"0x2",module:"coin",function:"into_balance",typeArguments:[CR],arguments:[t]});return RR(e,n,r)}async function RR(e,t,r){let n=IR();e.moveCall({package:TR,module:"auctioneer",function:"submit_bid",arguments:[e.sharedObjectRef({objectId:n.objectId,mutable:!0,initialSharedVersion:n.version}),e.pure.u64(r),t]})}const G0="CoinWithBalance",jR=Fe({type:At(),balance:vc()});async function NR(e,t,r){var l,u;const n=new Set,i=new Map;if(!e.sender)throw new Error("Sender must be set to resolve CoinWithBalance");for(const f of e.commands)if(f.$kind==="$Intent"&&f.$Intent.name===G0){const{type:p,balance:y}=cr(jR,f.$Intent.data);p!=="gas"&&y>0n&&n.add(p),i.set(p,(i.get(p)??0n)+y)}const s=new Set;for(const f of e.inputs)(l=f.Object)!=null&&l.ImmOrOwnedObject&&s.add(f.Object.ImmOrOwnedObject.objectId),(u=f.UnresolvedObject)!=null&&u.objectId&&s.add(f.UnresolvedObject.objectId);const o=new Map,a=t.client;await Promise.all([...n].map(async f=>{o.set(f,await kR({coinType:f,balance:i.get(f),client:a,owner:e.sender,usedIds:s}))}));const c=new Map;c.set("gas",{$kind:"GasCoin",GasCoin:!0});for(const[f,p]of e.commands.entries()){if(p.$kind!=="$Intent"||p.$Intent.name!==G0)continue;const{type:y,balance:x}=p.$Intent.data;if(x===0n&&y!=="gas"){e.replaceCommand(f,Kn.MoveCall({target:"0x2::coin::zero",typeArguments:[y]}));continue}const v=[];if(!c.has(y)){const[_,...T]=o.get(y).map(O=>e.addInput("object",In.ObjectRef({objectId:O.coinObjectId,digest:O.digest,version:O.version})));T.length>0&&v.push(Kn.MergeCoins(_,T)),c.set(y,_)}v.push(Kn.SplitCoins(c.get(y),[e.addInput("pure",In.Pure(xg.bcs.u64().serialize(x)))])),e.replaceCommand(f,v),e.mapArguments(_=>_.$kind==="Result"&&_.Result===f?{$kind:"NestedResult",NestedResult:[f+v.length-1,0]}:_)}return r()}async function kR({coinType:e,balance:t,client:r,owner:n,usedIds:i}){let s=t;const o=[];return a();async function a(c=null){const{data:l,hasNextPage:u,nextCursor:f}=await r.getCoins({owner:n,coinType:e,cursor:c}),p=l.sort((y,x)=>Number(BigInt(x.balance)-BigInt(y.balance)));for(const y of p){if(i.has(y.coinObjectId))continue;const x=BigInt(y.balance);if(o.push(y),s-=x,s<=0)return o}if(u)return a(f);throw new Error(`Not enough coins of type ${e} to satisfy requested balance`)}}function xw(){const{suiClient:e}=hs(),{currentAccount:t}=zr(),{mutateAsync:r}=Wr.useSignTransaction(),{mutate:n}=Wr.useSignAndExecuteTransaction({execute:async({bytes:c,signature:l})=>await s(c,l)}),i=le.useMemo(()=>"sui:mainnet",[t]),s=async(c,l,u=!1)=>{var p,y;if(u){const x=await e.devInspectTransactionBlock({transactionBlock:es.from(yr(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 f,p;let u;if(typeof c=="string"?u=es.from(c):u=c,l){const y=await e.devInspectTransactionBlock({transactionBlock:c,sender:t.address});if(!y||((f=y.effects)==null?void 0:f.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:v=>{y(v)},onError:v=>{console.error("signAndExecuteTransactionBlock transaction failed",v),x(v)}})})},signTransactionBlock:async c=>(c instanceof Uint8Array&&(c=es.from(c)),typeof c=="string"&&(c=es.from(yr(c))),new Promise((l,u)=>{r({transaction:c,chain:i},{onSuccess:f=>{l(f)},onError:f=>{console.error("signTransactionBlock failed",f),u(f)},onSettled:(f,p,y,x)=>{console.error("signTransactionBlock onSettled",{data:f,error:p,variables:y})}})})),executeTransactionBlock:s}}function DR(){const{signTransactionBlock:e,executeTransactionBlock:t,signAndExecuteTransactionBlock:r}=xw(),{currentAccount:n}=zr();return{getFastModeTx:async(s,o,a)=>{let c,l,u;try{const f=new Ns({url:AR});s.setSender(n==null?void 0:n.address),s.setGasPrice(Number(a));const p=es.from(s);p.addIntentResolver(G0,NR);const y=await MR({transaction:p,client:f}),x=Be(o).mul(Math.pow(10,9)).toString();if(Be(y.gasBudget).gt(x))throw Error("Max cap reached. This is to prevent your txn from overpaying. You can choose to edit your gas max cap in settings if needed.");s.setGasBudget(y.gasBudget);const v=s.splitCoins(s.gas,[y.tipAmount]);PR(s,v[0],y.tipAmount);const _=await s.build({client:f}),T=await e(_),{bytes:O,signature:R}=T;u=O,l=new Date().getTime(),c=await OR(f,T,{showEffects:!0,showEvents:!0})}catch(f){throw String(f).includes("Failed to fetch")?Error("Fast Mode service error"):f}return{result:c,startExecuteTime:l,transactionBlockBytes:u}}}}function LR(){const{signTransactionBlock:e,executeTransactionBlock:t,signAndExecuteTransactionBlock:r}=xw(),{currentAccount:n}=zr(),{suiClient:i}=hs(),{setTransactionData:s}=q0(),{addTxToast:o,removeToast:a}=Io(),{getFastModeTx:c}=DR(),l=5,u=2e3;async function f(x,v=1){try{let _;try{_=await i.getTransactionBlock({digest:x,options:{showEvents:!0,showEffects:!0,showBalanceChanges:!0,showInput:!0,showRawInput:!0,showObjectChanges:!0}})}catch{_=await i.getTransactionBlock({digest:x,options:{showEvents:!0,showEffects:!0}})}if(_)return _;throw new Error("Empty response")}catch(_){if(console.error(`Attempt ${v} failed:`,_),v>=l)throw new Error("Failed to fetch transaction status after maximum retries.");return await kv(u),f(x,v+1)}}const p=async(x,v,_={useDevInspect:!1,useMev:!1,txAction:"signTransactionBlock",useFastMode:!1,maxCapForGas:"",customGasPrice:""})=>{var ce,ne,de;const{useDevInspect:T=!1,useMev:O,txAction:R="signTransactionBlock",useFastMode:F=!1,maxCapForGas:B="",customGasPrice:H=""}=_;let $;v.status="confirmation",s(v);let Z="";try{let q,N,h;typeof x=="function"?h=await x():h=x,h.setSender(n.address);let d;if(F&&B&&H){const S=await c(h,B,H);q=S.result,d=S.startExecuteTime,N=S.transactionBlockBytes}else if(R==="signTransactionBlock"){const S=await e(h),{bytes:E,signature:M}=S;if(O)try{const j=await wR(E,M,500)}catch{}q=await t(E,M,T)}else q=await r(h,T);v.status="submitted",s({...v}),v.tx=q.digest,$=o(v),await kv(u),Z=q==null?void 0:q.digest;let m;if(((ce=q==null?void 0:q.effects)==null?void 0:ce.status.status)==="success"?m=q:m=await f(Z,0),!m||((ne=m.effects)==null?void 0:ne.status.status)==="failure")y(v,(de=m.effects)==null?void 0:de.status.error);else{const S=zC(m,n==null?void 0:n.address,!1);if(v.buildShowInfo){const E=v.buildShowInfo("success",S);v.buildShowInfo=M=>E}a($),v.status="success",s({...v})}return m}catch(q){y(v,q)}},y=(x,v)=>{const _=bR(v);if(x.buildShowInfo){const T=x.buildShowInfo("confirmation");x.buildShowInfo=O=>(T.toastDescriptionContent=_,T.modalDescriptionText=_,T),x.status="rejected",s({...x})}else x.buildShowInfo=T=>{const O={};return O.toastDescriptionContent=_,O.modalDescriptionText=_,O},x.status="rejected",s({...x})};return{signAndExecuteTransaction:p}}function K0(e,t=1e3){const r=le.useRef(),n=le.useCallback((...i)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(...i)},t)},[e,t]);return le.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]),n}function BR(){const{aggregatorSDK:e}=hs(),{findBestRouters:t}=fR(),{getTokenAmountValue:r,fetchTokenPrices:n}=Ka(),{providers:i,slippage:s,mevProtect:o,maxCapForGas:a,transactionMode:c,customGasPrice:l}=Vr(),{signAndExecuteTransaction:u}=LR(),{setTransactionData:f}=q0(),{addTxToast:p}=Io(),{fromCoin:y,toCoin:x,setFromCoin:v,setToCoin:_,setToAmount:T,fromAmount:O,toAmount:R,setFromAmount:F,setFindRouterLoading:B,setRouterData:H,setByAmountIn:$,byAmountIn:Z}=Zr(),[ce,ne]=le.useState(""),de=$o(ce),q=$o(Z),N=$o(O),h=$o(R),d=$o(y),m=$o(x),{balanceInfo:S,getOwnerCoinBalances:E}=Ia(y),{balanceInfo:M}=Ia(x),j=r(y==null?void 0:y.coin_type,O),I=r(x==null?void 0:x.coin_type,R),b=K0(async(re,ee,Q)=>{if(d.current&&m.current&&+re){(+N.current||+h.current)&&B(!0);const fe=$C(re,ee?d.current.decimals:m.current.decimals),W=await t({fromToken:d.current,toToken:m.current,amount:fe.toString(),providersKeys:i,by_amount_in:ee,uuid:Q});B(!1),de.current===Q&&(ee?+N.current?(T(W.toAmountUi||""),H(W)):T(""):+h.current?(F(W.fromAmountUi||"ß"),H(W)):F(""))}else he(!ee)},500),k=(re,ee,Q=!1)=>{if($(ee),ee?(F(re),Q&&T("")):(T(re),Q&&F("")),+re){const fe=mw();ne(fe),b(re,ee,fe)}else B(!1),H(void 0),he(!ee)},ve=(re,ee=!0)=>{he(),ee?((re==null?void 0:re.coin_type)===(x==null?void 0:x.coin_type)&&_(y),v(re)):((re==null?void 0:re.coin_type)===(y==null?void 0:y.coin_type)&&v(x),_(re))},he=re=>{re===void 0?(F(""),T("")):re?F(""):T(""),B(!1),H(void 0)},we=()=>{const re=q.current?N.current:h.current;if(+re){const ee=mw();ne(ee),b(re,q.current,ee)}},Oe=async(re,ee)=>{const{routerData:Q,byAmountIn:fe,fromAmountUi:W,toAmountUi:K}=re,te=new es,oe={routers:Q,slippage:Number(s)/100,txb:te,partner:ee||YC};try{const pe={status:"confirmation",buildShowInfo:(Ne,He)=>{const Ge=`Swap ${Fr(W,y==null?void 0:y.decimals)} ${y==null?void 0:y.symbol} for ${Fr(K,x==null?void 0:x.decimals)} ${x==null?void 0:x.symbol}`,Re={modalDescriptionText:Ge,toastTitleText:Ge};if(Ne==="success"){let Ke=W,nt=K;He&&(Ke=Dv(He,y)||W,nt=Dv(He,x)||K);const Qe=`Swapped ${Fr(Ke,y==null?void 0:y.decimals)} ${y==null?void 0:y.symbol} for ${Fr(nt,x==null?void 0:x.decimals)} ${x==null?void 0:x.symbol}`;Re.toastTitleText=Qe,Re.modalDescriptionText=Qe}return Re},id:0};f(pe),await u(async()=>(await e.fastRouterSwap(oe),te),pe,{useMev:o,useFastMode:c==="Fast Mode",maxCapForGas:a,customGasPrice:l})?(he(),E()):we()}catch(pe){String(pe).includes("TypeError: Failed to fetch")&&p({id:0,status:"rejected",buildShowInfo(Se,_e){return{toastTitleText:"RPC loading failed",toastDescriptionContent:"Try resubmission. Or to check your network and switch an RPC in settings to try again."}}})}};le.useEffect(()=>{je(),he()},[y==null?void 0:y.coin_type,x==null?void 0:x.coin_type]);const je=()=>{const re=[];y&&re.push(y.coin_type),x&&re.push(x.coin_type),re.length>0&&n(re)},{isScamsCoin:L}=bw(y),{isScamsCoin:z}=bw(x),G=le.useMemo(()=>{if(!(!L&&!z)){if(L&&z)return`${y==null?void 0:y.symbol} and ${x==null?void 0:x.symbol} are`;if(L)return`${y==null?void 0:y.symbol} token is `;if(z)return`${x==null?void 0:x.symbol} token is `}},[L,z]);return{handleAmountChange:k,handleSelectToken:ve,fromBalanceInfo:S,toBalanceInfo:M,fromAmountValue:j,toAmountValue:I,doSwapAction:Oe,reCalculateRouteData:we,refreshMarketPrice:je,scamsText:G}}function UR(e){const{fromCoin:t,toCoin:r,fromAmount:n,toAmount:i,routerData:s}=Zr(),{currentAccount:o}=zr(),a=le.useMemo(()=>{const c={text:"Swap",disabled:!1};if(!(o!=null&&o.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(s&&s.errorCode){if(s.errorCode===Xs.InsufficientLiquidity)return c.text="Insufficient liquidity for this trade",c.disabled=!0,c;if(s.errorCode===Xs.NoRouter||s.errorCode===Xs.HoneyPot)return c.text="No Available Route",c.disabled=!0,c}return+n&&Be(n).gt(e||0)?(c.disabled=!0,c.text=`Insufficient ${yn(t==null?void 0:t.symbol)} Balance`,c):((!+n||!+i)&&(c.disabled=!0),c)},[o==null?void 0:o.address,n,i,e,s==null?void 0:s.errorCode,t,r]);return{btnText:a.text,btnDisabled:a.disabled}}function FR({themeType:e}){const t=e=="Light"?Ct("/images/logo_light@2x.png"):Ct("/images/logo@2x.png");return w.jsxs("div",{style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",marginTop:"16px"},children:[w.jsx("span",{style:{fontSize:"12px",color:"var(--cs-text-primary)",fontWeight:"500",marginRight:"8px"},children:"Powered by"}),w.jsx("img",{style:{height:"20px"},src:t})]})}function Y0({baseToken:e,quoteToken:t,baseAmount:r,quoteAmount:n,loading:i,fontSize:s="14px"}){const[o,a]=le.useState(!0),c=vw(o,r,n);return w.jsxs("div",{className:"current-price-block",style:{cursor:"pointer"},onClick:()=>{a(!o)},children:[w.jsx(Pr,{src:o?e==null?void 0:e.logo_url:t==null?void 0:t.logo_url,token:o?e:t,showWarnSize:"10px"}),w.jsxs("span",{style:{display:"flex",alignItems:"center",color:"var(--cs-text-primary)",fontSize:s,maxWidth:"80%"},children:["1"," ",yn(o?e==null?void 0:e.symbol:t==null?void 0:t.symbol)," ","="," ",i?w.jsx(Ys,{className:"custom-skeleton",style:{height:"16px",width:"40px",marginLeft:"2px",marginRight:"2px"}}):Fr(c,t==null?void 0:t.decimals)," ",yn(o?t==null?void 0:t.symbol:e==null?void 0:e.symbol)]}),w.jsx(Pr,{src:o?t==null?void 0:t.logo_url:e==null?void 0:e.logo_url,token:o?t:e,showWarnSize:"8px"}),w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-swap"})})]})}function Ya(){const[e,t]=le.useState(window.innerWidth),r=K0(()=>{t(window.innerWidth)},300);le.useEffect(()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}),[]);const n=le.useMemo(()=>e<810,[e]);return{windowWidth:e,isApp:n}}function J0({content:e,children:t,position:r,autoSwitchTooltip:n=!1,borderRadius:i="8px"}){const{isApp:s}=Ya();return s&&n?w.jsxs($i.Root,{children:[w.jsx($i.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($i.Content,{variant:"soft",style:{transition:"opacity 0.3s ease",display:"block",zIndex:9e3,padding:"8px 12px",backgroundColor:"var(--cs-bg-primary)",color:"var(--cs-text-secondary)",borderRadius:i,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(Js,{content:e,position:r,borderRadius:i,children:t})}function $R({pr:e="8px",pl:t="8px",value:r,isLoading:n}){const{isApp:i}=Ya();return w.jsxs("div",{className:"swap-info-between",style:{paddingLeft:t,paddingRight:e},children:[w.jsxs("div",{className:"left",children:[w.jsx("span",{children:"Overlay Fee"}),w.jsx(J0,{autoSwitchTooltip:!0,position:"top",content:w.jsx("div",{style:{color:"var(--cs-text-secondary)",fontSize:"12px",lineHeight:"18px",width:i?"200px":"280px",textAlign:"start",whiteSpace:"normal"},children:"Fees charged by the integrator, which has been deducted from the output."}),children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",style:{cursor:"pointer",width:"20px",height:"20px"},children:w.jsx("use",{xlinkHref:"#icon-tips"})})})]}),n?w.jsx(Ys,{className:"custom-skeleton",style:{height:"18px",width:"80px"}}):w.jsx("div",{className:"right",children:r?`${Be(r).mul(100).toString()}%`:""})]})}function Sw(e,t,r,n){const{getTokenPrice:i}=Ka(),s=i(e==null?void 0:e.coin_type),o=i(t==null?void 0:t.coin_type),a=vw(!0,r,n),c=le.useMemo(()=>{if(o&&s)return Be(s.price).div(o.price).toString()},[s==null?void 0:s.price,o==null?void 0:o.price]),l=le.useMemo(()=>{if(c&&+a)return Be(a).sub(c).div(a).mul(100).toFixed(10)},[c,a]),u=le.useMemo(()=>{const v=[];return s&&v.push(s.market),o&&!v.includes(o.market)&&v.push(o.market),v},[s==null?void 0:s.market,o==null?void 0:o.market]),f=le.useMemo(()=>!s||!o||s.market==="cetus"||o.market==="cetus",[s,o]),p=le.useMemo(()=>f?!1:l&&Be(l).lt(0)?Be(l).abs().gt(5):!1,[l,f]),y=le.useMemo(()=>f?!1:l&&Be(l).lt(0)?Be(l).abs().gt(10):!1,[l,f]),x=le.useMemo(()=>{let v,_="yellow";if(f)return{priceImpactText:void 0,textColor:"yellow"};if(l)if(Be(l).gt(0))_="green",Be(l).lt(.1)?v="< 0.1% cheaper than":v=`${Fr(l,2,!0,Ur.ROUND_UP)}% cheaper than`;else if(Be(l).eq(0))v="0%",_="green";else{const T=Be(l).abs();T.lte(5)?(_="green",v=`Within ${Fr(T.toString(),2,!0,Ur.ROUND_UP)}%`):T.lte(10)?(_="yellow",v=`${Fr(T.toString(),2,!0,Ur.ROUND_UP)}% more than`):T.lte(100)?(_="red",v=`${Fr(T.toString(),2,!0,Ur.ROUND_UP)}% more than`):(_="red",v="> 100% more than")}return{priceImpactText:v,textColor:_}},[l,f]);return{swapPrice:a,marketPrice:c,priceImpact:l,sources:u,showPriceImpactTips:p,showPriceImpactWarn:y,priceImpactTextInfo:x,showIncalculable:f}}function _w({isLoading:e,routerData:t,noTips:r}){const{fromCoin:n,toCoin:i,fromAmount:s,toAmount:o}=Zr();Ya();const{priceImpact:a,sources:c,marketPrice:l,priceImpactTextInfo:u,showIncalculable:f}=Sw(n,i,t==null?void 0:t.fromAmountUi,t==null?void 0:t.toAmountUi);return w.jsxs(w.Fragment,{children:[!r&&Be(a).lte(-30)&&!f&&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-secondary)"},children:"Price Difference"}),w.jsx(J0,{autoSwitchTooltip:!0,position:"top",content:w.jsx(VR,{fromToken:n,toToken:i,sources:c,baseAmount:"1",quoteAmount:l,showIncalculable:f}),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(Ys,{className:"custom-skeleton",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&&!f?u==null?void 0:u.priceImpactText:"Incalculable"}),u.priceImpactText&&!f&&w.jsx("div",{className:"platforms",children:c.map(p=>w.jsx(Js,{content:w.jsx("span",{style:{fontSize:"12px",color:"var(--cs-text-primary)"},children:Vv[p]}),position:"top",delay:300,children:w.jsx(Pr,{src:eA[p],haveBorder:!1,style:{width:"16px",height:"16px"}})},p))})]})]})]})]})}function VR({fromToken:e,toToken:t,baseAmount:r,quoteAmount:n,sources:i,showIncalculable:s}){const{isApp:o}=Ya();return w.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[w.jsx("p",{style:{color:"var(--cs-text-secondary)",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."}),!s&&w.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[w.jsx("p",{style:{fontSize:"12px",color:"var(--cs-text-primary)"},children:"Market price sources:"}),r&&n?w.jsx(Y0,{baseToken:e,quoteToken:t,baseAmount:"1",quoteAmount:n,loading:!1,fontSize:"12px"}):w.jsx("p",{style:{color:"var(--cs-text-primary)",fontSize:"12px"},children:"Price is unknown"})]}),!s&&w.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[w.jsx("p",{style:{color:"var(--cs-text-secondary)",fontSize:"12px",whiteSpace:"pre"},children:"Market price sources:"}),w.jsx("p",{style:{color:"var(--cs-text-secondary)",fontSize:"12px",whiteSpace:"pre"},children:i.map(a=>Vv[a]+" ").join("")})]})]})}function Ew({pr:e="8px",pl:t="8px",amountLimit:r,isLoading:n}){const{fromCoin:i,toCoin:s,byAmountIn:o}=Zr();return w.jsxs("div",{className:"swap-info-between",style:{paddingLeft:t,paddingRight:e},children:[w.jsx("div",{className:"left",children:o?"Minimum Received":"Maximum Sold"}),n?w.jsx(Ys,{className:"custom-skeleton",style:{height:"18px",width:"80px"}}):w.jsxs("div",{className:"right",children:[Fr(r,o?s==null?void 0:s.decimals:i==null?void 0:i.decimals,!1,Ur.ROUND_DOWN)," ",yn(o?(s==null?void 0:s.symbol)||"":(i==null?void 0:i.symbol)||"")]})]})}function zR({scamsText:e}){return w.jsxs("div",{style:{marginTop:"16px",borderRadius:"8px",border:"1px solid var(--cs-border)",paddingTop:"12px",width:"100%",backgroundColor:"var(--cs-bg-secondary-common)"},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:"var(--cs-warning)"},"aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-alert"})}),w.jsx("span",{style:{color:"var(--cs-warning)",marginLeft:"4px"},children:"Alert"})]}),w.jsx("div",{style:{borderRadius:"8px",padding:"11px",margin:"-1px",marginTop:"14px",border:"1px solid var(--cs-border)",lineHeight:"1"},children:w.jsx(Wv,{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 qR({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 X0({title:e,backClick:t}){return w.jsxs("div",{className:"cs-have-back-header",children:[w.jsx(qR,{onClick:t}),w.jsx("span",{className:"title",children:e})]})}const lu=globalThis||void 0||self;var HR=typeof lu=="object"&&lu&&lu.Object===Object&&lu;const Cw=HR;var WR=typeof self=="object"&&self&&self.Object===Object&&self,GR=Cw||WR||Function("return this")();const fi=GR;var KR=fi.Symbol;const hi=KR;var Aw=Object.prototype,YR=Aw.hasOwnProperty,JR=Aw.toString,Ja=hi?hi.toStringTag:void 0;function XR(e){var t=YR.call(e,Ja),r=e[Ja];try{e[Ja]=void 0;var n=!0}catch{}var i=JR.call(e);return n&&(t?e[Ja]=r:delete e[Ja]),i}var ZR=Object.prototype,QR=ZR.toString;function ej(e){return QR.call(e)}var tj="[object Null]",rj="[object Undefined]",Tw=hi?hi.toStringTag:void 0;function Vo(e){return e==null?e===void 0?rj:tj:Tw&&Tw in Object(e)?XR(e):ej(e)}function ws(e){return e!=null&&typeof e=="object"}var nj="[object Symbol]";function Xa(e){return typeof e=="symbol"||ws(e)&&Vo(e)==nj}function uu(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 ij=Array.isArray;const en=ij;var sj=1/0,Mw=hi?hi.prototype:void 0,Iw=Mw?Mw.toString:void 0;function Ow(e){if(typeof e=="string")return e;if(en(e))return uu(e,Ow)+"";if(Xa(e))return Iw?Iw.call(e):"";var t=e+"";return t=="0"&&1/e==-sj?"-0":t}function zo(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Pw(e){return e}var oj="[object AsyncFunction]",aj="[object Function]",cj="[object GeneratorFunction]",lj="[object Proxy]";function Rw(e){if(!zo(e))return!1;var t=Vo(e);return t==aj||t==cj||t==oj||t==lj}var uj=fi["__core-js_shared__"];const Z0=uj;var jw=function(){var e=/[^.]+$/.exec(Z0&&Z0.keys&&Z0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function dj(e){return!!jw&&jw in e}var fj=Function.prototype,hj=fj.toString;function Zs(e){if(e!=null){try{return hj.call(e)}catch{}try{return e+""}catch{}}return""}var pj=/[\\^$.*+?()[\]{}|]/g,mj=/^\[object .+?Constructor\]$/,gj=Function.prototype,vj=Object.prototype,bj=gj.toString,yj=vj.hasOwnProperty,wj=RegExp("^"+bj.call(yj).replace(pj,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xj(e){if(!zo(e)||dj(e))return!1;var t=Rw(e)?wj:mj;return t.test(Zs(e))}function Sj(e,t){return e==null?void 0:e[t]}function Qs(e,t){var r=Sj(e,t);return xj(r)?r:void 0}var _j=Qs(fi,"WeakMap");const Q0=_j;var Nw=Object.create,Ej=function(){function e(){}return function(t){if(!zo(t))return{};if(Nw)return Nw(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();const Cj=Ej;function Aj(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var Tj=function(){try{var e=Qs(Object,"defineProperty");return e({},"",{}),e}catch{}}();const kw=Tj;function Mj(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var Ij=9007199254740991,Oj=/^(?:0|[1-9]\d*)$/;function Dw(e,t){var r=typeof e;return t=t??Ij,!!t&&(r=="number"||r!="symbol"&&Oj.test(e))&&e>-1&&e%1==0&&e<t}function Lw(e,t,r){t=="__proto__"&&kw?kw(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function eh(e,t){return e===t||e!==e&&t!==t}var Pj=Object.prototype,Rj=Pj.hasOwnProperty;function Bw(e,t,r){var n=e[t];(!(Rj.call(e,t)&&eh(n,r))||r===void 0&&!(t in e))&&Lw(e,t,r)}function du(e,t,r,n){var i=!r;r||(r={});for(var s=-1,o=t.length;++s<o;){var a=t[s],c=n?n(r[a],e[a],a,r,e):void 0;c===void 0&&(c=e[a]),i?Lw(r,a,c):Bw(r,a,c)}return r}var jj=9007199254740991;function th(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=jj}function fu(e){return e!=null&&th(e.length)&&!Rw(e)}var Nj=Object.prototype;function rh(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Nj;return e===r}function kj(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Dj="[object Arguments]";function Uw(e){return ws(e)&&Vo(e)==Dj}var Fw=Object.prototype,Lj=Fw.hasOwnProperty,Bj=Fw.propertyIsEnumerable,Uj=Uw(function(){return arguments}())?Uw:function(e){return ws(e)&&Lj.call(e,"callee")&&!Bj.call(e,"callee")};const $w=Uj;function Fj(){return!1}var Vw=typeof Wt=="object"&&Wt&&!Wt.nodeType&&Wt,zw=Vw&&typeof module=="object"&&module&&!module.nodeType&&module,$j=zw&&zw.exports===Vw,qw=$j?fi.Buffer:void 0,Vj=qw?qw.isBuffer:void 0,zj=Vj||Fj;const hu=zj;var qj="[object Arguments]",Hj="[object Array]",Wj="[object Boolean]",Gj="[object Date]",Kj="[object Error]",Yj="[object Function]",Jj="[object Map]",Xj="[object Number]",Zj="[object Object]",Qj="[object RegExp]",eN="[object Set]",tN="[object String]",rN="[object WeakMap]",nN="[object ArrayBuffer]",iN="[object DataView]",sN="[object Float32Array]",oN="[object Float64Array]",aN="[object Int8Array]",cN="[object Int16Array]",lN="[object Int32Array]",uN="[object Uint8Array]",dN="[object Uint8ClampedArray]",fN="[object Uint16Array]",hN="[object Uint32Array]",tr={};tr[sN]=tr[oN]=tr[aN]=tr[cN]=tr[lN]=tr[uN]=tr[dN]=tr[fN]=tr[hN]=!0,tr[qj]=tr[Hj]=tr[nN]=tr[Wj]=tr[iN]=tr[Gj]=tr[Kj]=tr[Yj]=tr[Jj]=tr[Xj]=tr[Zj]=tr[Qj]=tr[eN]=tr[tN]=tr[rN]=!1;function pN(e){return ws(e)&&th(e.length)&&!!tr[Vo(e)]}function pu(e){return function(t){return e(t)}}var Hw=typeof Wt=="object"&&Wt&&!Wt.nodeType&&Wt,Za=Hw&&typeof module=="object"&&module&&!module.nodeType&&module,mN=Za&&Za.exports===Hw,nh=mN&&Cw.process,gN=function(){try{var e=Za&&Za.require&&Za.require("util").types;return e||nh&&nh.binding&&nh.binding("util")}catch{}}();const qo=gN;var Ww=qo&&qo.isTypedArray,vN=Ww?pu(Ww):pN;const Gw=vN;var bN=Object.prototype,yN=bN.hasOwnProperty;function Kw(e,t){var r=en(e),n=!r&&$w(e),i=!r&&!n&&hu(e),s=!r&&!n&&!i&&Gw(e),o=r||n||i||s,a=o?kj(e.length,String):[],c=a.length;for(var l in e)(t||yN.call(e,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Dw(l,c)))&&a.push(l);return a}function Yw(e,t){return function(r){return e(t(r))}}var wN=Yw(Object.keys,Object);const xN=wN;var SN=Object.prototype,_N=SN.hasOwnProperty;function EN(e){if(!rh(e))return xN(e);var t=[];for(var r in Object(e))_N.call(e,r)&&r!="constructor"&&t.push(r);return t}function Qa(e){return fu(e)?Kw(e):EN(e)}function CN(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var AN=Object.prototype,TN=AN.hasOwnProperty;function MN(e){if(!zo(e))return CN(e);var t=rh(e),r=[];for(var n in e)n=="constructor"&&(t||!TN.call(e,n))||r.push(n);return r}function ih(e){return fu(e)?Kw(e,!0):MN(e)}var IN=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ON=/^\w*$/;function sh(e,t){if(en(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Xa(e)?!0:ON.test(e)||!IN.test(e)||t!=null&&e in Object(t)}var PN=Qs(Object,"create");const ec=PN;function RN(){this.__data__=ec?ec(null):{},this.size=0}function jN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var NN="__lodash_hash_undefined__",kN=Object.prototype,DN=kN.hasOwnProperty;function LN(e){var t=this.__data__;if(ec){var r=t[e];return r===NN?void 0:r}return DN.call(t,e)?t[e]:void 0}var BN=Object.prototype,UN=BN.hasOwnProperty;function FN(e){var t=this.__data__;return ec?t[e]!==void 0:UN.call(t,e)}var $N="__lodash_hash_undefined__";function VN(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ec&&t===void 0?$N:t,this}function eo(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])}}eo.prototype.clear=RN,eo.prototype.delete=jN,eo.prototype.get=LN,eo.prototype.has=FN,eo.prototype.set=VN;function zN(){this.__data__=[],this.size=0}function mu(e,t){for(var r=e.length;r--;)if(eh(e[r][0],t))return r;return-1}var qN=Array.prototype,HN=qN.splice;function WN(e){var t=this.__data__,r=mu(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():HN.call(t,r,1),--this.size,!0}function GN(e){var t=this.__data__,r=mu(t,e);return r<0?void 0:t[r][1]}function KN(e){return mu(this.__data__,e)>-1}function YN(e,t){var r=this.__data__,n=mu(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Vi(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])}}Vi.prototype.clear=zN,Vi.prototype.delete=WN,Vi.prototype.get=GN,Vi.prototype.has=KN,Vi.prototype.set=YN;var JN=Qs(fi,"Map");const tc=JN;function XN(){this.size=0,this.__data__={hash:new eo,map:new(tc||Vi),string:new eo}}function ZN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function gu(e,t){var r=e.__data__;return ZN(t)?r[typeof t=="string"?"string":"hash"]:r.map}function QN(e){var t=gu(this,e).delete(e);return this.size-=t?1:0,t}function ek(e){return gu(this,e).get(e)}function tk(e){return gu(this,e).has(e)}function rk(e,t){var r=gu(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function zi(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])}}zi.prototype.clear=XN,zi.prototype.delete=QN,zi.prototype.get=ek,zi.prototype.has=tk,zi.prototype.set=rk;var nk="Expected a function";function oh(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],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(oh.Cache||zi),r}oh.Cache=zi;var ik=500;function sk(e){var t=oh(e,function(n){return r.size===ik&&r.clear(),n}),r=t.cache;return t}var ok=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ak=/\\(\\)?/g,ck=sk(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(ok,function(r,n,i,s){t.push(i?s.replace(ak,"$1"):n||r)}),t});const lk=ck;function uk(e){return e==null?"":Ow(e)}function Jw(e,t){return en(e)?e:sh(e,t)?[e]:lk(uk(e))}var dk=1/0;function vu(e){if(typeof e=="string"||Xa(e))return e;var t=e+"";return t=="0"&&1/e==-dk?"-0":t}function ah(e,t){t=Jw(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[vu(t[r++])];return r&&r==n?e:void 0}function fk(e,t,r){var n=e==null?void 0:ah(e,t);return n===void 0?r:n}function Xw(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var hk=Yw(Object.getPrototypeOf,Object);const Zw=hk;function pk(){this.__data__=new Vi,this.size=0}function mk(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function gk(e){return this.__data__.get(e)}function vk(e){return this.__data__.has(e)}var bk=200;function yk(e,t){var r=this.__data__;if(r instanceof Vi){var n=r.__data__;if(!tc||n.length<bk-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new zi(n)}return r.set(e,t),this.size=r.size,this}function pi(e){var t=this.__data__=new Vi(e);this.size=t.size}pi.prototype.clear=pk,pi.prototype.delete=mk,pi.prototype.get=gk,pi.prototype.has=vk,pi.prototype.set=yk;function wk(e,t){return e&&du(t,Qa(t),e)}function xk(e,t){return e&&du(t,ih(t),e)}var Qw=typeof Wt=="object"&&Wt&&!Wt.nodeType&&Wt,e6=Qw&&typeof module=="object"&&module&&!module.nodeType&&module,Sk=e6&&e6.exports===Qw,t6=Sk?fi.Buffer:void 0,r6=t6?t6.allocUnsafe:void 0;function _k(e,t){if(t)return e.slice();var r=e.length,n=r6?r6(r):new e.constructor(r);return e.copy(n),n}function n6(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}function i6(){return[]}var Ek=Object.prototype,Ck=Ek.propertyIsEnumerable,s6=Object.getOwnPropertySymbols,Ak=s6?function(e){return e==null?[]:(e=Object(e),n6(s6(e),function(t){return Ck.call(e,t)}))}:i6;const ch=Ak;function Tk(e,t){return du(e,ch(e),t)}var Mk=Object.getOwnPropertySymbols,Ik=Mk?function(e){for(var t=[];e;)Xw(t,ch(e)),e=Zw(e);return t}:i6;const o6=Ik;function Ok(e,t){return du(e,o6(e),t)}function a6(e,t,r){var n=t(e);return en(e)?n:Xw(n,r(e))}function lh(e){return a6(e,Qa,ch)}function Pk(e){return a6(e,ih,o6)}var Rk=Qs(fi,"DataView");const uh=Rk;var jk=Qs(fi,"Promise");const dh=jk;var Nk=Qs(fi,"Set");const fh=Nk;var c6="[object Map]",kk="[object Object]",l6="[object Promise]",u6="[object Set]",d6="[object WeakMap]",f6="[object DataView]",Dk=Zs(uh),Lk=Zs(tc),Bk=Zs(dh),Uk=Zs(fh),Fk=Zs(Q0),to=Vo;(uh&&to(new uh(new ArrayBuffer(1)))!=f6||tc&&to(new tc)!=c6||dh&&to(dh.resolve())!=l6||fh&&to(new fh)!=u6||Q0&&to(new Q0)!=d6)&&(to=function(e){var t=Vo(e),r=t==kk?e.constructor:void 0,n=r?Zs(r):"";if(n)switch(n){case Dk:return f6;case Lk:return c6;case Bk:return l6;case Uk:return u6;case Fk:return d6}return t});const rc=to;var $k=Object.prototype,Vk=$k.hasOwnProperty;function zk(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&Vk.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var qk=fi.Uint8Array;const bu=qk;function hh(e){var t=new e.constructor(e.byteLength);return new bu(t).set(new bu(e)),t}function Hk(e,t){var r=t?hh(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Wk=/\w*$/;function Gk(e){var t=new e.constructor(e.source,Wk.exec(e));return t.lastIndex=e.lastIndex,t}var h6=hi?hi.prototype:void 0,p6=h6?h6.valueOf:void 0;function Kk(e){return p6?Object(p6.call(e)):{}}function Yk(e,t){var r=t?hh(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var Jk="[object Boolean]",Xk="[object Date]",Zk="[object Map]",Qk="[object Number]",eD="[object RegExp]",tD="[object Set]",rD="[object String]",nD="[object Symbol]",iD="[object ArrayBuffer]",sD="[object DataView]",oD="[object Float32Array]",aD="[object Float64Array]",cD="[object Int8Array]",lD="[object Int16Array]",uD="[object Int32Array]",dD="[object Uint8Array]",fD="[object Uint8ClampedArray]",hD="[object Uint16Array]",pD="[object Uint32Array]";function mD(e,t,r){var n=e.constructor;switch(t){case iD:return hh(e);case Jk:case Xk:return new n(+e);case sD:return Hk(e,r);case oD:case aD:case cD:case lD:case uD:case dD:case fD:case hD:case pD:return Yk(e,r);case Zk:return new n;case Qk:case rD:return new n(e);case eD:return Gk(e);case tD:return new n;case nD:return Kk(e)}}function gD(e){return typeof e.constructor=="function"&&!rh(e)?Cj(Zw(e)):{}}var vD="[object Map]";function bD(e){return ws(e)&&rc(e)==vD}var m6=qo&&qo.isMap,yD=m6?pu(m6):bD;const wD=yD;var xD="[object Set]";function SD(e){return ws(e)&&rc(e)==xD}var g6=qo&&qo.isSet,_D=g6?pu(g6):SD;const ED=_D;var CD=1,AD=2,TD=4,v6="[object Arguments]",MD="[object Array]",ID="[object Boolean]",OD="[object Date]",PD="[object Error]",b6="[object Function]",RD="[object GeneratorFunction]",jD="[object Map]",ND="[object Number]",y6="[object Object]",kD="[object RegExp]",DD="[object Set]",LD="[object String]",BD="[object Symbol]",UD="[object WeakMap]",FD="[object ArrayBuffer]",$D="[object DataView]",VD="[object Float32Array]",zD="[object Float64Array]",qD="[object Int8Array]",HD="[object Int16Array]",WD="[object Int32Array]",GD="[object Uint8Array]",KD="[object Uint8ClampedArray]",YD="[object Uint16Array]",JD="[object Uint32Array]",Qt={};Qt[v6]=Qt[MD]=Qt[FD]=Qt[$D]=Qt[ID]=Qt[OD]=Qt[VD]=Qt[zD]=Qt[qD]=Qt[HD]=Qt[WD]=Qt[jD]=Qt[ND]=Qt[y6]=Qt[kD]=Qt[DD]=Qt[LD]=Qt[BD]=Qt[GD]=Qt[KD]=Qt[YD]=Qt[JD]=!0,Qt[PD]=Qt[b6]=Qt[UD]=!1;function yu(e,t,r,n,i,s){var o,a=t&CD,c=t&AD,l=t&TD;if(r&&(o=i?r(e,n,i,s):r(e)),o!==void 0)return o;if(!zo(e))return e;var u=en(e);if(u){if(o=zk(e),!a)return Aj(e,o)}else{var f=rc(e),p=f==b6||f==RD;if(hu(e))return _k(e,a);if(f==y6||f==v6||p&&!i){if(o=c||p?{}:gD(e),!a)return c?Ok(e,xk(o,e)):Tk(e,wk(o,e))}else{if(!Qt[f])return i?e:{};o=mD(e,f,a)}}s||(s=new pi);var y=s.get(e);if(y)return y;s.set(e,o),ED(e)?e.forEach(function(_){o.add(yu(_,t,r,_,e,s))}):wD(e)&&e.forEach(function(_,T){o.set(T,yu(_,t,r,T,e,s))});var x=l?c?Pk:lh:c?ih:Qa,v=u?void 0:x(e);return Mj(v||e,function(_,T){v&&(T=_,_=e[T]),Bw(o,T,yu(_,t,r,T,e,s))}),o}var XD=1,ZD=4;function QD(e){return yu(e,XD|ZD)}var eL="__lodash_hash_undefined__";function tL(e){return this.__data__.set(e,eL),this}function rL(e){return this.__data__.has(e)}function wu(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new zi;++t<r;)this.add(e[t])}wu.prototype.add=wu.prototype.push=tL,wu.prototype.has=rL;function nL(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 iL(e,t){return e.has(t)}var sL=1,oL=2;function w6(e,t,r,n,i,s){var o=r&sL,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var f=-1,p=!0,y=r&oL?new wu:void 0;for(s.set(e,t),s.set(t,e);++f<a;){var x=e[f],v=t[f];if(n)var _=o?n(v,x,f,t,e,s):n(x,v,f,e,t,s);if(_!==void 0){if(_)continue;p=!1;break}if(y){if(!nL(t,function(T,O){if(!iL(y,O)&&(x===T||i(x,T,r,n,s)))return y.push(O)})){p=!1;break}}else if(!(x===v||i(x,v,r,n,s))){p=!1;break}}return s.delete(e),s.delete(t),p}function aL(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function cL(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var lL=1,uL=2,dL="[object Boolean]",fL="[object Date]",hL="[object Error]",pL="[object Map]",mL="[object Number]",gL="[object RegExp]",vL="[object Set]",bL="[object String]",yL="[object Symbol]",wL="[object ArrayBuffer]",xL="[object DataView]",x6=hi?hi.prototype:void 0,ph=x6?x6.valueOf:void 0;function SL(e,t,r,n,i,s,o){switch(r){case xL:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case wL:return!(e.byteLength!=t.byteLength||!s(new bu(e),new bu(t)));case dL:case fL:case mL:return eh(+e,+t);case hL:return e.name==t.name&&e.message==t.message;case gL:case bL:return e==t+"";case pL:var a=aL;case vL:var c=n&lL;if(a||(a=cL),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;n|=uL,o.set(e,t);var u=w6(a(e),a(t),n,i,s,o);return o.delete(e),u;case yL:if(ph)return ph.call(e)==ph.call(t)}return!1}var _L=1,EL=Object.prototype,CL=EL.hasOwnProperty;function AL(e,t,r,n,i,s){var o=r&_L,a=lh(e),c=a.length,l=lh(t),u=l.length;if(c!=u&&!o)return!1;for(var f=c;f--;){var p=a[f];if(!(o?p in t:CL.call(t,p)))return!1}var y=s.get(e),x=s.get(t);if(y&&x)return y==t&&x==e;var v=!0;s.set(e,t),s.set(t,e);for(var _=o;++f<c;){p=a[f];var T=e[p],O=t[p];if(n)var R=o?n(O,T,p,t,e,s):n(T,O,p,e,t,s);if(!(R===void 0?T===O||i(T,O,r,n,s):R)){v=!1;break}_||(_=p=="constructor")}if(v&&!_){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)&&(v=!1)}return s.delete(e),s.delete(t),v}var TL=1,S6="[object Arguments]",_6="[object Array]",xu="[object Object]",ML=Object.prototype,E6=ML.hasOwnProperty;function IL(e,t,r,n,i,s){var o=en(e),a=en(t),c=o?_6:rc(e),l=a?_6:rc(t);c=c==S6?xu:c,l=l==S6?xu:l;var u=c==xu,f=l==xu,p=c==l;if(p&&hu(e)){if(!hu(t))return!1;o=!0,u=!1}if(p&&!u)return s||(s=new pi),o||Gw(e)?w6(e,t,r,n,i,s):SL(e,t,c,r,n,i,s);if(!(r&TL)){var y=u&&E6.call(e,"__wrapped__"),x=f&&E6.call(t,"__wrapped__");if(y||x){var v=y?e.value():e,_=x?t.value():t;return s||(s=new pi),i(v,_,r,n,s)}}return p?(s||(s=new pi),AL(e,t,r,n,i,s)):!1}function Su(e,t,r,n,i){return e===t?!0:e==null||t==null||!ws(e)&&!ws(t)?e!==e&&t!==t:IL(e,t,r,n,Su,i)}var OL=1,PL=2;function RL(e,t,r,n){var i=r.length,s=i,o=!n;if(e==null)return!s;for(e=Object(e);i--;){var a=r[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=r[i];var c=a[0],l=e[c],u=a[1];if(o&&a[2]){if(l===void 0&&!(c in e))return!1}else{var f=new pi;if(n)var p=n(l,u,c,e,t,f);if(!(p===void 0?Su(u,l,OL|PL,n,f):p))return!1}}return!0}function C6(e){return e===e&&!zo(e)}function jL(e){for(var t=Qa(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,C6(i)]}return t}function A6(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function NL(e){var t=jL(e);return t.length==1&&t[0][2]?A6(t[0][0],t[0][1]):function(r){return r===e||RL(r,e,t)}}function kL(e,t){return e!=null&&t in Object(e)}function DL(e,t,r){t=Jw(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=vu(t[n]);if(!(s=e!=null&&r(e,o)))break;e=e[o]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&th(i)&&Dw(o,i)&&(en(e)||$w(e)))}function LL(e,t){return e!=null&&DL(e,t,kL)}var BL=1,UL=2;function FL(e,t){return sh(e)&&C6(t)?A6(vu(e),t):function(r){var n=fk(r,e);return n===void 0&&n===t?LL(r,e):Su(t,n,BL|UL)}}function $L(e){return function(t){return t==null?void 0:t[e]}}function VL(e){return function(t){return ah(t,e)}}function zL(e){return sh(e)?$L(vu(e)):VL(e)}function T6(e){return typeof e=="function"?e:e==null?Pw:typeof e=="object"?en(e)?FL(e[0],e[1]):NL(e):zL(e)}function qL(e){return function(t,r,n){for(var i=-1,s=Object(t),o=n(t),a=o.length;a--;){var c=o[e?a:++i];if(r(s[c],c,s)===!1)break}return t}}var HL=qL();const WL=HL;function GL(e,t){return e&&WL(e,t,Qa)}function KL(e,t){return function(r,n){if(r==null)return r;if(!fu(r))return e(r,n);for(var i=r.length,s=t?i:-1,o=Object(r);(t?s--:++s<i)&&n(o[s],s,o)!==!1;);return r}}var YL=KL(GL);const M6=YL;function JL(e,t){var r=[];return M6(e,function(n,i,s){t(n,i,s)&&r.push(n)}),r}function XL(e,t){var r=en(e)?n6:JL;return r(e,T6(t))}function ZL(e,t){var r=-1,n=fu(e)?Array(e.length):[];return M6(e,function(i,s,o){n[++r]=t(i,s,o)}),n}function QL(e,t){return Su(e,t)}function eB(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}function tB(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=e===e,s=Xa(e),o=t!==void 0,a=t===null,c=t===t,l=Xa(t);if(!a&&!l&&!s&&e>t||s&&o&&c&&!a&&!l||n&&o&&c||!r&&c||!i)return 1;if(!n&&!s&&!l&&e<t||l&&r&&i&&!n&&!s||a&&r&&i||!o&&i||!c)return-1}return 0}function rB(e,t,r){for(var n=-1,i=e.criteria,s=t.criteria,o=i.length,a=r.length;++n<o;){var c=tB(i[n],s[n]);if(c){if(n>=a)return c;var l=r[n];return c*(l=="desc"?-1:1)}}return e.index-t.index}function nB(e,t,r){t.length?t=uu(t,function(s){return en(s)?function(o){return ah(o,s.length===1?s[0]:s)}:s}):t=[Pw];var n=-1;t=uu(t,pu(T6));var i=ZL(e,function(s,o,a){var c=uu(t,function(l){return l(s)});return{criteria:c,index:++n,value:s}});return eB(i,function(s,o){return rB(s,o,r)})}function iB(e,t,r,n){return e==null?[]:(en(t)||(t=t==null?[]:[t]),r=n?void 0:r,en(r)||(r=r==null?[]:[r]),nB(e,t,r))}function sB({toBack:e,onSubmitClick:t,data:r}){const{fromCoin:n,toCoin:i}=Zr(),s=le.useRef(!1),{slippage:o}=Vr(),[a,c]=le.useState(r),{fromAmountUi:l,toAmountUi:u,byAmountIn:f}=a,{amountLimit:p}=gw(o,a),{showPriceImpactTips:y,showPriceImpactWarn:x}=Sw(n,i,l,u),{priceAcceptRouterData:v}=cR(a),[_,T]=le.useState(!1),[O,R]=le.useState(!1);le.useMemo(()=>f?i:n,[f]);const F=le.useMemo(()=>v!==void 0,[v]),B=()=>{if(v){if(s.current)return;s.current=!0;const $=QD(v);c($),setTimeout(()=>{s.current=!1},300)}},H=le.useMemo(()=>_?!1:!!x,[_,x]);return w.jsxs("div",{className:"secondary-dialog",children:[w.jsx(X0,{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:Co(l||"")}),w.jsx(Pr,{src:n==null?void 0:n.logo_url,token:n,style:{width:"28px",height:"28px"}}),w.jsx("span",{className:"symbol",children:yn((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:Co(u||"")}),w.jsx(Pr,{src:i==null?void 0:i.logo_url,token:i,style:{width:"28px",height:"28px"}}),w.jsx("span",{className:"symbol",children:yn((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:"var(--cs-bg-primary)",marginTop:"-1px"},children:w.jsx(Y0,{baseToken:n,quoteToken:i,baseAmount:l||"0",quoteAmount:u||"0",loading:!1})}),y&&w.jsx("div",{style:{paddingLeft:"8px",paddingBottom:"10px",color:"var(--cs-warning)"},children:"High price difference. Be cautious before submitting your order."})]}),w.jsxs("div",{className:"swap-info-between",style:{marginTop:"16px"},children:[w.jsx("div",{className:"left",children:"Slippage Tolerance"}),w.jsxs("div",{className:"right",children:[o,"%"]})]}),w.jsx(Ew,{pl:"0px",pr:"0px",isLoading:!1,amountLimit:p}),w.jsx(_w,{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:"var(--cs-error)"},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 ignorePriceImpact-btn":"swap-btn cs-outline-btn secondary-btn",style:{fontSize:"14px",height:"42px",flex:1,color:_?"var(--cs-primary)":"var(--cs-btn-disabled-text)"},onClick:()=>{T(!0)},children:"Yes, please continue."}),w.jsx("button",{className:"swap-btn cs-outline-btn secondary-btn",style:{fontSize:"14px",height:"42px",color:"var(--cs-btn-disabled-text)",flex:1},onClick:()=>e(),children:"No,cancel it."})]})]})]}),!F&&w.jsx("button",{disabled:H||O,className:"swap-btn cs-solid-btn",style:{marginTop:"16px"},onClick:()=>{O||(R(!0),t(a))},children:O?w.jsx("div",{style:{width:"100%",display:"flex",justifyContent:"center"},children:w.jsx(Hf,{})}):"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 _u(e){const{text:t,type:r,classType:n=""}=e,[i,s]=le.useState(!1),{addCommonToast:o}=Io(),a=c=>{i||(bl(c),lw(t,{debug:!1,message:"message"}),o("Copied"),s(!i))};return le.useEffect(()=>{i&&setTimeout(()=>{s(!1)},2e3)},[i]),w.jsx(w.Fragment,{children:r==="btn"?w.jsxs("div",{className:n?`${n} copy-btn`:"copy-btn",onClick:a,children:[w.jsx("svg",{className:"cs-icon cs-copy-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:i?"#icon-sel":"#icon-icon_copy"})}),w.jsx("span",{children:"Copy"})]}):w.jsx("svg",{className:"cs-icon cs-copy-icon","aria-hidden":"true",onClick:a,children:w.jsx("use",{xlinkHref:i?"#icon-sel":"#icon-icon_copy"})})})}function oB({toBack:e,data:t,isLoading:r}){const{fromCoin:n,toCoin:i,fromAmount:s,toAmount:o}=Zr(),{fetchTokenInfo:a}=ps(),[c,l]=le.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 le.useEffect(()=>{u().then(f=>{l(f)})},[t]),w.jsxs("div",{className:"route-dialog",children:[w.jsx(X0,{title:"Route",backClick:e}),w.jsxs("div",{className:"route-dialog-content",children:[w.jsx("div",{className:"simple-router-box",children:w.jsx(O6,{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(Pr,{src:n==null?void 0:n.logo_url,token:n,style:{width:"26px",height:"26px",borderRadius:"100%"}}),w.jsx("span",{className:"amount",style:{color:"var(--cs-text-primary)"},children:Fr(s,n==null?void 0:n.decimals)}),w.jsx("span",{className:"symbol",style:{color:"var(--cs-text-secondary)"},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 var(--cs-border)",borderRadius:"8px",display:"flex",flexDirection:"column",paddingTop:"20px",paddingBottom:"20px",overflowY:"auto",maxHeight:"280px",position:"relative"},children:c==null?void 0:c.map((f,p)=>w.jsxs("div",{className:"route-item-box-h5",children:[w.jsxs("div",{className:"percent",children:[Be(f.percentage).mul(100).toString(),"%"]}),w.jsx("div",{className:f.paths.length>1?"route-two-h5":"",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"},children:f.paths.map(y=>w.jsx("div",{className:"route-path-item",children:w.jsx(J0,{autoSwitchTooltip:!0,position:"bottom",borderRadius:"12px",content:w.jsxs("div",{className:"router-pool-tip-con",style:{display:"flex",flexDirection:"column",minWidth:"220px"},children:[w.jsx(cB,{poolAddress:y.pool_address}),w.jsx(I6,{token:y.fromToken}),w.jsx(I6,{token:y.toToken})]}),children:w.jsx(aB,{path:y})})},y.to_type))})]},p))})}),w.jsxs("div",{className:"center",style:{gap:"4px"},children:[w.jsx(Pr,{src:i==null?void 0:i.logo_url,token:i,style:{width:"26px",height:"26px",borderRadius:"100%"}}),w.jsx("span",{className:"amount",style:{color:"var(--cs-text-primary)"},children:Fr(o,i==null?void 0:i.decimals)}),w.jsx("span",{className:"symbol",style:{color:"var(--cs-text-secondary)"},children:i==null?void 0:i.symbol})]})]})]})]})}function aB({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(Pr,{src:(t=e.fromToken)==null?void 0:t.logo_url,token:e.fromToken,style:{width:"24px",height:"24px",minWidth:"24px",minHeight:"24px",borderRadius:"100%"}}),w.jsx(Pr,{src:(r=e.toToken)==null?void 0:r.logo_url,token:e.toToken,style:{width:"24px",height:"24px",minWidth:"24px",minHeight:"24px",borderRadius:"100%"}})]}),w.jsxs("span",{className:"provider",style:{color:"var(--cs-text-primary)"},children:[(n=zv[e.provider])==null?void 0:n.name," "]}),!!+e.fee_rate&&w.jsxs("div",{className:"fee-tier",children:[" ",UC(BC(e.fee_rate,e.provider==="FULLSAIL"?4:2))]})]})}function I6({token:e}){const{getExplorerUrl:t}=To();return w.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"12px",margin:"8px 0 4px",gap:"12px"},children:[w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexShrink:0},children:[w.jsx(Pr,{src:e==null?void 0:e.logo_url,token:e,showWarnSize:"12px",style:{width:"20px",height:"20px",borderRadius:"100%"}}),w.jsx("span",{style:{color:"var(--cs-text-primary)",fontSize:"12px"},children:yn((e==null?void 0:e.symbol)||"")})]}),w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[w.jsx("a",{onClick:bl,href:t(e==null?void 0:e.coin_type,"coin"),target:"_blank",style:{textDecoration:"none",color:"var(--cs-text-secondary)",marginRight:"4px"},children:zs(e==null?void 0:e.coin_type)}),w.jsx(_u,{text:(e==null?void 0:e.coin_type)||""})]})]})}function cB({poolAddress:e}){const{getExplorerUrl:t}=To();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:"var(--cs-text-primary)",fontSize:"12px"},children:"Pool"}),w.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"},children:[w.jsx("a",{style:{color:"var(--cs-text-primary)",textDecoration:"none",marginRight:"4px"},onClick:bl,href:t(e,"poolAddress"),target:"_blank",children:zs(e)}),w.jsx(_u,{text:e})]})]}),e&&w.jsx("div",{style:{width:"100%",height:"1px",marginTop:"8px",backgroundColor:"var(--cs-border)"}})]})}function O6({hasSubMenu:e,isLoading:t,formatSwapRouter:r}){var f;const[n,i]=le.useState(!1),{isApp:s}=Ya(),{fetchTokenInfo:o}=ps(),a=le.useMemo(()=>(r==null?void 0:r.routers.length)===1,[r==null?void 0:r.routers.length]),[c,l]=le.useState(""),u=async()=>{var v,_;const p=[],y=((_=(v=r==null?void 0:r.routers)==null?void 0:v[0])==null?void 0:_.paths)||[];for(let T=0;T<y.length;T++){const O=y[T],R=await o(O==null?void 0:O.to_type);if(T===0){const F=await o(O==null?void 0:O.from_type);p.push(`${F==null?void 0:F.symbol} > ${R==null?void 0:R.symbol}`)}else p.push(R==null?void 0:R.symbol)}const x=p.join(" > ");l(x)};return le.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-secondary)":"var(--cs-text-primary)",paddingRight:"8px"},children:e?"Auto Router":"Route"}),t?w.jsx(Ys,{className:"custom-skeleton",style:{width:"80px",height:"18px"}}):w.jsxs("div",{className:"right",onClick:()=>{i(!0)},children:[w.jsx("span",{style:{textAlign:"right",color:"var(--cs-text-primary)"},children:a?c:r==null?void 0:r.router_summery}),(f=r==null?void 0:r.providers)==null?void 0:f.map((p,y)=>{var x;return s?w.jsx(Pr,{src:$t[p],style:{width:"16px",height:"16px"},haveBorder:!1}):w.jsx(Js,{content:w.jsx("div",{style:{color:"var(--cs-text-primary)"},children:((x=zv[p])==null?void 0:x.name)||p}),position:"top",delay:300,children:w.jsx(Pr,{src:$t[p],style:{width:"16px",height:"16px"},haveBorder:!1})},p)}),e&&w.jsx("svg",{className:"cs-icon spread-icon","aria-hidden":"true",style:{width:"16px",height:"16px",flexShrink:0},children:w.jsx("use",{xlinkHref:"#icon-spread"})})]}),n&&e&&w.jsx(oB,{data:r,isLoading:t,toBack:()=>i(!1)})]})}const _F="";function P6(){const{setCollectTokenMap:e,collectTokenMap:t}=qs(),r=i=>{const s=new Map(t);s.get(i.coin_type)?s.delete(i.coin_type):s.set(i.coin_type,i),e(s)},n=le.useCallback(i=>t.get(i.coin_type)!==void 0,[t]);return{handleCollectToken:r,isCollectToken:n,collectTokenMap:t}}function lB(e){const{trustedTokenList:t}=Mo(),{tokenBalanceObj:r,currentAccount:n}=zr(),{coinPriceObj:i}=dw(),{getTokenAmountValue:s}=Ka(),{fetchTokenInfo:o}=ps(),{currentTypeTab:a,showTokenList:c,setShowTokenList:l,combineTokenList:u,importTokenList:f,setComBineTokenList:p,setImportToken:y,setCurrentImportTokenData:x,setImportTokenIsLoading:v,currentImportTokenData:_,searchInput:T,setSearchInput:O,importTokenIsLoading:R,showTokenListIsLoading:F,setCurrentTypeTab:B,setCurrentPlatformTab:H}=qs(),[$,Z]=le.useState(!1);le.useEffect(()=>{t&&(t==null?void 0:t.length)>0&&Z(!0)},[t]);const[ce,ne]=le.useState(!1);le.useEffect(()=>{jv(i)||ne(!0)},[i]);const de=le.useRef({}),[q,N]=le.useState(!1);le.useEffect(()=>{(!jv(r)||!Vf(de.current,r))&&(de.current=r,N(!0))},[r]);const h=le.useMemo(()=>(f==null?void 0:f.length)>1?f==null?void 0:f.map(ve=>{const he=El(r==null?void 0:r[ve==null?void 0:ve.coin_type],ve),we=he==null?void 0:he.totalBalanceFormat,Oe=Be(we).gt("0")?s(ve==null?void 0:ve.coin_type,we):"0";return{...ve,balance:we,rate:Oe}}):f,[f,r,i]),d=(ve,he)=>{const we=he&&he.toLocaleLowerCase().trim(),Oe=ve.map(L=>{let z=0,G=0;L.symbol.toLowerCase()===we||L.name.toLowerCase()===we||L.coin_type.toLowerCase()===we?(z=1e3,G=2):L.symbol.toLowerCase().indexOf(we)>-1?(z=100,G=0):L.name.toLowerCase().indexOf(we)>-1?(z=10,G=0):L.coin_type.toLowerCase().indexOf(we)>-1?(z=1,G=0):L.coin_type.toLowerCase()=="0x2::sui::sui"&&(G=1);let re=Array.isArray(L==null?void 0:L.coin_priority)?Number(L.coin_priority[0])||0:Number(L==null?void 0:L.coin_priority)||0;return e===L.coin_type&&!he&&(G=12,z=1e3,re=1e4),{...L,mark:z,sort:G,coin_priority_sort:re,rateNumber:Number((L==null?void 0:L.rate)||"0"),balanceNumber:Number((L==null?void 0:L.balance)||"0")}});return iB(Oe,[L=>!he&&e===L.coin_type?1:0,"rateNumber","balanceNumber","sort","mark","coin_priority_sort"],["desc","desc","desc","desc","desc","desc"])},m=(ve,he=!1)=>{const we=he?ve.trim():ve.toLowerCase().trim(),Oe=["symbol","name","coin_type"];return XL(we.length===0?u:[...u,...h],L=>Oe.some(z=>{const G=L[z];if(typeof G=="string"){const re=he?G:G.toLowerCase();return z==="coin_type"?re.includes(we)||Ri(re,!0).includes(Ri(we,!0)):re.includes(we)}return!1}))},S=ve=>{ve||x(void 0);const he=m(ve);if((he==null?void 0:he.length)===0){E(ve);return}else{const we=d(he,ve);l(we)}},E=async ve=>{v(!0);try{if(Nv(ve)){const he=ve.trim(),we=dr(he).full_address,Oe=await o(we);if(!Oe){l([]);return}const je=El(r==null?void 0:r[we],Oe),L=(je==null?void 0:je.totalBalanceFormat)||"0",z=Be(L).gt("0")?s(he,L):"0",G={...Oe,balance:L,rate:z};l([G]),x(G)}else{l([]);return}}catch{x(void 0),l([]);return}finally{v(!1)}},M=ve=>{if(ve==="Default")g("All"),H("All");else{const he=d(h,T);l(he)}},j=()=>{if(_){const ve=y(_,!0),he=d(ve,T);l(he),x(void 0),O("")}},I=ve=>{const he=y(ve,!1),we=d(he,T);l(we)},g=ve=>{const he=ve==="All"?[...u]:u.filter(Oe=>ve=="Native"?!Oe.labels||Oe.labels.length==0||Oe.labels=="Native":Oe.labels&&Oe.labels.length>0&&Oe.labels[0].toLowerCase()==ve.toLowerCase()),we=d(he,T);l(we)};le.useEffect(()=>{if(!$||!(t!=null&&t.length)){p([]);return}if(!(n!=null&&n.address))p(t);else if(n!=null&&n.address){const ve=[];for(const he of t){const we=r==null?void 0:r[he==null?void 0:he.coin_type],Oe=El(we,he),je=(Oe==null?void 0:Oe.totalBalanceFormat)||"0",L=(Oe==null?void 0:Oe.displayBalance)||"0",z=Be(je).gt("0")?s(he==null?void 0:he.coin_type,je):"0";ve.push({...he,balance:L,rate:Fr(z,4,!0)})}p(ve)}},[$,ce,q,n==null?void 0:n.address,i]);const b=le.useRef([]);le.useEffect(()=>{if((u==null?void 0:u.length)>0&&!QL(b.current,u)){b.current=u;const ve=d(u);e?h.find(we=>we.coin_type===e)!==void 0||a!=="Default"?(B("Imported"),M("Imported")):l(_?[_]:ve):l(ve)}},[u,e]);const k=le.useMemo(()=>{if(a==="Default"){if(!F&&(c==null?void 0:c.length)===0)return!0}else if((c==null?void 0:c.length)===0&&!R)return!0;return!1},[T,c,_,R,F]);return{showTokenList:c,handleSearch:S,handleChangePlatform:g,currentImportTokenData:_,handleChangeType:M,handleImportClick:j,handleDeleteImportClick:I,isNoData:k}}function uB({tokenList:e,onHandleTokenAction:t}){return w.jsx("div",{className:"token-collect-list",children:e.map(r=>w.jsx(dB,{token:r,onHandleTokenAction:t},r.coin_type))})}function dB({token:e,onHandleTokenAction:t}){return w.jsxs("div",{className:"token-collect-item",onClick:()=>{t(e,"select_token")},children:[w.jsx(Pr,{src:e==null?void 0:e.logo_url,token:e,style:{width:"20px",height:"20px"}}),w.jsx("span",{style:{marginLeft:"4px"},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"})})})]})}function fB(e){const{img:t="",text:r,width:n="100%",height:i="100%",padding:s="20px",subItem:o}=e;return w.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:n,height:i,padding:s,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:"var(--cs-text-primary)",fontSize:"14px"},children:r}),o&&o]})}function hB({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 R6=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function pB(e,t){return!!(e===t||R6(e)&&R6(t))}function mB(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!pB(e[r],t[r]))return!1;return!0}function gB(e,t){t===void 0&&(t=mB);var r=null;function n(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(r&&r.lastThis===this&&t(i,r.lastArgs))return r.lastResult;var o=e.apply(this,i);return r={lastResult:o,lastArgs:i,lastThis:this},o}return n.clear=function(){r=null},n}function mh(){return mh=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},mh.apply(null,arguments)}function j6(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gh(e,t){return gh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},gh(e,t)}function vB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,gh(e,t)}var N6=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function bB(e,t){return!!(e===t||N6(e)&&N6(t))}function yB(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!bB(e[r],t[r]))return!1;return!0}function vh(e,t){t===void 0&&(t=yB);var r,n=[],i,s=!1;function o(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return s&&r===this&&t(a,n)||(i=e.apply(this,a),s=!0,r=this,n=a),i}return o}function k6(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 wB=typeof performance=="object"&&typeof performance.now=="function",D6=wB?function(){return performance.now()}:function(){return Date.now()};function L6(e){cancelAnimationFrame(e.id)}function xB(e,t){var r=D6();function n(){D6()-r>=t?e.call(null):i.id=requestAnimationFrame(n)}var i={id:requestAnimationFrame(n)};return i}var bh=-1;function B6(e){if(e===void 0&&(e=!1),bh===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),bh=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return bh}var Ho=null;function U6(e){if(e===void 0&&(e=!1),Ho===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?Ho="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Ho="negative":Ho="positive-ascending"),document.body.removeChild(t),Ho}return Ho}_n.env.NODE_ENV;var SB=150,_B=function(t,r){return t},Eu=null,Cu=null;_n.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Eu=new WeakSet,Cu=new WeakSet);function EB(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,i=e.getItemSize,s=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,c=e.initInstanceProps,l=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(f){vB(p,f);function p(x){var v;return v=f.call(this,x)||this,v._instanceProps=c(v.props,j6(v)),v._outerRef=void 0,v._resetIsScrollingTimeoutId=null,v.state={instance:j6(v),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof v.props.initialScrollOffset=="number"?v.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},v._callOnItemsRendered=void 0,v._callOnItemsRendered=vh(function(_,T,O,R){return v.props.onItemsRendered({overscanStartIndex:_,overscanStopIndex:T,visibleStartIndex:O,visibleStopIndex:R})}),v._callOnScroll=void 0,v._callOnScroll=vh(function(_,T,O){return v.props.onScroll({scrollDirection:_,scrollOffset:T,scrollUpdateWasRequested:O})}),v._getItemStyle=void 0,v._getItemStyle=function(_){var T=v.props,O=T.direction,R=T.itemSize,F=T.layout,B=v._getItemStyleCache(l&&R,l&&F,l&&O),H;if(B.hasOwnProperty(_))H=B[_];else{var $=r(v.props,_,v._instanceProps),Z=i(v.props,_,v._instanceProps),ce=O==="horizontal"||F==="horizontal",ne=O==="rtl",de=ce?$:0;B[_]=H={position:"absolute",left:ne?void 0:de,right:ne?de:void 0,top:ce?0:$,height:ce?"100%":Z,width:ce?Z:"100%"}}return H},v._getItemStyleCache=void 0,v._getItemStyleCache=vh(function(_,T,O){return{}}),v._onScrollHorizontal=function(_){var T=_.currentTarget,O=T.clientWidth,R=T.scrollLeft,F=T.scrollWidth;v.setState(function(B){if(B.scrollOffset===R)return null;var H=v.props.direction,$=R;if(H==="rtl")switch(U6()){case"negative":$=-R;break;case"positive-descending":$=F-O-R;break}return $=Math.max(0,Math.min($,F-O)),{isScrolling:!0,scrollDirection:B.scrollOffset<$?"forward":"backward",scrollOffset:$,scrollUpdateWasRequested:!1}},v._resetIsScrollingDebounced)},v._onScrollVertical=function(_){var T=_.currentTarget,O=T.clientHeight,R=T.scrollHeight,F=T.scrollTop;v.setState(function(B){if(B.scrollOffset===F)return null;var H=Math.max(0,Math.min(F,R-O));return{isScrolling:!0,scrollDirection:B.scrollOffset<H?"forward":"backward",scrollOffset:H,scrollUpdateWasRequested:!1}},v._resetIsScrollingDebounced)},v._outerRefSetter=function(_){var T=v.props.outerRef;v._outerRef=_,typeof T=="function"?T(_):T!=null&&typeof T=="object"&&T.hasOwnProperty("current")&&(T.current=_)},v._resetIsScrollingDebounced=function(){v._resetIsScrollingTimeoutId!==null&&L6(v._resetIsScrollingTimeoutId),v._resetIsScrollingTimeoutId=xB(v._resetIsScrolling,SB)},v._resetIsScrolling=function(){v._resetIsScrollingTimeoutId=null,v.setState({isScrolling:!1},function(){v._getItemStyleCache(-1,null)})},v}p.getDerivedStateFromProps=function(v,_){return CB(v,_),u(v),null};var y=p.prototype;return y.scrollTo=function(v){v=Math.max(0,v),this.setState(function(_){return _.scrollOffset===v?null:{scrollDirection:_.scrollOffset<v?"forward":"backward",scrollOffset:v,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},y.scrollToItem=function(v,_){_===void 0&&(_="auto");var T=this.props,O=T.itemCount,R=T.layout,F=this.state.scrollOffset;v=Math.max(0,Math.min(v,O-1));var B=0;if(this._outerRef){var H=this._outerRef;R==="vertical"?B=H.scrollWidth>H.clientWidth?B6():0:B=H.scrollHeight>H.clientHeight?B6():0}this.scrollTo(s(this.props,v,_,F,this._instanceProps,B))},y.componentDidMount=function(){var v=this.props,_=v.direction,T=v.initialScrollOffset,O=v.layout;if(typeof T=="number"&&this._outerRef!=null){var R=this._outerRef;_==="horizontal"||O==="horizontal"?R.scrollLeft=T:R.scrollTop=T}this._callPropsCallbacks()},y.componentDidUpdate=function(){var v=this.props,_=v.direction,T=v.layout,O=this.state,R=O.scrollOffset,F=O.scrollUpdateWasRequested;if(F&&this._outerRef!=null){var B=this._outerRef;if(_==="horizontal"||T==="horizontal")if(_==="rtl")switch(U6()){case"negative":B.scrollLeft=-R;break;case"positive-ascending":B.scrollLeft=R;break;default:var H=B.clientWidth,$=B.scrollWidth;B.scrollLeft=$-H-R;break}else B.scrollLeft=R;else B.scrollTop=R}this._callPropsCallbacks()},y.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&L6(this._resetIsScrollingTimeoutId)},y.render=function(){var v=this.props,_=v.children,T=v.className,O=v.direction,R=v.height,F=v.innerRef,B=v.innerElementType,H=v.innerTagName,$=v.itemCount,Z=v.itemData,ce=v.itemKey,ne=ce===void 0?_B:ce,de=v.layout,q=v.outerElementType,N=v.outerTagName,h=v.style,d=v.useIsScrolling,m=v.width,S=this.state.isScrolling,E=O==="horizontal"||de==="horizontal",M=E?this._onScrollHorizontal:this._onScrollVertical,j=this._getRangeToRender(),I=j[0],g=j[1],b=[];if($>0)for(var k=I;k<=g;k++)b.push(le.createElement(_,{data:Z,key:ne(k,Z),index:k,isScrolling:d?S:void 0,style:this._getItemStyle(k)}));var ve=n(this.props,this._instanceProps);return le.createElement(q||N||"div",{className:T,onScroll:M,ref:this._outerRefSetter,style:mh({position:"relative",height:R,width:m,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:O},h)},le.createElement(B||H||"div",{children:b,ref:F,style:{height:E?"100%":ve,pointerEvents:S?"none":void 0,width:E?ve:"100%"}}))},y._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var v=this.props.itemCount;if(v>0){var _=this._getRangeToRender(),T=_[0],O=_[1],R=_[2],F=_[3];this._callOnItemsRendered(T,O,R,F)}}if(typeof this.props.onScroll=="function"){var B=this.state,H=B.scrollDirection,$=B.scrollOffset,Z=B.scrollUpdateWasRequested;this._callOnScroll(H,$,Z)}},y._getRangeToRender=function(){var v=this.props,_=v.itemCount,T=v.overscanCount,O=this.state,R=O.isScrolling,F=O.scrollDirection,B=O.scrollOffset;if(_===0)return[0,0,0,0];var H=o(this.props,B,this._instanceProps),$=a(this.props,H,B,this._instanceProps),Z=!R||F==="backward"?Math.max(1,T):1,ce=!R||F==="forward"?Math.max(1,T):1;return[Math.max(0,H-Z),Math.max(0,Math.min(_-1,$+ce)),H,$]},p}(le.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var CB=function(t,r){var n=t.children,i=t.direction,s=t.height,o=t.layout,a=t.innerTagName,c=t.outerTagName,l=t.width,u=r.instance;if(_n.env.NODE_ENV!=="production"){(a!=null||c!=null)&&Cu&&!Cu.has(u)&&(Cu.add(u),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=i==="horizontal"||o==="horizontal";switch(i){case"horizontal":case"vertical":Eu&&!Eu.has(u)&&(Eu.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(o){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+o+'" 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(f&&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(!f&&typeof s!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(s===null?"null":typeof s)+'" was specified.'))}},AB=EB({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,s,o){var a=t.direction,c=t.height,l=t.itemCount,u=t.itemSize,f=t.layout,p=t.width,y=a==="horizontal"||f==="horizontal",x=y?p:c,v=Math.max(0,l*u-x),_=Math.min(v,r*u),T=Math.max(0,r*u-x+u+o);switch(n==="smart"&&(i>=T-x&&i<=_+x?n="auto":n="center"),n){case"start":return _;case"end":return T;case"center":{var O=Math.round(T+(_-T)/2);return O<Math.ceil(x/2)?0:O>v+Math.floor(x/2)?v:O}case"auto":default:return i>=T&&i<=_?i:i<T?T:_}},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,s=t.height,o=t.itemCount,a=t.itemSize,c=t.layout,l=t.width,u=i==="horizontal"||c==="horizontal",f=r*a,p=u?l:s,y=Math.ceil((p+n-f)/a);return Math.max(0,Math.min(o-1,r+y-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(_n.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 F6(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 TB=["style"],MB=["style"];function IB(e,t){var r=e.style,n=k6(e,TB),i=t.style,s=k6(t,MB);return!F6(r,i)&&!F6(n,s)}const OB=le.memo(({data:e,index:t,style:r})=>{const{items:n,onHandleTokenAction:i,showCollect:s,showDelete:o}=e,a=n[t];return w.jsx("div",{style:r,children:w.jsx(jB,{data:a,onHandleTokenAction:i,showCollect:s,showDelete:o})})},IB),PB=gB((e,t,r,n)=>({items:e,onHandleTokenAction:t,showCollect:r,showDelete:n}));function RB({showTokenList:e,onHandleTokenAction:t,showCollect:r=!0,showDelete:n=!1}){const i=le.useRef(null);le.useEffect(()=>{i.current&&i.current.scrollTo(0)},[e.length]);const s=PB(e,t,r,n);return w.jsx("div",{className:"token-list",children:w.jsx(AB,{ref:i,style:{overflowY:"scroll",scrollbarWidth:"none",msOverflowStyle:"none",padding:"8px"},height:360,itemCount:e.length,itemData:s,itemSize:72,width:"100%",children:OB})})}function jB({data:e,showCollect:t,showDelete:r,onHandleTokenAction:n}){const{isCollectToken:i}=P6(),{getExplorerUrl:s}=To();return Ka(),w.jsxs("div",{className:"token-list-item",onClick:o=>{t&&(o.stopPropagation(),n(e,"select_token"))},children:[w.jsx(Pr,{className:"token-img",src:e==null?void 0:e.logo_url,token:e,showWarnSize:"16px",showWarn:!t}),w.jsxs("div",{className:"token-info",children:[w.jsx("h4",{className:"token-symbol",children:w.jsx("span",{children:yn(e.symbol)})}),w.jsx("p",{className:"token-name",children:yn(e==null?void 0:e.name,20)}),w.jsxs("div",{className:"copy",children:[w.jsx("a",{onClick:bl,href:s(e==null?void 0:e.coin_type,"coin"),target:"_blank",style:{fontSize:"12px"},children:zs(e==null?void 0:e.coin_type)}),w.jsx(_u,{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?Iv(e==null?void 0:e.rate,2):""})]}),r&&w.jsx("div",{className:"collect-button",onClick:o=>{o.stopPropagation(),n(e,"delete_import")},children:w.jsx("svg",{className:"cs-icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-icon_del1"})})}),t&&w.jsx("div",{className:"collect-button",onClick:o=>{o.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 NB({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 kB({backClick:e,onSelectToken:t,currToken:r}){const{showTokenList:n,isNoData:i,handleSearch:s,handleChangePlatform:o,handleChangeType:a,handleImportClick:c,handleDeleteImportClick:l}=lB(r==null?void 0:r.coin_type),{importTokenList:u,currentTypeTab:f,setCurrentTypeTab:p,currentPlatformTab:y,setCurrentPlatformTab:x,platformList:v,isOpenImportDialog:_,setIsOpenImportDialog:T,setSearchInput:O,searchInput:R,importTokenIsLoading:F,currentImportTokenData:B,setCurrentImportTokenData:H}=qs();le.useEffect(()=>()=>{O(""),x("All"),p("Default"),H(void 0)},[]);const{handleCollectToken:$,collectTokenMap:Z}=P6(),ce=m=>{p(m),a(m)},ne=m=>{x(m),o(m)},de=()=>{c(),T(!1)},q=m=>{let S=m.replace(/[^a-zA-Z0-9\s]+$/g,"").trim();O(S),S?N(S):(N(""),ce("Default"))},N=K0(m=>{Nv(m)?s(Ri(m,!0)):s(m)},300),h=(m,S)=>{if(S==="delete_import"){l(m);return}if(S==="collect_token"||S==="un_collect"){$(m);return}S==="select_token"&&(t(m),e())},d=le.useMemo(()=>Array.from(Z.values()),[Z]);return w.jsxs("div",{className:"token-select-modal",children:[w.jsx(X0,{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:R,onChange:m=>q(m.target.value),style:{paddingRight:"40px"}}),R.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"})})]}),d.length>0&&w.jsx(uB,{tokenList:d,onHandleTokenAction:h}),R.length===0&&w.jsx(NB,{currentType:f,changeTab:ce}),R.length===0&&f==="Default"&&w.jsx(hB,{tabList:v,currentTab:y,changeTab:ne})]}),i&&w.jsx(DB,{showTooltip:R.length>0,text:R.length>0||B===void 0?"No tokens found":"No Imported Tokens"}),F&&w.jsx(uw,{}),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(RB,{showTokenList:n,showCollect:!B,showDelete:!B&&f==="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:()=>{de(),h(B,"select_token")},children:"Import"})})]})]})]})}function DB({showTooltip:e,text:t}){return w.jsx("div",{style:{height:"360px"},children:w.jsx(fB,{text:t,subItem:e?w.jsx("div",{children:w.jsx(Js,{position:"bottom",content:w.jsx("div",{style:{color:"var(--cs-text-primary)"},children:"The unique id of coin"}),children:w.jsxs("div",{style:{fontSize:"12px",color:"var(--cs-text-secondary)",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 LB({onClose:e,tokenList:t,onSureClick:r}){const[n,i]=le.useState(!1),{setIgnoreWarnToken:s}=Vr();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(o=>w.jsxs("div",{className:"import-token-info",children:[w.jsx(Pr,{style:{width:"30px",height:"30px",borderRadius:"36px"},token:o,showWarnSize:"16px",src:o.logo_url}),w.jsxs("div",{className:"info",children:[w.jsx("div",{className:"name",children:w.jsxs("span",{children:[" ",o.symbol," "]})}),w.jsxs("div",{className:"address",children:[w.jsx("span",{children:zs(o.coin_type)}),w.jsx(_u,{text:o.coin_type})]})]})]},o.coin_type)),w.jsxs("div",{className:"risk-checkbox ",children:[w.jsx(Hl,{color:"indigo",checked:n,variant:"soft",className:"cs-checkbox cs-allow-change-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(o=>{s(o.coin_type)})},children:"Confirm"})]})]})]})]})}const EF="";function $6(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 nc;(function(e){e.event="event",e.props="prop"})(nc||(nc={}));function xs(){}function BB(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(s,o){return s===t[o]})||(t=n,r=e.apply(void 0,n)),r}}function ic(e){return!!(e||"").match(/\d/)}function Wo(e){return e==null}function UB(e){return typeof e=="number"&&isNaN(e)}function V6(e){return Wo(e)||UB(e)||typeof e=="number"&&!isFinite(e)}function z6(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 $B(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 VB(e){var t=le.useRef(e);t.current=e;var r=le.useRef(function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return t.current.apply(t,n)});return r.current}function yh(e,t){t===void 0&&(t=!0);var r=e[0]==="-",n=r&&t;e=e.replace("-","");var i=e.split("."),s=i[0],o=i[1]||"";return{beforeDecimal:s,afterDecimal:o,hasNegation:r,addNegation:n}}function zB(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 q6(e,t,r){for(var n="",i=r?"0":"",s=0;s<=t-1;s++)n+=e[s]||i;return n}function H6(e,t){return Array(t+1).join(e)}function W6(e){var t=e+"",r=t[0]==="-"?"-":"";r&&(t=t.substring(1));var n=t.split(/[eE]/g),i=n[0],s=n[1];if(s=Number(s),!s)return r+i;i=i.replace(".","");var o=1+s,a=i.length;return o<0?i="0."+H6("0",Math.abs(o))+i:o>=a?i=i+H6("0",o-a):i=(i.substring(0,o)||"0")+"."+i.substring(o),r+i}function G6(e,t,r){if(["","-"].indexOf(e)!==-1)return e;var n=(e.indexOf(".")!==-1||r)&&t,i=yh(e),s=i.beforeDecimal,o=i.afterDecimal,a=i.hasNegation,c=parseFloat("0."+(o||"0")),l=o.length<=t?"0."+o:c.toFixed(t),u=l.split("."),f=s;s&&Number(u[0])&&(f=s.split("").reverse().reduce(function(v,_,T){return v.length>T?(Number(v[0])+Number(_)).toString()+v.substring(1,v.length):_+v},u[0]));var p=q6(u[1]||"",t,r),y=a?"-":"",x=n?".":"";return""+y+f+x+p}function ro(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 K6=BB(function(e,t){for(var r=0,n=0,i=e.length,s=t.length;e[r]===t[r]&&r<i;)r++;for(;e[i-1-n]===t[s-1-n]&&s-n>r&&i-n>r;)n++;return{from:{start:r,end:i-n},to:{start:r,end:s-n}}}),qB=function(e,t){var r=Math.min(e.selectionStart,t);return{from:{start:r,end:e.selectionEnd},to:{start:r,end:t}}};function HB(e,t,r){return Math.min(Math.max(e,t),r)}function wh(e){return Math.max(e.selectionStart,e.selectionEnd)}function WB(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function GB(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function KB(e){var t=e.currentValue,r=e.formattedValue,n=e.currentValueIndex,i=e.formattedValueIndex;return t[n]===r[i]}function YB(e,t,r,n,i,s,o){o===void 0&&(o=KB);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,f={},p=new Array(l),y=0;y<l;y++){p[y]=-1;for(var x=0,v=u;x<v;x++){var _=o({currentValue:r,lastValue:t,formattedValue:e,currentValueIndex:y,formattedValueIndex:x});if(_&&f[x]!==!0){p[y]=x,f[x]=!0;break}}}for(var T=n;T<l&&(p[T]===-1||!s(r[T]));)T++;var O=T===l||p[T]===-1?u:p[T];for(T=n-1;T>0&&p[T]===-1;)T--;var R=T===-1||p[T]===-1?0:p[T]+1;return R>O?O:n-R<O-n?R:O}function Y6(e,t,r,n){var i=e.length;if(t=HB(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 JB(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),r=0,n=t.length;r<n;r++)t[r]=!!(ic(e[r])||ic(e[r-1]));return t}function J6(e,t,r,n,i,s){s===void 0&&(s=xs);var o=VB(function(x,v){var _,T;return V6(x)?(T="",_=""):typeof x=="number"||v?(T=typeof x=="number"?W6(x):x,_=n(T)):(T=i(x,void 0),_=n(T)),{formattedValue:_,numAsString:T}}),a=le.useState(function(){return o(Wo(e)?t:e,r)}),c=a[0],l=a[1],u=function(x,v){x.formattedValue!==c.formattedValue&&l({formattedValue:x.formattedValue,numAsString:x.value}),s(x,v)},f=e,p=r;Wo(e)&&(f=c.numAsString,p=!0);var y=o(f,p);return le.useMemo(function(){l(y)},[y.formattedValue]),[c,u]}function XB(e){return e.replace(/[^0-9]/g,"")}function ZB(e){return e}function QB(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,s=e.getInputRef,o=e.format;o===void 0&&(o=ZB);var a=e.removeFormatting;a===void 0&&(a=XB);var c=e.defaultValue,l=e.valueIsNumericString,u=e.onValueChange,f=e.isAllowed,p=e.onChange;p===void 0&&(p=xs);var y=e.onKeyDown;y===void 0&&(y=xs);var x=e.onMouseUp;x===void 0&&(x=xs);var v=e.onFocus;v===void 0&&(v=xs);var _=e.onBlur;_===void 0&&(_=xs);var T=e.value,O=e.getCaretBoundary;O===void 0&&(O=JB);var R=e.isValidInputCharacter;R===void 0&&(R=ic);var F=e.isCharacterSame,B=$6(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),H=J6(T,c,!!l,o,a,u),$=H[0],Z=$.formattedValue,ce=$.numAsString,ne=H[1],de=le.useRef(),q=le.useRef({formattedValue:Z,numAsString:ce}),N=function(W,K){q.current={formattedValue:W.formattedValue,numAsString:W.value},ne(W,K)},h=le.useState(!1),d=h[0],m=h[1],S=le.useRef(null),E=le.useRef({setCaretTimeout:null,focusTimeout:null});le.useEffect(function(){return m(!0),function(){clearTimeout(E.current.setCaretTimeout),clearTimeout(E.current.focusTimeout)}},[]);var M=o,j=function(W,K){var te=parseFloat(K);return{formattedValue:W,value:K,floatValue:isNaN(te)?void 0:te}},I=function(W,K,te){W.selectionStart===0&&W.selectionEnd===W.value.length||(ro(W,K),E.current.setCaretTimeout=setTimeout(function(){W.value===te&&W.selectionStart!==K&&ro(W,K)},0))},g=function(W,K,te){return Y6(W,K,O(W),te)},b=function(W,K,te){var oe=O(K),pe=YB(K,Z,W,te,oe,R,F);return pe=Y6(K,pe,oe),pe},k=function(W){var K=W.formattedValue;K===void 0&&(K="");var te=W.input,oe=W.source,pe=W.event,Se=W.numAsString,_e;if(te){var Ne=W.inputValue||te.value,He=wh(te);te.value=K,_e=b(Ne,K,He),_e!==void 0&&I(te,_e,K)}K!==Z&&N(j(K,Se),{event:pe,source:oe})};le.useEffect(function(){var W=q.current,K=W.formattedValue,te=W.numAsString;(Z!==K||ce!==te)&&N(j(Z,ce),{event:void 0,source:nc.props})},[Z,ce]);var ve=S.current?wh(S.current):void 0,he=typeof window<"u"?le.useLayoutEffect:le.useEffect;he(function(){var W=S.current;if(Z!==q.current.formattedValue&&W){var K=b(q.current.formattedValue,Z,ve);W.value=Z,I(W,K,Z)}},[Z]);var we=function(W,K,te){var oe=K.target,pe=de.current?qB(de.current,oe.selectionEnd):K6(Z,W),Se=Object.assign(Object.assign({},pe),{lastValue:Z}),_e=a(W,Se),Ne=M(_e);if(_e=a(Ne,void 0),f&&!f(j(Ne,_e))){var He=K.target,Ge=wh(He),Re=b(W,Z,Ge);return He.value=Z,I(He,Re,Z),!1}return k({formattedValue:Ne,numAsString:_e,inputValue:W,event:K,source:te,input:K.target}),!0},Oe=function(W,K){K===void 0&&(K=0);var te=W.selectionStart,oe=W.selectionEnd;de.current={selectionStart:te,selectionEnd:oe+K}},je=function(W){var K=W.target,te=K.value,oe=we(te,W,nc.event);oe&&p(W),de.current=void 0},L=function(W){var K=W.target,te=W.key,oe=K.selectionStart,pe=K.selectionEnd,Se=K.value;Se===void 0&&(Se="");var _e;te==="ArrowLeft"||te==="Backspace"?_e=Math.max(oe-1,0):te==="ArrowRight"?_e=Math.min(oe+1,Se.length):te==="Delete"&&(_e=oe);var Ne=0;te==="Delete"&&oe===pe&&(Ne=1);var He=te==="ArrowLeft"||te==="ArrowRight";if(_e===void 0||oe!==pe&&!He){y(W),Oe(K,Ne);return}var Ge=_e;if(He){var Re=te==="ArrowLeft"?"left":"right";Ge=g(Se,_e,Re),Ge!==_e&&W.preventDefault()}else te==="Delete"&&!R(Se[_e])?Ge=g(Se,_e,"right"):te==="Backspace"&&!R(Se[_e])&&(Ge=g(Se,_e,"left"));Ge!==_e&&I(K,Ge,Se),y(W),Oe(K,Ne)},z=function(W){var K=W.target,te=function(){var oe=K.selectionStart,pe=K.selectionEnd,Se=K.value;if(Se===void 0&&(Se=""),oe===pe){var _e=g(Se,oe);_e!==oe&&I(K,_e,Se)}};te(),requestAnimationFrame(function(){te()}),x(W),Oe(K)},G=function(W){W.persist&&W.persist();var K=W.target,te=W.currentTarget;S.current=K,E.current.focusTimeout=setTimeout(function(){var oe=K.selectionStart,pe=K.selectionEnd,Se=K.value;Se===void 0&&(Se="");var _e=g(Se,oe);_e!==oe&&!(oe===0&&pe===Se.length)&&I(K,_e,Se),v(Object.assign(Object.assign({},W),{currentTarget:te}))},0)},re=function(W){S.current=null,clearTimeout(E.current.focusTimeout),clearTimeout(E.current.setCaretTimeout),_(W)},ee=d&&WB()?"numeric":void 0,Q=Object.assign({inputMode:ee},B,{type:t,value:Z,onChange:je,onKeyDown:L,onMouseUp:z,onFocus:G,onBlur:re});if(r==="text")return i?le.createElement(le.Fragment,null,i(Z,B)||null):le.createElement("span",Object.assign({},B,{ref:s}),Z);if(n){var fe=n;return le.createElement(fe,Object.assign({},Q,{ref:s}))}return le.createElement("input",Object.assign({},Q,{ref:s}))}function X6(e,t){var r=t.decimalScale,n=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var s=t.suffix;s===void 0&&(s="");var o=t.allowNegative,a=t.thousandsGroupStyle;if(a===void 0&&(a="thousand"),e===""||e==="-")return e;var c=Au(t),l=c.thousandSeparator,u=c.decimalSeparator,f=r!==0&&e.indexOf(".")!==-1||r&&n,p=yh(e,o),y=p.beforeDecimal,x=p.afterDecimal,v=p.addNegation;return r!==void 0&&(x=q6(x,r,!!n)),l&&(y=$B(y,l,a)),i&&(y=i+y),s&&(x=x+s),v&&(y="-"+y),e=y+(f&&u||"")+x,e}function Au(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 eU(e,t){e===void 0&&(e="");var r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),i=r.test(e),s=n.test(e);return e=e.replace(/-/g,""),i&&!s&&t&&(e="-"+e),e}function tU(e,t){return new RegExp("(^-)|[0-9]|"+z6(e),t?"g":void 0)}function rU(e,t,r){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(r!=null&&r.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function nU(e,t,r){var n;t===void 0&&(t=GB(e));var i=r.allowNegative,s=r.prefix;s===void 0&&(s="");var o=r.suffix;o===void 0&&(o="");var a=r.decimalScale,c=t.from,l=t.to,u=l.start,f=l.end,p=Au(r),y=p.allowedDecimalSeparators,x=p.decimalSeparator,v=e[f]===x;if(ic(e)&&(e===s||e===o)&&t.lastValue==="")return e;if(f-u===1&&y.indexOf(e[u])!==-1){var _=a===0?"":x;e=e.substring(0,u)+_+e.substring(u+1,e.length)}var T=function(S,E,M){var j=!1,I=!1;s.startsWith("-")?j=!1:S.startsWith("--")?(j=!1,I=!0):o.startsWith("-")&&S.length===o.length?j=!1:S[0]==="-"&&(j=!0);var g=j?1:0;return I&&(g=2),g&&(S=S.substring(g),E-=g,M-=g),{value:S,start:E,end:M,hasNegation:j}},O=T(e,u,f),R=O.hasNegation;n=O,e=n.value,u=n.start,f=n.end;var F=T(t.lastValue,c.start,c.end),B=F.start,H=F.end,$=F.value,Z=e.substring(u,f);e.length&&$.length&&(B>$.length-o.length||H<s.length)&&!(Z&&o.startsWith(Z))&&(e=$);var ce=0;e.startsWith(s)?ce+=s.length:u<s.length&&(ce=u),e=e.substring(ce),f-=ce;var ne=e.length,de=e.length-o.length;e.endsWith(o)?ne=de:(f>de||f>e.length-o.length)&&(ne=f),e=e.substring(0,ne),e=eU(R?"-"+e:e,i),e=(e.match(tU(x,!0))||[]).join("");var q=e.indexOf(x);e=e.replace(new RegExp(z6(x),"g"),function(S,E){return E===q?".":""});var N=yh(e,i),h=N.beforeDecimal,d=N.afterDecimal,m=N.addNegation;return l.end-l.start<c.end-c.start&&h===""&&v&&!parseFloat(d)&&(e=m?"-":""),e}function iU(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}),s=e[0]==="-";i.fill(!1,0,r.length+(s?1:0));var o=e.length;return i.fill(!1,o-n.length+1,o+1),i}function sU(e){var t=Au(e),r=t.thousandSeparator,n=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var s=e.allowNegative;if(s===void 0&&(s=!0),r===n)throw new Error(`
|
|
110
110
|
Decimal separator can't be same as thousand separator.
|
|
111
111
|
thousandSeparator: `+r+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
112
112
|
decimalSeparator: `+n+` (default value for decimalSeparator is .)
|
|
@@ -114,4 +114,4 @@ body { background-color: var(--color-page-background); }
|
|
|
114
114
|
Prefix can't start with '-' when allowNegative is true.
|
|
115
115
|
prefix: `+i+`
|
|
116
116
|
allowNegative: `+s+`
|
|
117
|
-
`),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function aU(e){e=oU(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,r=e.allowNegative,n=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=ws);var s=e.onBlur;s===void 0&&(s=ws);var o=e.thousandSeparator,a=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l="");var u=e.defaultValue,f=e.value,p=e.valueIsNumericString,y=e.onValueChange,x=$6(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),v=Au(e),_=v.decimalSeparator,T=v.allowedDecimalSeparators,O=function(m){return X6(m,e)},R=function(m,S){return iU(m,S,e)},F=Wo(f)?u:f,B=p??nU(F,l,t);Wo(f)?Wo(u)||(B=B||typeof u=="number"):B=B||typeof f=="number";var H=function(m){return V6(m)?m:(typeof m=="number"&&(m=W6(m)),B&&typeof a=="number"?G6(m,a,!!c):m)},$=J6(H(f),H(u),!!B,O,R,y),Z=$[0],ce=Z.numAsString,ne=Z.formattedValue,de=$[1],q=function(m){var S=m.target,E=m.key,M=S.selectionStart,j=S.selectionEnd,I=S.value;if(I===void 0&&(I=""),(E==="Backspace"||E==="Delete")&&j<l.length){m.preventDefault();return}if(M!==j){i(m);return}E==="Backspace"&&I[0]==="-"&&M===l.length+1&&r&&ro(S,1),a&&c&&(E==="Backspace"&&I[M-1]===_?(ro(S,M-1),m.preventDefault()):E==="Delete"&&I[M]===_&&m.preventDefault()),T!=null&&T.includes(E)&&I[M]===_&&ro(S,M+1);var g=o===!0?",":o;E==="Backspace"&&I[M-1]===g&&ro(S,M-1),E==="Delete"&&I[M]===g&&ro(S,M+1),i(m)},N=function(m){var S=ce;if(S.match(/\d/g)||(S=""),n||(S=qB(S)),c&&a&&(S=G6(S,a,c)),S!==ce){var E=X6(S,e);de({formattedValue:E,value:S,floatValue:parseFloat(S)},{event:m,source:rc.event})}s(m)},h=function(m){return m===_?!0:nc(m)},d=function(m){var S=m.currentValue,E=m.lastValue,M=m.formattedValue,j=m.currentValueIndex,I=m.formattedValueIndex,g=S[j],b=M[I],k=K6(E,S),ve=k.to,he=function(we){return R(we).indexOf(".")+l.length};return f===0&&c&&a&&S[ve.start]===_&&he(S)<j&&he(M)>I?!1:j>=ve.start&&j<ve.end&&T&&T.includes(g)&&b===_?!0:g===b};return Object.assign(Object.assign({},x),{value:ne,valueIsNumericString:!1,isValidInputCharacter:h,isCharacterSame:d,onValueChange:de,format:O,removeFormatting:R,getCaretBoundary:function(m){return sU(m,e)},onKeyDown:q,onBlur:N})}function cU(e){var t=aU(e);return le.createElement(eU,Object.assign({},t))}function lU(e){const{className:t,value:r,decimals:n,placeholder:i,style:s,onChange:o,maxValue:a,minValue:c=0,inputAllowed:l=!0,prefix:u,...f}=e,p=y=>{var _;const x=((_=y==null?void 0:y.target)==null?void 0:_.value)||"";let v=x;if(x.startsWith("0")&&x!=="0"&&!x.startsWith("0.")&&(v=x.replace(/^0+/,"")),v){if(v.startsWith(".")){o(v.slice(1,v.length));return}let T=String(v).replace(/,/g,"");if(T.startsWith("-")){o("");return}u&&(T=T.replace(u,"")),a!==void 0&&Ue(T).gt(a)?T=a.toString():c!==void 0&&Ue(T).lt(c)&&(T=c.toString()),o(String(T))}else o("")};return w.jsx(cU,{className:t,value:r,disabled:!l,placeholder:i,decimalScale:n,prefix:u,allowLeadingZeros:!0,thousandSeparator:",",isAllowed:y=>!y.value.startsWith("-"),onChange:p,...f,style:{...s,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 uU(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(Pr,{src:t==null?void 0:t.logo_url,token:t,showWarnSize:"16px"})},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 Z6({label:e,amount:t,amountValue:r,balance:n,onInputChange:i,handleTokenSelectClick:s,token:o,loading:a=!1,showMax:c=!0,showHalf:l=!0,inputAllowed:u=!0,marginTop:f}){const[p,y]=le.useState(!1),{currentAccount:x}=zr(),v=()=>{const T=Ue((n==null?void 0:n.totalBalanceFormat)||"0").div(2),O=Ur(T.toString(),o==null?void 0:o.decimals,!0).toString();t&&Ue(O).eq(t)||i(O)},_=()=>{const T=Ue((n==null?void 0:n.totalBalanceFormat)||0),O=dr((o==null?void 0:o.coin_type)||"").full_address===yc,R=.05;let F=T;O&&Ue(T).gt(R)&&(F=F.sub(R)),!(t&&Ue(F).eq(t))&&Ue(F).gte(0)&&i(F.toString())};return w.jsxs("div",{className:p?"active trade-input-box":"trade-input-box",style:{backgroundColor:u?"var(--cs-input-bg-normal)":"var(--cs-input-disabled-bg)",marginTop:f},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(Ys,{className:"custom-skeleton",style:{width:"150px",height:"28px",flex:1}})," "]}):w.jsx(lU,{inputAllowed:u,value:t,decimals:(o==null?void 0:o.decimals)||9,placeholder:"0.0",className:"input",onChange:i,onFocus:()=>y(!0),onBlur:()=>y(!1)}),w.jsx(uU,{token:o,handleTokenSelectClick:s})]}),w.jsxs("div",{className:"info-box",children:[!a&&r&&Ue(r).gt(0)?w.jsx("div",{className:"input-rate",style:{marginTop:"8px"},children:Pv(r,2)}):w.jsx("div",{}),x&&o&&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:v,children:"HALF"}),c&&w.jsx("button",{className:"cs-outline-btn",onClick:_,children:"MAX"})]})]})]})]})}function dU({refreshCount:e,customWallet:t,initProps:r}){const{currentAccount:n,onWalletModal:i}=zr(),{getOwnerCoinBalances:s}=Ma(),{fromCoin:o,toCoin:a,fromAmount:c,toAmount:l,findRouterLoading:u,byAmountIn:f,routerData:p,isOpenSecondary:y,setIsOpenSecondary:x,isOpenTokensDialog:v,setIsOpenTokensDialog:_}=Zr(),{handleAmountChange:T,handleSelectToken:O,fromBalanceInfo:R,toBalanceInfo:F,fromAmountValue:B,toAmountValue:H,doSwapAction:$,reCalculateRouteData:Z,refreshMarketPrice:ce,scamsText:ne}=UR(),{slippage:de}=Vr(),{isCustomMode:q,customWarnTokenList:N}=fR(o==null?void 0:o.coin_type,a==null?void 0:a.coin_type),{amountLimit:h}=gw(de,p),{formatSwapRouter:d}=uR(p),[m,S]=le.useState(!1),{btnText:E,btnDisabled:M}=FR(R==null?void 0:R.totalBalanceFormat),[j,I]=le.useState(!1),[g,b]=le.useState(!1);le.useEffect(()=>{y?e>=5&&k():e>=20&&k()},[e]);const k=()=>{Z(),n&&s(),ce()},ve=()=>({...p}),he=async()=>{a&&O(a,!0)};return w.jsxs("div",{className:"swap-trade-box",children:[w.jsxs("div",{className:"trade-form",style:{flexDirection:"column"},children:[w.jsx(Z6,{loading:!f&&u,balance:R,amountValue:B,handleTokenSelectClick:()=>{I(!0),_(!0)},onInputChange:we=>{T(we,!0)},amount:c,token:o}),w.jsx("div",{onClick:he,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(Z6,{marginTop:"-20px",loading:f&&u,balance:F,showHalf:!1,showMax:!1,amountValue:H,handleTokenSelectClick:()=>{I(!1),_(!0)},onInputChange:we=>{T(we,!1)},inputAllowed:!1,amount:l,token:a})]}),ne&&w.jsx(qR,{scamsText:ne}),w.jsxs("div",{className:"swap-bottom-block",style:{border:M?"0px solid var(--cs-border)":"1px solid var(--cs-border)"},children:[w.jsx("button",{className:"cs-solid-btn swap-btn",style:{marginTop:"0px"},disabled:M||u,onClick:()=>{n?q&&N.length>0?b(!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(Wf,{})}):E}),c&&l&&Ue(c).gt(0)&&Ue(l).gt(0)&&w.jsxs("div",{className:"content",children:[w.jsxs("div",{className:"price-related-info",children:[p&&!(p!=null&&p.errorCode)&&w.jsx(J0,{baseToken:o,quoteToken:a,baseAmount:p.fromAmountUi||"",quoteAmount:p.toAmountUi||"",loading:u}),w.jsx(_w,{isLoading:u,routerData:p})]}),w.jsx(Ew,{isLoading:u,amountLimit:h}),w.jsx(O6,{hasSubMenu:!0,formatSwapRouter:d,isLoading:u}),!!(r!=null&&r.overlayFeeRate)&&!!(r!=null&&r.overlayFeeReceiver)&&w.jsx(VR,{value:r==null?void 0:r.overlayFeeRate,isLoading:u})]})]}),w.jsx($R,{themeType:r==null?void 0:r.themeType}),y&&w.jsx(oB,{data:ve(),toBack:()=>x(!1),onSubmitClick:async we=>{try{await $(we,r==null?void 0:r.partner)}finally{x(!1)}}}),v&&w.jsx(DB,{currToken:j?o:a,backClick:()=>_(!1),onSelectToken:we=>{O(we,j),_(!1)}}),g&&N.length>0&&w.jsx(BB,{onClose:()=>{b(!1)},tokenList:N,onSureClick:()=>{b(!1),x(!0)}})]})}const fU=(e,t)=>{const r={...e};return r.primary_10=Hr(e.primary,.1),r.primary_20=Hr(e.primary,.2),r.primary_50=Hr(e.primary,.5),r.primary_80=Hr(e.primary,.8),r.btn_disabled_bg=Hr(e.primary,.2),r["btn-hover-bg"]=Hr(e.primary,.8),r.success_10=Hr(e.success,.1),r.warning_10=Hr(e.warning,.1),r.error_10=Hr(e.error,.1),t==="Light"?(r.bg_secondary="#72C1F7",r.bg_secondary_common=Hr(e.primary,.1),r.input_bg_normal=Hr(e.primary,.1),r.border="rgba(0,0,0,0.1)",r.icon_fill=Hr(e.text_secondary,1),r.text_placeholder="rgba(0,0,0,0.5)",r.btn_disabled_text=Hr(e.text_primary,.5)):(r.bg_secondary="#000",r.bg_secondary_common="rgba(0, 0, 0,0.2)",r.input_bg_normal="rgba(0, 0, 0,0.3)",r.border="rgba(255,255,255,0.1)",r.icon_fill=Hr(e.text_secondary,1),r.text_placeholder="rgba(255,255,255,0.5)",r.btn_disabled_text=Hr(e.text_primary,.5)),r},Hr=(e,t)=>{const r=e.replace("#",""),n=parseInt(r.substring(0,2),16),i=parseInt(r.substring(2,4),16),s=parseInt(r.substring(4,6),16);return`rgba(${n}, ${i}, ${s}, ${t})`},hU=(e,t)=>{let r=":root {";const n=fU(e,t);return Object.entries(n).forEach(([i,s])=>{s&&(r+=`--cs-${i.split("_").join("-")}: ${s};`)}),r+="}",r},Q6=e=>{const t=document.createElement("style");t.id="dynamic-theme",t.textContent=e;const r=document.getElementById("dynamic-theme");r&&r.remove(),document.head.appendChild(t)},pU=({theme:e,children:t,themeType:r})=>(le.useEffect(()=>{if(!e||!r)return;const n=hU(e,r);if("adoptedStyleSheets"in document){const i=new CSSStyleSheet;try{return i.replaceSync(n),document.adoptedStyleSheets=[...document.adoptedStyleSheets,i],()=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(s=>s!==i)}}catch(s){console.warn("CSSStyleSheet error:",s),Q6(n)}}else Q6(n)},[e,r]),w.jsx(w.Fragment,{children:t}));function mU({initProps:e={},customWallet:t}){XP(e);const{ToastContainer:r}=Io(),{fetchRouterConfig:n}=HP(),{getTrustTokens:i}=hs(),{transactionData:s,setTransactionData:o}=H0(),{isOpenSecondary:a,fromCoin:c,toAmount:l,toCoin:u,fromAmount:f}=Zr(),[p,y]=le.useState(0),x=le.useRef(p);JP(e),le.useEffect(()=>{i(),n()},[]),le.useEffect(()=>{x.current=0},[c==null?void 0:c.coin_type,u==null?void 0:u.coin_type,f,l]),WP({interval:1e3,callback:()=>{x.current=x.current+1,a?x.current>=5&&v():x.current>=20&&v()}});const v=()=>{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($P,{independentWallet:!!(e!=null&&e.independentWallet),customWallet:t,logo:e==null?void 0:e.logo}),w.jsx(AP,{handleRefresh:v,themeType:e==null?void 0:e.themeType}),w.jsx(dU,{refreshCount:p,customWallet:t,initProps:e}),s&&w.jsx(VP,{transactionData:s,onClose:()=>{o(void 0)}}),w.jsx(r,{})]})})}function Sh({initProps:e={},customWallet:t}){var o;KP();const{getOwnerCoinBalances:r}=Ma(),n=Wr.useCurrentAccount(),{saveCurrentAccount:i}=zr(),{mutate:s}=Wr.useConnectWallet();return le.useEffect(()=>{i(n||void 0),r(n==null?void 0:n.address)},[n]),le.useEffect(()=>{var a;t&&((a=t==null?void 0:t.currentAccount)==null?void 0:a.address)!==(n==null?void 0:n.address)&&s({wallet:t==null?void 0:t.currentWallet},{onSuccess:()=>{}})},[(o=t==null?void 0:t.currentAccount)==null?void 0:o.address,n==null?void 0:n.address]),w.jsx(pU,{theme:e.theme,themeType:e.themeType,children:w.jsx(mU,{initProps:e,customWallet:t})})}function gU({initProps:e,customWallet:t}){const[r,n]=le.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(Sh,{initProps:e,customWallet:t})}),w.jsx("div",{className:"swap-modal-mask",onClick:()=>n(!1)})]})}function vU({size:e,direction:t,initProps:r,customWallet:n}){const[i,s]=le.useState(!1),o=()=>{s(!i)};return w.jsxs("div",{className:"widget-btn-box",children:[w.jsx("div",{className:`img-btn ${e} ${t}`,onClick:o,children:i?w.jsx("svg",{className:"icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-unfold"})}):w.jsx("img",{src:Ct("/images/img-logo@2x.png")})}),i&&w.jsx("div",{className:`widget-modal ${t} ${e}`,children:w.jsx(Sh,{initProps:r,customWallet:n})})]})}function bU({initProps:e={},customWallet:t}){const{displayMode:r,widgetBtnDirection:n,widgetBtnSize:i}=e;return w.jsxs(Fl,{appearance:"dark",children:[r==="Integrated"&&w.jsx(Sh,{initProps:e,customWallet:t}),r==="Widget"&&w.jsx(vU,{initProps:e,customWallet:t,direction:n||"right-bottom",size:i||"Default"}),(!r||r==="Modal")&&w.jsx(gU,{initProps:e,customWallet:t})]})}const yU=bU;Wt.CetusSwap=yU,Object.defineProperty(Wt,Symbol.toStringTag,{value:"Module"})});
|
|
117
|
+
`),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function oU(e){e=sU(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,r=e.allowNegative,n=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=xs);var s=e.onBlur;s===void 0&&(s=xs);var o=e.thousandSeparator,a=e.decimalScale,c=e.fixedDecimalScale,l=e.prefix;l===void 0&&(l="");var u=e.defaultValue,f=e.value,p=e.valueIsNumericString,y=e.onValueChange,x=$6(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),v=Au(e),_=v.decimalSeparator,T=v.allowedDecimalSeparators,O=function(m){return X6(m,e)},R=function(m,S){return nU(m,S,e)},F=Wo(f)?u:f,B=p??rU(F,l,t);Wo(f)?Wo(u)||(B=B||typeof u=="number"):B=B||typeof f=="number";var H=function(m){return V6(m)?m:(typeof m=="number"&&(m=W6(m)),B&&typeof a=="number"?G6(m,a,!!c):m)},$=J6(H(f),H(u),!!B,O,R,y),Z=$[0],ce=Z.numAsString,ne=Z.formattedValue,de=$[1],q=function(m){var S=m.target,E=m.key,M=S.selectionStart,j=S.selectionEnd,I=S.value;if(I===void 0&&(I=""),(E==="Backspace"||E==="Delete")&&j<l.length){m.preventDefault();return}if(M!==j){i(m);return}E==="Backspace"&&I[0]==="-"&&M===l.length+1&&r&&ro(S,1),a&&c&&(E==="Backspace"&&I[M-1]===_?(ro(S,M-1),m.preventDefault()):E==="Delete"&&I[M]===_&&m.preventDefault()),T!=null&&T.includes(E)&&I[M]===_&&ro(S,M+1);var g=o===!0?",":o;E==="Backspace"&&I[M-1]===g&&ro(S,M-1),E==="Delete"&&I[M]===g&&ro(S,M+1),i(m)},N=function(m){var S=ce;if(S.match(/\d/g)||(S=""),n||(S=zB(S)),c&&a&&(S=G6(S,a,c)),S!==ce){var E=X6(S,e);de({formattedValue:E,value:S,floatValue:parseFloat(S)},{event:m,source:nc.event})}s(m)},h=function(m){return m===_?!0:ic(m)},d=function(m){var S=m.currentValue,E=m.lastValue,M=m.formattedValue,j=m.currentValueIndex,I=m.formattedValueIndex,g=S[j],b=M[I],k=K6(E,S),ve=k.to,he=function(we){return R(we).indexOf(".")+l.length};return f===0&&c&&a&&S[ve.start]===_&&he(S)<j&&he(M)>I?!1:j>=ve.start&&j<ve.end&&T&&T.includes(g)&&b===_?!0:g===b};return Object.assign(Object.assign({},x),{value:ne,valueIsNumericString:!1,isValidInputCharacter:h,isCharacterSame:d,onValueChange:de,format:O,removeFormatting:R,getCaretBoundary:function(m){return iU(m,e)},onKeyDown:q,onBlur:N})}function aU(e){var t=oU(e);return le.createElement(QB,Object.assign({},t))}function cU(e){const{className:t,value:r,decimals:n,placeholder:i,style:s,onChange:o,maxValue:a,minValue:c=0,inputAllowed:l=!0,prefix:u,...f}=e,p=y=>{var _;const x=((_=y==null?void 0:y.target)==null?void 0:_.value)||"";let v=x;if(x.startsWith("0")&&x!=="0"&&!x.startsWith("0.")&&(v=x.replace(/^0+/,"")),v){if(v.startsWith(".")){o(v.slice(1,v.length));return}let T=String(v).replace(/,/g,"");if(T.startsWith("-")){o("");return}u&&(T=T.replace(u,"")),a!==void 0&&Be(T).gt(a)?T=a.toString():c!==void 0&&Be(T).lt(c)&&(T=c.toString()),o(String(T))}else o("")};return w.jsx(aU,{className:t,value:r,disabled:!l,placeholder:i,decimalScale:n,prefix:u,allowLeadingZeros:!0,thousandSeparator:",",isAllowed:y=>!y.value.startsWith("-"),onChange:p,...f,style:{...s,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 lU(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(Pr,{src:t==null?void 0:t.logo_url,token:t,showWarnSize:"16px"})},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 Z6({label:e,amount:t,amountValue:r,balance:n,onInputChange:i,handleTokenSelectClick:s,token:o,loading:a=!1,showMax:c=!0,showHalf:l=!0,inputAllowed:u=!0,marginTop:f}){const[p,y]=le.useState(!1),{currentAccount:x}=zr(),v=()=>{const T=Be((n==null?void 0:n.totalBalanceFormat)||"0").div(2),O=Fr(T.toString(),o==null?void 0:o.decimals,!0).toString();t&&Be(O).eq(t)||i(O)},_=()=>{const T=Be((n==null?void 0:n.totalBalanceFormat)||0),O=dr((o==null?void 0:o.coin_type)||"").full_address===wc,R=.05;let F=T;O&&Be(T).gt(R)&&(F=F.sub(R)),!(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?"var(--cs-input-bg-normal)":"var(--cs-input-disabled-bg)",marginTop:f},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(Ys,{className:"custom-skeleton",style:{width:"150px",height:"28px",flex:1}})," "]}):w.jsx(cU,{inputAllowed:u,value:t,decimals:(o==null?void 0:o.decimals)||9,placeholder:"0.0",className:"input",onChange:i,onFocus:()=>y(!0),onBlur:()=>y(!1)}),w.jsx(lU,{token:o,handleTokenSelectClick:s})]}),w.jsxs("div",{className:"info-box",children:[!a&&r&&Be(r).gt(0)?w.jsx("div",{className:"input-rate",style:{marginTop:"8px"},children:Iv(r,2)}):w.jsx("div",{}),x&&o&&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:v,children:"HALF"}),c&&w.jsx("button",{className:"cs-outline-btn",onClick:_,children:"MAX"})]})]})]})]})}function uU({refreshCount:e,customWallet:t,initProps:r}){const{currentAccount:n,onWalletModal:i}=zr(),{getOwnerCoinBalances:s}=Ia(),{fromCoin:o,toCoin:a,fromAmount:c,toAmount:l,findRouterLoading:u,byAmountIn:f,routerData:p,isOpenSecondary:y,setIsOpenSecondary:x,isOpenTokensDialog:v,setIsOpenTokensDialog:_}=Zr(),{handleAmountChange:T,handleSelectToken:O,fromBalanceInfo:R,toBalanceInfo:F,fromAmountValue:B,toAmountValue:H,doSwapAction:$,reCalculateRouteData:Z,refreshMarketPrice:ce,scamsText:ne}=BR(),{slippage:de}=Vr(),{isCustomMode:q,customWarnTokenList:N}=dR(o==null?void 0:o.coin_type,a==null?void 0:a.coin_type),{amountLimit:h}=gw(de,p),{formatSwapRouter:d}=lR(p),[m,S]=le.useState(!1),{btnText:E,btnDisabled:M}=UR(R==null?void 0:R.totalBalanceFormat),[j,I]=le.useState(!1),[g,b]=le.useState(!1);le.useEffect(()=>{y?e>=5&&k():e>=20&&k()},[e]);const k=()=>{Z(),n&&s(),ce()},ve=()=>({...p}),he=async()=>{a&&O(a,!0)};return w.jsxs("div",{className:"swap-trade-box",children:[w.jsxs("div",{className:"trade-form",style:{flexDirection:"column"},children:[w.jsx(Z6,{loading:!f&&u,balance:R,amountValue:B,handleTokenSelectClick:()=>{I(!0),_(!0)},onInputChange:we=>{T(we,!0)},amount:c,token:o}),w.jsx("div",{onClick:he,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(Z6,{marginTop:"-20px",loading:f&&u,balance:F,showHalf:!1,showMax:!1,amountValue:H,handleTokenSelectClick:()=>{I(!1),_(!0)},onInputChange:we=>{T(we,!1)},inputAllowed:!1,amount:l,token:a})]}),ne&&w.jsx(zR,{scamsText:ne}),w.jsxs("div",{className:"swap-bottom-block",style:{border:M?"0px solid var(--cs-border)":"1px solid var(--cs-border)"},children:[w.jsx("button",{className:"cs-solid-btn swap-btn",style:{marginTop:"0px"},disabled:M||u,onClick:()=>{n?q&&N.length>0?b(!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(Hf,{})}):E}),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(Y0,{baseToken:o,quoteToken:a,baseAmount:p.fromAmountUi||"",quoteAmount:p.toAmountUi||"",loading:u}),w.jsx(_w,{isLoading:u,routerData:p})]}),w.jsx(Ew,{isLoading:u,amountLimit:h}),w.jsx(O6,{hasSubMenu:!0,formatSwapRouter:d,isLoading:u}),!!(r!=null&&r.overlayFeeRate)&&!!(r!=null&&r.overlayFeeReceiver)&&w.jsx($R,{value:r==null?void 0:r.overlayFeeRate,isLoading:u})]})]}),w.jsx(FR,{themeType:r==null?void 0:r.themeType}),y&&w.jsx(sB,{data:ve(),toBack:()=>x(!1),onSubmitClick:async we=>{try{await $(we,r==null?void 0:r.partner)}finally{x(!1)}}}),v&&w.jsx(kB,{currToken:j?o:a,backClick:()=>_(!1),onSelectToken:we=>{O(we,j),_(!1)}}),g&&N.length>0&&w.jsx(LB,{onClose:()=>{b(!1)},tokenList:N,onSureClick:()=>{b(!1),x(!0)}})]})}const dU=(e,t)=>{const r={...e};return r.primary_10=Hr(e.primary,.1),r.primary_20=Hr(e.primary,.2),r.primary_50=Hr(e.primary,.5),r.primary_80=Hr(e.primary,.8),r.btn_disabled_bg=Hr(e.primary,.2),r["btn-hover-bg"]=Hr(e.primary,.8),r.success_10=Hr(e.success,.1),r.warning_10=Hr(e.warning,.1),r.error_10=Hr(e.error,.1),t==="Light"?(r.bg_secondary="#72C1F7",r.bg_secondary_common=Hr(e.primary,.1),r.input_bg_normal=Hr(e.primary,.1),r.border="rgba(0,0,0,0.1)",r.icon_fill=Hr(e.text_secondary,1),r.text_placeholder="rgba(0,0,0,0.5)",r.btn_disabled_text=Hr(e.text_primary,.5)):(r.bg_secondary="#000",r.bg_secondary_common="rgba(0, 0, 0,0.2)",r.input_bg_normal="rgba(0, 0, 0,0.3)",r.border="rgba(255,255,255,0.1)",r.icon_fill=Hr(e.text_secondary,1),r.text_placeholder="rgba(255,255,255,0.5)",r.btn_disabled_text=Hr(e.text_primary,.5)),r},Hr=(e,t)=>{const r=e.replace("#",""),n=parseInt(r.substring(0,2),16),i=parseInt(r.substring(2,4),16),s=parseInt(r.substring(4,6),16);return`rgba(${n}, ${i}, ${s}, ${t})`},fU=(e,t)=>{let r=":root {";const n=dU(e,t);return Object.entries(n).forEach(([i,s])=>{s&&(r+=`--cs-${i.split("_").join("-")}: ${s};`)}),r+="}",r},Q6=e=>{const t=document.createElement("style");t.id="dynamic-theme",t.textContent=e;const r=document.getElementById("dynamic-theme");r&&r.remove(),document.head.appendChild(t)},hU=({theme:e,children:t,themeType:r})=>(le.useEffect(()=>{if(!e||!r)return;const n=fU(e,r);if("adoptedStyleSheets"in document){const i=new CSSStyleSheet;try{return i.replaceSync(n),document.adoptedStyleSheets=[...document.adoptedStyleSheets,i],()=>{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(s=>s!==i)}}catch(s){console.warn("CSSStyleSheet error:",s),Q6(n)}}else Q6(n)},[e,r]),w.jsx(w.Fragment,{children:t}));function pU({initProps:e={},customWallet:t}){JP(e);const{ToastContainer:r}=Io(),{fetchRouterConfig:n}=qP(),{getTrustTokens:i}=ps(),{transactionData:s,setTransactionData:o}=q0(),{isOpenSecondary:a,fromCoin:c,toAmount:l,toCoin:u,fromAmount:f}=Zr(),[p,y]=le.useState(0),x=le.useRef(p);YP(e),le.useEffect(()=>{i(),n()},[]),le.useEffect(()=>{x.current=0},[c==null?void 0:c.coin_type,u==null?void 0:u.coin_type,f,l]),HP({interval:1e3,callback:()=>{x.current=x.current+1,a?x.current>=5&&v():x.current>=20&&v()}});const v=()=>{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(FP,{independentWallet:!!(e!=null&&e.independentWallet),customWallet:t,logo:e==null?void 0:e.logo}),w.jsx(CP,{handleRefresh:v,themeType:e==null?void 0:e.themeType}),w.jsx(uU,{refreshCount:p,customWallet:t,initProps:e}),s&&w.jsx($P,{transactionData:s,onClose:()=>{o(void 0)}}),w.jsx(r,{})]})})}function xh({initProps:e={},customWallet:t}){var o;GP();const{getOwnerCoinBalances:r}=Ia(),n=Wr.useCurrentAccount(),{saveCurrentAccount:i}=zr(),{mutate:s}=Wr.useConnectWallet();return le.useEffect(()=>{i(n||void 0),r(n==null?void 0:n.address)},[n]),le.useEffect(()=>{var a;t&&((a=t==null?void 0:t.currentAccount)==null?void 0:a.address)!==(n==null?void 0:n.address)&&s({wallet:t==null?void 0:t.currentWallet},{onSuccess:()=>{}})},[(o=t==null?void 0:t.currentAccount)==null?void 0:o.address,n==null?void 0:n.address]),w.jsx(hU,{theme:e.theme,themeType:e.themeType,children:w.jsx(pU,{initProps:e,customWallet:t})})}function mU({initProps:e,customWallet:t}){const[r,n]=le.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(xh,{initProps:e,customWallet:t})}),w.jsx("div",{className:"swap-modal-mask",onClick:()=>n(!1)})]})}function gU({size:e,direction:t,initProps:r,customWallet:n}){const[i,s]=le.useState(!1),o=()=>{s(!i)};return w.jsxs("div",{className:"widget-btn-box",children:[w.jsx("div",{className:`img-btn ${e} ${t}`,onClick:o,children:i?w.jsx("svg",{className:"icon","aria-hidden":"true",children:w.jsx("use",{xlinkHref:"#icon-unfold"})}):w.jsx("img",{src:Ct("/images/img-logo@2x.png")})}),i&&w.jsx("div",{className:`widget-modal ${t} ${e}`,children:w.jsx(xh,{initProps:r,customWallet:n})})]})}function vU({initProps:e={},customWallet:t}){const{displayMode:r,widgetBtnDirection:n,widgetBtnSize:i}=e;return w.jsxs(Fl,{appearance:"dark",children:[r==="Integrated"&&w.jsx(xh,{initProps:e,customWallet:t}),r==="Widget"&&w.jsx(gU,{initProps:e,customWallet:t,direction:n||"right-bottom",size:i||"Default"}),(!r||r==="Modal")&&w.jsx(mU,{initProps:e,customWallet:t})]})}const bU=vU;Wt.CetusSwap=bU,Object.defineProperty(Wt,Symbol.toStringTag,{value:"Module"})});
|